Future plot redesign #2549
lucas-wilkins
started this conversation in
Code Camp Topics
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
These are my thoughts on the overall structural changes that would be needed for an sustainable approach to [improving] the plotting functionality.
I'm writing this with the idea want to be able to do the following things (I know there is always more things users want to, and that SasView currently does some of them, but I'm listing the things here which are design considerations):
The following are the steps that I think should make that workable, which come down to a design rule:
and an improvement the code
Detailed addressing system
The following is a strategy for maintaining as much flexibility in the plotting system, without it getting out of hand.
Instead of a single integer addressing each plot I recommend we introduce a semi-hierarchical reference system, which references from the level of single traces, to a collection of plots (currently we don't have this, but would like it).
This is to say, we should be able to reference elements of plots at a multitude of levels, and this should go down to level of individual traces within a figure, but access should not depend on providing a hierarchical address.
It would make sense to maintain a way of addressing the following from a central location:
Lines shouldn't know what axes they belong to, axes shouldn't know plot they belong to, etc, etc. The same line could be in multiple axes/figure/collection and so forth.
Some examples, written here using a glob like syntax (this is just notation to articulate the structure, not )
a specific figure
collection1.figure7.axis2.line6
or all lines on an axis
collection1.figure7.axis2.*
all axes in a figure
collection1.figure7.*
or all lines in a figure
collection1.figure7.*.*
or all axes of a particular figure
*.figure7.*
a particular line, wherever it might be
*.*.*.line1
UIDs vs. semantic addressing
Each of the plot lines should be specified using a non-semantic UID. It should probably be possible to address axes and figures by specific properties, thus the naming should probably be semantic.
Referencing from other objects, copying, and linking
*.*.*.line1
Avoid back referencing from plots
When data flows in two directions things get messy, so I suggest the following
This also solves some potential issues with serialisation
Serialisation
Data-Push Approach - An exception that proves the rule
One example that might seem to necessitate breaking the data-push rule is interactive plots is user feedback from plots.
In this case, either:
Neither of these break the data-push rule, but will allow for the desired functionality
Let me know what you think,
@gonzalezma @rozyczko @krzywon
Beta Was this translation helpful? Give feedback.
All reactions