plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
21.14k stars 2.04k forks source link

provide selectedData/MultiSelect for pie chart #2334

Open Matan-Morduch opened 1 year ago

Matan-Morduch commented 1 year ago

Thanks so much for your interest in Dash!

Before posting an issue here, please check the Dash community forum to see if the topic has already been discussed. The community forum is also great for implementation questions. When in doubt, please feel free to just post the issue here :)

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I'm always frustrated when I try to create a dashboard with a pie chart and in order to filter the dashboard using the pie chart I can only select one slice of the pie chart to filter by, unlike bar charts and other visualizations where the color of the unselected data darken in the pie chart you need to implement it yourself using callbacks, and if I want to select more than one slice I need to save the selected data in a dcc store or a div and check every time someone clicks on another slice, Is there data saved in the store, which data is it? if it's not the same as the newly selected slice add it if not remove it and build + style the pie chart from scratch.

Describe the solution you'd like A clear and concise description of what you want to happen. Implement selectedData in the pie chart, now because it's a pie chart instead of a box select used in bar charts and other charts, you can implement it so it uses click events. and if the slice is selected then deselect it and if it's not select it then select it. now if we select a slice it will grey out all the slices that are not selected, and update the selectedData to be with all the selected slices data.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. I wrote a partial solution in the feature problem section.

Additional context Add any other context or screenshots about the feature request here. it's a feature that exists in any bi tool out there, it's an important feature in order to create interactive dashboards a critical one even. so really hoping it can be implemented! thank you plotly team for the hard work!

alexcjohnson commented 1 year ago

Good idea! This would need to be designed and implemented in plotly.js - cc @archmoj