Skip to content

Conversation

@t-b
Copy link
Collaborator

@t-b t-b commented Jul 8, 2024

Implement a MVP

  • Don't support vs
  • AppendToTable with with
  • Multiple tables with and
table(0...10)

gives

image

@t-b t-b self-assigned this Jul 8, 2024
@t-b t-b removed their assignment Feb 21, 2025
@timjarsky timjarsky requested a review from Copilot August 7, 2025 17:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a minimum viable product (MVP) for the table operation in SweepFormula, allowing data to be displayed in a table format instead of the default graph view.

  • Adds a new table operation that can be applied to datasets
  • Modifies the plotting logic to display data as an editable table when the table operation is used
  • Implements basic table functionality without support for advanced features like vs, with, or and operations

@MichaelHuth MichaelHuth self-assigned this Nov 7, 2025
@MichaelHuth MichaelHuth force-pushed the feature/2171-add-table-support-in-sweepformula branch 2 times, most recently from 90e95b9 to 529c345 Compare November 8, 2025 22:50
@MichaelHuth
Copy link
Collaborator

@timjarsky Here is a first version for playing around.

If you enclose an expression in table(expr) then it is presented in a table. table must be the outermost operation to have an effect. (e.g. table(1) + 1 does not result in a table because the + is the outermost operation applied)

The table(s) are in a separate panel.
Combinations with and and with are supported. Any x-wave provided with vs is ignored when the y-wave is targeted for a table. table operation on the x-wave has no effect.

f.e.

1
and
table(2)
and
3
and
table(4)

results in two panels with two sub windows each, one with two tables and the other with two plots.

table(1)
with
table(2)

One subwindow with one table and two columns. Expressions added with with are added as new columns.

Also multiple datasets from a single expression result in new columns per dataset.

Special case mixing:

table(1)
with
2

Is split into a table and a plot.

If you use only tables or only plots the second window is not presented as it would contain no data.

SF_DM_NORMAL display mode is supported as well.

@MichaelHuth MichaelHuth assigned timjarsky and unassigned MichaelHuth Nov 8, 2025
@t-b
Copy link
Collaborator Author

t-b commented Nov 10, 2025

@MichaelHuth The runners work again. The failure in https://github.com/AllenInstitute/MIES/actions/runs/19199707109/job/55010723400 is our documentation check.

@timjarsky
Copy link
Collaborator

@MichaelHuth This is working well. Please add a right-click menu option to bring the databrowser to the front, similar to what we do for the plots. Also, could you make the dimension labels on the tables more informative? Thank you.

@timjarsky timjarsky assigned MichaelHuth and unassigned timjarsky Nov 12, 2025
@t-b
Copy link
Collaborator Author

t-b commented Nov 12, 2025

The table(s) are in a separate panel.

Why in a separate panel and not as a subwindow in the existing one?

@MichaelHuth
Copy link
Collaborator

The table(s) are in a separate panel.

Why in a separate panel and not as a subwindow in the existing one?

In the current panel as a subwindow the resulting size of the table might be two small and it could be inconvenient to use without additional elements to change the guide to adjust subwindow distribution.

Also the complexity stays similar as a user can have a formula like:

table(1)
with
2

then this results in a plot and a table. In a single panel I would also need to reserve subwindows for each display type and remove empty ones afterwards.

If you think that moving different display types to a new panel is too inflationary regarding the number windows I can wrap everything in the same panel.

This is the equivalent for RemoveTracesFromGraph for plots with the
base functionality.

Function:
RemoveAllColumnsFromTable
@MichaelHuth MichaelHuth force-pushed the feature/2171-add-table-support-in-sweepformula branch from 529c345 to 40341b0 Compare November 14, 2025 14:33
@MichaelHuth
Copy link
Collaborator

@timjarsky

Also, could you make the dimension labels on the tables more informative? Thank you.

I changed the table that it shows dimension labels. The dimension labels are from the data waves that are from the result in the expression in table(expr). This means that depending on that operation the resulting wave can have labels or not.
e.g. for the result from select() we add dimension labels, but most operations do not add dimension labels.
So tables are rather limited in that respect.

In Igor 10 for tables also tooltips work. I can retrieve the indices and the wave where the cursor is currently positioned. So it would be possible to generate some tooltip text including information present in the JSON wave note.
Would such a tooltip a viable option?

Tables introduce a second type of displaying data (after plots) to the plotter.
Tables are displayed in a separate panel.

Therefore in SF_PreparePlotter the plotGraphs wave that lists all window names
is extended with a new row for the names of the table subwindows.
The creation of plotGraphs is moved to an own getter function.

The panel or window creation for SF_DM_NORMAL mode is moved to an own function
SF_NewSweepFormulaBaseWindow

For the equivalent of RemoveTracesFromGraph the function RemoveAllColumnsFromTable
is used for tables.

Since not all SubWindows prepared by SF_PreparePlotter might be used in plotting
the subWindows (SF_DM_SUBWINDOWS mode) are tiled only between the windows that
actually contain data after all data was plotted in SF_TileExistingData.
operation tags the output wave to hint the plotter that the data should be displayed
in a table. The operation does not change the data otherwise.

table(expression)
@MichaelHuth MichaelHuth force-pushed the feature/2171-add-table-support-in-sweepformula branch from 40341b0 to 832c2b7 Compare November 14, 2025 15:43
@t-b
Copy link
Collaborator Author

t-b commented Nov 14, 2025

In Igor 10 for tables also tooltips work. I can retrieve the indices and the wave where the cursor is currently positioned. So it would be possible to generate some tooltip text including information present in the JSON wave note.
Would such a tooltip a viable option?

Can the tooltip show the formula which created the table column? If yes I'd say it's worth the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants