Skip to content

Expose consistent data prop #529

@techniq

Description

@techniq

In 2.0.0, we've started to add data directly to hierarchy and graph layout components instead of using <Chart {data}>. This simplifies the typing of <Chart {data}> and removes unnecessary indirection.

  • Graph
    • <ForceSimulation {data}>
    • <Dagre {data}>
    • <Sankey> - needs data passed directly
  • Hierarchy
    • <Pack {hierarchy}> - needs renamed to data
    • <Partition {hierarchy}> - needs renamed to data
    • <Tree {hierarchy}> - needs renamed to data
    • <Treemap {hierarchy}> - needs renamed to data

It would also be useful to add data to many other marks such as Axis. Some components already support this, such as

  • Bars
  • Hull
  • Labels
  • Link
  • Pie
  • Points
  • Spline

This is currently leveraged for series support in simplified charts like BarChart and LineChart, but would be useful is most all marks.

Lastly, adding data via marks would then be useful to register it with the chart context to be used to determine overall scale domains (similar to Observable Plot, SveltePlot, visx XYChart, data-ui, and others)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Up next

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions