layerchart 2.0.0-next.46 → 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 +7 -5
- 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 +25 -14
- 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
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG presentation and style properties that need to be inlined
|
|
3
|
+
* to ensure correct rendering when the SVG is exported as an image
|
|
4
|
+
* (CSS variables and class-based styles won't be available outside the DOM).
|
|
5
|
+
*/
|
|
6
|
+
const SVG_STYLE_PROPERTIES = [
|
|
7
|
+
'fill',
|
|
8
|
+
'fill-opacity',
|
|
9
|
+
'fill-rule',
|
|
10
|
+
'stroke',
|
|
11
|
+
'stroke-opacity',
|
|
12
|
+
'stroke-width',
|
|
13
|
+
'stroke-dasharray',
|
|
14
|
+
'stroke-dashoffset',
|
|
15
|
+
'stroke-linecap',
|
|
16
|
+
'stroke-linejoin',
|
|
17
|
+
'stroke-miterlimit',
|
|
18
|
+
'opacity',
|
|
19
|
+
'color',
|
|
20
|
+
'font-family',
|
|
21
|
+
'font-size',
|
|
22
|
+
'font-weight',
|
|
23
|
+
'font-style',
|
|
24
|
+
'font-variant',
|
|
25
|
+
'text-anchor',
|
|
26
|
+
'dominant-baseline',
|
|
27
|
+
'alignment-baseline',
|
|
28
|
+
'visibility',
|
|
29
|
+
'display',
|
|
30
|
+
'paint-order',
|
|
31
|
+
'shape-rendering',
|
|
32
|
+
'text-rendering',
|
|
33
|
+
'letter-spacing',
|
|
34
|
+
'word-spacing',
|
|
35
|
+
];
|
|
36
|
+
/**
|
|
37
|
+
* Clone an SVG element and inline all computed styles so the exported image
|
|
38
|
+
* renders correctly without access to the page's stylesheets or CSS variables.
|
|
39
|
+
*/
|
|
40
|
+
function inlineSvgStyles(svg) {
|
|
41
|
+
const clone = svg.cloneNode(true);
|
|
42
|
+
const originalElements = Array.from(svg.querySelectorAll('*'));
|
|
43
|
+
const clonedElements = Array.from(clone.querySelectorAll('*'));
|
|
44
|
+
for (let i = 0; i < originalElements.length; i++) {
|
|
45
|
+
const original = originalElements[i];
|
|
46
|
+
const cloneEl = clonedElements[i];
|
|
47
|
+
if (!(cloneEl instanceof SVGElement))
|
|
48
|
+
continue;
|
|
49
|
+
const computed = window.getComputedStyle(original);
|
|
50
|
+
for (const prop of SVG_STYLE_PROPERTIES) {
|
|
51
|
+
const value = computed.getPropertyValue(prop);
|
|
52
|
+
if (value) {
|
|
53
|
+
cloneEl.style.setProperty(prop, value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return clone;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Draw an SVG element onto a canvas context at the given pixel dimensions.
|
|
61
|
+
*/
|
|
62
|
+
function drawSvgToCanvas(svg, ctx, pixelWidth, pixelHeight) {
|
|
63
|
+
const inlined = inlineSvgStyles(svg);
|
|
64
|
+
inlined.setAttribute('width', String(pixelWidth));
|
|
65
|
+
inlined.setAttribute('height', String(pixelHeight));
|
|
66
|
+
const svgStr = new XMLSerializer().serializeToString(inlined);
|
|
67
|
+
const blob = new Blob([svgStr], { type: 'image/svg+xml;charset=utf-8' });
|
|
68
|
+
const url = URL.createObjectURL(blob);
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
const img = new Image();
|
|
71
|
+
img.onload = () => {
|
|
72
|
+
ctx.drawImage(img, 0, 0);
|
|
73
|
+
URL.revokeObjectURL(url);
|
|
74
|
+
resolve();
|
|
75
|
+
};
|
|
76
|
+
img.onerror = (e) => {
|
|
77
|
+
URL.revokeObjectURL(url);
|
|
78
|
+
reject(e);
|
|
79
|
+
};
|
|
80
|
+
img.src = url;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Composite all SVG and Canvas layers within a chart container element into
|
|
85
|
+
* an offscreen canvas and return the result as a `Blob`.
|
|
86
|
+
*
|
|
87
|
+
* Layers are drawn in ascending z-index order (DOM order used as tiebreaker).
|
|
88
|
+
* SVG layer styles (CSS variables, class-based colours, etc.) are inlined
|
|
89
|
+
* before serialisation so the image renders correctly outside the DOM.
|
|
90
|
+
*/
|
|
91
|
+
export async function getChartImageBlob(container, options = {}) {
|
|
92
|
+
const { background, format = 'png', quality = 0.92 } = options;
|
|
93
|
+
const dpr = options.pixelRatio ?? window.devicePixelRatio ?? 1;
|
|
94
|
+
const cssWidth = container.clientWidth;
|
|
95
|
+
const cssHeight = container.clientHeight;
|
|
96
|
+
const pixelWidth = Math.round(cssWidth * dpr);
|
|
97
|
+
const pixelHeight = Math.round(cssHeight * dpr);
|
|
98
|
+
const offscreen = document.createElement('canvas');
|
|
99
|
+
offscreen.width = pixelWidth;
|
|
100
|
+
offscreen.height = pixelHeight;
|
|
101
|
+
const ctx = offscreen.getContext('2d');
|
|
102
|
+
// Default white background for lossy formats that don't support transparency
|
|
103
|
+
const bg = background ?? (format !== 'png' ? 'white' : undefined);
|
|
104
|
+
if (bg) {
|
|
105
|
+
ctx.fillStyle = bg;
|
|
106
|
+
ctx.fillRect(0, 0, pixelWidth, pixelHeight);
|
|
107
|
+
}
|
|
108
|
+
// Find all SVG and Canvas layers within the container, sorted by z-index.
|
|
109
|
+
// `.lc-hit-canvas` is excluded via the class selector (it uses `.lc-layout-canvas`).
|
|
110
|
+
const layers = Array.from(container.querySelectorAll('.lc-layout-svg, .lc-layout-canvas')).sort((a, b) => {
|
|
111
|
+
const aZ = parseFloat(window.getComputedStyle(a).zIndex) || 0;
|
|
112
|
+
const bZ = parseFloat(window.getComputedStyle(b).zIndex) || 0;
|
|
113
|
+
return aZ - bZ;
|
|
114
|
+
});
|
|
115
|
+
for (const layer of layers) {
|
|
116
|
+
if (layer instanceof SVGElement) {
|
|
117
|
+
await drawSvgToCanvas(layer, ctx, pixelWidth, pixelHeight);
|
|
118
|
+
}
|
|
119
|
+
else if (layer instanceof HTMLCanvasElement) {
|
|
120
|
+
// Canvas layers are already rendered at physical pixel resolution via scaleCanvas().
|
|
121
|
+
// Draw them at full natural size to preserve sharpness.
|
|
122
|
+
ctx.drawImage(layer, 0, 0);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return new Promise((resolve, reject) => {
|
|
126
|
+
offscreen.toBlob((blob) => {
|
|
127
|
+
if (blob)
|
|
128
|
+
resolve(blob);
|
|
129
|
+
else
|
|
130
|
+
reject(new Error('Failed to create image blob'));
|
|
131
|
+
}, `image/${format}`, quality);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Collect and sort all `.lc-layout-svg` layers within a chart container by z-index,
|
|
136
|
+
* preserving DOM order as a tiebreaker (Array.from + stable sort).
|
|
137
|
+
*/
|
|
138
|
+
function getSvgLayers(container) {
|
|
139
|
+
return Array.from(container.querySelectorAll('.lc-layout-svg')).sort((a, b) => {
|
|
140
|
+
const aZ = parseFloat(window.getComputedStyle(a).zIndex) || 0;
|
|
141
|
+
const bZ = parseFloat(window.getComputedStyle(b).zIndex) || 0;
|
|
142
|
+
return aZ - bZ;
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Return a self-contained SVG string for all SVG layers within a chart container.
|
|
147
|
+
*
|
|
148
|
+
* - Computed styles (CSS variables, class-based colours, etc.) are inlined so
|
|
149
|
+
* the file renders correctly in editors, browsers, and other tools.
|
|
150
|
+
* - When multiple `<Svg>` layers are present they are composited into a single
|
|
151
|
+
* `<svg>` in z-index order by merging their `<defs>` and content `<g>` elements.
|
|
152
|
+
* - Returns `null` when the container has no SVG layers (e.g. Canvas-only charts).
|
|
153
|
+
*/
|
|
154
|
+
export function getChartSvgString(container) {
|
|
155
|
+
const layers = getSvgLayers(container);
|
|
156
|
+
if (layers.length === 0)
|
|
157
|
+
return null;
|
|
158
|
+
const width = container.clientWidth;
|
|
159
|
+
const height = container.clientHeight;
|
|
160
|
+
// Single layer — inline styles, stamp dimensions, serialise.
|
|
161
|
+
if (layers.length === 1) {
|
|
162
|
+
const inlined = inlineSvgStyles(layers[0]);
|
|
163
|
+
inlined.setAttribute('width', String(width));
|
|
164
|
+
inlined.setAttribute('height', String(height));
|
|
165
|
+
return new XMLSerializer().serializeToString(inlined);
|
|
166
|
+
}
|
|
167
|
+
// Multiple layers — composite into one <svg>.
|
|
168
|
+
const ns = 'http://www.w3.org/2000/svg';
|
|
169
|
+
const wrapper = document.createElementNS(ns, 'svg');
|
|
170
|
+
wrapper.setAttribute('xmlns', ns);
|
|
171
|
+
wrapper.setAttribute('width', String(width));
|
|
172
|
+
wrapper.setAttribute('height', String(height));
|
|
173
|
+
wrapper.setAttribute('viewBox', `0 0 ${width} ${height}`);
|
|
174
|
+
const combinedDefs = document.createElementNS(ns, 'defs');
|
|
175
|
+
wrapper.appendChild(combinedDefs);
|
|
176
|
+
for (const layer of layers) {
|
|
177
|
+
const inlined = inlineSvgStyles(layer);
|
|
178
|
+
// Collect <defs> children (gradients, clip paths, filters, etc.)
|
|
179
|
+
for (const child of Array.from(inlined.querySelectorAll(':scope > defs > *'))) {
|
|
180
|
+
combinedDefs.appendChild(child);
|
|
181
|
+
}
|
|
182
|
+
// Append the content <g> (carries the padding translate and any zoom transform)
|
|
183
|
+
const contentG = inlined.querySelector('.lc-layout-svg-g');
|
|
184
|
+
if (contentG)
|
|
185
|
+
wrapper.appendChild(contentG);
|
|
186
|
+
}
|
|
187
|
+
return new XMLSerializer().serializeToString(wrapper);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Download the SVG layers of a chart container as a `.svg` file.
|
|
191
|
+
*
|
|
192
|
+
* Canvas layers are not included — use `downloadImage` when the chart uses
|
|
193
|
+
* `<Canvas>` layers or contains a mix of SVG and Canvas.
|
|
194
|
+
*
|
|
195
|
+
* Returns `false` without throwing if the container has no SVG layers.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```svelte
|
|
199
|
+
* <script>
|
|
200
|
+
* import { downloadSvg } from '../index.js';
|
|
201
|
+
* let chartRef = $state<HTMLElement>();
|
|
202
|
+
* </script>
|
|
203
|
+
*
|
|
204
|
+
* <Chart bind:ref={chartRef} ...>...</Chart>
|
|
205
|
+
* <button onclick={() => downloadSvg(chartRef, { filename: 'my-chart' })}>
|
|
206
|
+
* Download SVG
|
|
207
|
+
* </button>
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
export function downloadSvg(container, options = {}) {
|
|
211
|
+
const { filename = 'chart' } = options;
|
|
212
|
+
const svgStr = getChartSvgString(container);
|
|
213
|
+
if (svgStr === null)
|
|
214
|
+
return false;
|
|
215
|
+
const blob = new Blob([svgStr], { type: 'image/svg+xml;charset=utf-8' });
|
|
216
|
+
const url = URL.createObjectURL(blob);
|
|
217
|
+
const a = document.createElement('a');
|
|
218
|
+
a.href = url;
|
|
219
|
+
a.download = `${filename}.svg`;
|
|
220
|
+
a.click();
|
|
221
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Download a chart container as an image file.
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```svelte
|
|
229
|
+
* <script>
|
|
230
|
+
* import { downloadImage } from '../index.js';
|
|
231
|
+
* let chartRef = $state<HTMLElement>();
|
|
232
|
+
* </script>
|
|
233
|
+
*
|
|
234
|
+
* <Chart bind:ref={chartRef} ...>...</Chart>
|
|
235
|
+
* <button onclick={() => downloadImage(chartRef, { filename: 'my-chart' })}>
|
|
236
|
+
* Download PNG
|
|
237
|
+
* </button>
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
export async function downloadImage(container, options = {}) {
|
|
241
|
+
const { filename = 'chart', format = 'png', ...imageOptions } = options;
|
|
242
|
+
const blob = await getChartImageBlob(container, { format, ...imageOptions });
|
|
243
|
+
const url = URL.createObjectURL(blob);
|
|
244
|
+
const a = document.createElement('a');
|
|
245
|
+
a.href = url;
|
|
246
|
+
a.download = `${filename}.${format}`;
|
|
247
|
+
a.click();
|
|
248
|
+
// Revoke after a short delay to ensure the browser has started the download
|
|
249
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
250
|
+
}
|
|
@@ -3,15 +3,17 @@ import { csvParseRows } from 'd3-dsv';
|
|
|
3
3
|
* Convert CSV rows in format: 'source,target,value' to SankeyGraph
|
|
4
4
|
*/
|
|
5
5
|
export function sankeyGraphFromCsv(csv) {
|
|
6
|
-
const links = csvParseRows(csv, (
|
|
7
|
-
|
|
6
|
+
const links = csvParseRows(csv, (row) => {
|
|
7
|
+
const [source, target, rawValue] = row;
|
|
8
|
+
if (!source || !target)
|
|
9
|
+
return null;
|
|
10
|
+
const num = rawValue ? +rawValue : NaN;
|
|
11
|
+
return {
|
|
8
12
|
source,
|
|
9
13
|
target,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
: null);
|
|
14
|
+
value: isNaN(num) ? 1 : num,
|
|
15
|
+
};
|
|
16
|
+
});
|
|
15
17
|
return { nodes: sankeyNodesFromLinks(links), links };
|
|
16
18
|
}
|
|
17
19
|
/**
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { applyLanes } from './array.js';
|
|
2
|
+
export * from './download.js';
|
|
2
3
|
export * from './canvas.js';
|
|
3
4
|
export * from './common.js';
|
|
5
|
+
export * from './dataProp.js';
|
|
4
6
|
export * from './geo.js';
|
|
5
7
|
export * from './hierarchy.js';
|
|
6
8
|
export * from './math.js';
|
|
@@ -11,6 +13,8 @@ export * from './stack.js';
|
|
|
11
13
|
export * from './ticks.js';
|
|
12
14
|
export * from './treemap.js';
|
|
13
15
|
export * from './threshold.js';
|
|
16
|
+
export * from './rasterInterpolate.js';
|
|
17
|
+
export * from './stats.js';
|
|
14
18
|
export * from './types.js';
|
|
15
19
|
export * from './graph/dagre.js';
|
|
16
20
|
export * from './graph/sankey.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { applyLanes } from './array.js';
|
|
2
|
+
export * from './download.js';
|
|
2
3
|
export * from './canvas.js';
|
|
3
4
|
export * from './common.js';
|
|
5
|
+
export * from './dataProp.js';
|
|
4
6
|
export * from './geo.js';
|
|
5
7
|
export * from './hierarchy.js';
|
|
6
8
|
export * from './math.js';
|
|
@@ -11,6 +13,8 @@ export * from './stack.js';
|
|
|
11
13
|
export * from './ticks.js';
|
|
12
14
|
export * from './treemap.js';
|
|
13
15
|
export * from './threshold.js';
|
|
16
|
+
export * from './rasterInterpolate.js';
|
|
17
|
+
export * from './stats.js';
|
|
14
18
|
export * from './types.js';
|
|
15
19
|
export * from './graph/dagre.js';
|
|
16
20
|
export * from './graph/sankey.js';
|
|
@@ -124,6 +124,20 @@ export declare function createMotionTracker(): {
|
|
|
124
124
|
handle: (promise: Promise<void> | void) => void;
|
|
125
125
|
readonly current: boolean;
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Creates a motion state map for data mode rendering.
|
|
129
|
+
* Tracks per-item animated values keyed by the item key.
|
|
130
|
+
* Returns null if no motion is configured (type: 'none').
|
|
131
|
+
*/
|
|
132
|
+
export declare function createDataMotionMap(motionProp: MotionOptions | undefined): {
|
|
133
|
+
/** Update motion targets for an item. Creates states on first call per key/prop. */
|
|
134
|
+
update(key: any, values: Record<string, number>): void;
|
|
135
|
+
/** Get current animated values for an item, or null if not tracked yet. */
|
|
136
|
+
get(key: any): Record<string, number> | null;
|
|
137
|
+
/** Remove items no longer in the active set. */
|
|
138
|
+
cleanup(activeKeys: Set<any>): void;
|
|
139
|
+
} | null;
|
|
140
|
+
export type DataMotionMap = NonNullable<ReturnType<typeof createDataMotionMap>>;
|
|
127
141
|
/**
|
|
128
142
|
* Extracts tween configuration from a motion prop
|
|
129
143
|
* @returns Resolved tween configuration or undefined if not a tween
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { untrack } from 'svelte';
|
|
1
2
|
import { Spring, Tween } from 'svelte/motion';
|
|
2
3
|
/**
|
|
3
4
|
* Extended Spring class that adds a type discriminator to help with
|
|
@@ -62,7 +63,14 @@ function setupTracking(motion, getValue, options) {
|
|
|
62
63
|
if (options.controlled)
|
|
63
64
|
return;
|
|
64
65
|
$effect(() => {
|
|
65
|
-
|
|
66
|
+
const value = getValue();
|
|
67
|
+
if (value == null)
|
|
68
|
+
return;
|
|
69
|
+
// Use untrack to prevent reactive reads inside motion.set() and motion.target
|
|
70
|
+
// from being tracked as dependencies of this effect (which would cause infinite loops)
|
|
71
|
+
untrack(() => {
|
|
72
|
+
motion.set(value, { instant: motion.target == null });
|
|
73
|
+
});
|
|
66
74
|
});
|
|
67
75
|
}
|
|
68
76
|
export function createMotion(initialValue, getValue, motionProp, options = {}) {
|
|
@@ -114,6 +122,60 @@ export function createMotionTracker() {
|
|
|
114
122
|
},
|
|
115
123
|
};
|
|
116
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Creates a motion state map for data mode rendering.
|
|
127
|
+
* Tracks per-item animated values keyed by the item key.
|
|
128
|
+
* Returns null if no motion is configured (type: 'none').
|
|
129
|
+
*/
|
|
130
|
+
export function createDataMotionMap(motionProp) {
|
|
131
|
+
const config = parseMotionProp(motionProp);
|
|
132
|
+
if (config.type === 'none')
|
|
133
|
+
return null;
|
|
134
|
+
const map = new Map();
|
|
135
|
+
function create(value) {
|
|
136
|
+
return config.type === 'spring'
|
|
137
|
+
? new MotionSpring(value, config.options)
|
|
138
|
+
: new MotionTween(value, config.options);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
/** Update motion targets for an item. Creates states on first call per key/prop. */
|
|
142
|
+
update(key, values) {
|
|
143
|
+
let itemMap = map.get(key);
|
|
144
|
+
if (!itemMap) {
|
|
145
|
+
itemMap = new Map();
|
|
146
|
+
map.set(key, itemMap);
|
|
147
|
+
}
|
|
148
|
+
for (const [prop, value] of Object.entries(values)) {
|
|
149
|
+
let state = itemMap.get(prop);
|
|
150
|
+
if (!state) {
|
|
151
|
+
state = create(value);
|
|
152
|
+
itemMap.set(prop, state);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
state.set(value);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
/** Get current animated values for an item, or null if not tracked yet. */
|
|
160
|
+
get(key) {
|
|
161
|
+
const itemMap = map.get(key);
|
|
162
|
+
if (!itemMap)
|
|
163
|
+
return null;
|
|
164
|
+
const result = {};
|
|
165
|
+
for (const [prop, state] of itemMap) {
|
|
166
|
+
result[prop] = state.current;
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
},
|
|
170
|
+
/** Remove items no longer in the active set. */
|
|
171
|
+
cleanup(activeKeys) {
|
|
172
|
+
for (const key of map.keys()) {
|
|
173
|
+
if (!activeKeys.has(key))
|
|
174
|
+
map.delete(key);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
117
179
|
/**
|
|
118
180
|
* Extracts tween configuration from a motion prop
|
|
119
181
|
* @returns Resolved tween configuration or undefined if not a tween
|
package/dist/utils/path.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ export declare function circlePath(dimensions: {
|
|
|
10
10
|
r: number;
|
|
11
11
|
sweep?: 'inside' | 'outside';
|
|
12
12
|
}): string;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `vectorSpikePath` or the `Vector` component with `shape="spike"` instead.
|
|
15
|
+
* Create spike (triangle) using path data
|
|
16
|
+
*/
|
|
14
17
|
export declare function spikePath({ x, y, width, height, }: {
|
|
15
18
|
x: number;
|
|
16
19
|
y: number;
|
|
@@ -27,5 +30,45 @@ export declare function roundedPolygonPath(coords: {
|
|
|
27
30
|
x: number;
|
|
28
31
|
y: number;
|
|
29
32
|
}[], radius: number): string;
|
|
33
|
+
/** Vector anchor position */
|
|
34
|
+
export type VectorAnchor = 'start' | 'middle' | 'end';
|
|
35
|
+
/**
|
|
36
|
+
* Create arrow vector path data (pointing up by default).
|
|
37
|
+
* The path is centered on the anchor point at origin — use SVG `transform` to position and rotate.
|
|
38
|
+
*
|
|
39
|
+
* The arrow consists of a stem line with a V-shaped arrowhead at the tip.
|
|
40
|
+
*/
|
|
41
|
+
export declare function vectorArrowPath({ length, anchor, width, }: {
|
|
42
|
+
length: number;
|
|
43
|
+
anchor?: VectorAnchor;
|
|
44
|
+
/** Total width of the arrowhead (wing tip to wing tip). */
|
|
45
|
+
width?: number;
|
|
46
|
+
}): string;
|
|
47
|
+
/**
|
|
48
|
+
* Create spike (filled triangle) vector path data (pointing up by default).
|
|
49
|
+
* The path is centered on the anchor point at origin — use SVG `transform` to position and rotate.
|
|
50
|
+
*/
|
|
51
|
+
export declare function vectorSpikePath({ length, anchor, width, }: {
|
|
52
|
+
length: number;
|
|
53
|
+
anchor?: VectorAnchor;
|
|
54
|
+
width?: number;
|
|
55
|
+
}): string;
|
|
56
|
+
/**
|
|
57
|
+
* Create filled arrow vector path data (pointing up by default).
|
|
58
|
+
* The path is centered on the anchor point at origin — use SVG `transform` to position and rotate.
|
|
59
|
+
*
|
|
60
|
+
* The shape has a tapered tail that widens into a triangular arrowhead at the tip.
|
|
61
|
+
*/
|
|
62
|
+
export declare function vectorArrowFilledPath({ length, anchor, width, }: {
|
|
63
|
+
length: number;
|
|
64
|
+
anchor?: VectorAnchor;
|
|
65
|
+
/** Total width of the arrowhead. Defaults to 30% of length. */
|
|
66
|
+
width?: number;
|
|
67
|
+
}): string;
|
|
68
|
+
/**
|
|
69
|
+
* Apply rotation (degrees) and translation to a path string containing only M and L commands
|
|
70
|
+
* with absolute coordinates. Converts local vector path data to absolute positioned coordinates.
|
|
71
|
+
*/
|
|
72
|
+
export declare function transformVectorPath(pathData: string, cx: number, cy: number, rotateDeg: number): string;
|
|
30
73
|
/** Flatten all `y` coordinates to `0` */
|
|
31
74
|
export declare function flattenPathData(pathData: string, yOverride?: number): string;
|
package/dist/utils/path.js
CHANGED
|
@@ -24,17 +24,12 @@ export function circlePath(dimensions) {
|
|
|
24
24
|
a ${r},${r} 0 1,${_sweep} -${r * 2},0
|
|
25
25
|
`;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use `vectorSpikePath` or the `Vector` component with `shape="spike"` instead.
|
|
29
|
+
* Create spike (triangle) using path data
|
|
30
|
+
*/
|
|
28
31
|
export function spikePath({ x, y, width, height, }) {
|
|
29
|
-
|
|
30
|
-
const midPoint = { x, y: y - height };
|
|
31
|
-
const endPoint = { x: x + width / 2, y };
|
|
32
|
-
const pathData = `
|
|
33
|
-
M ${startPoint.x},${startPoint.y}
|
|
34
|
-
L ${midPoint.x},${midPoint.y}
|
|
35
|
-
L ${endPoint.x},${endPoint.y}
|
|
36
|
-
`;
|
|
37
|
-
return pathData;
|
|
32
|
+
return transformVectorPath(vectorSpikePath({ length: height, anchor: 'start', width }), x, y, 0);
|
|
38
33
|
}
|
|
39
34
|
/** Create rounded polygon path
|
|
40
35
|
*
|
|
@@ -66,6 +61,114 @@ export function roundedPolygonPath(coords, radius) {
|
|
|
66
61
|
path += 'Z';
|
|
67
62
|
return path;
|
|
68
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Create arrow vector path data (pointing up by default).
|
|
66
|
+
* The path is centered on the anchor point at origin — use SVG `transform` to position and rotate.
|
|
67
|
+
*
|
|
68
|
+
* The arrow consists of a stem line with a V-shaped arrowhead at the tip.
|
|
69
|
+
*/
|
|
70
|
+
export function vectorArrowPath({ length, anchor = 'middle', width = 5, }) {
|
|
71
|
+
const halfWidth = width / 2;
|
|
72
|
+
// Compute y-offsets for base and tip relative to anchor point at origin
|
|
73
|
+
let baseY, tipY;
|
|
74
|
+
switch (anchor) {
|
|
75
|
+
case 'start':
|
|
76
|
+
baseY = 0;
|
|
77
|
+
tipY = -length;
|
|
78
|
+
break;
|
|
79
|
+
case 'end':
|
|
80
|
+
baseY = length;
|
|
81
|
+
tipY = 0;
|
|
82
|
+
break;
|
|
83
|
+
case 'middle':
|
|
84
|
+
default:
|
|
85
|
+
baseY = length / 2;
|
|
86
|
+
tipY = -length / 2;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
// Stem from base to tip, then arrowhead wings at the tip
|
|
90
|
+
return `M0,${baseY}L0,${tipY}M${-halfWidth},${tipY + width}L0,${tipY}L${halfWidth},${tipY + width}`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Create spike (filled triangle) vector path data (pointing up by default).
|
|
94
|
+
* The path is centered on the anchor point at origin — use SVG `transform` to position and rotate.
|
|
95
|
+
*/
|
|
96
|
+
export function vectorSpikePath({ length, anchor = 'start', width = 3, }) {
|
|
97
|
+
const halfWidth = width / 2;
|
|
98
|
+
let baseY, tipY;
|
|
99
|
+
switch (anchor) {
|
|
100
|
+
case 'start':
|
|
101
|
+
baseY = 0;
|
|
102
|
+
tipY = -length;
|
|
103
|
+
break;
|
|
104
|
+
case 'end':
|
|
105
|
+
baseY = length;
|
|
106
|
+
tipY = 0;
|
|
107
|
+
break;
|
|
108
|
+
case 'middle':
|
|
109
|
+
default:
|
|
110
|
+
baseY = length / 2;
|
|
111
|
+
tipY = -length / 2;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
return `M${-halfWidth},${baseY}L0,${tipY}L${halfWidth},${baseY}`;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Create filled arrow vector path data (pointing up by default).
|
|
118
|
+
* The path is centered on the anchor point at origin — use SVG `transform` to position and rotate.
|
|
119
|
+
*
|
|
120
|
+
* The shape has a tapered tail that widens into a triangular arrowhead at the tip.
|
|
121
|
+
*/
|
|
122
|
+
export function vectorArrowFilledPath({ length, anchor = 'middle', width = length * 0.3, }) {
|
|
123
|
+
let baseY, tipY;
|
|
124
|
+
switch (anchor) {
|
|
125
|
+
case 'start':
|
|
126
|
+
baseY = 0;
|
|
127
|
+
tipY = -length;
|
|
128
|
+
break;
|
|
129
|
+
case 'end':
|
|
130
|
+
baseY = length;
|
|
131
|
+
tipY = 0;
|
|
132
|
+
break;
|
|
133
|
+
case 'middle':
|
|
134
|
+
default:
|
|
135
|
+
baseY = length / 2;
|
|
136
|
+
tipY = -length / 2;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
const headLength = Math.max(3, length * 0.3);
|
|
140
|
+
const headSpike = headLength * 0.2;
|
|
141
|
+
const headWidth = Math.max(2, width);
|
|
142
|
+
const tailWidth = headWidth * 0.3;
|
|
143
|
+
// Path points (relative to base→tip axis)
|
|
144
|
+
const headStart = tipY + headLength;
|
|
145
|
+
const spikeY = headStart - headSpike;
|
|
146
|
+
return [
|
|
147
|
+
`M0,${baseY}`,
|
|
148
|
+
`L${tailWidth / 2},${spikeY}`,
|
|
149
|
+
`L${headWidth / 2},${headStart}`,
|
|
150
|
+
`L0,${tipY}`,
|
|
151
|
+
`L${-headWidth / 2},${headStart}`,
|
|
152
|
+
`L${-tailWidth / 2},${spikeY}`,
|
|
153
|
+
'Z',
|
|
154
|
+
].join('');
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Apply rotation (degrees) and translation to a path string containing only M and L commands
|
|
158
|
+
* with absolute coordinates. Converts local vector path data to absolute positioned coordinates.
|
|
159
|
+
*/
|
|
160
|
+
export function transformVectorPath(pathData, cx, cy, rotateDeg) {
|
|
161
|
+
const rad = (rotateDeg * Math.PI) / 180;
|
|
162
|
+
const cos = Math.cos(rad);
|
|
163
|
+
const sin = Math.sin(rad);
|
|
164
|
+
return pathData.replace(/([ML])(-?\d*\.?\d+),(-?\d*\.?\d+)/g, (_match, cmd, xStr, yStr) => {
|
|
165
|
+
const lx = Number(xStr);
|
|
166
|
+
const ly = Number(yStr);
|
|
167
|
+
const ax = cx + lx * cos - ly * sin;
|
|
168
|
+
const ay = cy + lx * sin + ly * cos;
|
|
169
|
+
return `${cmd}${ax},${ay}`;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
69
172
|
/** Flatten all `y` coordinates to `0` */
|
|
70
173
|
export function flattenPathData(pathData, yOverride = 0) {
|
|
71
174
|
let result = pathData;
|
|
@@ -77,12 +180,9 @@ export function flattenPathData(pathData, yOverride = 0) {
|
|
|
77
180
|
result = result.replace(/([v])(-?\d*\.?\d+)/g, (match, command, l) => {
|
|
78
181
|
return `${command}${0}`;
|
|
79
182
|
});
|
|
80
|
-
//
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// return `a${rx},0 ${rot} ${large} ${sweep} ${x},0`;
|
|
85
|
-
// }
|
|
86
|
-
// );
|
|
183
|
+
// Flatten relative elliptical arc commands (ex. `a4,4 0 0 1 4,4`) — zero out ry and dy
|
|
184
|
+
result = result.replace(/a(-?\d*\.?\d+),(-?\d*\.?\d+) (\d+) (\d+) (\d+) (-?\d*\.?\d+),(-?\d*\.?\d+)/g, (match, rx, ry, rot, large, sweep, dx, dy) => {
|
|
185
|
+
return `a${rx},0 ${rot} ${large} ${sweep} ${dx},0`;
|
|
186
|
+
});
|
|
87
187
|
return result;
|
|
88
188
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type InterpolateMethod = 'none' | 'nearest' | 'barycentric';
|
|
2
|
+
/**
|
|
3
|
+
* Interpolate scattered 2D points onto a regular grid.
|
|
4
|
+
*
|
|
5
|
+
* @param points - Array of [x, y, value] triples in grid coordinates
|
|
6
|
+
* @param width - Grid width (columns)
|
|
7
|
+
* @param height - Grid height (rows)
|
|
8
|
+
* @param method - Interpolation method
|
|
9
|
+
* @returns Flat Float64Array of grid values (row-major, length = width * height)
|
|
10
|
+
*/
|
|
11
|
+
export declare function interpolateGrid(points: [number, number, number][], width: number, height: number, method?: InterpolateMethod): Float64Array;
|