@cascivo/charts 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -55,9 +55,20 @@ interface TimeScale {
55
55
  map(value: Date): number;
56
56
  invert(position: number): Date;
57
57
  ticks(count?: number): Date[];
58
- tickInterval(): 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
59
- tickFormat(): Intl.DateTimeFormatOptions;
58
+ /**
59
+ * The unit the ticks step in at the given density. Pass the same `count` you pass to
60
+ * {@link TimeScale.ticks} — a 24-hour domain steps in hours at `count: 6` and in days at
61
+ * `count: 1`, so a hardcoded density would disagree with the ticks actually drawn.
62
+ */
63
+ tickInterval(count?: number): IntervalUnit;
64
+ /**
65
+ * `Intl.DateTimeFormat` options that make the ticks at this density distinguishable.
66
+ * Sub-day steps format as times, day/week steps as dates, and so on — formatting a
67
+ * 3-hourly axis with a day format renders the same string on every tick.
68
+ */
69
+ tickFormat(count?: number): Intl.DateTimeFormatOptions;
60
70
  }
71
+ type IntervalUnit = 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
61
72
  declare function timeScale(domain: [Date, Date], range: [number, number]): TimeScale;
62
73
  type Point = readonly [x: number, y: number];
63
74
  /**
@@ -1619,6 +1630,19 @@ interface AreaChartSeries<Datum> {
1619
1630
  color?: string;
1620
1631
  /** Which y-axis this series is measured against (ignored when `stacked`). Default 'left'. */
1621
1632
  axis?: 'left' | 'right';
1633
+ /**
1634
+ * Draw this series as a stroked line with no fill.
1635
+ *
1636
+ * The case this exists for: a dual-axis chart plotting requests (left) against errors
1637
+ * (right). As two areas the smaller series hides behind the larger one, and `fill` is
1638
+ * chart-level so it cannot make just the second translucent. `ComboChart` does not help —
1639
+ * it is bar+line, not area+line (2026-08-08 report A).
1640
+ *
1641
+ * Ignored when `stacked`, where every series must be an area for the stack to read.
1642
+ *
1643
+ * @defaultValue `'area'`
1644
+ */
1645
+ type?: 'area' | 'line';
1622
1646
  /**
1623
1647
  * Per-series Y accessor. Overrides the chart-level `y` for this series only —
1624
1648
  * use it to plot two series from one shared `data` row against different fields
@@ -1980,12 +2004,18 @@ interface SparklineBaseProps {
1980
2004
  * 120px rather than a container-filling chart. Pass a number to change it. The
1981
2005
  * catalogue-wide "omit for a responsive chart" note does not apply to this chart.
1982
2006
  *
1983
- * @defaultValue `80`
2007
+ * @defaultValue `120`
1984
2008
  * @see the component manifest
1985
2009
  */
1986
2010
  width?: number;
1987
2011
  height?: number;
1988
2012
  color?: string;
2013
+ /**
2014
+ * Show dot at last data point
2015
+ *
2016
+ * @defaultValue `true`
2017
+ * @see the component manifest
2018
+ */
1989
2019
  endDot?: boolean;
1990
2020
  }
