layerchart 2.0.0-next.45 → 2.0.0-next.47
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/bench/ComposableLineChart.svelte +56 -0
- package/dist/bench/ComposableLineChart.svelte.d.ts +16 -0
- package/dist/bench/GeoBench.svelte +31 -0
- package/dist/bench/GeoBench.svelte.d.ts +11 -0
- package/dist/bench/composable-vs-linechart.svelte.bench.d.ts +1 -0
- package/dist/bench/composable-vs-linechart.svelte.bench.js +100 -0
- package/dist/bench/generateData.d.ts +29 -0
- package/dist/bench/generateData.js +93 -0
- package/dist/bench/svg-vs-canvas.svelte.bench.d.ts +1 -0
- package/dist/bench/svg-vs-canvas.svelte.bench.js +431 -0
- package/dist/components/Arc.svelte +10 -10
- package/dist/components/Arc.svelte.d.ts +2 -3
- package/dist/components/Arc.svelte.test.js +20 -30
- package/dist/components/Area.svelte +87 -102
- package/dist/components/Area.svelte.d.ts +7 -3
- package/dist/components/Axis.svelte +18 -2
- package/dist/components/Bar.svelte +156 -14
- package/dist/components/Bar.svelte.d.ts +20 -0
- package/dist/components/Bars.svelte +29 -3
- package/dist/components/Bars.svelte.d.ts +9 -1
- package/dist/components/BoxPlot.svelte +397 -0
- package/dist/components/BoxPlot.svelte.d.ts +40 -0
- package/dist/components/BrushContext.svelte +103 -283
- package/dist/components/BrushContext.svelte.d.ts +17 -45
- package/dist/components/BrushContext.svelte.test.d.ts +1 -0
- package/dist/components/BrushContext.svelte.test.js +301 -0
- package/dist/components/Calendar.svelte +5 -6
- package/dist/components/Calendar.svelte.d.ts +2 -3
- package/dist/components/Cell.svelte +59 -0
- package/dist/components/Cell.svelte.d.ts +25 -0
- package/dist/components/Chart.svelte +359 -695
- package/dist/components/Chart.svelte.d.ts +85 -12
- package/dist/components/ChartChildren.svelte +290 -0
- package/dist/components/ChartChildren.svelte.d.ts +147 -0
- package/dist/components/Chord.svelte +114 -0
- package/dist/components/Chord.svelte.d.ts +53 -0
- package/dist/components/Circle.svelte +266 -64
- package/dist/components/Circle.svelte.d.ts +31 -9
- package/dist/components/Circle.svelte.test.d.ts +1 -0
- package/dist/components/Circle.svelte.test.js +141 -0
- package/dist/components/CircleClipPath.svelte +10 -1
- package/dist/components/ClipPath.svelte +31 -0
- package/dist/components/ClipPath.svelte.d.ts +10 -0
- package/dist/components/Contour.svelte +224 -0
- package/dist/components/Contour.svelte.d.ts +40 -0
- package/dist/components/Dagre.svelte +5 -0
- package/dist/components/Density.svelte +146 -0
- package/dist/components/Density.svelte.d.ts +21 -0
- package/dist/components/Ellipse.svelte +281 -66
- package/dist/components/Ellipse.svelte.d.ts +36 -11
- package/dist/components/Ellipse.svelte.test.d.ts +1 -0
- package/dist/components/Ellipse.svelte.test.js +126 -0
- package/dist/components/GeoEdgeFade.svelte +2 -3
- package/dist/components/GeoPath.svelte +18 -11
- package/dist/components/GeoPath.svelte.d.ts +2 -3
- package/dist/components/GeoPoint.svelte +16 -6
- package/dist/components/GeoProjection.svelte +30 -0
- package/dist/components/GeoProjection.svelte.d.ts +8 -0
- package/dist/components/GeoSpline.svelte +23 -15
- package/dist/components/GeoSpline.svelte.d.ts +2 -2
- package/dist/components/GeoTile.svelte +6 -8
- package/dist/components/GeoVisible.svelte +2 -2
- package/dist/components/Grid.svelte +3 -0
- package/dist/components/Group.svelte +164 -54
- package/dist/components/Group.svelte.d.ts +24 -6
- package/dist/components/Group.svelte.test.d.ts +1 -0
- package/dist/components/Group.svelte.test.js +63 -0
- package/dist/components/Highlight.svelte +307 -121
- package/dist/components/Highlight.svelte.d.ts +8 -0
- package/dist/components/Hull.svelte +7 -4
- package/dist/components/Image.svelte +544 -0
- package/dist/components/Image.svelte.d.ts +127 -0
- package/dist/components/Image.svelte.test.d.ts +1 -0
- package/dist/components/Image.svelte.test.js +220 -0
- package/dist/components/Labels.svelte +29 -5
- package/dist/components/Labels.svelte.d.ts +4 -0
- package/dist/components/Legend.svelte +100 -17
- package/dist/components/Legend.svelte.d.ts +11 -4
- package/dist/components/Line.svelte +293 -77
- package/dist/components/Line.svelte.d.ts +39 -14
- package/dist/components/Line.svelte.test.d.ts +1 -0
- package/dist/components/Line.svelte.test.js +121 -0
- package/dist/components/LinearGradient.svelte +2 -4
- package/dist/components/Path.svelte +6 -5
- package/dist/components/Pattern.svelte +5 -4
- package/dist/components/Pie.svelte +4 -5
- package/dist/components/Pie.svelte.d.ts +2 -3
- package/dist/components/Points.svelte +65 -12
- package/dist/components/Points.svelte.d.ts +6 -0
- package/dist/components/Polygon.svelte +231 -42
- package/dist/components/Polygon.svelte.d.ts +29 -8
- package/dist/components/Polygon.svelte.test.d.ts +1 -0
- package/dist/components/Polygon.svelte.test.js +121 -0
- package/dist/components/RadialGradient.svelte +2 -4
- package/dist/components/Raster.svelte +247 -0
- package/dist/components/Raster.svelte.d.ts +40 -0
- package/dist/components/Rect.svelte +425 -90
- package/dist/components/Rect.svelte.d.ts +78 -7
- package/dist/components/Rect.svelte.test.d.ts +1 -0
- package/dist/components/Rect.svelte.test.js +179 -0
- package/dist/components/RectClipPath.svelte +13 -2
- package/dist/components/Ribbon.svelte +141 -0
- package/dist/components/Ribbon.svelte.d.ts +51 -0
- package/dist/components/Spline.svelte +111 -6
- package/dist/components/Spline.svelte.d.ts +11 -1
- package/dist/components/Text.svelte +413 -155
- package/dist/components/Text.svelte.d.ts +42 -14
- package/dist/components/Text.svelte.test.d.ts +1 -0
- package/dist/components/Text.svelte.test.js +152 -0
- package/dist/components/Threshold.svelte +3 -0
- package/dist/components/TransformContext.svelte +115 -292
- package/dist/components/TransformContext.svelte.d.ts +22 -0
- package/dist/components/Vector.svelte +374 -0
- package/dist/components/Vector.svelte.d.ts +109 -0
- package/dist/components/Violin.svelte +319 -0
- package/dist/components/Violin.svelte.d.ts +47 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-full-circle--360-degree-range--1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-full-circle--360-degree-range--2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-innerRadius-of-0--pie-slice--1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-innerRadius-of-0--pie-slice--2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-negative-domain-values-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-negative-domain-values-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-partial-arc--e-g---180-degrees--1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-partial-arc--e-g---180-degrees--2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-at-max-domain-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-at-max-domain-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-below-domain-min-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-below-domain-min-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-exceeding-domain-max-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-exceeding-domain-max-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-of-0-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-of-0-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-enter-events-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-enter-events-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-move-events-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-move-events-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-offset-to-arc-position-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-offset-to-arc-position-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-hide-on-pointer-leave-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-hide-on-pointer-leave-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-show-on-pointer-enter-with-data-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-show-on-pointer-enter-with-data-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-handle-custom-start-angle-in-range-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-handle-custom-start-angle-in-range-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-an-arc-path-with-value-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-an-arc-path-with-value-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-when-track-prop-is-provided-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-when-track-prop-is-provided-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackEndAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackEndAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackPadAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackPadAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-and-trackEndAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-and-trackEndAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-both-startAngle-and-endAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-both-startAngle-and-endAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-cornerRadius-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-cornerRadius-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-and-range-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-and-range-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-range-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-range-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-endAngle-in-radians-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-endAngle-in-radians-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-padAngle-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-padAngle-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-startAngle-in-radians-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-startAngle-in-radians-2.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-snippets-should-render-text-inner--middle--outer-Text-children-1.png +0 -0
- package/dist/components/__screenshots__/Arc.svelte.test.ts/Arc-snippets-should-render-text-inner--middle--outer-Text-children-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-clear-brush-when-x-prop-changes-to--null--null--1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-clear-brush-when-x-prop-changes-to--null--null--2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-is-null-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-is-null-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-matches-full-domain-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-not-show-brush-when-x-prop-matches-full-domain-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-show-brush-when-x-prop-is-provided-with-a-sub-domain-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-show-brush-when-x-prop-is-provided-with-a-sub-domain-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-update-brush-width-when-x-prop-changes-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-external-sync--x-y-props--should-update-brush-width-when-x-prop-changes-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-clear-brush-when-reset-programmatically-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-clear-brush-when-reset-programmatically-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-compute-correct-pixel-width-for-brush-move---1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-compute-correct-pixel-width-for-brush-move---2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-move-only-y-when-x-is-not-specified-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-move-only-y-when-x-is-not-specified-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-select-full-domain-with-selectAll-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-select-full-domain-with-selectAll-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-show-brush-when-moved-programmatically-via-context-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-show-brush-when-moved-programmatically-via-context-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-update-width-when-brush-move---is-called-again-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-programmatic-control-should-update-width-when-brush-move---is-called-again-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-brush-UI-when-brush-is-disabled-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-brush-UI-when-brush-is-disabled-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-range-or-handles-initially-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-not-render-range-or-handles-initially-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-render-brush-context-when-brush-is-enabled-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-rendering-should-render-brush-context-when-brush-is-enabled-2.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-zoomOnBrush-with-onBrushEnd-should-pass-brush-domain-values-to-onBrushEnd-before-resetting-1.png +0 -0
- package/dist/components/__screenshots__/BrushContext.svelte.test.ts/BrushContext-zoomOnBrush-with-onBrushEnd-should-pass-brush-domain-values-to-onBrushEnd-before-resetting-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-one-circle-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-one-circle-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-with-function-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-render-with-function-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-pixel-mode-should-render-a-circle-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Circle.svelte.test.ts/Circle-pixel-mode-should-render-a-circle-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-render-one-ellipse-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-render-one-ellipse-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-pixel-mode-should-render-an-ellipse-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Ellipse.svelte.test.ts/Ellipse-pixel-mode-should-render-an-ellipse-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-apply-circular-clipping-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-apply-circular-clipping-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-pass-literal-URL-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-pass-literal-URL-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-one-image-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-one-image-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-with-function-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-render-with-function-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-resolve-data-driven-href-from-data-property-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-resolve-data-driven-href-from-data-property-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-circular-clipping-when-r-is-set-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-circular-clipping-when-r-is-set-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-preserveAspectRatio-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-preserveAspectRatio-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-rotation-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-apply-rotation-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-default-width-and-height-to-16-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-default-width-and-height-to-16-2.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-render-an-image-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Image.svelte.test.ts/Image-pixel-mode-should-render-an-image-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-render-one-line-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-render-one-line-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-resolve-data-driven-stroke-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-resolve-data-driven-stroke-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-pixel-mode-should-render-a-line-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Line.svelte.test.ts/Line-pixel-mode-should-render-a-line-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-render-one-polygon-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-render-one-polygon-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-pixel-mode-should-render-a-polygon-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Polygon.svelte.test.ts/Polygon-pixel-mode-should-render-a-polygon-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---colors-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-from-edge-props-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-from-edge-props-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-with-insets-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-render-rects-with-insets-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---edge-based-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---standard-should-render-one-rect-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-data-mode---standard-should-render-one-rect-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-pixel-mode-should-render-a-rect-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Rect.svelte.test.ts/Rect-pixel-mode-should-render-a-rect-with-pixel-values-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-pass-literal-CSS-colors-through-unchanged-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-render-one-text-per-data-item-with-string-accessors-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-render-one-text-per-data-item-with-string-accessors-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-data-driven-fill-through-cScale-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-data-driven-fill-through-cScale-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-value-as-data-property-name-in-data-mode-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-resolve-value-as-data-property-name-in-data-mode-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-use-explicit-data-prop-over-chart-context-data-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-data-mode-should-use-explicit-data-prop-over-chart-context-data-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-preserve-CSS-like-string-values-as-SVG-values-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-preserve-CSS-like-string-values-as-SVG-values-2.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-render-text-with-pixel-values-1.png +0 -0
- package/dist/components/__screenshots__/Text.svelte.test.ts/Text-pixel-mode-should-render-text-with-pixel-values-2.png +0 -0
- package/dist/components/charts/ArcChart.svelte +140 -193
- package/dist/components/charts/ArcChart.svelte.d.ts +34 -15
- package/dist/components/charts/ArcChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/ArcChart.svelte.test.js +24 -0
- package/dist/components/charts/AreaChart.svelte +77 -496
- package/dist/components/charts/AreaChart.svelte.d.ts +26 -34
- package/dist/components/charts/AreaChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/AreaChart.svelte.test.js +154 -0
- package/dist/components/charts/BarChart.svelte +115 -508
- package/dist/components/charts/BarChart.svelte.d.ts +29 -29
- package/dist/components/charts/BarChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/BarChart.svelte.test.js +449 -0
- package/dist/components/charts/BarChartFixedWidthTest.svelte +47 -0
- package/dist/components/charts/BarChartFixedWidthTest.svelte.d.ts +11 -0
- package/dist/components/charts/ChartAnnotations.svelte +8 -7
- package/dist/components/charts/ChartAnnotations.svelte.d.ts +1 -3
- package/dist/components/charts/DefaultTooltip.svelte +97 -32
- package/dist/components/charts/DefaultTooltip.svelte.d.ts +2 -4
- package/dist/components/charts/DefaultTooltip.svelte.test.d.ts +1 -0
- package/dist/components/charts/DefaultTooltip.svelte.test.js +231 -0
- package/dist/components/charts/LineChart.svelte +79 -418
- package/dist/components/charts/LineChart.svelte.bench.d.ts +1 -0
- package/dist/components/charts/LineChart.svelte.bench.js +189 -0
- package/dist/components/charts/LineChart.svelte.d.ts +22 -30
- package/dist/components/charts/LineChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/LineChart.svelte.test.js +45 -0
- package/dist/components/charts/PieChart.svelte +282 -333
- package/dist/components/charts/PieChart.svelte.d.ts +52 -30
- package/dist/components/charts/PieChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/PieChart.svelte.test.js +36 -0
- package/dist/components/charts/ScatterChart.svelte +51 -347
- package/dist/components/charts/ScatterChart.svelte.d.ts +18 -21
- package/dist/components/charts/__fixtures__/ArcChartTooltip.svelte +39 -0
- package/dist/components/charts/__fixtures__/ArcChartTooltip.svelte.d.ts +18 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-and-stack-layout-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-multiple-area-paths-for-each-series-with-separate-data-and-stack-layout-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-with-single-series-when-no-series-prop-provided-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-basic-should-render-with-single-series-when-no-series-prop-provided-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-overlap-layout-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-overlap-layout-2.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-stack-layout-1.png +0 -0
- package/dist/components/charts/__screenshots__/AreaChart.svelte.test.ts/AreaChart-series-layout-should-render-with-stack-layout-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-horizontal-bars-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-horizontal-bars-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-vertical-bars-without-NaN-attributes-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-vertical-bars-without-NaN-attributes-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-with-default-series-when-no-series-prop-provided-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-basic-should-render-with-default-series-when-no-series-prop-provided-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-center-fixed-width-bars-within-their-band-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-center-fixed-width-bars-within-their-band-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-horizontal-bars-with-fixed-height-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-horizontal-bars-with-fixed-height-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-vertical-bars-with-fixed-width-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-fixed-width-height-should-render-vertical-bars-with-fixed-width-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-legend-series-toggle-adjusts-group-scale-should-adjust-grouped-bar-widths-when-series-are-toggled-via-legend-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-legend-series-toggle-adjusts-group-scale-should-adjust-grouped-bar-widths-when-series-are-toggled-via-legend-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-no-series-prop--transition-example-pattern--should-render-without-series-prop-and-not-produce-NaN-rect-attributes-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-no-series-prop--transition-example-pattern--should-render-without-series-prop-and-not-produce-NaN-rect-attributes-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-overlapping-series-with-separate-data-arrays-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-overlapping-series-with-separate-data-arrays-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-stacked-series-with-separate-data-arrays-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-separate-data-per-series-should-render-stacked-series-with-separate-data-arrays-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-grouped-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-grouped-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-multiple-Bars-groups-for-each-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-multiple-Bars-groups-for-each-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackDiverging-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackDiverging-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackExpand-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stackExpand-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-horizontally-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-should-render-stacked-series-horizontally-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-both-tips-when-there-is-one-positive-and-one-negative-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-both-tips-when-there-is-one-positive-and-one-negative-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-the-tip-of-each-direction--not-inner-layers-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-stackDiverging-edge-rounding-should-round-the-tip-of-each-direction--not-inner-layers-2.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-tooltip-should-use-explicit-series-colors--not-color-scale-1.png +0 -0
- package/dist/components/charts/__screenshots__/BarChart.svelte.test.ts/BarChart-series-tooltip-should-use-explicit-series-colors--not-color-scale-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-fade-non-highlighted-tooltip-series-items-on-hover-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-fade-non-highlighted-tooltip-series-items-on-hover-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-LineChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-LineChart--multi-series--quadtree-x-mode--should-show-header-and-all-series-items-2.png +0 -0
- package/dist/components/charts/types.d.ts +6 -212
- package/dist/components/index.d.ts +22 -2
- package/dist/components/index.js +22 -3
- package/dist/components/layers/Canvas.svelte +134 -134
- package/dist/components/layers/Canvas.svelte.d.ts +0 -6
- package/dist/components/layers/Html.svelte +3 -6
- package/dist/components/layers/Svg.svelte +3 -6
- package/dist/components/tests/BrushTestHarness.svelte +27 -0
- package/dist/components/tests/BrushTestHarness.svelte.d.ts +8 -0
- package/dist/components/tests/TestHarness.svelte +12 -1
- package/dist/components/tests/TestHarness.svelte.d.ts +2 -0
- package/dist/components/tooltip/Tooltip.svelte +24 -25
- package/dist/components/tooltip/Tooltip.svelte.d.ts +2 -11
- package/dist/components/tooltip/TooltipContext.svelte +126 -85
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +6 -6
- package/dist/components/tooltip/TooltipItem.svelte +11 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/contexts/canvas.d.ts +0 -2
- package/dist/contexts/chart.d.ts +6 -84
- package/dist/contexts/chart.js +40 -2
- package/dist/contexts/componentTree.test.d.ts +1 -0
- package/dist/contexts/componentTree.test.js +83 -0
- package/dist/contexts/geo.d.ts +4 -6
- package/dist/contexts/geo.js +0 -1
- package/dist/contexts/index.d.ts +0 -1
- package/dist/contexts/index.js +0 -1
- package/dist/contexts/transform.d.ts +3 -2
- package/dist/contexts/transform.js +2 -2
- package/dist/states/__fixtures__/ComponentNodeLifecycleChild.svelte +13 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleChild.svelte.d.ts +18 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleHarness.svelte +48 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleHarness.svelte.d.ts +8 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleParent.svelte +26 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleParent.svelte.d.ts +9 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-baseline-domain-multi-series-should-work-without-baseline--no-forced-0--1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-baseline-domain-multi-series-should-work-without-baseline--no-forced-0--2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-degenerate-domain-should-expand-degenerate-y-domain--5--5--to--5--6--1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-degenerate-domain-should-expand-degenerate-y-domain--5--5--to--5--6--2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-explicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-explicit-series-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-implicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-series-domain-update-on-visibility-toggle-should-update-y-domain-when-hiding-an-implicit-series-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-deduplicate-repeated-mark-x-keys-into-a-single-accessor-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-deduplicate-repeated-mark-x-keys-into-a-single-accessor-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-correct-y-domain-across-two-marks-with-different-data-and-no-y-prop-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-correct-y-domain-across-two-marks-with-different-data-and-no-y-prop-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-x-accessor-from-marks-when-x-prop-is-absent-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-implicit-x-y-from-marks--no-x-y-on-Chart--should-derive-x-accessor-from-marks-when-x-prop-is-absent-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-aggregate-y-accessor-from-implicit-series-into-resolveAccessor-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-aggregate-y-accessor-from-implicit-series-into-resolveAccessor-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-calculate-correct-y-domain-from-two-marks-with-same-y-accessor-but-different-data-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-calculate-correct-y-domain-from-two-marks-with-same-y-accessor-but-different-data-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-deduplicate-implicit-series-with-the-same-key-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-deduplicate-implicit-series-with-the-same-key-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-seriesKey-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-seriesKey-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-string-y-accessors-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-marks-with-string-y-accessors-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-x-accessor-for-vertical-charts--valueAxis-x--1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-generate-implicit-series-from-x-accessor-for-vertical-charts--valueAxis-x--2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-data-from-two-marks-with-same-y-accessor-but-different-data-arrays-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-data-from-two-marks-with-same-y-accessor-but-different-data-arrays-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-implicit-series-label-when-provided-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-implicit-series-label-when-provided-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-mark-data-in-flatData-for-domain-calculation-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-mark-data-in-flatData-for-domain-calculation-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-per-mark-data-in-domain-via-implicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-include-per-mark-data-in-domain-via-implicit-series-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-not-double-include-data-when-mark-data-matches-series-data-reference-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-not-double-include-data-when-mark-data-matches-series-data-reference-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-register-and-unregister-marks-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-register-and-unregister-marks-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-revert-flatData-after-all-marks-unregister-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-revert-flatData-after-all-marks-unregister-2.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-skip-marks-without-a-derivable-key-for-implicit-series-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-mark-registration-should-skip-marks-without-a-derivable-key-for-implicit-series-2.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-allow-toggling-after-initial-selected--false-1.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-allow-toggling-after-initial-selected--false-2.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-respect-selected--false-on-series-items-1.png +0 -0
- package/dist/states/__screenshots__/series.svelte.test.ts/SeriesState-visibility-should-respect-selected--false-on-series-items-2.png +0 -0
- package/dist/states/brush.svelte.d.ts +90 -0
- package/dist/states/brush.svelte.js +153 -0
- package/dist/states/brush.svelte.test.d.ts +1 -0
- package/dist/states/brush.svelte.test.js +292 -0
- package/dist/states/chart.component-node.svelte.test.d.ts +1 -0
- package/dist/states/chart.component-node.svelte.test.js +28 -0
- package/dist/states/chart.svelte.d.ts +254 -0
- package/dist/states/chart.svelte.js +972 -0
- package/dist/states/chart.svelte.test.d.ts +1 -0
- package/dist/states/chart.svelte.test.js +1278 -0
- package/dist/{components/GeoContext.svelte.d.ts → states/geo.svelte.d.ts} +18 -21
- package/dist/states/geo.svelte.js +88 -0
- package/dist/states/series.svelte.d.ts +62 -9
- package/dist/states/series.svelte.js +213 -19
- package/dist/states/series.svelte.test.d.ts +1 -0
- package/dist/states/series.svelte.test.js +333 -0
- package/dist/states/tooltip.svelte.d.ts +22 -0
- package/dist/states/tooltip.svelte.js +16 -0
- package/dist/states/transform.svelte.d.ts +169 -3
- package/dist/states/transform.svelte.js +402 -27
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/clearCanvasContext-clears-with-zero-padding--no-offset--1.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/clearCanvasContext-clears-with-zero-padding--no-offset--2.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-inline-style-overrides-styles-object-1.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-inline-style-overrides-styles-object-2.png +0 -0
- package/dist/utils/canvas.d.ts +3 -1
- package/dist/utils/canvas.js +27 -4
- package/dist/utils/canvas.svelte.test.d.ts +1 -0
- package/dist/utils/canvas.svelte.test.js +703 -0
- package/dist/utils/chart.js +8 -0
- package/dist/utils/common.d.ts +5 -5
- package/dist/utils/common.js +3 -0
- package/dist/utils/common.test.js +10 -1
- package/dist/utils/dataProp.d.ts +120 -0
- package/dist/utils/dataProp.js +114 -0
- package/dist/utils/dataProp.test.d.ts +1 -0
- package/dist/utils/dataProp.test.js +128 -0
- package/dist/utils/download.d.ts +98 -0
- package/dist/utils/download.js +250 -0
- package/dist/utils/graph/sankey.js +9 -7
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/motion.svelte.d.ts +14 -0
- package/dist/utils/motion.svelte.js +63 -1
- package/dist/utils/path.d.ts +44 -1
- package/dist/utils/path.js +117 -17
- package/dist/utils/rasterInterpolate.d.ts +11 -0
- package/dist/utils/rasterInterpolate.js +103 -0
- package/dist/utils/rect.svelte.d.ts +9 -2
- package/dist/utils/rect.svelte.js +1 -1
- package/dist/utils/scales.svelte.d.ts +1 -1
- package/dist/utils/scales.svelte.js +9 -7
- package/dist/utils/stats.d.ts +33 -0
- package/dist/utils/stats.js +79 -0
- package/dist/utils/types.d.ts +13 -0
- package/package.json +27 -16
- package/dist/components/GeoContext.svelte +0 -160
- package/dist/components/TransformControls.svelte +0 -230
- package/dist/components/TransformControls.svelte.d.ts +0 -28
- package/dist/components/charts/utils.svelte.d.ts +0 -12
- package/dist/components/charts/utils.svelte.js +0 -27
- package/dist/components/tooltip/tooltipMetaContext.d.ts +0 -79
- package/dist/components/tooltip/tooltipMetaContext.js +0 -139
- package/dist/contexts/tooltip.d.ts +0 -15
- package/dist/contexts/tooltip.js +0 -8
- package/dist/utils/graph/dagre.d.ts +0 -34
package/dist/utils/chart.js
CHANGED
|
@@ -58,6 +58,14 @@ export function createChartScale(axis, { domain, scale, padding, nice, reverse,
|
|
|
58
58
|
console.error(`[Layer Chart] You set \`${axis}Nice: true\` but the ${axis}Scale does not have a \`.nice\` method. Ignoring...`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
// Guard against degenerate domains where min === max (e.g. all-zero data).
|
|
62
|
+
// A degenerate domain causes the scale to return NaN for all inputs.
|
|
63
|
+
if (typeof trueScale.domain === 'function' && typeof trueScale.invert === 'function') {
|
|
64
|
+
const [dMin, dMax] = trueScale.domain();
|
|
65
|
+
if (typeof dMin === 'number' && typeof dMax === 'number' && dMin === dMax) {
|
|
66
|
+
trueScale.domain([dMin, dMin + 1]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
61
69
|
return trueScale;
|
|
62
70
|
}
|
|
63
71
|
// These scales have a discrete range so they can't be padded
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
2
|
import type Chart from '../components/Chart.svelte';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChartProps } from '../components/Chart.svelte';
|
|
4
4
|
export type Accessor<TData = any> = number | string | ((d: TData) => any) | undefined | null | Accessor<TData>[];
|
|
5
5
|
export declare function accessor<TData = any>(prop: Accessor<TData>): (d: TData) => any;
|
|
6
6
|
/** Guarantee chart data is an array */
|
|
7
7
|
export declare function chartDataArray<TData = any>(data: ComponentProps<Chart<TData>>['data']): any[];
|
|
8
|
-
export declare function defaultChartPadding<TData
|
|
9
|
-
axis?:
|
|
10
|
-
legend?:
|
|
8
|
+
export declare function defaultChartPadding<TData>(options?: {
|
|
9
|
+
axis?: ChartProps<TData>['axis'];
|
|
10
|
+
legend?: ChartProps<TData>['legend'];
|
|
11
11
|
top?: number;
|
|
12
12
|
left?: number;
|
|
13
13
|
bottom?: number;
|
package/dist/utils/common.js
CHANGED
|
@@ -49,6 +49,9 @@ export function defaultChartPadding(options = {}) {
|
|
|
49
49
|
* Handles complex objects such as `Date` by invoking `.valueOf()`
|
|
50
50
|
*/
|
|
51
51
|
export function findRelatedData(data, original, accessor) {
|
|
52
|
+
if (data.includes(original)) {
|
|
53
|
+
return original;
|
|
54
|
+
}
|
|
52
55
|
return data.find((d) => {
|
|
53
56
|
return accessor(d)?.valueOf() === accessor(original)?.valueOf();
|
|
54
57
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { accessor, resolveMaybeFn, getObjectOrNull } from './common.js';
|
|
2
|
+
import { accessor, findRelatedData, resolveMaybeFn, getObjectOrNull } from './common.js';
|
|
3
3
|
export const testData = {
|
|
4
4
|
one: 1,
|
|
5
5
|
two: 2,
|
|
@@ -52,6 +52,15 @@ describe('getObjectOrNull', () => {
|
|
|
52
52
|
expect(getObjectOrNull(obj)).toBe(obj);
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
|
+
describe('findRelatedData', () => {
|
|
56
|
+
it('prefers exact object identity before accessor matching', () => {
|
|
57
|
+
const first = { id: 'first', value: 10 };
|
|
58
|
+
const second = { id: 'second', value: 10 };
|
|
59
|
+
const data = [first, second];
|
|
60
|
+
const actual = findRelatedData(data, second, accessor('value'));
|
|
61
|
+
expect(actual).toBe(second);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
55
64
|
describe('resolveMaybeFn', () => {
|
|
56
65
|
it('returns value if not a function', () => {
|
|
57
66
|
expect(resolveMaybeFn(5)).toBe(5);
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { AnyScale } from './scales.svelte.js';
|
|
2
|
+
/**
|
|
3
|
+
* A prop that can be a direct pixel value, a data property name (resolved via scale),
|
|
4
|
+
* or an accessor function (whose result is passed through a scale).
|
|
5
|
+
*
|
|
6
|
+
* - `number` → pixel value (direct, no scale applied)
|
|
7
|
+
* - `string` → data property path, resolved via accessor then passed through scale
|
|
8
|
+
* - `function(d)` → called with data item, result passed through scale
|
|
9
|
+
*/
|
|
10
|
+
export type DataProp<T = any> = number | string | ((d: T) => any);
|
|
11
|
+
/**
|
|
12
|
+
* Returns true if the value is a data-space prop (string or function),
|
|
13
|
+
* meaning it needs scale resolution rather than being a direct pixel value.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isDataProp(value: any): value is string | Function;
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if ANY of the provided values is a data-space prop.
|
|
18
|
+
* Used to detect whether a component should enter "data mode".
|
|
19
|
+
*/
|
|
20
|
+
export declare function hasAnyDataProp(...values: any[]): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves a DataProp value for a specific data item through a scale.
|
|
23
|
+
*
|
|
24
|
+
* - `number`: returned directly (pixel value, no scale)
|
|
25
|
+
* - `string`: used as property path on data item, result passed through scale
|
|
26
|
+
* - `function`: called with data item, result passed through scale
|
|
27
|
+
* - `undefined`/`null`: returns defaultValue
|
|
28
|
+
*
|
|
29
|
+
* If no scale is provided and the raw value is numeric, it passes through directly.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveDataProp<T>(value: DataProp<T> | undefined | null, d: T, scale: AnyScale | null | undefined, defaultValue?: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* Extract the raw value from a DataProp without applying any scale.
|
|
34
|
+
* Numbers pass through, strings do property lookup, functions are called.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractRawDataValue<T>(value: DataProp<T> | undefined | null, d: T): any;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve a pair of x/y DataProps through a geo projection.
|
|
39
|
+
* x = longitude, y = latitude → projection([lon, lat]) → [px, py]
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveGeoDataPair<T>(xProp: DataProp<T> | undefined | null, yProp: DataProp<T> | undefined | null, d: T, projection: (coords: [number, number]) => [number, number] | null, defaults?: [number, number]): [number, number];
|
|
42
|
+
/**
|
|
43
|
+
* A color prop that can be a literal CSS color string, a data property name
|
|
44
|
+
* (resolved through cScale), or an accessor function (result passed through cScale).
|
|
45
|
+
*
|
|
46
|
+
* - `string` → in data mode, if it matches a data property, the value is extracted
|
|
47
|
+
* and passed through cScale. Otherwise used as a literal CSS color.
|
|
48
|
+
* - `function(d)` → called per data item, result passed through cScale.
|
|
49
|
+
*/
|
|
50
|
+
export type ColorProp<T = any> = string | ((d: T) => any);
|
|
51
|
+
/**
|
|
52
|
+
* A style prop that can be a static value or a per-item accessor function.
|
|
53
|
+
* In data mode, if a function is provided, it is called with the data item.
|
|
54
|
+
*/
|
|
55
|
+
export type StyleProp<V, T = any> = V | ((d: T) => V);
|
|
56
|
+
/**
|
|
57
|
+
* Style props for primitives that support data-driven styling.
|
|
58
|
+
* All style props accept either a static value or a per-item accessor function.
|
|
59
|
+
*/
|
|
60
|
+
export type DataDrivenStyleProps<T = any> = {
|
|
61
|
+
/**
|
|
62
|
+
* The fill color.
|
|
63
|
+
* - `string`: in data mode, if it matches a data property name, the value is
|
|
64
|
+
* extracted and passed through cScale. Otherwise used as a literal CSS color.
|
|
65
|
+
* - `function(d)`: accessor called per data item, result passed through cScale.
|
|
66
|
+
*/
|
|
67
|
+
fill?: ColorProp<T>;
|
|
68
|
+
/**
|
|
69
|
+
* The stroke color.
|
|
70
|
+
* - `string`: in data mode, if it matches a data property name, the value is
|
|
71
|
+
* extracted and passed through cScale. Otherwise used as a literal CSS color.
|
|
72
|
+
* - `function(d)`: accessor called per data item, result passed through cScale.
|
|
73
|
+
*/
|
|
74
|
+
stroke?: ColorProp<T>;
|
|
75
|
+
/**
|
|
76
|
+
* The fill opacity (0 to 1).
|
|
77
|
+
* - `number`: static value
|
|
78
|
+
* - `function(d)`: accessor called per data item
|
|
79
|
+
*/
|
|
80
|
+
fillOpacity?: StyleProp<number | undefined, T>;
|
|
81
|
+
/**
|
|
82
|
+
* The stroke opacity (0 to 1).
|
|
83
|
+
* - `number`: static value
|
|
84
|
+
* - `function(d)`: accessor called per data item
|
|
85
|
+
*/
|
|
86
|
+
strokeOpacity?: StyleProp<number | undefined, T>;
|
|
87
|
+
/**
|
|
88
|
+
* The stroke width.
|
|
89
|
+
* - `number`: static value
|
|
90
|
+
* - `function(d)`: accessor called per data item
|
|
91
|
+
*/
|
|
92
|
+
strokeWidth?: StyleProp<number | undefined, T>;
|
|
93
|
+
/**
|
|
94
|
+
* The opacity (0 to 1).
|
|
95
|
+
* - `number`: static value
|
|
96
|
+
* - `function(d)`: accessor called per data item
|
|
97
|
+
*/
|
|
98
|
+
opacity?: StyleProp<number | undefined, T>;
|
|
99
|
+
/**
|
|
100
|
+
* CSS class name(s).
|
|
101
|
+
* - `string`: static class string
|
|
102
|
+
* - `function(d)`: accessor called per data item, returns class string
|
|
103
|
+
*/
|
|
104
|
+
class?: StyleProp<string | undefined, T>;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Resolves a ColorProp for a specific data item, optionally through a color scale.
|
|
108
|
+
*
|
|
109
|
+
* - `string`: checks if `get(d, value)` is defined → data property, passed through cScale.
|
|
110
|
+
* Otherwise returns the string as a literal CSS color.
|
|
111
|
+
* - `function`: called with data item, result passed through cScale.
|
|
112
|
+
* - `undefined`/`null`: returns undefined.
|
|
113
|
+
*/
|
|
114
|
+
export declare function resolveColorProp<T>(value: ColorProp<T> | undefined | null, d: T, cScale: AnyScale | null | undefined): string | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Resolves a StyleProp for a specific data item.
|
|
117
|
+
* If the value is a function, calls it with the data item.
|
|
118
|
+
* Otherwise returns the static value.
|
|
119
|
+
*/
|
|
120
|
+
export declare function resolveStyleProp<V, T>(value: StyleProp<V, T> | undefined, d: T): V | undefined;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { get } from '@layerstack/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true if the value is a data-space prop (string or function),
|
|
4
|
+
* meaning it needs scale resolution rather than being a direct pixel value.
|
|
5
|
+
*/
|
|
6
|
+
export function isDataProp(value) {
|
|
7
|
+
return typeof value === 'string' || typeof value === 'function';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns true if ANY of the provided values is a data-space prop.
|
|
11
|
+
* Used to detect whether a component should enter "data mode".
|
|
12
|
+
*/
|
|
13
|
+
export function hasAnyDataProp(...values) {
|
|
14
|
+
return values.some((v) => v !== undefined && isDataProp(v));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolves a DataProp value for a specific data item through a scale.
|
|
18
|
+
*
|
|
19
|
+
* - `number`: returned directly (pixel value, no scale)
|
|
20
|
+
* - `string`: used as property path on data item, result passed through scale
|
|
21
|
+
* - `function`: called with data item, result passed through scale
|
|
22
|
+
* - `undefined`/`null`: returns defaultValue
|
|
23
|
+
*
|
|
24
|
+
* If no scale is provided and the raw value is numeric, it passes through directly.
|
|
25
|
+
*/
|
|
26
|
+
export function resolveDataProp(value, d, scale, defaultValue = 0) {
|
|
27
|
+
if (value === undefined || value === null)
|
|
28
|
+
return defaultValue;
|
|
29
|
+
if (typeof value === 'number')
|
|
30
|
+
return value;
|
|
31
|
+
let rawValue;
|
|
32
|
+
if (typeof value === 'string') {
|
|
33
|
+
rawValue = get(d, value);
|
|
34
|
+
}
|
|
35
|
+
else if (typeof value === 'function') {
|
|
36
|
+
rawValue = value(d);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return defaultValue;
|
|
40
|
+
}
|
|
41
|
+
if (scale) {
|
|
42
|
+
const result = scale(rawValue);
|
|
43
|
+
return typeof result === 'number' && isFinite(result) ? result : defaultValue;
|
|
44
|
+
}
|
|
45
|
+
// No scale: if raw value is a number, use it directly
|
|
46
|
+
return typeof rawValue === 'number' ? rawValue : defaultValue;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Extract the raw value from a DataProp without applying any scale.
|
|
50
|
+
* Numbers pass through, strings do property lookup, functions are called.
|
|
51
|
+
*/
|
|
52
|
+
export function extractRawDataValue(value, d) {
|
|
53
|
+
if (value === undefined || value === null)
|
|
54
|
+
return undefined;
|
|
55
|
+
if (typeof value === 'number')
|
|
56
|
+
return value;
|
|
57
|
+
if (typeof value === 'string')
|
|
58
|
+
return get(d, value);
|
|
59
|
+
if (typeof value === 'function')
|
|
60
|
+
return value(d);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Resolve a pair of x/y DataProps through a geo projection.
|
|
65
|
+
* x = longitude, y = latitude → projection([lon, lat]) → [px, py]
|
|
66
|
+
*/
|
|
67
|
+
export function resolveGeoDataPair(xProp, yProp, d, projection, defaults = [0, 0]) {
|
|
68
|
+
const rawX = extractRawDataValue(xProp, d);
|
|
69
|
+
const rawY = extractRawDataValue(yProp, d);
|
|
70
|
+
if (rawX == null || rawY == null)
|
|
71
|
+
return defaults;
|
|
72
|
+
const result = projection([rawX, rawY]);
|
|
73
|
+
return result ?? defaults;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolves a ColorProp for a specific data item, optionally through a color scale.
|
|
77
|
+
*
|
|
78
|
+
* - `string`: checks if `get(d, value)` is defined → data property, passed through cScale.
|
|
79
|
+
* Otherwise returns the string as a literal CSS color.
|
|
80
|
+
* - `function`: called with data item, result passed through cScale.
|
|
81
|
+
* - `undefined`/`null`: returns undefined.
|
|
82
|
+
*/
|
|
83
|
+
export function resolveColorProp(value, d, cScale) {
|
|
84
|
+
if (value === undefined || value === null)
|
|
85
|
+
return undefined;
|
|
86
|
+
if (typeof value === 'function') {
|
|
87
|
+
const rawValue = value(d);
|
|
88
|
+
if (rawValue === undefined || rawValue === null)
|
|
89
|
+
return undefined;
|
|
90
|
+
return cScale ? String(cScale(rawValue)) : String(rawValue);
|
|
91
|
+
}
|
|
92
|
+
if (typeof value === 'string') {
|
|
93
|
+
const dataValue = get(d, value);
|
|
94
|
+
if (dataValue !== undefined) {
|
|
95
|
+
// Data property — resolve through cScale
|
|
96
|
+
return cScale ? String(cScale(dataValue)) : String(dataValue);
|
|
97
|
+
}
|
|
98
|
+
// Not a data property — literal CSS color
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolves a StyleProp for a specific data item.
|
|
105
|
+
* If the value is a function, calls it with the data item.
|
|
106
|
+
* Otherwise returns the static value.
|
|
107
|
+
*/
|
|
108
|
+
export function resolveStyleProp(value, d) {
|
|
109
|
+
if (value === undefined)
|
|
110
|
+
return undefined;
|
|
111
|
+
if (typeof value === 'function')
|
|
112
|
+
return value(d);
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { isDataProp, hasAnyDataProp, resolveDataProp, resolveColorProp } from './dataProp.js';
|
|
3
|
+
describe('isDataProp', () => {
|
|
4
|
+
it('returns true for strings', () => {
|
|
5
|
+
expect(isDataProp('date')).toBe(true);
|
|
6
|
+
expect(isDataProp('nested.path')).toBe(true);
|
|
7
|
+
});
|
|
8
|
+
it('returns true for functions', () => {
|
|
9
|
+
expect(isDataProp((d) => d.value)).toBe(true);
|
|
10
|
+
});
|
|
11
|
+
it('returns false for numbers', () => {
|
|
12
|
+
expect(isDataProp(0)).toBe(false);
|
|
13
|
+
expect(isDataProp(42)).toBe(false);
|
|
14
|
+
});
|
|
15
|
+
it('returns false for undefined and null', () => {
|
|
16
|
+
expect(isDataProp(undefined)).toBe(false);
|
|
17
|
+
expect(isDataProp(null)).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
describe('hasAnyDataProp', () => {
|
|
21
|
+
it('returns true if any value is a string', () => {
|
|
22
|
+
expect(hasAnyDataProp(10, 'date', 20)).toBe(true);
|
|
23
|
+
});
|
|
24
|
+
it('returns true if any value is a function', () => {
|
|
25
|
+
expect(hasAnyDataProp(10, (d) => d.x, 20)).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('returns false if all values are numbers', () => {
|
|
28
|
+
expect(hasAnyDataProp(10, 20, 30)).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
it('returns false if all values are undefined', () => {
|
|
31
|
+
expect(hasAnyDataProp(undefined, undefined)).toBe(false);
|
|
32
|
+
});
|
|
33
|
+
it('ignores undefined values but detects strings', () => {
|
|
34
|
+
expect(hasAnyDataProp(undefined, 'date')).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('resolveDataProp', () => {
|
|
38
|
+
const data = { date: '2024-01-01', value: 42, nested: { x: 10 } };
|
|
39
|
+
const mockScale = vi.fn((v) => v * 2);
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
mockScale.mockClear();
|
|
42
|
+
});
|
|
43
|
+
it('returns number directly without calling scale', () => {
|
|
44
|
+
expect(resolveDataProp(100, data, mockScale)).toBe(100);
|
|
45
|
+
expect(mockScale).not.toHaveBeenCalled();
|
|
46
|
+
});
|
|
47
|
+
it('resolves string as property path and passes through scale', () => {
|
|
48
|
+
expect(resolveDataProp('value', data, mockScale)).toBe(84); // 42 * 2
|
|
49
|
+
expect(mockScale).toHaveBeenCalledWith(42);
|
|
50
|
+
});
|
|
51
|
+
it('resolves nested string paths', () => {
|
|
52
|
+
expect(resolveDataProp('nested.x', data, mockScale)).toBe(20); // 10 * 2
|
|
53
|
+
expect(mockScale).toHaveBeenCalledWith(10);
|
|
54
|
+
});
|
|
55
|
+
it('resolves function accessor and passes through scale', () => {
|
|
56
|
+
const accessor = (d) => d.value;
|
|
57
|
+
expect(resolveDataProp(accessor, data, mockScale)).toBe(84); // 42 * 2
|
|
58
|
+
expect(mockScale).toHaveBeenCalledWith(42);
|
|
59
|
+
});
|
|
60
|
+
it('returns defaultValue for undefined', () => {
|
|
61
|
+
expect(resolveDataProp(undefined, data, mockScale)).toBe(0);
|
|
62
|
+
expect(resolveDataProp(undefined, data, mockScale, 99)).toBe(99);
|
|
63
|
+
});
|
|
64
|
+
it('returns defaultValue for null', () => {
|
|
65
|
+
expect(resolveDataProp(null, data, mockScale)).toBe(0);
|
|
66
|
+
expect(resolveDataProp(null, data, mockScale, 99)).toBe(99);
|
|
67
|
+
});
|
|
68
|
+
it('returns raw numeric value when no scale provided', () => {
|
|
69
|
+
expect(resolveDataProp('value', data, null)).toBe(42);
|
|
70
|
+
expect(resolveDataProp('value', data, undefined)).toBe(42);
|
|
71
|
+
});
|
|
72
|
+
it('returns defaultValue when no scale and raw value is not numeric', () => {
|
|
73
|
+
expect(resolveDataProp('date', data, null)).toBe(0); // '2024-01-01' is not a number
|
|
74
|
+
});
|
|
75
|
+
it('returns defaultValue when scale returns non-finite value', () => {
|
|
76
|
+
const badScale = vi.fn(() => NaN);
|
|
77
|
+
expect(resolveDataProp('value', data, badScale)).toBe(0);
|
|
78
|
+
});
|
|
79
|
+
it('returns defaultValue when scale returns Infinity', () => {
|
|
80
|
+
const badScale = vi.fn(() => Infinity);
|
|
81
|
+
expect(resolveDataProp('value', data, badScale)).toBe(0);
|
|
82
|
+
});
|
|
83
|
+
it('handles function returning a number without scale', () => {
|
|
84
|
+
const accessor = (d) => d.value;
|
|
85
|
+
expect(resolveDataProp(accessor, data, null)).toBe(42);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
describe('resolveColorProp', () => {
|
|
89
|
+
const data = { category: 'A', value: 42, color: '#ff0000' };
|
|
90
|
+
const mockCScale = vi.fn((v) => (v === 'A' ? 'steelblue' : v === 'B' ? 'coral' : 'gray'));
|
|
91
|
+
beforeEach(() => {
|
|
92
|
+
mockCScale.mockClear();
|
|
93
|
+
});
|
|
94
|
+
it('returns undefined for undefined input', () => {
|
|
95
|
+
expect(resolveColorProp(undefined, data, mockCScale)).toBeUndefined();
|
|
96
|
+
});
|
|
97
|
+
it('returns undefined for null input', () => {
|
|
98
|
+
expect(resolveColorProp(null, data, mockCScale)).toBeUndefined();
|
|
99
|
+
});
|
|
100
|
+
it('resolves string data property through cScale', () => {
|
|
101
|
+
expect(resolveColorProp('category', data, mockCScale)).toBe('steelblue');
|
|
102
|
+
expect(mockCScale).toHaveBeenCalledWith('A');
|
|
103
|
+
});
|
|
104
|
+
it('returns literal CSS color when string does not match a data property', () => {
|
|
105
|
+
expect(resolveColorProp('red', data, mockCScale)).toBe('red');
|
|
106
|
+
expect(mockCScale).not.toHaveBeenCalled();
|
|
107
|
+
});
|
|
108
|
+
it('returns hex color literal when not a data property', () => {
|
|
109
|
+
expect(resolveColorProp('#00ff00', data, mockCScale)).toBe('#00ff00');
|
|
110
|
+
expect(mockCScale).not.toHaveBeenCalled();
|
|
111
|
+
});
|
|
112
|
+
it('resolves function accessor through cScale', () => {
|
|
113
|
+
expect(resolveColorProp((d) => d.category, data, mockCScale)).toBe('steelblue');
|
|
114
|
+
expect(mockCScale).toHaveBeenCalledWith('A');
|
|
115
|
+
});
|
|
116
|
+
it('returns stringified data value when no cScale', () => {
|
|
117
|
+
expect(resolveColorProp('category', data, null)).toBe('A');
|
|
118
|
+
});
|
|
119
|
+
it('returns data property value directly when it is a color string and no cScale', () => {
|
|
120
|
+
expect(resolveColorProp('color', data, null)).toBe('#ff0000');
|
|
121
|
+
});
|
|
122
|
+
it('returns undefined when function accessor returns undefined', () => {
|
|
123
|
+
expect(resolveColorProp((d) => d.nonexistent, data, mockCScale)).toBeUndefined();
|
|
124
|
+
});
|
|
125
|
+
it('returns stringified function result when no cScale', () => {
|
|
126
|
+
expect(resolveColorProp((d) => d.value, data, null)).toBe('42');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export type ChartImageOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Background fill color for the exported image.
|
|
4
|
+
* Defaults to transparent (PNG) or white (JPEG/WebP).
|
|
5
|
+
*/
|
|
6
|
+
background?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Output image format.
|
|
9
|
+
*
|
|
10
|
+
* @default 'png'
|
|
11
|
+
*/
|
|
12
|
+
format?: 'png' | 'jpeg' | 'webp';
|
|
13
|
+
/**
|
|
14
|
+
* Quality for lossy formats (`'jpeg'` / `'webp'`), between 0 and 1.
|
|
15
|
+
*
|
|
16
|
+
* @default 0.92
|
|
17
|
+
*/
|
|
18
|
+
quality?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Device pixel ratio to use when rasterising SVG layers.
|
|
21
|
+
* Higher values produce crisper images on retina displays.
|
|
22
|
+
* Defaults to `window.devicePixelRatio` (usually 1 or 2).
|
|
23
|
+
*/
|
|
24
|
+
pixelRatio?: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Composite all SVG and Canvas layers within a chart container element into
|
|
28
|
+
* an offscreen canvas and return the result as a `Blob`.
|
|
29
|
+
*
|
|
30
|
+
* Layers are drawn in ascending z-index order (DOM order used as tiebreaker).
|
|
31
|
+
* SVG layer styles (CSS variables, class-based colours, etc.) are inlined
|
|
32
|
+
* before serialisation so the image renders correctly outside the DOM.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getChartImageBlob(container: HTMLElement, options?: ChartImageOptions): Promise<Blob>;
|
|
35
|
+
export type ChartSvgOptions = {
|
|
36
|
+
/**
|
|
37
|
+
* File name without extension.
|
|
38
|
+
*
|
|
39
|
+
* @default 'chart'
|
|
40
|
+
*/
|
|
41
|
+
filename?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Return a self-contained SVG string for all SVG layers within a chart container.
|
|
45
|
+
*
|
|
46
|
+
* - Computed styles (CSS variables, class-based colours, etc.) are inlined so
|
|
47
|
+
* the file renders correctly in editors, browsers, and other tools.
|
|
48
|
+
* - When multiple `<Svg>` layers are present they are composited into a single
|
|
49
|
+
* `<svg>` in z-index order by merging their `<defs>` and content `<g>` elements.
|
|
50
|
+
* - Returns `null` when the container has no SVG layers (e.g. Canvas-only charts).
|
|
51
|
+
*/
|
|
52
|
+
export declare function getChartSvgString(container: HTMLElement): string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Download the SVG layers of a chart container as a `.svg` file.
|
|
55
|
+
*
|
|
56
|
+
* Canvas layers are not included — use `downloadImage` when the chart uses
|
|
57
|
+
* `<Canvas>` layers or contains a mix of SVG and Canvas.
|
|
58
|
+
*
|
|
59
|
+
* Returns `false` without throwing if the container has no SVG layers.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```svelte
|
|
63
|
+
* <script>
|
|
64
|
+
* import { downloadSvg } from '../index.js';
|
|
65
|
+
* let chartRef = $state<HTMLElement>();
|
|
66
|
+
* </script>
|
|
67
|
+
*
|
|
68
|
+
* <Chart bind:ref={chartRef} ...>...</Chart>
|
|
69
|
+
* <button onclick={() => downloadSvg(chartRef, { filename: 'my-chart' })}>
|
|
70
|
+
* Download SVG
|
|
71
|
+
* </button>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function downloadSvg(container: HTMLElement, options?: ChartSvgOptions): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Download a chart container as an image file.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```svelte
|
|
80
|
+
* <script>
|
|
81
|
+
* import { downloadImage } from '../index.js';
|
|
82
|
+
* let chartRef = $state<HTMLElement>();
|
|
83
|
+
* </script>
|
|
84
|
+
*
|
|
85
|
+
* <Chart bind:ref={chartRef} ...>...</Chart>
|
|
86
|
+
* <button onclick={() => downloadImage(chartRef, { filename: 'my-chart' })}>
|
|
87
|
+
* Download PNG
|
|
88
|
+
* </button>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function downloadImage(container: HTMLElement, options?: ChartImageOptions & {
|
|
92
|
+
/**
|
|
93
|
+
* File name without extension.
|
|
94
|
+
*
|
|
95
|
+
* @default 'chart'
|
|
96
|
+
*/
|
|
97
|
+
filename?: string;
|
|
98
|
+
}): Promise<void>;
|