Skip to content

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

@markov00

Description

@markov00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :allApplies to all chart types:refactorCode refactor:tooltipRelated to hover tooltipenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions