-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add Plot::hover_indexes
& Plot::items::group
to retrieve indexes of the source
#2628
Draft
haricot
wants to merge
10
commits into
emilk:master
Choose a base branch
from
haricot:hovered_src_indexes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43dbd45
to
52f65e2
Compare
plot_hover_indexes
& Plot::items::group
to retrieve src indexPlot::hover_indexes
& Plot::items::group
to retrieve src index
Plot::hover_indexes
& Plot::items::group
to retrieve src indexPlot::hover_indexes
& Plot::items::group
to retrieve the indexes and the source
Plot::hover_indexes
& Plot::items::group
to retrieve the indexes and the sourcePlot::hover_indexes
& Plot::items::group
to retrieve indexes of the source
I think I have something more concise but I've gotten a little confused with other features that seem to me to take precedence. I think the principle is there. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the plot when the hover function is used, I notice that we can retrieve the indexes from the source without additional cost (without iterating twice).
Once we have the indexes, given that the items of the plot are presented in the order in which they were pushed, if one of them is hidden in the plot via the legend then the order of the items shifts and it is therefore difficult to know what source items it is. (or else we rely on hidden_item to update the indexes but if they don't have a name we can't know, they won't appear in hidden_items).
Hence the addition of groups which allows this to be overloaded via
SourceIndex
.This allows to find the indexes and the source of the item in the following cases:
if the group has not been defined, we can still recover but is retain items.
if the group is defined and sub_index is true and it is a line for example.
if group is defined and sub_index is false and it is points in a vector that nests others.
if multiple groups are defined and they represent a graph.
This can allow to select the element with which we can interact and it would not necessarily need the PR allow_hover #2558.
With groups this leaves enough flexibility to be able to present the data as desired.
Alternative would be another way to generate the hidden_items so that one is not lag if one becomes hidden.
it wouldn't need retain items, but such a visible filter.
This would involve keeping track of the index when initializing the plot and then we would only need the optional sub_index but it seems to me that we would not have the point indices indexes embedded in several vectors for example .