-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Preserve ui state across Plotly.react redraws #3236
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
Changes from 1 commit
3a70fee
a86ca58
4ca328a
082ac38
b134a52
c62cf25
a11ec44
10ddbb9
4af2bf8
03baca7
6a9d0d7
a443747
54304b4
86b90d4
502082f
5182f6a
89dde84
778ec15
21f5db5
8f0f075
eb728fe
c95ae07
7ab8630
756308f
874a72a
090231b
5a27c00
2034941
6cfe7c5
8d11985
d9b3aea
0621e43
bdef7d3
2b77911
067bd7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -234,6 +234,15 @@ module.exports = { | |||||
'Defaults to `layout.uirevision`.' | ||||||
].join(' ') | ||||||
}, | ||||||
selectionrevision: { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the rationale here for putting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha I see, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Does it? I don't think so, at least I don't see it when I try that.
I can certainly think of a use case for resetting Now there's still a question about what That leaves There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ah. I think I got that from: plotly.js/src/plots/attributes.js Lines 173 to 174 in 874a72a
You got me convinced. Thanks for writing your thought process down.
Good point. I have no problem leaving There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good catch, that was wrong, thanks! -> 5a27c00 |
||||||
valType: 'any', | ||||||
role: 'info', | ||||||
editType: 'none', | ||||||
description: [ | ||||||
'Controls persistence of user-driven changes in selected points', | ||||||
'from all traces.' | ||||||
].join(' ') | ||||||
}, | ||||||
template: { | ||||||
valType: 'any', | ||||||
role: 'info', | ||||||
|
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.
Missed this one earlier as it doesn't go through
restyle
or emit aplotly_restyle
event - but anyway it wants to be a special case so that we don't push individual array elements into_tracePreGUI
, we link the array as a unit.BTW I'm working off
trace._fullInput
here but I notice farther down we go straight fromtrace
totrace._input
- have we ever looked at selections ongroupby
traces?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.
I don't remember doing that 😨
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.
Actually it looks like selections work fine with groupby 😌 there's some potential confusion around
pointNumber
vspointIndex
in the event data, but all the information is there (curveNumber
andpointIndex
give you the index in the input arrays,pointNumber
is the index within the group), and visible behavior is all correct.The only thing that looks odd to me is
fullTrace.selectedpoints
:fullTrace._fullInput.selectedpoints
is missingrestyle
or zoom, for example)fullTrace.selectedpoints
andfullTrace._fullInput.selectedpoints
both have the entire array of input array indices.I don't see any practical effects of this difference, though it's possible
Plotly.react
's diffing algo will care.Anyway I think I've found a
uirevision
+selectedpoints
bug, investigating.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.
haha looks like it's just the missing
fullInput.selectedpoints
I mentioned above - fix coming, and perhaps I'll makefullTrace.selectedpoints
self-consistent across edits as well while I'm at it.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.
alright, 🔒 in 090231b - which should also speed things up a bit in the normal non-transform case where
data
andfullData
can point to the same array (as they will after an edit anyway) so we only need to build it once.