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

[charts] Get access to the data outside of the SVG #13852

Closed
alexfauquette opened this issue Jul 16, 2024 · 1 comment · Fixed by #15511
Closed

[charts] Get access to the data outside of the SVG #13852

alexfauquette opened this issue Jul 16, 2024 · 1 comment · Fixed by #15511
Assignees
Labels
component: charts This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature v8.x waiting for 👍 Waiting for upvotes

Comments

@alexfauquette
Copy link
Member

alexfauquette commented Jul 16, 2024

For now charts only have the notion of container which is basically

function ChartContainer(){
  <SizeProvider>
    <DataProvider>
      <svg>
        {children}
      <svg>
    <DataProvider>
  <SizeProvider>
}

With that structure, the user can not use data information from outside of the SVG. Which could be useful for creating HTML legend, or interactions around the chart

The ideal DX would probably look like that

<ChartsDataManager>
  <MyCustomTitle/>
  <MyLegend />
  <ChartsSurface>
    // plotting...
  </ChartsSurface>
<ChartsDataManager>

The biggest challenge on this aspect is that interconnection between the sizing and the rendering. Scale provider need to have access to the sizing of the SVG to do its computation.

Search keywords:

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature v8.x waiting for 👍 Waiting for upvotes
Projects
None yet
2 participants