Skip to content

Add styling/data props to all charts, fix height bug, improve screenshots#20

Merged
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G
Apr 19, 2026
Merged

Add styling/data props to all charts, fix height bug, improve screenshots#20
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G

Conversation

@islubee
Copy link
Copy Markdown
Owner

@islubee islubee commented Apr 19, 2026

Summary

New props (all charts)

  • color — primary fill/stroke color
  • formatXTick / formatYTick — custom axis tick formatters

Timeline-specific

  • gradientColors — two-element array for the area fill gradient
  • interpolation — D3 curve factory (d3.curveBasis, d3.curveStep, etc.)
  • showArea — toggle the filled area (default: true)
  • showDots — overlay circles at each data point (default: false)

ScatterPlot-specific

  • radius — circle radius in pixels or a function (d) => number

Histogram-specific

  • gradientColors — gradient for bars
  • thresholds — number of bins

BarChart-specific

  • barPadding — fractional gap between bars (0–1)
  • yMin — minimum y-axis domain value

Bug fixes

  • Height bug: Chart wrapper divs lacked height: 100%, so ResizeObserver always measured ~110px regardless of the container size. Charts now fill their containers correctly.
  • Timeline margin: marginBottom was 40px but the x-axis label sits at y+60 — overflow fixed by setting marginBottom: 77 to match other charts.

Screenshots

All four chart screenshots regenerated with full labels, ticks, and data visible:

Timeline ScatterPlot
Histogram BarChart

Test plan

  • Charts render at the correct height when placed in a fixed-size container
  • color prop overrides the default purple on all chart types
  • showDots={true} renders circles on Timeline
  • thresholds changes the number of Histogram bins
  • formatYTick={d => "$" + d} correctly formats BarChart y-axis labels

Charts:
- Add color, gradientColors, interpolation, showArea, showDots, formatXTick,
  formatYTick props to Timeline
- Add color, radius, formatXTick, formatYTick to ScatterPlot
- Add color, gradientColors, thresholds, formatXTick, formatYTick to Histogram
- Add color, barPadding, formatYTick, yMin to BarChart
- Add color prop to Circles component

Bug fixes:
- All chart wrapper divs now set height:100% so ResizeObserver measures the
  correct container height (previously SVG rendered at ~110px regardless of
  container size)
- Timeline now uses marginBottom:77 (matching other charts) so x-axis labels
  don't overflow the SVG viewport

Screenshots:
- Regenerated all four chart screenshots with correct dimensions and full
  label/tick visibility

README:
- Full prop tables for all four charts including new props
- Updated screenshots embedded inline

https://claude.ai/code/session_01Bf9veNX9mqfMqrCEGnujAo
@islubee islubee merged commit a17b52e into main Apr 19, 2026
6 checks passed
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.

2 participants