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
|
@@ -1,55 +1,35 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import {
|
|
2
|
+
import { type ComponentProps, type Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
import { scaleOrdinal, scaleSqrt } from 'd3-scale';
|
|
5
4
|
import type { TimeInterval } from 'd3-time';
|
|
6
|
-
import { extent, max, min } from 'd3-array';
|
|
7
5
|
import type { HierarchyNode } from 'd3-hierarchy';
|
|
8
6
|
import type { SankeyGraph } from 'd3-sankey';
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { type
|
|
13
|
-
import { printDebug } from '../utils/debug.js';
|
|
14
|
-
import { filterObject } from '../utils/filterObject.js';
|
|
15
|
-
import {
|
|
16
|
-
autoScale,
|
|
17
|
-
createScale,
|
|
18
|
-
getRange,
|
|
19
|
-
isScaleBand,
|
|
20
|
-
isScaleTime,
|
|
21
|
-
makeAccessor,
|
|
22
|
-
type AnyScale,
|
|
23
|
-
type DomainType,
|
|
24
|
-
} from '../utils/scales.svelte.js';
|
|
7
|
+
|
|
8
|
+
import { getObjectOrNull, type Accessor } from '../utils/common.js';
|
|
9
|
+
import type { MotionProp } from '../utils/motion.svelte.js';
|
|
10
|
+
import { type AnyScale, type DomainType } from '../utils/scales.svelte.js';
|
|
25
11
|
import type {
|
|
26
12
|
BaseRange,
|
|
27
|
-
Extents,
|
|
28
13
|
Nice,
|
|
29
14
|
PaddingArray,
|
|
30
15
|
Without,
|
|
31
16
|
XRangeWithScale,
|
|
32
17
|
YRangeWithScale,
|
|
33
18
|
} from '../utils/types.js';
|
|
34
|
-
import {
|
|
35
|
-
calcDomain,
|
|
36
|
-
calcScaleExtents,
|
|
37
|
-
createGetter,
|
|
38
|
-
createChartScale,
|
|
39
|
-
} from '../utils/chart.js';
|
|
40
|
-
import GeoContext from './GeoContext.svelte';
|
|
19
|
+
import type { GeoStateProps } from '../states/geo.svelte.js';
|
|
41
20
|
import TooltipContext from './tooltip/TooltipContext.svelte';
|
|
42
|
-
import type { TooltipContextValue } from '../contexts/tooltip.js';
|
|
43
21
|
|
|
44
22
|
import { geoFitObjectTransform } from '../utils/geo.js';
|
|
45
23
|
import TransformContext from './TransformContext.svelte';
|
|
46
|
-
import BrushContext
|
|
24
|
+
import BrushContext from './BrushContext.svelte';
|
|
25
|
+
import { type BrushDomainType, type BrushState } from '../states/brush.svelte.js';
|
|
47
26
|
|
|
48
|
-
import { setChartContext
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
27
|
+
import { setChartContext } from '../contexts/chart.js';
|
|
28
|
+
import { ChartState } from '../states/chart.svelte.js';
|
|
29
|
+
import type { StackLayout } from '../states/series.svelte.js';
|
|
51
30
|
|
|
52
|
-
|
|
31
|
+
import type { ChartChildrenProps } from './ChartChildren.svelte';
|
|
32
|
+
import type { SeriesData } from './charts/types.js';
|
|
53
33
|
|
|
54
34
|
export type ChartResizeDetail = {
|
|
55
35
|
width: number;
|
|
@@ -550,7 +530,12 @@
|
|
|
550
530
|
*/
|
|
551
531
|
yInterval?: TimeInterval | null;
|
|
552
532
|
|
|
553
|
-
|
|
533
|
+
/**
|
|
534
|
+
* The axis that represents the value dimension, typically based on the type and orientation of the chart
|
|
535
|
+
*
|
|
536
|
+
* @default 'y'
|
|
537
|
+
*/
|
|
538
|
+
valueAxis?: 'x' | 'y';
|
|
554
539
|
|
|
555
540
|
/**
|
|
556
541
|
* Use radial instead of cartesian coordinates, mapping `x` to `angle` and `y`` to radial.
|
|
@@ -561,30 +546,95 @@
|
|
|
561
546
|
*/
|
|
562
547
|
radial?: boolean;
|
|
563
548
|
|
|
564
|
-
children?: Snippet<[{ context:
|
|
549
|
+
children?: Snippet<[{ context: ChartState<T, XScale, YScale> }]>;
|
|
565
550
|
|
|
566
551
|
/**
|
|
567
552
|
* A bindable reference to the chart context.
|
|
568
553
|
*/
|
|
569
|
-
context?:
|
|
554
|
+
context?: ChartState<T, XScale, YScale>;
|
|
570
555
|
|
|
571
556
|
/**
|
|
572
|
-
* Props passed to
|
|
557
|
+
* Props passed to GeoState
|
|
573
558
|
*/
|
|
574
|
-
geo?: Partial<
|
|
559
|
+
geo?: Partial<GeoStateProps>;
|
|
575
560
|
|
|
576
561
|
/**
|
|
577
562
|
* Props passed to the `TooltipContext` component.
|
|
578
563
|
*/
|
|
579
|
-
|
|
564
|
+
tooltipContext?: Partial<ComponentProps<typeof TooltipContext>> | boolean;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Props passed to TransformContext, with optional domain-space constraints.
|
|
568
|
+
*/
|
|
569
|
+
transform?: Partial<ComponentProps<typeof TransformContext>> & {
|
|
570
|
+
/**
|
|
571
|
+
* Controls which projection properties are updated by transform state in `mode: 'projection'`.
|
|
572
|
+
* Auto-detected from the projection type when not specified:
|
|
573
|
+
* - Globe projections (e.g. `geoOrthographic`): `{ rotation: true, scale: false, translate: false }`
|
|
574
|
+
* - Flat maps (e.g. `geoMercator`): `{ rotation: false, scale: true, translate: true }`
|
|
575
|
+
*
|
|
576
|
+
* `rotation` and `translate` are mutually exclusive.
|
|
577
|
+
*/
|
|
578
|
+
apply?: {
|
|
579
|
+
/** Apply transform translate as projection rotation (yaw/pitch). */
|
|
580
|
+
rotation?: boolean;
|
|
581
|
+
/** Apply transform scale to projection scale. */
|
|
582
|
+
scale?: boolean;
|
|
583
|
+
/** Apply transform translate to projection translate. */
|
|
584
|
+
translate?: boolean;
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Domain-space constraints for pan/zoom in `mode: 'domain'`.
|
|
589
|
+
* Expressed in data units (numbers, Dates) rather than pixel-space.
|
|
590
|
+
* Converted internally to a `constrain` function on TransformState.
|
|
591
|
+
*/
|
|
592
|
+
domainExtent?: {
|
|
593
|
+
x?: {
|
|
594
|
+
/** Minimum domain value. `'data'` = initial data bounds. */
|
|
595
|
+
min?: number | Date | 'data';
|
|
596
|
+
/** Maximum domain value. `'data'` = initial data bounds. */
|
|
597
|
+
max?: number | Date | 'data';
|
|
598
|
+
/** Minimum visible range (max zoom in). In data units (e.g., ms for dates). */
|
|
599
|
+
minRange?: number;
|
|
600
|
+
};
|
|
601
|
+
y?: {
|
|
602
|
+
min?: number | Date | 'data';
|
|
603
|
+
max?: number | Date | 'data';
|
|
604
|
+
minRange?: number;
|
|
605
|
+
};
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
/** Props passed to BrushContext */
|
|
610
|
+
brush?:
|
|
611
|
+
| (Partial<ComponentProps<typeof BrushContext>> & {
|
|
612
|
+
/**
|
|
613
|
+
* Zoom the chart domain to the brushed area on brush end.
|
|
614
|
+
*
|
|
615
|
+
* @default false
|
|
616
|
+
*/
|
|
617
|
+
zoomOnBrush?: boolean;
|
|
618
|
+
})
|
|
619
|
+
| boolean;
|
|
620
|
+
|
|
621
|
+
/** Series definitions for multi-series charts */
|
|
622
|
+
series?: SeriesData<T, any>[];
|
|
623
|
+
|
|
624
|
+
/** Layout mode for series: 'overlap', 'group', 'stack', 'stackExpand', 'stackDiverging' */
|
|
625
|
+
seriesLayout?: StackLayout | 'group';
|
|
580
626
|
|
|
581
627
|
/**
|
|
582
|
-
*
|
|
628
|
+
* Padding between primary bands (e.g. bars), applied to the category axis scaleBand().padding().
|
|
629
|
+
* When set, the category axis (opposite of valueAxis) automatically uses a scaleBand with this padding.
|
|
583
630
|
*/
|
|
584
|
-
|
|
631
|
+
bandPadding?: number;
|
|
585
632
|
|
|
586
|
-
/**
|
|
587
|
-
|
|
633
|
+
/**
|
|
634
|
+
* Padding between group/series items when using seriesLayout="group", applied to the x1/y1 scaleBand().padding().
|
|
635
|
+
* @default 0
|
|
636
|
+
*/
|
|
637
|
+
groupPadding?: number;
|
|
588
638
|
|
|
589
639
|
/**
|
|
590
640
|
* A callback function that is called when the chart is resized.
|
|
@@ -599,6 +649,12 @@
|
|
|
599
649
|
*/
|
|
600
650
|
clip?: boolean;
|
|
601
651
|
|
|
652
|
+
/**
|
|
653
|
+
* Animate scale domain transitions with spring or tween motion.
|
|
654
|
+
* Applies to all domain changes (data updates, brush zoom, transform, etc.)
|
|
655
|
+
*/
|
|
656
|
+
motion?: MotionProp;
|
|
657
|
+
|
|
602
658
|
// TransformContext callback events
|
|
603
659
|
ondragstart?: ComponentProps<typeof TransformContext>['ondragstart'];
|
|
604
660
|
ondragend?: ComponentProps<typeof TransformContext>['ondragend'];
|
|
@@ -609,7 +665,7 @@
|
|
|
609
665
|
|
|
610
666
|
/** Sets height of the chart container. Uses parent height if not set (bind:clientHeight) */
|
|
611
667
|
height?: number;
|
|
612
|
-
}
|
|
668
|
+
} & ChartChildrenProps<T, XScale, YScale>;
|
|
613
669
|
|
|
614
670
|
export type ChartProps<
|
|
615
671
|
T,
|
|
@@ -623,689 +679,299 @@
|
|
|
623
679
|
lang="ts"
|
|
624
680
|
generics="TData = any, XScale extends AnyScale = AnyScale, YScale extends AnyScale = AnyScale"
|
|
625
681
|
>
|
|
682
|
+
import { setGeoContext } from '../contexts/geo.js';
|
|
683
|
+
import { getSettings } from '../contexts/settings.js';
|
|
684
|
+
import ChartChildren from './ChartChildren.svelte';
|
|
685
|
+
|
|
686
|
+
let {
|
|
687
|
+
ref: refProp = $bindable(),
|
|
688
|
+
context: contextProp = $bindable(),
|
|
689
|
+
...props
|
|
690
|
+
}: ChartProps<TData, XScale, YScale> = $props();
|
|
691
|
+
|
|
626
692
|
let {
|
|
627
693
|
ssr = false,
|
|
628
694
|
pointerEvents = true,
|
|
629
|
-
width
|
|
630
|
-
height
|
|
695
|
+
width,
|
|
696
|
+
height,
|
|
631
697
|
position = 'relative',
|
|
632
|
-
|
|
633
|
-
ref: refProp = $bindable(),
|
|
634
|
-
x: xProp,
|
|
635
|
-
y: yProp,
|
|
636
|
-
z: zProp,
|
|
637
|
-
r: rProp,
|
|
638
|
-
data = [],
|
|
639
|
-
flatData: flatDataProp,
|
|
640
|
-
xDomain: xDomainProp,
|
|
641
|
-
yDomain: yDomainProp,
|
|
642
|
-
zDomain: zDomainProp,
|
|
643
|
-
rDomain: rDomainProp,
|
|
644
|
-
xNice = false,
|
|
645
|
-
yNice = false,
|
|
646
|
-
zNice = false,
|
|
647
|
-
rNice = false,
|
|
648
|
-
xPadding,
|
|
649
|
-
yPadding,
|
|
650
|
-
zPadding,
|
|
651
|
-
rPadding,
|
|
652
|
-
// @ts-expect-error shh
|
|
653
|
-
xScale: xScaleProp = autoScale(xDomainProp, flatDataProp ?? data, xProp),
|
|
654
|
-
// @ts-expect-error shh
|
|
655
|
-
yScale: yScaleProp = autoScale(yDomainProp, flatDataProp ?? data, yProp),
|
|
656
|
-
// @ts-expect-error shh
|
|
657
|
-
zScale: zScaleProp = autoScale(zDomainProp, flatDataProp ?? data, zProp),
|
|
658
|
-
rScale: rScaleProp = scaleSqrt(),
|
|
659
|
-
padding: paddingProp = {},
|
|
660
|
-
verbose = true,
|
|
661
|
-
debug = false,
|
|
662
|
-
extents: extentsProp = {},
|
|
663
|
-
xDomainSort = false,
|
|
664
|
-
yDomainSort = false,
|
|
665
|
-
zDomainSort = false,
|
|
666
|
-
rDomainSort = false,
|
|
667
|
-
xReverse = false,
|
|
668
|
-
zReverse = false,
|
|
669
|
-
rReverse = false,
|
|
670
|
-
yRange: _yRangeProp,
|
|
671
|
-
zRange: zRangeProp,
|
|
672
|
-
rRange: rRangeProp,
|
|
673
|
-
xBaseline = null,
|
|
674
|
-
yBaseline = null,
|
|
675
|
-
xInterval = null,
|
|
676
|
-
yInterval = null,
|
|
677
|
-
meta = {},
|
|
678
|
-
children: _children,
|
|
679
|
-
radial = false,
|
|
680
|
-
xRange: _xRangeProp,
|
|
681
|
-
x1: x1Prop,
|
|
682
|
-
x1Domain: x1DomainProp,
|
|
683
|
-
x1Range: x1RangeProp,
|
|
684
|
-
x1Scale: x1ScaleProp,
|
|
685
|
-
y1: y1Prop,
|
|
686
|
-
y1Domain: y1DomainProp,
|
|
687
|
-
y1Range: y1RangeProp,
|
|
688
|
-
y1Scale: y1ScaleProp,
|
|
689
|
-
c: cProp,
|
|
690
|
-
cScale: cScaleProp,
|
|
691
|
-
cDomain: cDomainProp,
|
|
692
|
-
cRange: cRangeProp,
|
|
693
|
-
onResize,
|
|
698
|
+
children,
|
|
694
699
|
geo,
|
|
695
|
-
|
|
696
|
-
tooltip,
|
|
700
|
+
tooltipContext,
|
|
697
701
|
transform,
|
|
698
702
|
onTransform,
|
|
699
703
|
ondragend,
|
|
700
704
|
ondragstart,
|
|
701
705
|
brush,
|
|
706
|
+
motion,
|
|
707
|
+
debug = false,
|
|
702
708
|
clip = false,
|
|
709
|
+
onTooltipClick,
|
|
703
710
|
class: className,
|
|
704
711
|
...restProps
|
|
705
|
-
}
|
|
712
|
+
} = $derived(props);
|
|
706
713
|
|
|
707
|
-
let
|
|
714
|
+
let brushXDomain = $state<BrushDomainType>();
|
|
715
|
+
let brushYDomain = $state<BrushDomainType>();
|
|
708
716
|
|
|
717
|
+
const chartState = new ChartState<TData, XScale, YScale>(() => ({
|
|
718
|
+
ref: refProp,
|
|
719
|
+
context: contextProp,
|
|
720
|
+
...props,
|
|
721
|
+
xDomain: brushXDomain ?? props.xDomain,
|
|
722
|
+
yDomain: brushYDomain ?? props.yDomain,
|
|
723
|
+
}));
|
|
724
|
+
|
|
725
|
+
let ref = $state<HTMLElement>();
|
|
709
726
|
$effect.pre(() => {
|
|
710
727
|
refProp = ref;
|
|
728
|
+
chartState.containerRef = ref;
|
|
711
729
|
});
|
|
712
730
|
|
|
713
|
-
|
|
731
|
+
// Update bindable
|
|
732
|
+
contextProp = chartState;
|
|
714
733
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
let _containerHeight = $state(100);
|
|
734
|
+
setChartContext(chartState);
|
|
735
|
+
setGeoContext(chartState.geoState);
|
|
718
736
|
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
737
|
+
const settings = getSettings();
|
|
738
|
+
$effect(() => {
|
|
739
|
+
settings.debug = debug;
|
|
740
|
+
});
|
|
723
741
|
|
|
724
|
-
|
|
725
|
-
|
|
742
|
+
// Resolve which projection properties the transform state applies to
|
|
743
|
+
const resolvedApply = $derived.by(() => {
|
|
744
|
+
if (transform?.mode !== 'projection') return { rotation: false, scale: false, translate: false };
|
|
726
745
|
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
746
|
+
// Auto-detect globe projections from clipAngle (flat projections return 0, globes return > 0)
|
|
747
|
+
let isGlobe = false;
|
|
748
|
+
if (geo?.projection) {
|
|
749
|
+
const proj = geo.projection();
|
|
750
|
+
isGlobe = (proj.clipAngle?.() ?? 0) > 0;
|
|
730
751
|
}
|
|
731
752
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
const _yDomain: DomainType | undefined = $derived.by(() => {
|
|
739
|
-
if (yDomainProp !== undefined) return yDomainProp;
|
|
753
|
+
const defaults = isGlobe
|
|
754
|
+
? { rotation: true, scale: false, translate: false }
|
|
755
|
+
: { rotation: false, scale: true, translate: true };
|
|
740
756
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
757
|
+
// User overrides win; enforce mutual exclusion
|
|
758
|
+
const result = { ...defaults, ...transform?.apply };
|
|
759
|
+
if (transform?.apply?.rotation === true && transform?.apply?.translate == null) {
|
|
760
|
+
result.translate = false;
|
|
744
761
|
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
const yValues = data.flatMap(accessor(yProp));
|
|
748
|
-
return [min([yBaseline, ...yValues]), max([yBaseline, ...yValues])];
|
|
762
|
+
if (transform?.apply?.translate === true && transform?.apply?.rotation == null) {
|
|
763
|
+
result.rotation = false;
|
|
749
764
|
}
|
|
750
|
-
});
|
|
751
|
-
|
|
752
|
-
const yRangeProp = $derived(
|
|
753
|
-
_yRangeProp ?? (radial ? ({ height }: { height: number }) => [0, height / 2] : undefined)
|
|
754
|
-
);
|
|
755
|
-
|
|
756
|
-
const yReverse = $derived(
|
|
757
|
-
yScaleProp ? !isScaleBand(yScaleProp) && !isScaleTime(yScaleProp) : true
|
|
758
|
-
);
|
|
759
|
-
|
|
760
|
-
const x = $derived(makeAccessor(xProp));
|
|
761
|
-
const y = $derived(makeAccessor(yProp));
|
|
762
|
-
const z = $derived(makeAccessor(zProp));
|
|
763
|
-
const r = $derived(makeAccessor(rProp));
|
|
764
|
-
const c = $derived(accessor(cProp));
|
|
765
|
-
const x1 = $derived(accessor(x1Prop));
|
|
766
|
-
const y1 = $derived(accessor(y1Prop));
|
|
767
|
-
|
|
768
|
-
const flatData = $derived(flatDataProp ?? data) as TData[];
|
|
769
|
-
|
|
770
|
-
const filteredExtents = $derived(filterObject($state.snapshot(extentsProp)));
|
|
771
765
|
|
|
772
|
-
|
|
773
|
-
x,
|
|
774
|
-
y,
|
|
775
|
-
z,
|
|
776
|
-
r,
|
|
777
|
-
});
|
|
778
|
-
|
|
779
|
-
const padding = $derived.by(() => {
|
|
780
|
-
if (typeof paddingProp === 'number') {
|
|
781
|
-
return {
|
|
782
|
-
...defaultPadding,
|
|
783
|
-
top: paddingProp,
|
|
784
|
-
right: paddingProp,
|
|
785
|
-
bottom: paddingProp,
|
|
786
|
-
left: paddingProp,
|
|
787
|
-
};
|
|
788
|
-
}
|
|
789
|
-
return { ...defaultPadding, ...paddingProp };
|
|
766
|
+
return result;
|
|
790
767
|
});
|
|
791
768
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
const top = padding.top;
|
|
796
|
-
const right = containerWidth - padding.right;
|
|
797
|
-
const bottom = containerHeight - padding.bottom;
|
|
798
|
-
const left = padding.left;
|
|
799
|
-
const width = right - left;
|
|
800
|
-
const height = bottom - top;
|
|
801
|
-
if (verbose === true) {
|
|
802
|
-
if (width <= 0 && isMounted === true) {
|
|
803
|
-
console.warn(
|
|
804
|
-
`[LayerChart] Target div has zero or negative width (${width}). Did you forget to set an explicit width in CSS on the container?`
|
|
805
|
-
);
|
|
806
|
-
}
|
|
807
|
-
if (height <= 0 && isMounted === true) {
|
|
808
|
-
console.warn(
|
|
809
|
-
`[LayerChart] Target div has zero or negative height (${height}). Did you forget to set an explicit height in CSS on the container?`
|
|
810
|
-
);
|
|
811
|
-
}
|
|
769
|
+
$effect.pre(() => {
|
|
770
|
+
if (chartState.geoState) {
|
|
771
|
+
chartState.geoState.transformApply = resolvedApply;
|
|
812
772
|
}
|
|
813
|
-
|
|
814
|
-
return {
|
|
815
|
-
top,
|
|
816
|
-
left,
|
|
817
|
-
bottom,
|
|
818
|
-
right,
|
|
819
|
-
width,
|
|
820
|
-
height,
|
|
821
|
-
};
|
|
822
773
|
});
|
|
823
774
|
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
* Calculate extents by taking the extent of the data
|
|
834
|
-
* and filling that in with anything set by the user
|
|
835
|
-
* Note that this is different from an "extent" passed
|
|
836
|
-
* in as a domain, which can be a partial domain
|
|
837
|
-
*/
|
|
838
|
-
const extents: Extents = $derived.by(() => {
|
|
839
|
-
const scaleLookup: Record<string, ScaleEntry> = {
|
|
840
|
-
x: { scale: xScaleProp, sort: xDomainSort },
|
|
841
|
-
y: { scale: yScaleProp, sort: yDomainSort },
|
|
842
|
-
z: { scale: zScaleProp, sort: zDomainSort },
|
|
843
|
-
r: { scale: rScaleProp, sort: rDomainSort },
|
|
844
|
-
};
|
|
845
|
-
|
|
846
|
-
const getters = filterObject(activeGetters, filteredExtents);
|
|
847
|
-
const activeScales: Record<string, ScaleEntry> = Object.fromEntries(
|
|
848
|
-
Object.keys(getters).map((k) => [k, scaleLookup[k]])
|
|
849
|
-
);
|
|
775
|
+
const initialTransform = $derived(
|
|
776
|
+
transform?.mode === 'projection' && (resolvedApply.translate || resolvedApply.scale) && geo?.fitGeojson && geo?.projection
|
|
777
|
+
? geoFitObjectTransform(
|
|
778
|
+
geo.projection(),
|
|
779
|
+
[chartState.width, chartState.height],
|
|
780
|
+
geo.fitGeojson
|
|
781
|
+
)
|
|
782
|
+
: undefined
|
|
783
|
+
);
|
|
850
784
|
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
return
|
|
854
|
-
|
|
855
|
-
|
|
785
|
+
const processTranslate = $derived.by(() => {
|
|
786
|
+
if (resolvedApply.rotation && chartState.geoState?.projection) {
|
|
787
|
+
return (x: number, y: number, deltaX: number, deltaY: number) => {
|
|
788
|
+
// When applying transform as rotation, invert `y` values and reduce sensitivity based on projection scale
|
|
789
|
+
// see: https://observablehq.com/@benoldenburg/simple-globe and https://observablehq.com/@michael-keith/draggable-globe-in-d3
|
|
790
|
+
const projectionScale = chartState.geoState.projection!.scale() ?? 0;
|
|
791
|
+
const sensitivity = 75;
|
|
792
|
+
return {
|
|
793
|
+
x: x + deltaX * (sensitivity / projectionScale),
|
|
794
|
+
y: y + deltaY * (sensitivity / projectionScale) * -1,
|
|
795
|
+
};
|
|
796
|
+
};
|
|
856
797
|
}
|
|
798
|
+
return undefined;
|
|
857
799
|
});
|
|
858
800
|
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
height,
|
|
881
|
-
width,
|
|
882
|
-
extents: snappedExtents,
|
|
883
|
-
})
|
|
884
|
-
);
|
|
885
|
-
|
|
886
|
-
const xGet = $derived(createGetter(x, xScale));
|
|
887
|
-
|
|
888
|
-
const yScale = $derived(
|
|
889
|
-
createChartScale('y', {
|
|
890
|
-
scale: yScaleProp,
|
|
891
|
-
domain: yDomain,
|
|
892
|
-
padding: yPadding,
|
|
893
|
-
nice: yNice,
|
|
894
|
-
reverse: yReverse,
|
|
895
|
-
percentRange,
|
|
896
|
-
range: yRangeProp,
|
|
897
|
-
height,
|
|
898
|
-
width,
|
|
899
|
-
extents: filteredExtents,
|
|
900
|
-
})
|
|
901
|
-
);
|
|
801
|
+
// Convert domainExtent to a constrain function on TransformState
|
|
802
|
+
const domainExtentConstrain = $derived.by(() => {
|
|
803
|
+
const de = transform?.domainExtent;
|
|
804
|
+
if (!de) return undefined;
|
|
805
|
+
|
|
806
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
807
|
+
let { scale, translate } = t;
|
|
808
|
+
|
|
809
|
+
// Helper to resolve 'data' to base domain values
|
|
810
|
+
const resolveValue = (
|
|
811
|
+
val: number | Date | 'data' | undefined,
|
|
812
|
+
baseDomainValue: unknown
|
|
813
|
+
): number | undefined => {
|
|
814
|
+
if (val === undefined) return undefined;
|
|
815
|
+
if (val === 'data') {
|
|
816
|
+
if (baseDomainValue instanceof Date) return baseDomainValue.getTime();
|
|
817
|
+
return baseDomainValue as number;
|
|
818
|
+
}
|
|
819
|
+
if (val instanceof Date) return val.getTime();
|
|
820
|
+
return val;
|
|
821
|
+
};
|
|
902
822
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
823
|
+
// Constrain a single axis. Normalizes reversed domains (e.g. [500, 0])
|
|
824
|
+
// to ascending order, applies constraints, then maps back.
|
|
825
|
+
const constrainAxis = (
|
|
826
|
+
axisTranslate: number,
|
|
827
|
+
axisScale: number,
|
|
828
|
+
dimension: number,
|
|
829
|
+
baseDomain: number[],
|
|
830
|
+
extent: { min?: number | Date | 'data'; max?: number | Date | 'data'; minRange?: number } | undefined
|
|
831
|
+
): number => {
|
|
832
|
+
if (!extent || baseDomain.length < 2 || dimension <= 0) return axisTranslate;
|
|
833
|
+
|
|
834
|
+
const d0 = baseDomain[0] as unknown;
|
|
835
|
+
const d1 = baseDomain[1] as unknown;
|
|
836
|
+
const isDate = d0 instanceof Date;
|
|
837
|
+
const rawD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
838
|
+
const rawD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
839
|
+
const range = Math.abs(rawD1 - rawD0);
|
|
840
|
+
if (!isFinite(range) || range === 0) return axisTranslate;
|
|
841
|
+
|
|
842
|
+
// Normalize reversed domains by flipping the translate
|
|
843
|
+
const reversed = rawD0 > rawD1;
|
|
844
|
+
const normTranslate = reversed ? dimension * axisScale - axisTranslate - dimension : axisTranslate;
|
|
845
|
+
const numMin = Math.min(rawD0, rawD1);
|
|
846
|
+
|
|
847
|
+
const rawMinVal = resolveValue(extent.min, baseDomain[0]);
|
|
848
|
+
const rawMaxVal = resolveValue(extent.max, baseDomain[1]);
|
|
849
|
+
const minVal = rawMinVal != null && rawMaxVal != null ? Math.min(rawMinVal, rawMaxVal) : rawMinVal;
|
|
850
|
+
const maxVal = rawMinVal != null && rawMaxVal != null ? Math.max(rawMinVal, rawMaxVal) : rawMaxVal;
|
|
851
|
+
|
|
852
|
+
// Current visible domain from translate/scale
|
|
853
|
+
const f0 = -normTranslate / axisScale / dimension;
|
|
854
|
+
const f1 = (dimension - normTranslate) / axisScale / dimension;
|
|
855
|
+
let visMin = numMin + f0 * range;
|
|
856
|
+
let visMax = numMin + f1 * range;
|
|
857
|
+
const visRange = visMax - visMin;
|
|
858
|
+
|
|
859
|
+
// Enforce minRange (max zoom in limit)
|
|
860
|
+
if (extent.minRange != null && visRange < extent.minRange) {
|
|
861
|
+
const center = (visMin + visMax) / 2;
|
|
862
|
+
visMin = center - extent.minRange / 2;
|
|
863
|
+
visMax = center + extent.minRange / 2;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// Enforce domain min/max (pan boundaries)
|
|
867
|
+
if (minVal != null && visMin < minVal) {
|
|
868
|
+
visMin = minVal;
|
|
869
|
+
visMax = visMin + (extent.minRange != null && visRange < extent.minRange ? extent.minRange : visRange);
|
|
870
|
+
}
|
|
871
|
+
if (maxVal != null && visMax > maxVal) {
|
|
872
|
+
visMax = maxVal;
|
|
873
|
+
visMin = visMax - (extent.minRange != null && visRange < extent.minRange ? extent.minRange : visRange);
|
|
874
|
+
if (minVal != null && visMin < minVal) visMin = minVal;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
// Back-compute translate from corrected visible domain
|
|
878
|
+
const newF0 = (visMin - numMin) / range;
|
|
879
|
+
const result = -newF0 * axisScale * dimension;
|
|
880
|
+
return reversed ? dimension * axisScale - result - dimension : result;
|
|
881
|
+
};
|
|
935
882
|
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
883
|
+
const transformAxis = transform?.axis ?? 'both';
|
|
884
|
+
|
|
885
|
+
if (de.x && (transformAxis === 'x' || transformAxis === 'both') && chartState.width > 0) {
|
|
886
|
+
// Also enforce minRange via scale clamping
|
|
887
|
+
if (de.x.minRange != null && chartState._baseXDomain.length >= 2) {
|
|
888
|
+
const d0 = chartState._baseXDomain[0] as unknown;
|
|
889
|
+
const d1 = chartState._baseXDomain[1] as unknown;
|
|
890
|
+
const isDate = d0 instanceof Date;
|
|
891
|
+
const numD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
892
|
+
const numD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
893
|
+
const fullRange = Math.abs(numD1 - numD0);
|
|
894
|
+
if (fullRange > 0) {
|
|
895
|
+
const maxScale = fullRange / de.x.minRange;
|
|
896
|
+
scale = Math.min(scale, maxScale);
|
|
949
897
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
898
|
+
}
|
|
899
|
+
translate = {
|
|
900
|
+
...translate,
|
|
901
|
+
x: constrainAxis(translate.x, scale, chartState.width, chartState._baseXDomain, de.x),
|
|
902
|
+
};
|
|
903
|
+
}
|
|
953
904
|
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
width,
|
|
966
|
-
height,
|
|
905
|
+
if (de.y && (transformAxis === 'y' || transformAxis === 'both') && chartState.height > 0) {
|
|
906
|
+
if (de.y.minRange != null && chartState._baseYDomain.length >= 2) {
|
|
907
|
+
const d0 = chartState._baseYDomain[0] as unknown;
|
|
908
|
+
const d1 = chartState._baseYDomain[1] as unknown;
|
|
909
|
+
const isDate = d0 instanceof Date;
|
|
910
|
+
const numD0 = isDate ? (d0 as Date).getTime() : (d0 as number);
|
|
911
|
+
const numD1 = isDate ? (d1 as Date).getTime() : (d1 as number);
|
|
912
|
+
const fullRange = Math.abs(numD1 - numD0);
|
|
913
|
+
if (fullRange > 0) {
|
|
914
|
+
const maxScale = fullRange / de.y.minRange;
|
|
915
|
+
scale = Math.min(scale, maxScale);
|
|
967
916
|
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
const cScale = $derived(
|
|
975
|
-
cRangeProp
|
|
976
|
-
? createScale(cScaleProp ?? scaleOrdinal(), cDomain, cRangeProp, { width, height })
|
|
977
|
-
: null
|
|
978
|
-
);
|
|
979
|
-
|
|
980
|
-
const cGet = $derived((d: any) => cScale?.(c(d)));
|
|
981
|
-
|
|
982
|
-
const xDomainPossiblyNice = $derived(xScale.domain());
|
|
983
|
-
const yDomainPossiblyNice = $derived(yScale.domain());
|
|
984
|
-
const zDomainPossiblyNice = $derived(zScale.domain());
|
|
985
|
-
const rDomainPossiblyNice = $derived(rScale.domain());
|
|
986
|
-
|
|
987
|
-
const xRange = $derived(getRange(xScale));
|
|
988
|
-
const yRange = $derived(getRange(yScale));
|
|
989
|
-
const zRange = $derived(getRange(zScale));
|
|
990
|
-
const rRange = $derived(getRange(rScale));
|
|
991
|
-
|
|
992
|
-
const aspectRatio = $derived(width / height);
|
|
993
|
-
|
|
994
|
-
const config: PreservedChartConfig<TData, XScale, YScale> = $derived({
|
|
995
|
-
x: xProp,
|
|
996
|
-
y: yProp,
|
|
997
|
-
z: zProp,
|
|
998
|
-
r: rProp,
|
|
999
|
-
c: cProp,
|
|
1000
|
-
x1: x1Prop,
|
|
1001
|
-
y1: y1Prop,
|
|
1002
|
-
xDomain: _xDomain,
|
|
1003
|
-
yDomain: _yDomain,
|
|
1004
|
-
zDomain: zDomainProp,
|
|
1005
|
-
rDomain: rDomainProp,
|
|
1006
|
-
x1Domain: x1DomainProp,
|
|
1007
|
-
y1Domain: y1DomainProp,
|
|
1008
|
-
cDomain: cDomainProp,
|
|
1009
|
-
xRange: _xRangeProp,
|
|
1010
|
-
yRange: _yRangeProp,
|
|
1011
|
-
zRange: zRangeProp,
|
|
1012
|
-
rRange: rRangeProp,
|
|
1013
|
-
cRange: cRangeProp,
|
|
1014
|
-
x1Range: x1RangeProp,
|
|
1015
|
-
y1Range: y1RangeProp,
|
|
1016
|
-
});
|
|
1017
|
-
|
|
1018
|
-
let geoContext = $state<GeoContextValue>(null!);
|
|
1019
|
-
let transformContext = $state<TransformContextValue>(null!);
|
|
1020
|
-
let tooltipContext = $state<TooltipContextValue>(null!);
|
|
1021
|
-
let brushContext = $state<BrushContextValue>(null!);
|
|
1022
|
-
|
|
1023
|
-
const context: ChartContextValue<TData, XScale, YScale> = {
|
|
1024
|
-
get activeGetters() {
|
|
1025
|
-
return activeGetters;
|
|
1026
|
-
},
|
|
1027
|
-
get config() {
|
|
1028
|
-
return config;
|
|
1029
|
-
},
|
|
1030
|
-
get width() {
|
|
1031
|
-
return width;
|
|
1032
|
-
},
|
|
1033
|
-
get height() {
|
|
1034
|
-
return height;
|
|
1035
|
-
},
|
|
1036
|
-
get percentRange() {
|
|
1037
|
-
return percentRange;
|
|
1038
|
-
},
|
|
1039
|
-
get aspectRatio() {
|
|
1040
|
-
return aspectRatio;
|
|
1041
|
-
},
|
|
1042
|
-
get containerWidth() {
|
|
1043
|
-
return containerWidth;
|
|
1044
|
-
},
|
|
1045
|
-
get containerHeight() {
|
|
1046
|
-
return containerHeight;
|
|
1047
|
-
},
|
|
1048
|
-
get x() {
|
|
1049
|
-
return x;
|
|
1050
|
-
},
|
|
1051
|
-
get y() {
|
|
1052
|
-
return y;
|
|
1053
|
-
},
|
|
1054
|
-
get z() {
|
|
1055
|
-
return z;
|
|
1056
|
-
},
|
|
1057
|
-
get r() {
|
|
1058
|
-
return r;
|
|
1059
|
-
},
|
|
1060
|
-
get c() {
|
|
1061
|
-
return c;
|
|
1062
|
-
},
|
|
1063
|
-
get x1() {
|
|
1064
|
-
return x1;
|
|
1065
|
-
},
|
|
1066
|
-
get y1() {
|
|
1067
|
-
return y1;
|
|
1068
|
-
},
|
|
1069
|
-
get data() {
|
|
1070
|
-
return data;
|
|
1071
|
-
},
|
|
1072
|
-
get xNice() {
|
|
1073
|
-
return xNice;
|
|
1074
|
-
},
|
|
1075
|
-
get yNice() {
|
|
1076
|
-
return yNice;
|
|
1077
|
-
},
|
|
1078
|
-
get zNice() {
|
|
1079
|
-
return zNice;
|
|
1080
|
-
},
|
|
1081
|
-
get rNice() {
|
|
1082
|
-
return rNice;
|
|
1083
|
-
},
|
|
1084
|
-
get xDomainSort() {
|
|
1085
|
-
return xDomainSort;
|
|
1086
|
-
},
|
|
1087
|
-
get yDomainSort() {
|
|
1088
|
-
return yDomainSort;
|
|
1089
|
-
},
|
|
1090
|
-
get zDomainSort() {
|
|
1091
|
-
return zDomainSort;
|
|
1092
|
-
},
|
|
1093
|
-
get rDomainSort() {
|
|
1094
|
-
return rDomainSort;
|
|
1095
|
-
},
|
|
1096
|
-
get xReverse() {
|
|
1097
|
-
return xReverse;
|
|
1098
|
-
},
|
|
1099
|
-
get yReverse() {
|
|
1100
|
-
return yReverse;
|
|
1101
|
-
},
|
|
1102
|
-
get zReverse() {
|
|
1103
|
-
return zReverse;
|
|
1104
|
-
},
|
|
1105
|
-
get rReverse() {
|
|
1106
|
-
return rReverse;
|
|
1107
|
-
},
|
|
1108
|
-
get xPadding() {
|
|
1109
|
-
return xPadding;
|
|
1110
|
-
},
|
|
1111
|
-
get yPadding() {
|
|
1112
|
-
return yPadding;
|
|
1113
|
-
},
|
|
1114
|
-
get zPadding() {
|
|
1115
|
-
return zPadding;
|
|
1116
|
-
},
|
|
1117
|
-
get rPadding() {
|
|
1118
|
-
return rPadding;
|
|
1119
|
-
},
|
|
1120
|
-
get padding() {
|
|
1121
|
-
return padding;
|
|
1122
|
-
},
|
|
1123
|
-
get flatData() {
|
|
1124
|
-
return flatData;
|
|
1125
|
-
},
|
|
1126
|
-
get extents() {
|
|
1127
|
-
return extents;
|
|
1128
|
-
},
|
|
1129
|
-
get xDomain() {
|
|
1130
|
-
return xDomainPossiblyNice;
|
|
1131
|
-
},
|
|
1132
|
-
get yDomain() {
|
|
1133
|
-
return yDomainPossiblyNice;
|
|
1134
|
-
},
|
|
1135
|
-
get zDomain() {
|
|
1136
|
-
return zDomainPossiblyNice;
|
|
1137
|
-
},
|
|
1138
|
-
get rDomain() {
|
|
1139
|
-
return rDomainPossiblyNice;
|
|
1140
|
-
},
|
|
1141
|
-
get cDomain() {
|
|
1142
|
-
return cDomain;
|
|
1143
|
-
},
|
|
1144
|
-
get x1Domain() {
|
|
1145
|
-
return x1Domain;
|
|
1146
|
-
},
|
|
1147
|
-
get y1Domain() {
|
|
1148
|
-
return y1Domain;
|
|
1149
|
-
},
|
|
1150
|
-
get xRange() {
|
|
1151
|
-
return xRange;
|
|
1152
|
-
},
|
|
1153
|
-
get yRange() {
|
|
1154
|
-
return yRange;
|
|
1155
|
-
},
|
|
1156
|
-
get zRange() {
|
|
1157
|
-
return zRange;
|
|
1158
|
-
},
|
|
1159
|
-
get rRange() {
|
|
1160
|
-
return rRange;
|
|
1161
|
-
},
|
|
1162
|
-
get cRange() {
|
|
1163
|
-
return cRangeProp;
|
|
1164
|
-
},
|
|
1165
|
-
get x1Range() {
|
|
1166
|
-
return x1RangeProp;
|
|
1167
|
-
},
|
|
1168
|
-
get y1Range() {
|
|
1169
|
-
return y1RangeProp;
|
|
1170
|
-
},
|
|
1171
|
-
get meta() {
|
|
1172
|
-
return meta;
|
|
1173
|
-
},
|
|
1174
|
-
set meta(v: Record<string, any>) {
|
|
1175
|
-
meta = v;
|
|
1176
|
-
},
|
|
1177
|
-
get xScale() {
|
|
1178
|
-
return xScale;
|
|
1179
|
-
},
|
|
1180
|
-
get yScale() {
|
|
1181
|
-
return yScale;
|
|
1182
|
-
},
|
|
1183
|
-
get zScale() {
|
|
1184
|
-
return zScale;
|
|
1185
|
-
},
|
|
1186
|
-
get rScale() {
|
|
1187
|
-
return rScale;
|
|
1188
|
-
},
|
|
1189
|
-
get yGet() {
|
|
1190
|
-
return yGet;
|
|
1191
|
-
},
|
|
1192
|
-
get xGet() {
|
|
1193
|
-
return xGet;
|
|
1194
|
-
},
|
|
1195
|
-
get zGet() {
|
|
1196
|
-
return zGet;
|
|
1197
|
-
},
|
|
1198
|
-
get rGet() {
|
|
1199
|
-
return rGet;
|
|
1200
|
-
},
|
|
1201
|
-
get cGet() {
|
|
1202
|
-
return cGet;
|
|
1203
|
-
},
|
|
1204
|
-
get x1Get() {
|
|
1205
|
-
return x1Get;
|
|
1206
|
-
},
|
|
1207
|
-
get y1Get() {
|
|
1208
|
-
return y1Get;
|
|
1209
|
-
},
|
|
1210
|
-
get cScale() {
|
|
1211
|
-
return cScale;
|
|
1212
|
-
},
|
|
1213
|
-
get x1Scale() {
|
|
1214
|
-
return x1Scale;
|
|
1215
|
-
},
|
|
1216
|
-
get y1Scale() {
|
|
1217
|
-
return y1Scale;
|
|
1218
|
-
},
|
|
1219
|
-
get xInterval() {
|
|
1220
|
-
return xInterval;
|
|
1221
|
-
},
|
|
1222
|
-
get yInterval() {
|
|
1223
|
-
return yInterval;
|
|
1224
|
-
},
|
|
1225
|
-
get radial() {
|
|
1226
|
-
return radial;
|
|
1227
|
-
},
|
|
1228
|
-
get containerRef() {
|
|
1229
|
-
return ref;
|
|
1230
|
-
},
|
|
1231
|
-
get geo() {
|
|
1232
|
-
return geoContext;
|
|
1233
|
-
},
|
|
1234
|
-
get transform() {
|
|
1235
|
-
return transformContext;
|
|
1236
|
-
},
|
|
1237
|
-
get tooltip() {
|
|
1238
|
-
return tooltipContext;
|
|
1239
|
-
},
|
|
1240
|
-
get brush() {
|
|
1241
|
-
return brushContext;
|
|
1242
|
-
},
|
|
1243
|
-
};
|
|
1244
|
-
|
|
1245
|
-
contextProp = context;
|
|
1246
|
-
|
|
1247
|
-
setChartContext(context);
|
|
917
|
+
}
|
|
918
|
+
translate = {
|
|
919
|
+
...translate,
|
|
920
|
+
y: constrainAxis(translate.y, scale, chartState.height, chartState._baseYDomain, de.y),
|
|
921
|
+
};
|
|
922
|
+
}
|
|
1248
923
|
|
|
1249
|
-
|
|
1250
|
-
|
|
924
|
+
return { scale, translate };
|
|
925
|
+
};
|
|
1251
926
|
});
|
|
1252
927
|
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
r: rProp,
|
|
1264
|
-
xScale,
|
|
1265
|
-
yScale,
|
|
1266
|
-
zScale,
|
|
1267
|
-
rScale,
|
|
1268
|
-
});
|
|
1269
|
-
}
|
|
928
|
+
// Compose user-provided constrain with domainExtent constrain
|
|
929
|
+
const composedConstrain = $derived.by(() => {
|
|
930
|
+
const userConstrain = transform?.constrain;
|
|
931
|
+
if (!domainExtentConstrain && !userConstrain) return undefined;
|
|
932
|
+
if (!domainExtentConstrain) return userConstrain;
|
|
933
|
+
if (!userConstrain) return domainExtentConstrain;
|
|
934
|
+
// Domain extent first, then user constrain
|
|
935
|
+
return (t: { scale: number; translate: { x: number; y: number } }) => {
|
|
936
|
+
return userConstrain(domainExtentConstrain(t));
|
|
937
|
+
};
|
|
1270
938
|
});
|
|
1271
939
|
|
|
1272
|
-
$
|
|
1273
|
-
if (!
|
|
1274
|
-
|
|
1275
|
-
width: context.width,
|
|
1276
|
-
height: context.height,
|
|
1277
|
-
containerWidth: context.containerWidth,
|
|
1278
|
-
containerHeight: context.containerHeight,
|
|
1279
|
-
});
|
|
1280
|
-
});
|
|
940
|
+
const enhancedBrushProps = $derived.by(() => {
|
|
941
|
+
if (!brush) return { disabled: true };
|
|
942
|
+
const userProps = typeof brush === 'object' ? brush : {};
|
|
1281
943
|
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
);
|
|
944
|
+
const userOnBrushEnd = userProps.onBrushEnd;
|
|
945
|
+
const zoomOnBrush = 'zoomOnBrush' in userProps ? userProps.zoomOnBrush : false;
|
|
946
|
+
const needsEnhancement = transform?.mode === 'domain' || zoomOnBrush;
|
|
947
|
+
if (!needsEnhancement) return userProps;
|
|
1287
948
|
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
949
|
+
return {
|
|
950
|
+
...userProps,
|
|
951
|
+
onBrushEnd: (e: { brush: BrushState }) => {
|
|
952
|
+
if (e.brush.active) {
|
|
953
|
+
if (transform?.mode === 'domain') {
|
|
954
|
+
chartState.zoomToBrush(e.brush, userProps.axis ?? 'x');
|
|
955
|
+
} else if (zoomOnBrush) {
|
|
956
|
+
const axis = userProps.axis ?? 'x';
|
|
957
|
+
if (axis === 'x' || axis === 'both') brushXDomain = e.brush.x;
|
|
958
|
+
if (axis === 'y' || axis === 'both') brushYDomain = e.brush.y;
|
|
959
|
+
}
|
|
960
|
+
userOnBrushEnd?.(e);
|
|
961
|
+
e.brush.reset();
|
|
962
|
+
} else {
|
|
963
|
+
// Brush was cleared (click-to-reset) — reset transform/domain too
|
|
964
|
+
if (transform?.mode === 'domain') {
|
|
965
|
+
chartState.transform.reset();
|
|
966
|
+
} else if (zoomOnBrush) {
|
|
967
|
+
brushXDomain = undefined;
|
|
968
|
+
brushYDomain = undefined;
|
|
969
|
+
}
|
|
970
|
+
userOnBrushEnd?.(e);
|
|
971
|
+
}
|
|
972
|
+
},
|
|
1304
973
|
};
|
|
1305
974
|
});
|
|
1306
|
-
|
|
1307
|
-
const brushProps = $derived(typeof brush === 'object' ? brush : { disabled: !brush });
|
|
1308
|
-
const tooltipProps = $derived(typeof tooltip === 'object' ? tooltip : {});
|
|
1309
975
|
</script>
|
|
1310
976
|
|
|
1311
977
|
{#if ssr === true || typeof window !== 'undefined'}
|
|
@@ -1318,38 +984,36 @@
|
|
|
1318
984
|
style:left={position === 'absolute' ? 0 : null}
|
|
1319
985
|
style:pointer-events={pointerEvents === false ? 'none' : null}
|
|
1320
986
|
style:overflow={clip ? 'hidden' : null}
|
|
1321
|
-
style:width={
|
|
1322
|
-
style:height={
|
|
1323
|
-
bind:clientWidth={_containerWidth}
|
|
1324
|
-
bind:clientHeight={_containerHeight}
|
|
987
|
+
style:width={width ? `${width}px` : '100%'}
|
|
988
|
+
style:height={height ? `${height}px` : '100%'}
|
|
989
|
+
bind:clientWidth={chartState._containerWidth}
|
|
990
|
+
bind:clientHeight={chartState._containerHeight}
|
|
1325
991
|
class={['lc-root-container', className]}
|
|
1326
992
|
{...restProps}
|
|
1327
993
|
>
|
|
1328
|
-
{#key isMounted}
|
|
994
|
+
{#key chartState.isMounted}
|
|
1329
995
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
996
|
+
{@const { domainExtent: _de, constrain: _uc, apply: _apply, ...transformProps } = transform ?? {}}
|
|
1330
997
|
<TransformContext
|
|
1331
|
-
bind:
|
|
1332
|
-
mode={
|
|
1333
|
-
initialTranslate={initialTransform?.translate}
|
|
1334
|
-
initialScale={initialTransform?.scale}
|
|
998
|
+
bind:state={chartState.transformState}
|
|
999
|
+
mode={transform?.mode ?? 'none'}
|
|
1000
|
+
initialTranslate={resolvedApply.translate ? initialTransform?.translate : undefined}
|
|
1001
|
+
initialScale={resolvedApply.scale ? initialTransform?.scale : undefined}
|
|
1335
1002
|
{processTranslate}
|
|
1336
|
-
{...
|
|
1003
|
+
{...transformProps}
|
|
1004
|
+
constrain={composedConstrain}
|
|
1005
|
+
disablePointer={(brush === true || (typeof brush === 'object' && !brush.disabled)) || transform?.disablePointer}
|
|
1337
1006
|
{ondragstart}
|
|
1338
1007
|
{onTransform}
|
|
1339
1008
|
{ondragend}
|
|
1340
1009
|
>
|
|
1341
1010
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1342
|
-
<
|
|
1011
|
+
<BrushContext {...enhancedBrushProps} bind:state={chartState.brushState}>
|
|
1343
1012
|
<!-- svelte-ignore ownership_invalid_binding -->
|
|
1344
|
-
<
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
context,
|
|
1349
|
-
})}
|
|
1350
|
-
</TooltipContext>
|
|
1351
|
-
</BrushContext>
|
|
1352
|
-
</GeoContext>
|
|
1013
|
+
<TooltipContext onclick={onTooltipClick} {...getObjectOrNull(tooltipContext)} bind:state={chartState.tooltipState}>
|
|
1014
|
+
<ChartChildren {children} {tooltipContext} {...restProps} />
|
|
1015
|
+
</TooltipContext>
|
|
1016
|
+
</BrushContext>
|
|
1353
1017
|
</TransformContext>
|
|
1354
1018
|
{/key}
|
|
1355
1019
|
</div>
|