Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable picker #92

Merged
merged 16 commits into from
Jan 10, 2025
Merged

Variable picker #92

merged 16 commits into from
Jan 10, 2025

Conversation

Peter9192
Copy link
Member

@Peter9192 Peter9192 commented Dec 13, 2024

Adds a variable picker for profiles and timeseries plots

  • For profile you can choose theta or q
  • For timeseries you can choose from available variables in model output on y, and only choose time on x-axis

TODO:

  • Selecting the same option that's already selected results in error
  • Get nice axis labels for each variable from model config Input/output var names in config? #94
  • Get available model output parameters from model config
  • Better tick formatting - postpone to Time slider #93
  • Display time in hours? - postpone to Time slider #93
  • Allow other variables on x-axis? - easy to change in future.

image

Copy link
Collaborator

@sverhoeven sverhoeven left a comment

Choose a reason for hiding this comment

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

Selecting variables works for me.

It would be nice to have some e2e tests.

apps/class-solid/src/components/Analysis.tsx Show resolved Hide resolved
packages/class/src/bmi.ts Outdated Show resolved Hide resolved
@@ -28,6 +46,11 @@ const linestyles = ["none", "5,5", "10,10", "15,5,5,5", "20,10,5,5,5,10"];
* It only works if the time axes are equal
*/
export function TimeSeriesPlot() {
const [xVariable, setXVariable] = createSignal("t");
const [yVariable, setYVariable] = createSignal("theta");
Copy link
Collaborator

Choose a reason for hiding this comment

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

When saving/restoring a session or sharing a link would it make sense to also store the variable selection?

If so we would need to lift those signals to the analyses store.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that would make sense in the future, so I have done as you suggested. Variables are now set in the store. Regarding the URL, I think we should wait for the analysis interface to stabilize, so we can add it later.

apps/class-solid/src/components/Analysis.tsx Show resolved Hide resolved
apps/class-solid/src/components/Analysis.tsx Show resolved Hide resolved
apps/class-solid/src/lib/profiles.ts Show resolved Hide resolved
@Peter9192
Copy link
Member Author

It would be nice to have some e2e tests.

I agree, but I always struggle to write test for "figure should look different". I'm not eager to spend a lot of time on that now.

@Peter9192 Peter9192 marked this pull request as ready for review January 10, 2025 10:00
@Peter9192 Peter9192 merged commit 4238bb4 into main Jan 10, 2025
4 checks passed
@Peter9192 Peter9192 deleted the variable-picker branch January 10, 2025 14:49
@Peter9192 Peter9192 mentioned this pull request Jan 13, 2025
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.

2 participants