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

[context menu] Refactor the logic to be reusable #2134

Open
Tracked by #1859 ...
markov00 opened this issue Aug 3, 2023 · 0 comments
Open
Tracked by #1859 ...

[context menu] Refactor the logic to be reusable #2134

markov00 opened this issue Aug 3, 2023 · 0 comments
Labels
:all Applies to all chart types enhancement New feature or request :refactor Code refactor :tooltip Related to hover tooltip

Comments

@markov00
Copy link
Member

markov00 commented Aug 3, 2023

The current context-menu logic is tied to the tooltip logic, the values that we are passing to the context menu are related to the tooltip and its state is specific to the chart data tooltip.
We should refactor the current code to make it reusable to introduce more "in-chart" actions, like clicking on the chart title, axis title, axis lines, and background to provide a set of actions like changing values/text or saving the chart as an image etc.

The idea is to split the context menu/right-click event state and the tooltip pinned state so we can reuse the right-click and the context menu in multiple situations.

We are also polluting the state with selected TooltipValues. We can probably put the values in the tooltip local state instead, as they are not required by the chart in any way right now.

@markov00 markov00 added enhancement New feature or request :tooltip Related to hover tooltip :all Applies to all chart types :refactor Code refactor labels Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:all Applies to all chart types enhancement New feature or request :refactor Code refactor :tooltip Related to hover tooltip
Projects
None yet
Development

No branches or pull requests

1 participant