@cascivo/charts 0.16.0 → 0.17.0
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/charts.css +1 -1
- package/dist/index.d.ts +47 -16
- package/dist/index.js +941 -890
- package/dist/node/index.js +941 -890
- package/package.json +3 -3
package/dist/charts.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer cascivo.component{.
|
|
1
|
+
@layer cascivo.component{._frame_1gm0a_2{flex:auto;min-block-size:0;inline-size:100%;min-inline-size:0;position:relative}._frame_1gm0a_2>svg{block-size:auto;max-block-size:100%;max-inline-size:100%}@media (prefers-reduced-motion:no-preference){._frame_1gm0a_2>svg{animation:_cascivo-chart-in_1gm0a_1 var(--cascivo-chart-anim-dur,.32s) var(--cascivo-chart-anim-ease,ease-out) both}@keyframes _cascivo-chart-in_1gm0a_1{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}._frame_1gm0a_2 svg :is(path,rect,circle,line)[data-series],._frame_1gm0a_2 svg path[data-link],._frame_1gm0a_2 svg path[data-depth],._frame_1gm0a_2 svg rect[data-day]{transition-property:var(--cascivo-chart-anim-props,opacity, fill, fill-opacity);transition-duration:var(--cascivo-chart-anim-dur,.24s);transition-timing-function:var(--cascivo-chart-anim-ease,ease)}._frame_1gm0a_2[data-no-anim]>svg{animation:none}._frame_1gm0a_2[data-no-anim] svg :is(path,rect,circle,line)[data-series],._frame_1gm0a_2[data-no-anim] svg path[data-link],._frame_1gm0a_2[data-no-anim] svg path[data-depth],._frame_1gm0a_2[data-no-anim] svg rect[data-day]{transition:none}}._fallback_1gm0a_78{clip-path:inset(50%);white-space:nowrap;block-size:1px;inline-size:1px;position:absolute;inset-inline-start:-9999px;overflow:hidden}._legend_1pign_2{gap:var(--cascivo-space-2);padding-block:var(--cascivo-space-2);flex-wrap:wrap;display:flex}._item_1pign_9{align-items:center;gap:var(--cascivo-space-1);padding:var(--cascivo-space-1) var(--cascivo-space-2);border:1px solid var(--cascivo-color-border);border-radius:var(--cascivo-radius-sm);cursor:pointer;font-size:var(--cascivo-text-sm);color:var(--cascivo-color-text);transition:opacity var(--cascivo-duration-150,.15s) ease;background:0 0;display:flex}._item_1pign_9[data-state=off]{opacity:.4}._swatch_1pign_27{border-radius:2px;flex-shrink:0;block-size:12px;inline-size:12px;display:inline-block}._meter_cns3q_2{inline-size:100%;min-inline-size:0}._svg_cns3q_9{block-size:auto;inline-size:100%;max-inline-size:100%;display:block}._label_cns3q_16{font-size:var(--cascivo-text-xs);color:var(--cascivo-color-foreground-muted);margin-block-start:var(--cascivo-space-1)}._gaugeLabel_cns3q_22{text-align:center;font-size:var(--cascivo-text-sm);color:var(--cascivo-color-foreground-muted)}._fill_cns3q_28{transform-origin:0;transition:transform .4s}@media (prefers-reduced-motion:reduce){._fill_cns3q_28{transition:none}}._kpi_nrb8p_7{gap:var(--cascivo-space-2);padding:var(--cascivo-kpi-padding,var(--cascivo-space-4));border-radius:var(--cascivo-radius-surface);border:1px solid var(--cascivo-color-border);background:var(--cascivo-color-surface);flex-direction:column;min-inline-size:0;display:flex}._head_nrb8p_19{justify-content:space-between;align-items:center;gap:var(--cascivo-space-2);min-inline-size:0;display:flex}._label_nrb8p_27{font-size:var(--cascivo-text-sm);color:var(--cascivo-color-foreground-muted);overflow-wrap:anywhere;min-inline-size:0}._valueRow_nrb8p_34{align-items:flex-end;gap:var(--cascivo-space-2);min-inline-size:0;display:flex}._value_nrb8p_34{font-size:var(--cascivo-text-2xl);font-weight:var(--cascivo-font-bold);line-height:var(--cascivo-leading-none);color:var(--cascivo-color-foreground);font-variant-numeric:tabular-nums}._delta_nrb8p_49{font-size:var(--cascivo-text-sm);font-weight:var(--cascivo-font-medium);white-space:nowrap;color:var(--cascivo-color-foreground-muted)}._delta_nrb8p_49[data-sentiment=good]{color:var(--cascivo-color-success-foreground)}._delta_nrb8p_49[data-sentiment=bad]{color:var(--cascivo-color-destructive-foreground)}}
|
|
2
2
|
/*$vite$:1*/
|
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
|
-
|
|
59
|
-
|
|
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
|
/**
|
|
@@ -912,8 +923,17 @@ interface ChartFrameProps {
|
|
|
912
923
|
* container (`max-inline-size: 100%`) so it can never overflow its card.
|
|
913
924
|
*/
|
|
914
925
|
width?: number | undefined;
|
|
915
|
-
/**
|
|
916
|
-
*
|
|
926
|
+
/**
|
|
927
|
+
* Height of the **plot area** in px — the SVG only. The title, description and legend
|
|
928
|
+
* render OUTSIDE it (the legend is a sibling of this frame), so the rendered block is
|
|
929
|
+
* taller than `height` by whatever chrome the chart shows. Sizing a card to `height`
|
|
930
|
+
* exactly is what clips a legend.
|
|
931
|
+
*
|
|
932
|
+
* **Omit it (the default) for a responsive chart.** Like `width`, height now tracks the
|
|
933
|
+
* container via `ResizeObserver`: in a parent with a definite block size the plot fills
|
|
934
|
+
* the space left over after the legend, and in an auto-height parent it falls back to
|
|
935
|
+
* 300px. Set it only to force a fixed aspect.
|
|
936
|
+
*/
|
|
917
937
|
height?: number | undefined;
|
|
918
938
|
fallback?: ReactNode;
|
|
919
939
|
children: (size: {
|
|
@@ -1610,6 +1630,19 @@ interface AreaChartSeries<Datum> {
|
|
|
1610
1630
|
color?: string;
|
|
1611
1631
|
/** Which y-axis this series is measured against (ignored when `stacked`). Default 'left'. */
|
|
1612
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';
|
|
1613
1646
|
/**
|
|
1614
1647
|
* Per-series Y accessor. Overrides the chart-level `y` for this series only —
|
|
1615
1648
|
* use it to plot two series from one shared `data` row against different fields
|
|
@@ -1966,11 +1999,10 @@ declare function ScatterChart({
|
|
|
1966
1999
|
interface SparklineBaseProps {
|
|
1967
2000
|
data: readonly number[];
|
|
1968
2001
|
/**
|
|
1969
|
-
*
|
|
1970
|
-
*
|
|
1971
|
-
*
|
|
1972
|
-
*
|
|
1973
|
-
* this — charts call it internally.
|
|
2002
|
+
* SVG width in px. **This chart is fixed-width by default** — it is a compact, inline
|
|
2003
|
+
* chart meant to sit in a table cell or beside a label, so omitting `width` gives you
|
|
2004
|
+
* 120px rather than a container-filling chart. Pass a number to change it. The
|
|
2005
|
+
* catalogue-wide "omit for a responsive chart" note does not apply to this chart.
|
|
1974
2006
|
*
|
|
1975
2007
|
* @defaultValue `80`
|
|
1976
2008
|
* @see the component manifest
|
|
@@ -2049,7 +2081,7 @@ declare function Meter({
|
|
|
2049
2081
|
label,
|
|
2050
2082
|
variant,
|
|
2051
2083
|
thresholds,
|
|
2052
|
-
width,
|
|
2084
|
+
width: fixedWidth,
|
|
2053
2085
|
height
|
|
2054
2086
|
}: MeterProps): import("react").JSX.Element;
|
|
2055
2087
|
interface KpiProps {
|
|
@@ -2478,11 +2510,10 @@ interface BulletProps {
|
|
|
2478
2510
|
min?: number;
|
|
2479
2511
|
max?: number;
|
|
2480
2512
|
/**
|
|
2481
|
-
*
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
* this — charts call it internally.
|
|
2513
|
+
* SVG width in px. **This chart is fixed-width by default** — it is a compact, inline
|
|
2514
|
+
* chart meant to sit in a table cell or beside a label, so omitting `width` gives you
|
|
2515
|
+
* 300px rather than a container-filling chart. Pass a number to change it. The
|
|
2516
|
+
* catalogue-wide "omit for a responsive chart" note does not apply to this chart.
|
|
2486
2517
|
*
|
|
2487
2518
|
* @defaultValue `300`
|
|
2488
2519
|
* @see the component manifest
|
|
@@ -3053,4 +3084,4 @@ declare function Gauge({
|
|
|
3053
3084
|
className,
|
|
3054
3085
|
plain
|
|
3055
3086
|
}: GaugeProps): import("react").JSX.Element;
|
|
3056
|
-
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 };
|
|
3087
|
+
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 };
|