Skip to content

Add scatter, range, and horizontal bar charts#1

Open
oshtz wants to merge 1 commit into
Boring-Software-Inc:mainfrom
oshtz:agent/add-scatter-range-horizontal-bars
Open

Add scatter, range, and horizontal bar charts#1
oshtz wants to merge 1 commit into
Boring-Software-Inc:mainfrom
oshtz:agent/add-scatter-range-horizontal-bars

Conversation

@oshtz

@oshtz oshtz commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Adds the missing Cartesian geometries needed for numeric comparisons while preserving existing chart APIs.

  • Add ScatterChart and Scatter with numeric axes, dithered points, labels, tooltips, hover, and selection.
  • Add RangeChart and Range for horizontal low/value/high intervals with dithered value markers.
  • Add opt-in layout=horizontal support to BarChart.
  • Preserve the existing vertical layout as the default, including grouped and stacked bars.
  • Generalize Cartesian scaling, axes, grid rendering, hit testing, and dither painting for the new geometries.
  • Add exports, registry entries, generated registry JSON, documentation, and geometry tests.

Example

<ScatterChart
  data={data}
  config={config}
  xKey=cost
  xDomain={[0, maxCost]}
  yDomain={[0, 1]}
>
  <XAxis />
  <YAxis />
  <Tooltip labelKey=model />
  <Scatter dataKey=score labelKey=model radius={5} />
</ScatterChart>

<RangeChart
  data={data}
  config={config}
  categoryKey=model
  domain={[0, 1]}
>
  <XAxis />
  <YAxis dataKey=model />
  <Tooltip labelKey=model />
  <Range dataKey=mean lowKey=low highKey=high />
</RangeChart>

Horizontal bars use layout=horizontal, category labels on YAxis, and numeric values on XAxis.

Compatibility

Existing BarChart callers remain vertical by default. Existing grouped and stacked behavior is unchanged.

No application-specific UI or SVG export changes are included.

Validation

  • npm test — 4 geometry tests passed
  • npm run build — generated 8 registry items with 39 file references
  • Verified in a temporary Vite consumer at desktop and narrow widths in light and dark themes

@oshtz oshtz marked this pull request as ready for review July 11, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant