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

Add click interactions on legend items #25

Closed
3 tasks done
markov00 opened this issue Jan 31, 2019 · 7 comments · Fixed by #51
Closed
3 tasks done

Add click interactions on legend items #25

markov00 opened this issue Jan 31, 2019 · 7 comments · Fixed by #51
Assignees
Labels
enhancement New feature or request :interactions Interactions related issue kibana cross issue Has a Kibana issue counterpart released Issue released publicly

Comments

@markov00
Copy link
Member

markov00 commented Jan 31, 2019

Is your feature request related to a problem? Please describe.
Add click interaction on legend items.
Ideally used to hide/show a series.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Kibana Cross Issues
elastic/kibana#21084

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
@markov00 markov00 added discuss To be discussed enhancement New feature or request and removed discuss To be discussed labels Jan 31, 2019
@emmacunningham emmacunningham self-assigned this Feb 4, 2019
@emmacunningham
Copy link
Contributor

@markov00 Should we also change the domains of the axes based on the currently selected series? For example in the chart below, notice that the y-axis domain changes between the two views because when filtering for just the blue series, the upper bound of values is lower than when all of the series are displayed.

legend_click

@markov00
Copy link
Member Author

markov00 commented Feb 8, 2019

@emmacunningham I think we can just send out the information to an registered listener instead of doing anything on charts (like real filtering on data).
This because we don't know what user want to achieve on clicking, so i rether prefer having just an event, like the click on a bar, with the necessary information when clicking on a legend item.
Will be than the external app to apply filters or whatelse.
Also please check how it's currently handled in kibana:
we have few interactions on legend items: on click open a small panel with a color picker and the possibility to + o - (filter in our out the specific series)
I think we can include that on the legend (all these action will be just events)

@emmacunningham
Copy link
Contributor

@markov00 Great, I've set up the listeners so that they can be passed into the settings and will receive the necessary information to identify the data series selected.

Will add the panel with listeners as well.

@emmacunningham
Copy link
Contributor

@cchaos Do you have a recommendation for what the dropdown panel should look like in the new charts to be consistent with EUI? This is what it currently looks like in Kibana:

legend_click_panel

I assume we want to use the new EUI color picker component as well as the button icons for the +/- buttons? I was also wondering which components should be used for the panel itself. I was looking through the EUI styleguide and the closest component I could think of was a context menu with custom elements but wondering if there is something better to use. Thanks!

@cchaos
Copy link
Contributor

cchaos commented Feb 15, 2019

Hey @emmacunningham I have many thoughts so I'd like to not rush into a decision here. Unfortunately I'm traveling tomorrow (Friday) so I wont have much time before next week to get you something concrete. Off the bat, my gut is that the dot indicating the color in the legend should be the only think clickable to change the color and that it essentially opens the color picker. Then clicking the text part of the legend would filter for that category. But shift clicking it would filter out the category. The tooltip on the item should not display the label but the interaction available for clicking. Meaning, describe that by clicking it will filter for and to filter out, use shift plus click. You can add the delay="long" prop so the tooltip only shows on a prolonged hover.

Hopefully that gives you a starting point and I apologize for any typos as I'm typing this on my phone. ;)

@emmacunningham
Copy link
Contributor

Yes, this is great for a starting point, thanks @cchaos !

@markov00 markov00 changed the title Add click interactions on legend items [interactions] Add click interactions on legend items Feb 28, 2019
@markov00 markov00 added the :interactions Interactions related issue label Feb 28, 2019
@markov00 markov00 changed the title [interactions] Add click interactions on legend items Add click interactions on legend items Feb 28, 2019
@markov00 markov00 added this to the 7.1 milestone Feb 28, 2019
@emmacunningham emmacunningham added the kibana cross issue Has a Kibana issue counterpart label Feb 28, 2019
@markov00
Copy link
Member Author

markov00 commented Mar 6, 2019

🎉 This issue has been resolved in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :interactions Interactions related issue kibana cross issue Has a Kibana issue counterpart released Issue released publicly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants