Skip to content

v2.0.0

Choose a tag to compare

@brandtnewlabs brandtnewlabs released this 07 Jun 13:20
· 25 commits to main since this release
30b0967

First major release. Highlights: a new metrics design-token prop, a uniform
feature-flag API, and a scrub-performance fix.

npm install react-native-livechart@2.0.0

⚠️ Breaking changes — migrating from 1.x

  • LiveChartSeries now scrubs by default. scrub defaulted to false; it now
    defaults to true, matching LiveChart. Pass scrub={false} to restore the
    old behavior. (Legend taps are unaffected — chips sit outside the scrub gesture.)
  • DotConfig.show is deprecated in favor of dot={false} to hide the live
    dot. dot={{ show: false }} still works and is equivalent — no rush to migrate.
  • Every overlay toggle now follows the same boolean | Config convention
    (badge, gradient, pulse, valueLine, scrub, yAxis, xAxis,
    leftEdgeFade, legend, and now dot). This is additive for everything except
    the two items above.

See the Migrating to v2 section in the README.

✨ Added

  • metrics prop on both charts — sizing & motion design tokens, the
    geometry/feel analogue of palette. Namespaced (badge, candle, grid,
    motion, emptyState) with per-key overrides, exposing previously-hardcoded
    constants (badge pill geometry, candle body bounds, grid/axis fade and lerp
    speeds, empty-state layout). New types: LiveChartMetrics,
    LiveChartMetricsOverride, and the five namespace interfaces.
  • dot accepts a boolean on both charts (dot={false} to hide).

🐛 Fixed

  • Crosshair overlays no longer emit React's "final argument changed size between
    renders" error while scrubbing (a React Compiler × Reanimated auto-dependency
    interaction; the affected useDerivedValues now use explicit deps).

⚡ Performance

  • The line is decimated to ~2 points per horizontal pixel (min/max per pixel
    column — envelope and volatility spikes preserved). Dense or wide time windows no
    longer make per-frame work scale with sample count, fixing the sustained-scrub
    frame drops on saturated windows. Sparse windows are unchanged.

📖 Documentation · 📦 npm · 📝 Full changelog