-
Notifications
You must be signed in to change notification settings - Fork 0
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
mrc-5490 Add graph #207
mrc-5490 Add graph #207
Conversation
const unselectedVariables = | ||
rootState.model.odinModelResponse?.metadata?.variables.filter( | ||
(s) => !payload.selectedVariables.includes(s) | ||
) || []; | ||
commit(GraphsMutation.SetSelectedVariables, { ...payload, unselectedVariables }); | ||
// sort the selected variables to match the order in the model | ||
const selectedVariables = payload.selectedVariables.sort((a, b) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a benfit of the sort? is there significance in order of variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is the variable order that will be displayed in the UI, and we want it to match the order of variables as they're defined in the model, which might typically follow a temporal order e.g. S(usceptible), I(nfected), R(ecovered) or be ordered by category. Just leaving them unordered or sorting alphabetically would be less meanginful for the user. This matches the previous toggle behaviour where variables were always in model order.
mrc-5551 Show Time label on final graph only
…te when graph count changes
mrc-5485 Use multiple graph config in Sensitivity plots
Co-authored-by: David Mears <60350599+david-mears-2@users.noreply.github.com>
mrc-5545 Do not show linked variables on graphs which are not showing those variables
mrc-5443 Copy variable on drag if Ctrl key is pressed
NB After approval, we'll use this as the 'epic branch' for multiple graph tickets, and merge to main when the feature is complete.
This branch includes functionality to add graphs, and drag variables between graphs or to Hidden variables, as in the proof of concept.
Sorry about the line count! Future branches will be smaller.
Key changes:
GraphConfigs
to replaceSelectedVariables
and act as a container for the individualGraphConfig
s and theHiddenVariables
component.GraphConfigsCollapsible
which has the top level vertical collapse and shows nothing if no variables or compile required - this is easier to unit test by splitting like this because verifcal collapse content is contained in a slot.GraphConfig
andHiddenVariables
is contained in aSelectedVariables
mixin.color
package without enabling synthetic default imports - which caused a whole raft of other compilation errors, so I just side-stepped that by wrapping the usage of color (to fade the colour of hidden variables) into a separate util, and mocking that..