1991
2021
  /**
@@ -2094,6 +2124,23 @@ interface KpiProps {
2094
2124
  sparkline?: readonly number[];
2095
2125
  className?: string;
2096
2126
  }
2127
+ /**
2128
+ * A metric tile with its own card chrome: label, then value and delta on one line, then an
2129
+ * optional sparkline below.
2130
+ *
2131
+ * ## `Kpi` or `Stat`? Pick one per app.
2132
+ *
2133
+ * `Stat` (`@cascivo/react`) is the sibling tile, and they are **not two skins of one
2134
+ * component**. `Kpi` takes a numeric `delta` and formats it for you (sign, arrow, colour,
2135
+ * unit) and always brings card chrome. `Stat` takes a pre-formatted `string` delta, stacks
2136
+ * value → delta → help text, puts its `visual` in a trailing slot, and is layout-only unless
2137
+ * you set `card`.
2138
+ *
2139
+ * `<Stat card>` matches this component's **chrome** — surface, border, radius, padding — and
2140
+ * not its layout, so a `Stat` row and a `Kpi` row in one app still read as two tile designs
2141
+ * (2026-08-14 report §6). Use `Kpi` when you have a numeric delta and a sparkline; use `Stat`
2142
+ * otherwise; do not mix them.
2143
+ */
2097
2144
  declare function Kpi({
2098
2145
  value,
2099
2146
  label,
@@ -2275,7 +2322,12 @@ interface ComboChartProps {
2275
2322
  line: ComboChartPoint[];
2276
2323
  title: string;
2277
2324
  description?: string;
2278
- /** Measure the line on its own right-hand axis (use when the two metrics differ in scale). */
2325
+ /**
2326
+ * Render line on a secondary right y-axis
2327
+ *
2328
+ * @defaultValue `false`
2329
+ * @see the component manifest
2330
+ */
2279
2331
  secondAxis?: boolean;
2280
2332
  /** Legend label for the bar series. Defaults to `'Bars'`. */
2281
2333
  barsLabel?: string;
@@ -3060,4 +3112,4 @@ declare function Gauge({
3060
3112
  className,
3061
3113
  plain
3062
3114
  }: GaugeProps): import("react").JSX.Element;
3063
- export { AXIS_CHAR_PX, AXIS_LINE_PX, AggOp, AggregateSpec, AngleBand, Annotation, AnnotationContext, AnnotationScale, AreaChart, AreaChartProps, AreaChartSeries, AreaDecimateOptions, Axis, AxisProps, BandScale, BarChart, BarChartProps, BarChartSeries, Bin, BoundStream, BoxStats, Boxplot, BoxplotProps, BoxplotSeries, Brush, BrushProps, BubbleChart, BubbleChartProps, BubbleDatum, BubbleSeries, Bullet, BulletProps, CalendarHeatmap, CalendarHeatmapDatum, CalendarHeatmapProps, Candlestick, CandlestickDatum, CandlestickProps, CanvasLayer, CanvasLayerProps, CanvasPaint, CanvasSize, CategoryDatum, CategoryMapping, ChartDefs, ChartDefsProps, ChartFrame, ChartFrameProps, ChartSize, ComboChart, ComboChartBar, ComboChartPoint, ComboChartProps, Curve, DEFAULT_MARGINS, DataLabel, DataLabelProps, DataZoom, DataZoomProps, DecimateMethod, DecimateOptions, DefSeries, EncodeMapping, EncodedResult, EncodedSeries, FillKind, Funnel, FunnelProps, FunnelStage, Gauge, GaugeProps, GaugeThreshold, Glyph, GlyphProps, GlyphShape, GridLines, GridLinesProps, Heatmap, HeatmapDatum, HeatmapProps, HierNode, Histogram, HistogramBin, HistogramProps, Kpi, KpiProps, LabelOptions, LaidLink, LaidNode, Legend, LegendProps, LegendSeries, LineChart, LineChartProps, LineChartSeries, LinearScale, LogScale, Meter, MeterProps, MeterThresholds, PLAIN_MARGINS, PartitionedNode, PatternKind, PieChart, PieChartDatum, PieChartProps, Point, Polar, PolarDatum, PolarProps, Pt, Radar, RadarProps, RadarSeries, RadialBar, RadialBarDatum, RadialBarProps, RampKind, Rect, RegressionResult, RegressionType, ResolvedLabelOptions, Row, Sankey, SankeyLayout, SankeyLink, SankeyNode, SankeyOptions, SankeyProps, ScatterChart, ScatterChartProps, ScatterChartSeries, ScatterDatum, Sparkline, SparklineProps, StackedRow, StackedSegment, Stream, StreamDecimate, StreamOffset, StreamProps, StreamSeries, StreamSeriesOptions, StreamSource, Sunburst, SunburstProps, SyncGroup, Text, TextProps, TimeScale, Toolbox, ToolboxOptions, ToolboxProps, Treemap, TreemapDatum, TreemapNode, TreemapProps, TreemapRect, Vec, VisualChannel, VisualMap, VisualMapOptions, VisualMapProps, VisualMode, VisualResult, ZoomConfig, _syncGroupCount, aggregate, angleBand, annotationSummary, arcPath, areaPath, autoLabelStride, bandScale, bin, binValues, bindStream, boxStats, cellPath, decimate$1 as decimate, divergingRamp, download, encode, encodeCategory, extent, fillFor, filter, getSyncGroup, glyphPath, gradientId, isZoomed, leftMarginForLabels, linePath, linearScale, linkPath, logScale, lttb, mapVisual, maxDepth, minmax, nearestIndex, niceTicks, panWindow, partition, patternId, pieceIndex, polarPoint, quantize, radiusScale, rampLightness, rampOf, rampStops, regression, releaseSyncGroup, renderAnnotation, renderAnnotations, resolveColor, resolveLabels, rightMarginForLabels, sankeyLayout, sequentialRamp, serializeSvg, sort, splitDefined, sqrtScale, squarify, stackSeries, streamExtent, streamLayout, sumValue, svgToPngBlob, timeScale, toStackedSeries, useChartSize, useStreamSeries, visualVisible, voronoiCells, voronoiFind, wrapText, zoomWindow };
3115
+ export { AXIS_CHAR_PX, AXIS_LINE_PX, AggOp, AggregateSpec, AngleBand, Annotation, AnnotationContext, AnnotationScale, AreaChart, AreaChartProps, AreaChartSeries, AreaDecimateOptions, Axis, AxisProps, BandScale, BarChart, BarChartProps, BarChartSeries, Bin, BoundStream, BoxStats, Boxplot, BoxplotProps, BoxplotSeries, Brush, BrushProps, BubbleChart, BubbleChartProps, BubbleDatum, BubbleSeries, Bullet, BulletProps, CalendarHeatmap, CalendarHeatmapDatum, CalendarHeatmapProps, Candlestick, CandlestickDatum, CandlestickProps, CanvasLayer, CanvasLayerProps, CanvasPaint, CanvasSize, CategoryDatum, CategoryMapping, ChartDefs, ChartDefsProps, ChartFrame, ChartFrameProps, ChartSize, ComboChart, ComboChartBar, ComboChartPoint, ComboChartProps, Curve, DEFAULT_MARGINS, DataLabel, DataLabelProps, DataZoom, DataZoomProps, DecimateMethod, DecimateOptions, DefSeries, EncodeMapping, EncodedResult, EncodedSeries, FillKind, Funnel, FunnelProps, FunnelStage, Gauge, GaugeProps, GaugeThreshold, Glyph, GlyphProps, GlyphShape, GridLines, GridLinesProps, Heatmap, HeatmapDatum, HeatmapProps, HierNode, Histogram, HistogramBin, HistogramProps, IntervalUnit, Kpi, KpiProps, LabelOptions, LaidLink, LaidNode, Legend, LegendProps, LegendSeries, LineChart, LineChartProps, LineChartSeries, LinearScale, LogScale, Meter, MeterProps, MeterThresholds, PLAIN_MARGINS, PartitionedNode, PatternKind, PieChart, PieChartDatum, PieChartProps, Point, Polar, PolarDatum, PolarProps, Pt, Radar, RadarProps, RadarSeries, RadialBar, RadialBarDatum, RadialBarProps, RampKind, Rect, RegressionResult, RegressionType, ResolvedLabelOptions, Row, Sankey, SankeyLayout, SankeyLink, SankeyNode, SankeyOptions, SankeyProps, ScatterChart, ScatterChartProps, ScatterChartSeries, ScatterDatum, Sparkline, SparklineProps, StackedRow, StackedSegment, Stream, StreamDecimate, StreamOffset, StreamProps, StreamSeries, StreamSeriesOptions, StreamSource, Sunburst, SunburstProps, SyncGroup, Text, TextProps, TimeScale, Toolbox, ToolboxOptions, ToolboxProps, Treemap, TreemapDatum, TreemapNode, TreemapProps, TreemapRect, Vec, VisualChannel, VisualMap, VisualMapOptions, VisualMapProps, VisualMode, VisualResult, ZoomConfig, _syncGroupCount, aggregate, angleBand, annotationSummary, arcPath, areaPath, autoLabelStride, bandScale, bin, binValues, bindStream, boxStats, cellPath, decimate$1 as decimate, divergingRamp, download, encode, encodeCategory, extent, fillFor, filter, getSyncGroup, glyphPath, gradientId, isZoomed, leftMarginForLabels, linePath, linearScale, linkPath, logScale, lttb, mapVisual, maxDepth, minmax, nearestIndex, niceTicks, panWindow, partition, patternId, pieceIndex, polarPoint, quantize, radiusScale, rampLightness, rampOf, rampStops, regression, releaseSyncGroup, renderAnnotation, renderAnnotations, resolveColor, resolveLabels, rightMarginForLabels, sankeyLayout, sequentialRamp, serializeSvg, sort, splitDefined, sqrtScale, squarify, stackSeries, streamExtent, streamLayout, sumValue, svgToPngBlob, timeScale, toStackedSeries, useChartSize, useStreamSeries, visualVisible, voronoiCells, voronoiFind, wrapText, zoomWindow };