layerchart 2.0.0-next.6 → 2.0.0-next.60
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/LICENSE +1 -1
- package/dist/bench/ComposableLineChart.svelte +56 -0
- package/dist/bench/ComposableLineChart.svelte.d.ts +16 -0
- package/dist/bench/GeoBench.svelte +24 -0
- package/dist/bench/GeoBench.svelte.d.ts +11 -0
- package/dist/bench/PrimitiveBench.svelte +66 -0
- package/dist/bench/PrimitiveBench.svelte.d.ts +10 -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/primitives.svelte.bench.d.ts +1 -0
- package/dist/bench/primitives.svelte.bench.js +42 -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/AnnotationLine.svelte +126 -69
- package/dist/components/AnnotationLine.svelte.d.ts +10 -2
- package/dist/components/AnnotationPoint.svelte +122 -36
- package/dist/components/AnnotationPoint.svelte.d.ts +8 -1
- package/dist/components/AnnotationRange.svelte +45 -17
- package/dist/components/Arc.svelte +42 -35
- package/dist/components/Arc.svelte.d.ts +9 -6
- package/dist/components/Arc.svelte.test.d.ts +1 -0
- package/dist/components/Arc.svelte.test.js +858 -0
- package/dist/components/ArcLabel.svelte +259 -0
- package/dist/components/ArcLabel.svelte.d.ts +73 -0
- package/dist/components/ArcLabel.svelte.test.d.ts +1 -0
- package/dist/components/ArcLabel.svelte.test.js +235 -0
- package/dist/components/Area.svelte +95 -100
- package/dist/components/Area.svelte.d.ts +7 -3
- package/dist/components/Axis.svelte +254 -60
- package/dist/components/Axis.svelte.d.ts +42 -8
- package/dist/components/Bar.svelte +174 -53
- package/dist/components/Bar.svelte.d.ts +22 -2
- package/dist/components/Bars.svelte +33 -7
- package/dist/components/Bars.svelte.d.ts +9 -1
- package/dist/components/Blur.svelte +10 -9
- package/dist/components/Blur.svelte.d.ts +2 -5
- package/dist/components/Bounds.svelte +1 -1
- package/dist/components/BoxPlot.svelte +389 -0
- package/dist/components/BoxPlot.svelte.d.ts +40 -0
- package/dist/components/BrushContext.svelte +149 -329
- 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 +308 -0
- package/dist/components/Calendar.svelte +45 -20
- package/dist/components/Calendar.svelte.d.ts +4 -4
- package/dist/components/Cell.svelte +64 -0
- package/dist/components/Cell.svelte.d.ts +25 -0
- package/dist/components/Chart.svelte +580 -767
- package/dist/components/Chart.svelte.d.ts +127 -101
- package/dist/components/ChartChildren.svelte +334 -0
- package/dist/components/ChartChildren.svelte.d.ts +147 -0
- package/dist/components/ChartClipPath.svelte +2 -2
- package/dist/components/Circle.svelte +392 -72
- package/dist/components/Circle.svelte.d.ts +40 -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 +13 -15
- package/dist/components/CircleClipPath.svelte.d.ts +7 -1
- package/dist/components/CircleLegend.svelte +389 -0
- package/dist/components/CircleLegend.svelte.d.ts +114 -0
- package/dist/components/ClipPath.svelte +77 -10
- package/dist/components/ClipPath.svelte.d.ts +21 -2
- package/dist/components/ColorRamp.svelte +1 -1
- package/dist/components/ComputedStyles.svelte +10 -3
- package/dist/components/Contour.svelte +301 -0
- package/dist/components/Contour.svelte.d.ts +48 -0
- package/dist/components/Density.svelte +146 -0
- package/dist/components/Density.svelte.d.ts +21 -0
- package/dist/components/Ellipse.svelte +485 -0
- package/dist/components/Ellipse.svelte.d.ts +89 -0
- package/dist/components/Ellipse.svelte.test.d.ts +1 -0
- package/dist/components/Ellipse.svelte.test.js +126 -0
- package/dist/components/Frame.svelte +2 -2
- package/dist/components/Grid.svelte +106 -77
- package/dist/components/Grid.svelte.d.ts +19 -4
- package/dist/components/Group.svelte +188 -65
- package/dist/components/Group.svelte.d.ts +34 -9
- package/dist/components/Group.svelte.test.d.ts +1 -0
- package/dist/components/Group.svelte.test.js +63 -0
- package/dist/components/Highlight.svelte +393 -165
- package/dist/components/Highlight.svelte.d.ts +13 -1
- package/dist/components/Hull.svelte +42 -14
- package/dist/components/Hull.svelte.d.ts +2 -2
- package/dist/components/Image.svelte +558 -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 +144 -31
- package/dist/components/Labels.svelte.d.ts +24 -8
- package/dist/components/Legend.svelte +296 -84
- package/dist/components/Legend.svelte.d.ts +30 -12
- package/dist/components/Line.svelte +389 -84
- package/dist/components/Line.svelte.d.ts +46 -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 +47 -13
- package/dist/components/Link.svelte +269 -70
- package/dist/components/Link.svelte.d.ts +69 -26
- package/dist/components/Marker.svelte +51 -27
- package/dist/components/Marker.svelte.d.ts +1 -1
- package/dist/components/Month.svelte +273 -0
- package/dist/components/Month.svelte.d.ts +70 -0
- package/dist/components/MonthPath.svelte +32 -18
- package/dist/components/MonthPath.svelte.d.ts +8 -3
- package/dist/components/MotionPath.svelte +1 -1
- package/dist/components/Path.svelte +381 -0
- package/dist/components/Path.svelte.d.ts +72 -0
- package/dist/components/Pattern.svelte +112 -15
- package/dist/components/Pattern.svelte.d.ts +3 -1
- package/dist/components/Pie.svelte +10 -10
- package/dist/components/Pie.svelte.d.ts +2 -3
- package/dist/components/Point.svelte +1 -1
- package/dist/components/Points.svelte +76 -84
- package/dist/components/Points.svelte.d.ts +7 -8
- package/dist/components/Polygon.svelte +538 -0
- package/dist/components/Polygon.svelte.d.ts +136 -0
- package/dist/components/Polygon.svelte.test.d.ts +1 -0
- package/dist/components/Polygon.svelte.test.js +121 -0
- package/dist/components/RadialGradient.svelte +16 -16
- package/dist/components/Raster.svelte +335 -0
- package/dist/components/Raster.svelte.d.ts +48 -0
- package/dist/components/Rect.svelte +659 -89
- package/dist/components/Rect.svelte.d.ts +94 -8
- package/dist/components/Rect.svelte.test.d.ts +1 -0
- package/dist/components/Rect.svelte.test.js +179 -0
- package/dist/components/RectClipPath.svelte +17 -9
- package/dist/components/RectClipPath.svelte.d.ts +8 -2
- package/dist/components/Rule.svelte +170 -78
- package/dist/components/Rule.svelte.d.ts +7 -2
- package/dist/components/Spline.svelte +189 -269
- package/dist/components/Spline.svelte.d.ts +28 -56
- package/dist/components/Text.svelte +633 -211
- package/dist/components/Text.svelte.d.ts +62 -12
- package/dist/components/Text.svelte.test.d.ts +1 -0
- package/dist/components/Text.svelte.test.js +152 -0
- package/dist/components/Threshold.svelte +6 -3
- package/dist/components/Trail.svelte +268 -0
- package/dist/components/Trail.svelte.d.ts +88 -0
- package/dist/components/TransformContext.svelte +132 -428
- package/dist/components/TransformContext.svelte.d.ts +22 -0
- package/dist/components/TransformContext.svelte.test.d.ts +1 -0
- package/dist/components/TransformContext.svelte.test.js +166 -0
- package/dist/components/Vector.svelte +399 -0
- package/dist/components/Vector.svelte.d.ts +109 -0
- package/dist/components/Violin.svelte +318 -0
- package/dist/components/Violin.svelte.d.ts +47 -0
- package/dist/components/Voronoi.svelte +53 -25
- package/dist/components/Voronoi.svelte.d.ts +9 -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__/ArcLabel.svelte.test.ts/ArcLabel-defaults-placement-to-centroid--x-y-at-the-centroid--middle-anchors--1.png +0 -0
- package/dist/components/__screenshots__/ArcLabel.svelte.test.ts/ArcLabel-defaults-placement-to-centroid--x-y-at-the-centroid--middle-anchors--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 +192 -225
- package/dist/components/charts/ArcChart.svelte.d.ts +55 -18
- 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 +88 -526
- package/dist/components/charts/AreaChart.svelte.d.ts +36 -37
- 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 +130 -507
- package/dist/components/charts/BarChart.svelte.d.ts +39 -32
- package/dist/components/charts/BarChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/BarChart.svelte.test.js +454 -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 +109 -35
- 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 +242 -0
- package/dist/components/charts/LineChart.svelte +96 -430
- 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 +36 -31
- package/dist/components/charts/LineChart.svelte.test.d.ts +1 -0
- package/dist/components/charts/LineChart.svelte.test.js +48 -0
- package/dist/components/charts/PieChart.svelte +337 -362
- package/dist/components/charts/PieChart.svelte.d.ts +72 -33
- 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 +53 -376
- package/dist/components/charts/ScatterChart.svelte.d.ts +27 -23
- package/dist/components/charts/__fixtures__/ArcChartTooltip.svelte +39 -0
- package/dist/{docs/Blockquote.svelte.d.ts → components/charts/__fixtures__/ArcChartTooltip.svelte.d.ts} +4 -6
- 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-AreaChart--multi-series--quadtree-x-mode--should-show-series-colors-in-tooltip-items-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-series-colors-in-tooltip-items-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-single-series-without-total-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-AreaChart--multi-series--quadtree-x-mode--should-show-single-series-without-total-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/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-series-header-for-multi-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-series-header-for-multi-series-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x--y--and-r-items-when-r-is-configured-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x--y--and-r-items-when-r-is-configured-2.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x-and-y-items-in-tooltip-1.png +0 -0
- package/dist/components/charts/__screenshots__/DefaultTooltip.svelte.test.ts/DefaultTooltip-ScatterChart--single-point--quadtree-mode--should-show-x-and-y-items-in-tooltip-2.png +0 -0
- package/dist/components/charts/__screenshots__/LineChart.svelte.test.ts/LineChart-tooltip-should-prefer-cScale-color-over-default-series-color-when-cScale-is-explicitly-provided-1.png +0 -0
- package/dist/components/charts/__screenshots__/LineChart.svelte.test.ts/LineChart-tooltip-should-prefer-cScale-color-over-default-series-color-when-cScale-is-explicitly-provided-2.png +0 -0
- package/dist/components/charts/__screenshots__/PieChart.svelte.test.ts/PieChart-uses-hovered-slice-identity-for-implicit-tooltip-series-1.png +0 -0
- package/dist/components/charts/__screenshots__/PieChart.svelte.test.ts/PieChart-uses-hovered-slice-identity-for-implicit-tooltip-series-2.png +0 -0
- package/dist/components/charts/types.d.ts +6 -211
- package/dist/components/{ForceSimulation.svelte → force/ForceSimulation.svelte} +184 -50
- package/dist/components/force/ForceSimulation.svelte.d.ts +158 -0
- package/dist/components/force/index.d.ts +2 -0
- package/dist/components/force/index.js +2 -0
- package/dist/components/{GeoCircle.svelte → geo/GeoCircle.svelte} +3 -3
- package/dist/components/{GeoCircle.svelte.d.ts → geo/GeoCircle.svelte.d.ts} +1 -1
- package/dist/components/geo/GeoClipPath.svelte +72 -0
- package/dist/components/geo/GeoClipPath.svelte.d.ts +35 -0
- package/dist/components/{GeoEdgeFade.svelte → geo/GeoEdgeFade.svelte} +7 -8
- package/dist/components/{GeoEdgeFade.svelte.d.ts → geo/GeoEdgeFade.svelte.d.ts} +2 -2
- package/dist/components/geo/GeoLegend.svelte +433 -0
- package/dist/components/geo/GeoLegend.svelte.d.ts +117 -0
- package/dist/components/geo/GeoPath.svelte +161 -0
- package/dist/components/{GeoPath.svelte.d.ts → geo/GeoPath.svelte.d.ts} +7 -7
- package/dist/components/geo/GeoPoint.svelte +105 -0
- package/dist/components/{GeoPoint.svelte.d.ts → geo/GeoPoint.svelte.d.ts} +2 -2
- package/dist/components/geo/GeoProjection.svelte +30 -0
- package/dist/components/geo/GeoProjection.svelte.d.ts +8 -0
- package/dist/components/geo/GeoRaster.svelte +311 -0
- package/dist/components/geo/GeoRaster.svelte.d.ts +61 -0
- package/dist/components/geo/GeoSpline.svelte +78 -0
- package/dist/components/{GeoSpline.svelte.d.ts → geo/GeoSpline.svelte.d.ts} +4 -4
- package/dist/components/{GeoTile.svelte → geo/GeoTile.svelte} +18 -15
- package/dist/components/{GeoTile.svelte.d.ts → geo/GeoTile.svelte.d.ts} +1 -1
- package/dist/components/{GeoVisible.svelte → geo/GeoVisible.svelte} +4 -4
- package/dist/components/{Graticule.svelte → geo/Graticule.svelte} +11 -14
- package/dist/components/{Graticule.svelte.d.ts → geo/Graticule.svelte.d.ts} +3 -2
- package/dist/components/{TileImage.svelte → geo/TileImage.svelte} +22 -7
- package/dist/components/{TileImage.svelte.d.ts → geo/TileImage.svelte.d.ts} +1 -1
- package/dist/components/geo/index.d.ts +26 -0
- package/dist/components/geo/index.js +26 -0
- package/dist/components/graph/Chord.svelte +114 -0
- package/dist/components/graph/Chord.svelte.d.ts +53 -0
- package/dist/components/{Dagre.svelte → graph/Dagre.svelte} +6 -1
- package/dist/components/graph/Ribbon.svelte +141 -0
- package/dist/components/graph/Ribbon.svelte.d.ts +51 -0
- package/dist/components/{Sankey.svelte → graph/Sankey.svelte} +1 -3
- package/dist/components/graph/index.d.ts +8 -0
- package/dist/components/graph/index.js +8 -0
- package/dist/components/{Pack.svelte → hierarchy/Pack.svelte} +4 -6
- package/dist/components/{Pack.svelte.d.ts → hierarchy/Pack.svelte.d.ts} +12 -7
- package/dist/components/{Partition.svelte → hierarchy/Partition.svelte} +4 -3
- package/dist/components/{Partition.svelte.d.ts → hierarchy/Partition.svelte.d.ts} +12 -4
- package/dist/components/{Tree.svelte → hierarchy/Tree.svelte} +11 -6
- package/dist/components/{Tree.svelte.d.ts → hierarchy/Tree.svelte.d.ts} +12 -4
- package/dist/components/hierarchy/Treemap.svelte +203 -0
- package/dist/components/{Treemap.svelte.d.ts → hierarchy/Treemap.svelte.d.ts} +23 -15
- package/dist/components/hierarchy/index.d.ts +8 -0
- package/dist/components/hierarchy/index.js +8 -0
- package/dist/components/index.d.ts +41 -47
- package/dist/components/index.js +41 -48
- package/dist/components/layers/Canvas.svelte +502 -0
- package/dist/components/{layout → layers}/Canvas.svelte.d.ts +17 -37
- package/dist/components/{layout → layers}/Html.svelte +34 -16
- package/dist/components/{layout → layers}/Html.svelte.d.ts +7 -0
- package/dist/components/layers/Layer.svelte +85 -0
- package/dist/components/layers/Layer.svelte.d.ts +23 -0
- package/dist/components/{layout → layers}/Svg.svelte +38 -18
- package/dist/components/{layout → layers}/Svg.svelte.d.ts +7 -0
- package/dist/components/{layout → layers}/WebGL.svelte +27 -7
- package/dist/components/{layout → layers}/WebGL.svelte.d.ts +8 -5
- package/dist/components/tests/BrushTestHarness.svelte +27 -0
- package/dist/components/tests/BrushTestHarness.svelte.d.ts +8 -0
- package/dist/components/tests/TestHarness.svelte +87 -0
- package/dist/components/tests/TestHarness.svelte.d.ts +21 -0
- package/dist/components/tests/TransformTestHarness.svelte +27 -0
- package/dist/components/tests/TransformTestHarness.svelte.d.ts +8 -0
- package/dist/components/tooltip/Tooltip.svelte +239 -93
- package/dist/components/tooltip/Tooltip.svelte.d.ts +28 -14
- package/dist/components/tooltip/Tooltip.svelte.test.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.svelte.test.js +294 -0
- package/dist/components/tooltip/TooltipContext.svelte +440 -243
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +37 -21
- package/dist/components/tooltip/TooltipHeader.svelte +32 -18
- package/dist/components/tooltip/TooltipHeader.svelte.d.ts +3 -3
- package/dist/components/tooltip/TooltipItem.svelte +57 -37
- package/dist/components/tooltip/TooltipItem.svelte.d.ts +3 -3
- package/dist/components/tooltip/TooltipList.svelte +12 -10
- package/dist/components/tooltip/TooltipSeparator.svelte +18 -10
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-portal-tooltip-to-a-custom-selector-target-1.png +0 -0
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-portal-tooltip-to-a-custom-selector-target-2.png +0 -0
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-render-tooltip-inline-when-portal-is-false-1.png +0 -0
- package/dist/components/tooltip/__screenshots__/Tooltip.svelte.test.ts/Tooltip-portal-should-render-tooltip-inline-when-portal-is-false-2.png +0 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/contexts/canvas.d.ts +34 -0
- package/dist/contexts/canvas.js +14 -0
- package/dist/contexts/chart.d.ts +6 -0
- package/dist/contexts/chart.js +50 -0
- package/dist/contexts/componentTree.test.d.ts +1 -0
- package/dist/contexts/componentTree.test.js +83 -0
- package/dist/contexts/geo.d.ts +4 -0
- package/dist/contexts/geo.js +11 -0
- package/dist/contexts/index.d.ts +5 -0
- package/dist/contexts/index.js +5 -0
- package/dist/contexts/layer.d.ts +3 -0
- package/dist/contexts/layer.js +8 -0
- package/dist/contexts/settings.d.ts +4 -0
- package/dist/contexts/settings.js +10 -0
- package/dist/contexts/transform.d.ts +96 -0
- package/dist/contexts/transform.js +10 -0
- package/dist/force.d.ts +1 -0
- package/dist/force.js +1 -0
- package/dist/geo.d.ts +1 -0
- package/dist/geo.js +1 -0
- package/dist/graph.d.ts +1 -0
- package/dist/graph.js +1 -0
- package/dist/hierarchy.d.ts +1 -0
- package/dist/hierarchy.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/server/ContextCapture.svelte +30 -0
- package/dist/server/ContextCapture.svelte.d.ts +8 -0
- package/dist/server/ServerChart.svelte +26 -0
- package/dist/server/ServerChart.svelte.d.ts +11 -0
- package/dist/server/TestBarChart.svelte +35 -0
- package/dist/server/TestBarChart.svelte.d.ts +14 -0
- package/dist/server/TestLineChart.svelte +35 -0
- package/dist/server/TestLineChart.svelte.d.ts +14 -0
- package/dist/server/captureStore.d.ts +8 -0
- package/dist/server/captureStore.js +18 -0
- package/dist/server/index.d.ts +137 -0
- package/dist/server/index.js +141 -0
- package/dist/server/renderChart.ssr.test.d.ts +1 -0
- package/dist/server/renderChart.ssr.test.js +205 -0
- package/dist/server/renderTree.d.ts +8 -0
- package/dist/server/renderTree.js +29 -0
- package/dist/states/__fixtures__/ComponentNodeLifecycleChild.svelte +13 -0
- package/dist/{docs/Json.svelte.d.ts → states/__fixtures__/ComponentNodeLifecycleChild.svelte.d.ts} +4 -8
- 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.component-node.svelte.test.ts/ChartState-registerComponent-cleans-up-child-nodes-and-mark-registrations-when-components-unmount-1.png +0 -0
- package/dist/states/__screenshots__/chart.component-node.svelte.test.ts/ChartState-registerComponent-cleans-up-child-nodes-and-mark-registrations-when-components-unmount-2.png +0 -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-geo-projection-skips-markInfo-should-not-derive-x-y-accessors-from-marks-when-geo-projection-is-active-1.png +0 -0
- package/dist/states/__screenshots__/chart.svelte.test.ts/ChartState-geo-projection-skips-markInfo-should-not-derive-x-y-accessors-from-marks-when-geo-projection-is-active-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 +99 -0
- package/dist/states/brush.svelte.js +249 -0
- package/dist/states/brush.svelte.test.d.ts +1 -0
- package/dist/states/brush.svelte.test.js +417 -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 +264 -0
- package/dist/states/chart.svelte.js +1092 -0
- package/dist/states/chart.svelte.test.d.ts +1 -0
- package/dist/states/chart.svelte.test.js +1635 -0
- package/dist/states/geo.svelte.d.ts +49 -0
- package/dist/states/geo.svelte.js +97 -0
- package/dist/states/series.svelte.d.ts +83 -0
- package/dist/states/series.svelte.js +248 -0
- package/dist/states/series.svelte.test.d.ts +1 -0
- package/dist/states/series.svelte.test.js +333 -0
- package/dist/states/settings.svelte.d.ts +12 -0
- package/dist/states/settings.svelte.js +10 -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 +175 -0
- package/dist/states/transform.svelte.js +408 -0
- package/dist/styles/daisyui-5.css +6 -0
- package/dist/styles/shadcn-svelte.css +11 -0
- package/dist/styles/skeleton-3.css +15 -0
- package/dist/styles/skeleton-4.css +15 -0
- 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-composes-element-opacity-with-inherited-globalAlpha--Group-opacity--1.png +0 -0
- package/dist/utils/__screenshots__/canvas.svelte.test.ts/renderPathData-composes-element-opacity-with-inherited-globalAlpha--Group-opacity--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/arcText.svelte.d.ts +8 -2
- package/dist/utils/arcText.svelte.js +12 -8
- package/dist/utils/array.d.ts +11 -0
- package/dist/utils/array.js +23 -0
- package/dist/utils/array.test.d.ts +1 -0
- package/dist/utils/array.test.js +200 -0
- package/dist/utils/attributes.d.ts +3 -13
- package/dist/utils/attributes.js +4 -18
- package/dist/utils/canvas.d.ts +85 -0
- package/dist/utils/canvas.js +238 -56
- package/dist/utils/canvas.svelte.test.d.ts +1 -0
- package/dist/utils/canvas.svelte.test.js +758 -0
- package/dist/utils/chart.js +8 -0
- package/dist/utils/color.js +11 -8
- package/dist/utils/common.d.ts +19 -3
- package/dist/utils/common.js +29 -10
- package/dist/utils/common.test.js +35 -1
- package/dist/utils/dataProp.d.ts +112 -0
- package/dist/utils/dataProp.js +125 -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/genData.d.ts +22 -8
- package/dist/utils/genData.js +34 -14
- package/dist/utils/graph/dagre.js +6 -8
- package/dist/utils/graph/sankey.js +9 -7
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/linkUtils.d.ts +42 -0
- package/dist/utils/linkUtils.js +280 -0
- package/dist/utils/math.d.ts +17 -0
- package/dist/utils/math.js +17 -0
- package/dist/utils/motion.svelte.d.ts +26 -2
- package/dist/utils/motion.svelte.js +99 -2
- package/dist/utils/motion.test.js +49 -1
- package/dist/utils/path.d.ts +73 -1
- package/dist/utils/path.js +219 -17
- package/dist/utils/rasterBounds.d.ts +18 -0
- package/dist/utils/rasterBounds.js +98 -0
- package/dist/utils/rasterBounds.test.d.ts +1 -0
- package/dist/utils/rasterBounds.test.js +63 -0
- package/dist/utils/rasterInterpolate.d.ts +11 -0
- package/dist/utils/rasterInterpolate.js +103 -0
- package/dist/utils/rect.svelte.d.ts +29 -4
- package/dist/utils/rect.svelte.js +120 -7
- package/dist/utils/scales.svelte.d.ts +10 -4
- package/dist/utils/scales.svelte.js +60 -13
- package/dist/utils/scales.svelte.test.d.ts +1 -0
- package/dist/utils/scales.svelte.test.js +67 -0
- package/dist/utils/shape.d.ts +43 -0
- package/dist/utils/shape.js +59 -0
- package/dist/utils/stack.js +1 -1
- package/dist/utils/stats.d.ts +33 -0
- package/dist/utils/stats.js +79 -0
- package/dist/utils/string.d.ts +51 -0
- package/dist/utils/string.js +4 -2
- package/dist/utils/ticks.d.ts +15 -4
- package/dist/utils/ticks.js +147 -162
- package/dist/utils/ticks.test.js +26 -26
- package/dist/utils/trail.d.ts +36 -0
- package/dist/utils/trail.js +340 -0
- package/dist/utils/treemap.d.ts +1 -1
- package/dist/utils/types.d.ts +28 -2
- package/package.json +78 -57
- package/README.md +0 -41
- package/dist/components/Connector.svelte +0 -149
- package/dist/components/Connector.svelte.d.ts +0 -51
- package/dist/components/ForceSimulation.svelte.d.ts +0 -84
- package/dist/components/GeoContext.svelte +0 -176
- package/dist/components/GeoContext.svelte.d.ts +0 -52
- package/dist/components/GeoPath.svelte +0 -197
- package/dist/components/GeoPoint.svelte +0 -74
- package/dist/components/GeoSpline.svelte +0 -85
- package/dist/components/TransformControls.svelte +0 -179
- package/dist/components/TransformControls.svelte.d.ts +0 -28
- package/dist/components/Treemap.svelte +0 -165
- package/dist/components/charts/utils.svelte.d.ts +0 -30
- package/dist/components/charts/utils.svelte.js +0 -59
- package/dist/components/layout/Canvas.svelte +0 -505
- package/dist/components/layout/Layer.svelte +0 -39
- package/dist/components/layout/Layer.svelte.d.ts +0 -17
- package/dist/components/tooltip/tooltipMetaContext.d.ts +0 -79
- package/dist/components/tooltip/tooltipMetaContext.js +0 -139
- package/dist/docs/Blockquote.svelte +0 -15
- package/dist/docs/Code.svelte +0 -38
- package/dist/docs/Code.svelte.d.ts +0 -29
- package/dist/docs/ConnectorSweepMenuField.svelte +0 -17
- package/dist/docs/ConnectorSweepMenuField.svelte.d.ts +0 -7
- package/dist/docs/ConnectorTypeMenuField.svelte +0 -17
- package/dist/docs/ConnectorTypeMenuField.svelte.d.ts +0 -7
- package/dist/docs/CurveMenuField.svelte +0 -44
- package/dist/docs/CurveMenuField.svelte.d.ts +0 -9
- package/dist/docs/GeoDebug.svelte +0 -60
- package/dist/docs/GeoDebug.svelte.d.ts +0 -4
- package/dist/docs/Header1.svelte +0 -14
- package/dist/docs/Header1.svelte.d.ts +0 -29
- package/dist/docs/Json.svelte +0 -28
- package/dist/docs/Layout.svelte +0 -18
- package/dist/docs/Layout.svelte.d.ts +0 -23
- package/dist/docs/Link.svelte +0 -5
- package/dist/docs/Link.svelte.d.ts +0 -39
- package/dist/docs/PathDataMenuField.svelte +0 -78
- package/dist/docs/PathDataMenuField.svelte.d.ts +0 -9
- package/dist/docs/Preview.svelte +0 -105
- package/dist/docs/Preview.svelte.d.ts +0 -14
- package/dist/docs/TilesetField.svelte +0 -135
- package/dist/docs/TilesetField.svelte.d.ts +0 -23
- package/dist/docs/TransformDebug.svelte +0 -22
- package/dist/docs/TransformDebug.svelte.d.ts +0 -20
- package/dist/docs/ViewSourceButton.svelte +0 -50
- package/dist/docs/ViewSourceButton.svelte.d.ts +0 -25
- package/dist/utils/connectorUtils.d.ts +0 -21
- package/dist/utils/connectorUtils.js +0 -111
- package/dist/utils/graph/dagre.d.ts +0 -34
- package/dist/utils/object.js +0 -2
- /package/dist/components/{GeoVisible.svelte.d.ts → geo/GeoVisible.svelte.d.ts} +0 -0
- /package/dist/components/{Dagre.svelte.d.ts → graph/Dagre.svelte.d.ts} +0 -0
- /package/dist/components/{Sankey.svelte.d.ts → graph/Sankey.svelte.d.ts} +0 -0
- /package/dist/{utils → contexts}/legendPayload.d.ts +0 -0
- /package/dist/{utils → contexts}/legendPayload.js +0 -0
|
@@ -0,0 +1,1092 @@
|
|
|
1
|
+
import { untrack } from 'svelte';
|
|
2
|
+
import { scaleBand, scaleOrdinal, scaleSqrt, scaleTime } from 'd3-scale';
|
|
3
|
+
import { extent, max, min } from 'd3-array';
|
|
4
|
+
import { unique } from '@layerstack/utils';
|
|
5
|
+
import { Context, useDebounce } from 'runed';
|
|
6
|
+
import { getCanvasContext } from '../contexts/canvas.js';
|
|
7
|
+
import { autoScale, createScale, getRange, isScaleBand, isScaleTime, makeAccessor, } from '../utils/scales.svelte.js';
|
|
8
|
+
import { accessor, chartDataArray, defaultChartPadding } from '../utils/common.js';
|
|
9
|
+
import { filterObject } from '../utils/filterObject.js';
|
|
10
|
+
import { calcDomain, calcScaleExtents, createGetter, createChartScale } from '../utils/chart.js';
|
|
11
|
+
import { printDebug } from '../utils/debug.js';
|
|
12
|
+
import { GeoState } from './geo.svelte.js';
|
|
13
|
+
import { SeriesState } from './series.svelte.js';
|
|
14
|
+
import { createControlledMotion, parseMotionProp } from '../utils/motion.svelte.js';
|
|
15
|
+
const defaultPadding = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
16
|
+
/** Stable empty array to avoid creating new [] references on each reactive update */
|
|
17
|
+
const EMPTY_SERIES = [];
|
|
18
|
+
/** Svelte context key for tracking the nearest parent ComponentNode. */
|
|
19
|
+
const _ParentNodeContext = new Context('ComponentTreeParent');
|
|
20
|
+
export class ChartState {
|
|
21
|
+
// Props getter function - set in constructor
|
|
22
|
+
_propsGetter;
|
|
23
|
+
// Props - accessed via getter function for fine-grained reactivity
|
|
24
|
+
props = $derived(this._propsGetter());
|
|
25
|
+
// State / contexts
|
|
26
|
+
geoState;
|
|
27
|
+
transformState = $state(null);
|
|
28
|
+
tooltipState = $state(null);
|
|
29
|
+
brushState = $state(null);
|
|
30
|
+
// TODO: handle TComponent
|
|
31
|
+
seriesState;
|
|
32
|
+
// Container dimensions
|
|
33
|
+
_containerWidth = $state(100);
|
|
34
|
+
_containerHeight = $state(100);
|
|
35
|
+
// Mount state
|
|
36
|
+
isMounted = $state(false);
|
|
37
|
+
// Mark registration — marks register stable MarkInfo snapshots on mount for
|
|
38
|
+
// domain/series calculation. Snapshots are updated via $effect (not $derived)
|
|
39
|
+
// in registerComponent, so reads here never create circular derived refs.
|
|
40
|
+
// Composite marks set insideCompositeMark context so child marks skip registration.
|
|
41
|
+
//
|
|
42
|
+
// Use a plain array + reactive version counter instead of $state<array> so that
|
|
43
|
+
// registerMark() never reads $state during execution. If it did (e.g. spreading
|
|
44
|
+
// a $state array), calling registerMark() from a $effect would subscribe that
|
|
45
|
+
// effect to _markInfos changes, then the effect's own write would trigger it to
|
|
46
|
+
// re-run → infinite loop.
|
|
47
|
+
_markInfosRaw = [];
|
|
48
|
+
_markInfosVersion = $state(0);
|
|
49
|
+
_nextMarkId = 0;
|
|
50
|
+
/** Reactive accessor — reads _markInfosVersion to create a reactive dependency,
|
|
51
|
+
* returns the plain array so items are never wrapped in Svelte proxies.
|
|
52
|
+
*
|
|
53
|
+
* When a geo projection is active, strips x/y/data from mark info — those
|
|
54
|
+
* values are geographic coordinates handled by the projection, not xScale/yScale.
|
|
55
|
+
* seriesKey/color/label are preserved so marks can still contribute to legends. */
|
|
56
|
+
get _markInfos() {
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
58
|
+
this._markInfosVersion;
|
|
59
|
+
if (this.geoState.props.projection) {
|
|
60
|
+
return this._markInfosRaw.map(({ _id, info }) => ({
|
|
61
|
+
_id,
|
|
62
|
+
info: {
|
|
63
|
+
seriesKey: info.seriesKey,
|
|
64
|
+
color: info.color,
|
|
65
|
+
label: info.label,
|
|
66
|
+
},
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
return this._markInfosRaw;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Register a mark with the chart. The MarkInfo snapshot is stored directly
|
|
73
|
+
* (not inside $derived) so chart deriveds can read _markInfos without creating
|
|
74
|
+
* circular references. Returns a cleanup function to call on unmount.
|
|
75
|
+
*
|
|
76
|
+
* For use in tests or synchronous contexts. In components, use `registerComponent` with `markInfo`.
|
|
77
|
+
*/
|
|
78
|
+
registerMark(info) {
|
|
79
|
+
const id = ++this._nextMarkId;
|
|
80
|
+
this._markInfosRaw.push({ _id: id, info });
|
|
81
|
+
this._markInfosVersion++;
|
|
82
|
+
return () => {
|
|
83
|
+
const idx = this._markInfosRaw.findIndex((r) => r._id === id);
|
|
84
|
+
if (idx !== -1)
|
|
85
|
+
this._markInfosRaw.splice(idx, 1);
|
|
86
|
+
this._markInfosVersion++;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Register a component tree node. Call at the top level of a component's <script> block.
|
|
91
|
+
* Sets self as context for children, handles canvas deps/cleanup, and mark registration.
|
|
92
|
+
*/
|
|
93
|
+
registerComponent(options) {
|
|
94
|
+
const { name, kind, canvasRender, markInfo } = options;
|
|
95
|
+
const parent = _ParentNodeContext.getOr(null);
|
|
96
|
+
// Walk ancestors to check for composite-mark
|
|
97
|
+
let insideCompositeMark = false;
|
|
98
|
+
let ancestor = parent;
|
|
99
|
+
while (ancestor) {
|
|
100
|
+
if (ancestor.kind === 'composite-mark') {
|
|
101
|
+
insideCompositeMark = true;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
ancestor = ancestor.parent;
|
|
105
|
+
}
|
|
106
|
+
const node = {
|
|
107
|
+
id: Symbol(name),
|
|
108
|
+
kind,
|
|
109
|
+
name,
|
|
110
|
+
parent,
|
|
111
|
+
children: [],
|
|
112
|
+
canvasRender: canvasRender,
|
|
113
|
+
insideCompositeMark,
|
|
114
|
+
};
|
|
115
|
+
if (parent)
|
|
116
|
+
parent.children.push(node);
|
|
117
|
+
_ParentNodeContext.set(node);
|
|
118
|
+
const canvasCtx = canvasRender ? getCanvasContext() : null;
|
|
119
|
+
if (canvasRender) {
|
|
120
|
+
if (canvasRender.deps) {
|
|
121
|
+
$effect.pre(() => {
|
|
122
|
+
canvasRender.deps?.();
|
|
123
|
+
canvasCtx?.invalidate();
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
canvasCtx.invalidate();
|
|
127
|
+
}
|
|
128
|
+
$effect.pre(() => {
|
|
129
|
+
return () => {
|
|
130
|
+
this._removeComponentNode(node);
|
|
131
|
+
canvasCtx?.invalidate();
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
if (markInfo && !insideCompositeMark) {
|
|
135
|
+
$effect(() => {
|
|
136
|
+
const info = markInfo();
|
|
137
|
+
// Skip registration for empty mark info (e.g. pixel-mode marks)
|
|
138
|
+
// to avoid unnecessary array push/splice and version bumps
|
|
139
|
+
if (!info.x && !info.y && !info.data && !info.color && !info.seriesKey && !info.label)
|
|
140
|
+
return;
|
|
141
|
+
return untrack(() => this.registerMark(info));
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return node;
|
|
145
|
+
}
|
|
146
|
+
_removeComponentNode(node) {
|
|
147
|
+
if (node.parent) {
|
|
148
|
+
const idx = node.parent.children.indexOf(node);
|
|
149
|
+
if (idx >= 0)
|
|
150
|
+
node.parent.children.splice(idx, 1);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Container ref (set from Chart.svelte)
|
|
154
|
+
containerRef = $state();
|
|
155
|
+
// Domain motion (animates base domain changes for smooth scale transitions)
|
|
156
|
+
_xDomainMotion = null;
|
|
157
|
+
_yDomainMotion = null;
|
|
158
|
+
_xDomainIsDate = false;
|
|
159
|
+
_yDomainIsDate = false;
|
|
160
|
+
// Meta data - reactive to props.meta changes
|
|
161
|
+
meta = $derived(this.props.meta ?? {});
|
|
162
|
+
constructor(propsGetter) {
|
|
163
|
+
this._propsGetter = propsGetter;
|
|
164
|
+
// Create GeoState instance — pass a dimensions getter so projection
|
|
165
|
+
// is available during SSR (where $effect doesn't run)
|
|
166
|
+
this.geoState = new GeoState(() => this.props.geo ?? {}, () => ({ width: this.width, height: this.height }));
|
|
167
|
+
// Create SeriesState internally from series/seriesLayout props.
|
|
168
|
+
// When no explicit series are provided, derive implicit series from mark registrations.
|
|
169
|
+
this.seriesState = new SeriesState(() => {
|
|
170
|
+
const explicit = this.props.series;
|
|
171
|
+
if (explicit && explicit.length > 0)
|
|
172
|
+
return explicit;
|
|
173
|
+
// Generate implicit series from registered marks.
|
|
174
|
+
// Use the value axis accessor (y for horizontal charts, x for vertical).
|
|
175
|
+
const valueAxis = this.valueAxis;
|
|
176
|
+
const chartValueProp = valueAxis === 'y' ? this.props.y : this.props.x;
|
|
177
|
+
const chartValueKeys = Array.isArray(chartValueProp)
|
|
178
|
+
? chartValueProp.filter((k) => typeof k === 'string')
|
|
179
|
+
: typeof chartValueProp === 'string'
|
|
180
|
+
? [chartValueProp]
|
|
181
|
+
: [];
|
|
182
|
+
const chartHasOwnData = this.props.data != null &&
|
|
183
|
+
(!Array.isArray(this.props.data) || this.props.data.length > 0);
|
|
184
|
+
const implicitSeries = [];
|
|
185
|
+
for (const { info } of this._markInfos) {
|
|
186
|
+
const valueAccessor = valueAxis === 'y' ? info.y : info.x;
|
|
187
|
+
const key = info.seriesKey ??
|
|
188
|
+
(typeof valueAccessor === 'string' ? valueAccessor : undefined);
|
|
189
|
+
if (!key)
|
|
190
|
+
continue;
|
|
191
|
+
// Skip if the mark's key matches one of the chart's axis accessors.
|
|
192
|
+
// When the chart has its own data, any mark using that accessor is just
|
|
193
|
+
// decorating (e.g. a filtered label subset), not defining a new series.
|
|
194
|
+
// Without explicit chart data, still skip unless the mark has its own
|
|
195
|
+
// dataset (multi-dataset scenario).
|
|
196
|
+
if (chartValueKeys.includes(key) && (chartHasOwnData || !info.data))
|
|
197
|
+
continue;
|
|
198
|
+
if (implicitSeries.some((s) => s.key === key))
|
|
199
|
+
continue;
|
|
200
|
+
implicitSeries.push({
|
|
201
|
+
key,
|
|
202
|
+
color: info.color,
|
|
203
|
+
label: info.label,
|
|
204
|
+
value: valueAccessor,
|
|
205
|
+
data: info.data,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return implicitSeries.length > 0 ? implicitSeries : EMPTY_SERIES;
|
|
209
|
+
}, () => {
|
|
210
|
+
const layout = this.props.seriesLayout;
|
|
211
|
+
if (!layout || !layout.startsWith('stack'))
|
|
212
|
+
return null;
|
|
213
|
+
const series = this.props.series ?? [];
|
|
214
|
+
const keyBy = this.valueAxis === 'y' ? this.props.x : this.props.y;
|
|
215
|
+
const hasSeparateData = series.some((s) => s.data != null);
|
|
216
|
+
return {
|
|
217
|
+
layout: layout,
|
|
218
|
+
data: hasSeparateData ? undefined : chartDataArray(this.props.data),
|
|
219
|
+
keyBy: keyBy,
|
|
220
|
+
valueAccessor: this.valueAxis === 'y' ? this.props.y : this.props.x,
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
const logDebug = useDebounce(printDebug, 200);
|
|
224
|
+
// Set mounted state once component initializes
|
|
225
|
+
$effect(() => {
|
|
226
|
+
this.isMounted = true;
|
|
227
|
+
});
|
|
228
|
+
// Sync chart dimensions to geo state
|
|
229
|
+
$effect(() => {
|
|
230
|
+
this.geoState.chartWidth = this.width;
|
|
231
|
+
this.geoState.chartHeight = this.height;
|
|
232
|
+
});
|
|
233
|
+
// Sync transform state to geo state
|
|
234
|
+
$effect(() => {
|
|
235
|
+
if (this.transformState) {
|
|
236
|
+
this.geoState.transformState = this.transformState;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
// Call onResize callback when dimensions change
|
|
240
|
+
$effect(() => {
|
|
241
|
+
if (!this.isMounted)
|
|
242
|
+
return;
|
|
243
|
+
this.props.onResize?.({
|
|
244
|
+
width: this.width,
|
|
245
|
+
height: this.height,
|
|
246
|
+
containerWidth: this.containerWidth,
|
|
247
|
+
containerHeight: this.containerHeight,
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
// Debug logging when mounted
|
|
251
|
+
$effect(() => {
|
|
252
|
+
if (!this.isMounted ||
|
|
253
|
+
!this.props.debug ||
|
|
254
|
+
(!this.props.ssr && typeof window === 'undefined')) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (this.box) {
|
|
258
|
+
logDebug({
|
|
259
|
+
data: this.data,
|
|
260
|
+
flatData: this.flatData,
|
|
261
|
+
boundingBox: this.box,
|
|
262
|
+
activeGetters: this.activeGetters,
|
|
263
|
+
x: this.props.x,
|
|
264
|
+
y: this.props.y,
|
|
265
|
+
z: this.props.z,
|
|
266
|
+
r: this.props.r,
|
|
267
|
+
xScale: this.xScale,
|
|
268
|
+
yScale: this.yScale,
|
|
269
|
+
zScale: this.zScale,
|
|
270
|
+
rScale: this.rScale,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
// Set up domain motion if motion prop is configured
|
|
275
|
+
const motionProp = propsGetter().motion;
|
|
276
|
+
if (motionProp) {
|
|
277
|
+
const resolved = parseMotionProp(motionProp);
|
|
278
|
+
this._xDomainMotion = createControlledMotion([], resolved);
|
|
279
|
+
this._yDomainMotion = createControlledMotion([], resolved);
|
|
280
|
+
let xInit = false;
|
|
281
|
+
let yInit = false;
|
|
282
|
+
$effect(() => {
|
|
283
|
+
const domain = this._rawXDomain;
|
|
284
|
+
if (!domain || domain.length < 2)
|
|
285
|
+
return;
|
|
286
|
+
const isDate = domain[0] instanceof Date;
|
|
287
|
+
this._xDomainIsDate = isDate;
|
|
288
|
+
const numeric = isDate ? domain.map((d) => d.getTime()) : [...domain];
|
|
289
|
+
// Skip animation on first value to avoid mount transition
|
|
290
|
+
if (!xInit) {
|
|
291
|
+
xInit = true;
|
|
292
|
+
const instant = this._xDomainMotion.type === 'spring'
|
|
293
|
+
? { instant: true }
|
|
294
|
+
: this._xDomainMotion.type === 'tween'
|
|
295
|
+
? { duration: 0 }
|
|
296
|
+
: undefined;
|
|
297
|
+
this._xDomainMotion.set(numeric, instant);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
this._xDomainMotion.set(numeric);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
$effect(() => {
|
|
304
|
+
const domain = this._rawYDomain;
|
|
305
|
+
if (!domain || domain.length < 2)
|
|
306
|
+
return;
|
|
307
|
+
const isDate = domain[0] instanceof Date;
|
|
308
|
+
this._yDomainIsDate = isDate;
|
|
309
|
+
const numeric = isDate ? domain.map((d) => d.getTime()) : [...domain];
|
|
310
|
+
if (!yInit) {
|
|
311
|
+
yInit = true;
|
|
312
|
+
const instant = this._yDomainMotion.type === 'spring'
|
|
313
|
+
? { instant: true }
|
|
314
|
+
: this._yDomainMotion.type === 'tween'
|
|
315
|
+
? { duration: 0 }
|
|
316
|
+
: undefined;
|
|
317
|
+
this._yDomainMotion.set(numeric, instant);
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
this._yDomainMotion.set(numeric);
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// Use $derived fields instead of getters for caching
|
|
326
|
+
containerWidth = $derived(this.props.width ?? this._containerWidth);
|
|
327
|
+
containerHeight = $derived(this.props.height ?? this._containerHeight);
|
|
328
|
+
// When `<Chart data>` is passed with a non-empty dataset, it's canonical —
|
|
329
|
+
// marks with their own `data` (e.g. filtered label subsets) still contribute
|
|
330
|
+
// to `flatData` for domain calculation but don't replace iteration data.
|
|
331
|
+
// Otherwise fall back to `visibleSeriesData` so simplified charts that pass
|
|
332
|
+
// data via series definitions still work, with reactive recomputation when
|
|
333
|
+
// series are shown/hidden via legend.
|
|
334
|
+
data = $derived.by(() => {
|
|
335
|
+
const propsData = this.props.data;
|
|
336
|
+
if (propsData != null && (!Array.isArray(propsData) || propsData.length > 0)) {
|
|
337
|
+
return propsData;
|
|
338
|
+
}
|
|
339
|
+
if (this.seriesState?.visibleSeriesData?.length) {
|
|
340
|
+
return this.seriesState.visibleSeriesData;
|
|
341
|
+
}
|
|
342
|
+
return [];
|
|
343
|
+
});
|
|
344
|
+
flatData = $derived.by(() => {
|
|
345
|
+
const base = (this.props.flatData ?? this.data);
|
|
346
|
+
// Include data from marks that have their own data but aren't already in a series.
|
|
347
|
+
// Include data from marks that have their own data but aren't already in a series
|
|
348
|
+
const extra = [];
|
|
349
|
+
for (const { info } of this._markInfos) {
|
|
350
|
+
if (!info.data)
|
|
351
|
+
continue;
|
|
352
|
+
// If this mark's exact data array is already included via a series, skip it.
|
|
353
|
+
// Use reference equality (===) so marks sharing the same accessor key but
|
|
354
|
+
// different data arrays (e.g. two Circle marks with separate datasets) are
|
|
355
|
+
// both included in domain calculation.
|
|
356
|
+
const key = info.seriesKey ?? (typeof info.y === 'string' ? info.y : undefined);
|
|
357
|
+
if (key && this.seriesState?.series.some((s) => s.key === key && s.data === info.data))
|
|
358
|
+
continue;
|
|
359
|
+
extra.push(...info.data);
|
|
360
|
+
}
|
|
361
|
+
if (extra.length === 0)
|
|
362
|
+
return base;
|
|
363
|
+
return [...base, ...extra];
|
|
364
|
+
});
|
|
365
|
+
// Cached scale props - use this.flatData which derives from seriesState.visibleSeriesData when available
|
|
366
|
+
_xScaleProp = $derived.by(() => {
|
|
367
|
+
if (this.props.xScale)
|
|
368
|
+
return this.props.xScale;
|
|
369
|
+
// When xInterval is set, use scaleTime (takes precedence over bandPadding)
|
|
370
|
+
if (this.props.xInterval)
|
|
371
|
+
return scaleTime();
|
|
372
|
+
// When bandPadding is set and x is the category axis, use scaleBand with padding
|
|
373
|
+
if (this.props.bandPadding != null && this.valueAxis === 'y') {
|
|
374
|
+
return scaleBand().padding(this.props.bandPadding);
|
|
375
|
+
}
|
|
376
|
+
return autoScale(this.props.xDomain, this.flatData, this.x);
|
|
377
|
+
});
|
|
378
|
+
_yScaleProp = $derived.by(() => {
|
|
379
|
+
if (this.props.yScale)
|
|
380
|
+
return this.props.yScale;
|
|
381
|
+
// When yInterval is set, use scaleTime (takes precedence over bandPadding)
|
|
382
|
+
if (this.props.yInterval)
|
|
383
|
+
return scaleTime();
|
|
384
|
+
// When bandPadding is set and y is the category axis, use scaleBand with padding
|
|
385
|
+
if (this.props.bandPadding != null && this.valueAxis === 'x') {
|
|
386
|
+
return scaleBand().padding(this.props.bandPadding);
|
|
387
|
+
}
|
|
388
|
+
return autoScale(this.props.yDomain, this.flatData, this.y);
|
|
389
|
+
});
|
|
390
|
+
_zScaleProp = $derived.by(() => {
|
|
391
|
+
return this.props.zScale ?? autoScale(this.props.zDomain, this.flatData, this.props.z);
|
|
392
|
+
});
|
|
393
|
+
_rScaleProp = $derived(this.props.rScale ?? scaleSqrt());
|
|
394
|
+
xRangeProp = $derived(this.props.xRange ? this.props.xRange : this.props.radial ? [0, 2 * Math.PI] : undefined);
|
|
395
|
+
yRangeProp = $derived(this.props.yRange ??
|
|
396
|
+
(this.props.radial ? ({ height }) => [0, height / 2] : undefined));
|
|
397
|
+
/** Transform-aware range for band scales in domain mode (D3 range-rescaling pattern) */
|
|
398
|
+
_xScaleRange = $derived.by(() => {
|
|
399
|
+
if (this.transformState?.mode === 'domain' &&
|
|
400
|
+
(this.transformState.axis === 'x' || this.transformState.axis === 'both') &&
|
|
401
|
+
isScaleBand(this._xScaleProp) &&
|
|
402
|
+
this.width > 0) {
|
|
403
|
+
const { scale, translate } = this.transformState;
|
|
404
|
+
return [translate.x, translate.x + this.width * scale];
|
|
405
|
+
}
|
|
406
|
+
return this.xRangeProp;
|
|
407
|
+
});
|
|
408
|
+
_yScaleRange = $derived.by(() => {
|
|
409
|
+
if (this.transformState?.mode === 'domain' &&
|
|
410
|
+
(this.transformState.axis === 'y' || this.transformState.axis === 'both') &&
|
|
411
|
+
isScaleBand(this._yScaleProp) &&
|
|
412
|
+
this.height > 0) {
|
|
413
|
+
const { scale, translate } = this.transformState;
|
|
414
|
+
return [translate.y, translate.y + this.height * scale];
|
|
415
|
+
}
|
|
416
|
+
return this.yRangeProp;
|
|
417
|
+
});
|
|
418
|
+
yReverse = $derived(!isScaleBand(this._yScaleProp) && !isScaleTime(this._yScaleProp));
|
|
419
|
+
resolveAccessor(axis) {
|
|
420
|
+
const axisAccessor = axis === 'x' ? this.props.x : this.props.y;
|
|
421
|
+
if (axisAccessor) {
|
|
422
|
+
return makeAccessor(axisAccessor);
|
|
423
|
+
}
|
|
424
|
+
else if (this.valueAxis === axis && this.seriesState && !this.seriesState.isDefaultSeries) {
|
|
425
|
+
// Derive accessor from series (explicit or mark-implied) values/keys
|
|
426
|
+
return accessor(this.seriesState.series.map((s) => s.value ?? s.key));
|
|
427
|
+
}
|
|
428
|
+
// Derive position axis accessor from registered marks when not set on the Chart.
|
|
429
|
+
// This allows marks like <Circle cx="date" cy="value" /> to define the axes
|
|
430
|
+
// without requiring x/y on the Chart itself.
|
|
431
|
+
const markAxisKeys = [];
|
|
432
|
+
for (const { info } of this._markInfos) {
|
|
433
|
+
const markKey = axis === 'x' ? info.x : info.y;
|
|
434
|
+
if (typeof markKey === 'string' && !markAxisKeys.includes(markKey)) {
|
|
435
|
+
markAxisKeys.push(markKey);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (markAxisKeys.length > 0) {
|
|
439
|
+
return accessor(markAxisKeys.length === 1 ? markAxisKeys[0] : markAxisKeys);
|
|
440
|
+
}
|
|
441
|
+
// No accessor available — identity function
|
|
442
|
+
return makeAccessor(axisAccessor);
|
|
443
|
+
}
|
|
444
|
+
x = $derived(this.resolveAccessor('x'));
|
|
445
|
+
y = $derived(this.resolveAccessor('y'));
|
|
446
|
+
z = $derived(makeAccessor(this.props.z));
|
|
447
|
+
r = $derived(makeAccessor(this.props.r));
|
|
448
|
+
c = $derived(accessor(this.props.c));
|
|
449
|
+
x1 = $derived(makeAccessor(this.props.x1));
|
|
450
|
+
y1 = $derived(makeAccessor(this.props.y1));
|
|
451
|
+
filteredExtents = $derived(filterObject($state.snapshot(this.props.extents ?? {})));
|
|
452
|
+
activeGetters = $derived({
|
|
453
|
+
x: this.x,
|
|
454
|
+
y: this.y,
|
|
455
|
+
z: this.z,
|
|
456
|
+
r: this.r,
|
|
457
|
+
});
|
|
458
|
+
padding = $derived.by(() => {
|
|
459
|
+
let paddingProp = this.props.padding;
|
|
460
|
+
// When no explicit padding, compute default from axis/legend (unless radial).
|
|
461
|
+
// When `children` is not set, ChartChildren renders with axis=true by default,
|
|
462
|
+
// so apply matching padding. When `children` IS set (Treemap, Pack, etc.),
|
|
463
|
+
// the user controls layout — only apply padding if axis is explicitly set.
|
|
464
|
+
const hasChartChildrenLayout = !this.props.children;
|
|
465
|
+
const effectiveAxis = this.props.axis ?? (hasChartChildrenLayout ? true : false);
|
|
466
|
+
if (paddingProp == null && !this.props.radial && effectiveAxis) {
|
|
467
|
+
paddingProp = defaultChartPadding({
|
|
468
|
+
axis: effectiveAxis,
|
|
469
|
+
legend: this.props.legend,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
paddingProp = paddingProp ?? {};
|
|
473
|
+
if (typeof paddingProp === 'number') {
|
|
474
|
+
return {
|
|
475
|
+
...defaultPadding,
|
|
476
|
+
top: paddingProp,
|
|
477
|
+
right: paddingProp,
|
|
478
|
+
bottom: paddingProp,
|
|
479
|
+
left: paddingProp,
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
return { ...defaultPadding, ...paddingProp };
|
|
483
|
+
});
|
|
484
|
+
box = $derived.by(() => {
|
|
485
|
+
const top = this.padding.top;
|
|
486
|
+
const right = this.containerWidth - this.padding.right;
|
|
487
|
+
const bottom = this.containerHeight - this.padding.bottom;
|
|
488
|
+
const left = this.padding.left;
|
|
489
|
+
const width = right - left;
|
|
490
|
+
const height = bottom - top;
|
|
491
|
+
if (this.props.verbose === true) {
|
|
492
|
+
if (width <= 0 && this.isMounted === true) {
|
|
493
|
+
console.warn(`[LayerChart] Target div has zero or negative width (${width}). Did you forget to set an explicit width in CSS on the container?`);
|
|
494
|
+
}
|
|
495
|
+
if (height <= 0 && this.isMounted === true) {
|
|
496
|
+
console.warn(`[LayerChart] Target div has zero or negative height (${height}). Did you forget to set an explicit width in CSS on the container?`);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return {
|
|
500
|
+
top,
|
|
501
|
+
left,
|
|
502
|
+
bottom,
|
|
503
|
+
right,
|
|
504
|
+
width,
|
|
505
|
+
height,
|
|
506
|
+
};
|
|
507
|
+
});
|
|
508
|
+
width = $derived(this.box.width);
|
|
509
|
+
height = $derived(this.box.height);
|
|
510
|
+
extents = $derived.by(() => {
|
|
511
|
+
const scaleLookup = {
|
|
512
|
+
x: {
|
|
513
|
+
scale: this._xScaleProp,
|
|
514
|
+
sort: this.props.xDomainSort,
|
|
515
|
+
},
|
|
516
|
+
y: {
|
|
517
|
+
scale: this._yScaleProp,
|
|
518
|
+
sort: this.props.yDomainSort,
|
|
519
|
+
},
|
|
520
|
+
z: {
|
|
521
|
+
scale: this._zScaleProp,
|
|
522
|
+
sort: this.props.zDomainSort,
|
|
523
|
+
},
|
|
524
|
+
r: {
|
|
525
|
+
scale: this._rScaleProp,
|
|
526
|
+
sort: this.props.rDomainSort,
|
|
527
|
+
},
|
|
528
|
+
};
|
|
529
|
+
const getters = filterObject(this.activeGetters, this.filteredExtents);
|
|
530
|
+
const activeScales = Object.fromEntries(Object.keys(getters).map((k) => [k, scaleLookup[k]]));
|
|
531
|
+
if (Object.keys(getters).length > 0) {
|
|
532
|
+
const calculatedExtents = calcScaleExtents(this.flatData, getters, activeScales);
|
|
533
|
+
return { ...calculatedExtents, ...this.filteredExtents };
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
return {};
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
/**
|
|
540
|
+
* Resolves the domain for a given axis based on props, series state, and data.
|
|
541
|
+
* Handles explicit domains, intervals, baselines, and series-specific calculations.
|
|
542
|
+
*/
|
|
543
|
+
_computeTransformDomain(baseDomain, translate, scale, dimension) {
|
|
544
|
+
if (baseDomain.length < 2 || dimension <= 0) {
|
|
545
|
+
return baseDomain;
|
|
546
|
+
}
|
|
547
|
+
// d3 scales treat Date as numeric, so runtime values may be Date despite number[] type
|
|
548
|
+
const d0 = baseDomain[0];
|
|
549
|
+
const d1 = baseDomain[1];
|
|
550
|
+
const isDate = d0 instanceof Date;
|
|
551
|
+
if (!isDate && typeof d0 !== 'number')
|
|
552
|
+
return baseDomain;
|
|
553
|
+
const numMin = isDate ? d0.getTime() : d0;
|
|
554
|
+
const numMax = isDate ? d1.getTime() : d1;
|
|
555
|
+
const range = numMax - numMin;
|
|
556
|
+
if (!isFinite(range) || range === 0)
|
|
557
|
+
return baseDomain;
|
|
558
|
+
const f0 = -translate / scale / dimension;
|
|
559
|
+
const f1 = (dimension - translate) / scale / dimension;
|
|
560
|
+
const newMin = numMin + f0 * range;
|
|
561
|
+
const newMax = numMin + f1 * range;
|
|
562
|
+
return (isDate ? [new Date(newMin), new Date(newMax)] : [newMin, newMax]);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Auto-derive baseline for an axis based on valueAxis.
|
|
566
|
+
* The value axis gets baseline=0 (unless time scale), the category axis gets none.
|
|
567
|
+
*/
|
|
568
|
+
_autoBaseline(axis) {
|
|
569
|
+
const valueAxis = this.props.valueAxis;
|
|
570
|
+
// Only auto-derive baseline for simplified charts that set bandPadding
|
|
571
|
+
if (valueAxis == null || this.props.bandPadding == null)
|
|
572
|
+
return undefined;
|
|
573
|
+
if (valueAxis === axis) {
|
|
574
|
+
// Value axis — baseline 0 unless time scale
|
|
575
|
+
const scale = axis === 'x' ? this._xScaleProp : this._yScaleProp;
|
|
576
|
+
return isScaleTime(scale) ? undefined : 0;
|
|
577
|
+
}
|
|
578
|
+
// Category axis — no baseline
|
|
579
|
+
return undefined;
|
|
580
|
+
}
|
|
581
|
+
resolveDomain(axis) {
|
|
582
|
+
const domain = axis === 'x' ? this.props.xDomain : this.props.yDomain;
|
|
583
|
+
const interval = axis === 'x' ? this.props.xInterval : this.props.yInterval;
|
|
584
|
+
const explicitBaseline = axis === 'x' ? this.props.xBaseline : this.props.yBaseline;
|
|
585
|
+
// Use explicit baseline if provided (null means "no baseline"), otherwise auto-derive
|
|
586
|
+
const baseline = explicitBaseline !== undefined ? explicitBaseline : this._autoBaseline(axis);
|
|
587
|
+
const axisAccessor = axis === 'x' ? this.props.x : this.props.y;
|
|
588
|
+
// If explicit domain is provided, use it
|
|
589
|
+
if (domain !== undefined)
|
|
590
|
+
return domain;
|
|
591
|
+
// Series-specific domain calculation (only applies if the value axis)
|
|
592
|
+
if (this.valueAxis === axis && this.seriesState) {
|
|
593
|
+
// For stacked series, collect all y0/y1 values for domain calculation
|
|
594
|
+
if (this.seriesState.isStacked) {
|
|
595
|
+
const stackAccessor = (d) => {
|
|
596
|
+
const values = [];
|
|
597
|
+
for (const s of this.seriesState.visibleSeries) {
|
|
598
|
+
const stackValue = this.seriesState.getStackValue(s.key, d);
|
|
599
|
+
if (stackValue) {
|
|
600
|
+
values.push(stackValue[0], stackValue[1]);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return values.length ? values : undefined;
|
|
604
|
+
};
|
|
605
|
+
// @ts-ignore - fix type
|
|
606
|
+
return extent(chartDataArray(this.data).flatMap(stackAccessor));
|
|
607
|
+
}
|
|
608
|
+
// For non-default series, calculate domain from all visible series values
|
|
609
|
+
if (!this.seriesState.isDefaultSeries) {
|
|
610
|
+
const seriesValues = this.series.visibleSeries.flatMap((s) => {
|
|
611
|
+
const acc = accessor(s.value ?? axisAccessor ?? s.key);
|
|
612
|
+
const data = s.data ?? chartDataArray(this.data);
|
|
613
|
+
return data.flatMap(acc);
|
|
614
|
+
});
|
|
615
|
+
// Also include data from registered marks whose data isn't the primary
|
|
616
|
+
// data for any visible series. This handles marks with the same accessor
|
|
617
|
+
// key but different data arrays (e.g. two Circle marks pointing at
|
|
618
|
+
// separate datasets with the same field name).
|
|
619
|
+
const extraMarkValues = [];
|
|
620
|
+
for (const { info } of this._markInfos) {
|
|
621
|
+
if (!info.data)
|
|
622
|
+
continue;
|
|
623
|
+
const infoKey = info.seriesKey ?? (typeof info.y === 'string' ? info.y : undefined);
|
|
624
|
+
if (infoKey &&
|
|
625
|
+
this.seriesState.visibleSeries.some((s) => s.key === infoKey && s.data === info.data))
|
|
626
|
+
continue;
|
|
627
|
+
const markAccessor = (axis === 'y' ? info.y : info.x) ?? axisAccessor;
|
|
628
|
+
if (markAccessor) {
|
|
629
|
+
extraMarkValues.push(...info.data.flatMap(accessor(markAccessor)));
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
const allValues = [...seriesValues, ...extraMarkValues];
|
|
633
|
+
if (baseline != null) {
|
|
634
|
+
return [min([baseline, ...allValues]), max([baseline, ...allValues])];
|
|
635
|
+
}
|
|
636
|
+
return extent(allValues);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
// Interval-based domain: extend to the next interval offset
|
|
640
|
+
if (interval != null && Array.isArray(this.data) && this.data.length > 0) {
|
|
641
|
+
const lastValue = accessor(axisAccessor)(this.data[this.data.length - 1]);
|
|
642
|
+
return [null, interval.offset(lastValue)];
|
|
643
|
+
}
|
|
644
|
+
// Baseline-based domain: include the baseline value in the extent
|
|
645
|
+
if (baseline != null && Array.isArray(this.data)) {
|
|
646
|
+
const values = this.data.flatMap(accessor(axisAccessor));
|
|
647
|
+
return [min([baseline, ...values]), max([baseline, ...values])];
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
_xDomain = $derived.by(() => this.resolveDomain('x'));
|
|
651
|
+
_yDomain = $derived.by(() => this.resolveDomain('y'));
|
|
652
|
+
/** Full domain from data/props before any transform override */
|
|
653
|
+
_baseXDomain = $derived(calcDomain('x', this.extents, this._xDomain));
|
|
654
|
+
_baseYDomain = $derived(calcDomain('y', this.extents, this._yDomain));
|
|
655
|
+
/** Target domain — narrowed by transform when mode is 'domain', but not yet animated */
|
|
656
|
+
_rawXDomain = $derived.by(() => {
|
|
657
|
+
if (this.transformState?.mode === 'domain' &&
|
|
658
|
+
(this.transformState.axis === 'x' || this.transformState.axis === 'both') &&
|
|
659
|
+
this.width > 0) {
|
|
660
|
+
return this._computeTransformDomain(this._baseXDomain, this.transformState.translate.x, this.transformState.scale, this.width);
|
|
661
|
+
}
|
|
662
|
+
return this._baseXDomain;
|
|
663
|
+
});
|
|
664
|
+
_rawYDomain = $derived.by(() => {
|
|
665
|
+
if (this.transformState?.mode === 'domain' &&
|
|
666
|
+
(this.transformState.axis === 'y' || this.transformState.axis === 'both') &&
|
|
667
|
+
this.height > 0) {
|
|
668
|
+
return this._computeTransformDomain(this._baseYDomain, this.transformState.translate.y, this.transformState.scale, this.height);
|
|
669
|
+
}
|
|
670
|
+
return this._baseYDomain;
|
|
671
|
+
});
|
|
672
|
+
/** Effective domain — animated via motion if configured */
|
|
673
|
+
xDomain = $derived.by(() => {
|
|
674
|
+
if (this._xDomainMotion) {
|
|
675
|
+
const animated = this._xDomainMotion.current;
|
|
676
|
+
if (this._xDomainIsDate) {
|
|
677
|
+
return animated.map((v) => new Date(v));
|
|
678
|
+
}
|
|
679
|
+
return animated;
|
|
680
|
+
}
|
|
681
|
+
return this._rawXDomain;
|
|
682
|
+
});
|
|
683
|
+
yDomain = $derived.by(() => {
|
|
684
|
+
if (this._yDomainMotion) {
|
|
685
|
+
const animated = this._yDomainMotion.current;
|
|
686
|
+
if (this._yDomainIsDate) {
|
|
687
|
+
return animated.map((v) => new Date(v));
|
|
688
|
+
}
|
|
689
|
+
return animated;
|
|
690
|
+
}
|
|
691
|
+
return this._rawYDomain;
|
|
692
|
+
});
|
|
693
|
+
zDomain = $derived(calcDomain('z', this.extents, this.props.zDomain));
|
|
694
|
+
rDomain = $derived(calcDomain('r', this.extents, this.props.rDomain));
|
|
695
|
+
x1Domain = $derived.by(() => {
|
|
696
|
+
if (this.props.x1Domain) {
|
|
697
|
+
// Only filter by visible series when series are configured — otherwise the
|
|
698
|
+
// full x1Domain is used as-is (composable charts without series).
|
|
699
|
+
if (this.seriesState.series.length > 0) {
|
|
700
|
+
const visibleKeys = new Set(this.seriesState.visibleSeries.map((s) => s.key));
|
|
701
|
+
return this.props.x1Domain.filter((key) => visibleKeys.has(key));
|
|
702
|
+
}
|
|
703
|
+
return this.props.x1Domain;
|
|
704
|
+
}
|
|
705
|
+
// Auto-derive for grouped series when x is the category axis
|
|
706
|
+
if (this.props.seriesLayout === 'group' && this.valueAxis === 'y') {
|
|
707
|
+
return this.seriesState.visibleSeries.map((s) => s.key);
|
|
708
|
+
}
|
|
709
|
+
if (this.x1) {
|
|
710
|
+
return extent(chartDataArray(this.data), this.x1);
|
|
711
|
+
}
|
|
712
|
+
return undefined;
|
|
713
|
+
});
|
|
714
|
+
y1Domain = $derived.by(() => {
|
|
715
|
+
if (this.props.y1Domain) {
|
|
716
|
+
// Only filter by visible series when series are configured — otherwise the
|
|
717
|
+
// full y1Domain is used as-is (composable charts without series).
|
|
718
|
+
if (this.seriesState.series.length > 0) {
|
|
719
|
+
const visibleKeys = new Set(this.seriesState.visibleSeries.map((s) => s.key));
|
|
720
|
+
return this.props.y1Domain.filter((key) => visibleKeys.has(key));
|
|
721
|
+
}
|
|
722
|
+
return this.props.y1Domain;
|
|
723
|
+
}
|
|
724
|
+
// Auto-derive for grouped series when y is the category axis
|
|
725
|
+
if (this.props.seriesLayout === 'group' && this.valueAxis === 'x') {
|
|
726
|
+
return this.seriesState.visibleSeries.map((s) => s.key);
|
|
727
|
+
}
|
|
728
|
+
if (this.y1) {
|
|
729
|
+
return extent(chartDataArray(this.data), this.y1);
|
|
730
|
+
}
|
|
731
|
+
return undefined;
|
|
732
|
+
});
|
|
733
|
+
cDomain = $derived.by(() => {
|
|
734
|
+
if (this.props.cDomain)
|
|
735
|
+
return this.props.cDomain;
|
|
736
|
+
const values = chartDataArray(this.data).map(this.c);
|
|
737
|
+
// Use extent for numeric values (continuous scales), unique for categorical (ordinal scales)
|
|
738
|
+
if (values.length > 0 && typeof values[0] === 'number') {
|
|
739
|
+
return extent(values);
|
|
740
|
+
}
|
|
741
|
+
return unique(values);
|
|
742
|
+
});
|
|
743
|
+
snappedPadding = $derived($state.snapshot(this.props.xPadding));
|
|
744
|
+
snappedExtents = $derived($state.snapshot(this.extents));
|
|
745
|
+
xScale = $derived(createChartScale('x', {
|
|
746
|
+
scale: this._xScaleProp,
|
|
747
|
+
domain: this.xDomain,
|
|
748
|
+
padding: this.snappedPadding,
|
|
749
|
+
nice: this.xNice,
|
|
750
|
+
reverse: this.props.xReverse ?? false,
|
|
751
|
+
percentRange: this.props.percentRange ?? false,
|
|
752
|
+
range: this._xScaleRange,
|
|
753
|
+
height: this.height,
|
|
754
|
+
width: this.width,
|
|
755
|
+
extents: this.snappedExtents,
|
|
756
|
+
}));
|
|
757
|
+
xGet = $derived(createGetter(this.x, this.xScale));
|
|
758
|
+
yScale = $derived(createChartScale('y', {
|
|
759
|
+
scale: this._yScaleProp,
|
|
760
|
+
domain: this.yDomain,
|
|
761
|
+
padding: this.props.yPadding,
|
|
762
|
+
nice: this.yNice,
|
|
763
|
+
reverse: this.yReverse,
|
|
764
|
+
percentRange: this.props.percentRange ?? false,
|
|
765
|
+
range: this._yScaleRange,
|
|
766
|
+
height: this.height,
|
|
767
|
+
width: this.width,
|
|
768
|
+
extents: this.filteredExtents,
|
|
769
|
+
}));
|
|
770
|
+
yGet = $derived(createGetter(this.y, this.yScale));
|
|
771
|
+
/** Scale using the full (pre-transform) domain — used by BrushState for positioning */
|
|
772
|
+
baseXScale = $derived(createChartScale('x', {
|
|
773
|
+
scale: this._xScaleProp,
|
|
774
|
+
domain: this._baseXDomain,
|
|
775
|
+
padding: this.snappedPadding,
|
|
776
|
+
nice: this.xNice,
|
|
777
|
+
reverse: this.props.xReverse ?? false,
|
|
778
|
+
percentRange: this.props.percentRange ?? false,
|
|
779
|
+
range: this.xRangeProp,
|
|
780
|
+
height: this.height,
|
|
781
|
+
width: this.width,
|
|
782
|
+
extents: this.snappedExtents,
|
|
783
|
+
}));
|
|
784
|
+
baseYScale = $derived(createChartScale('y', {
|
|
785
|
+
scale: this._yScaleProp,
|
|
786
|
+
domain: this._baseYDomain,
|
|
787
|
+
padding: this.props.yPadding,
|
|
788
|
+
nice: this.yNice,
|
|
789
|
+
reverse: this.yReverse,
|
|
790
|
+
percentRange: this.props.percentRange ?? false,
|
|
791
|
+
range: this.yRangeProp,
|
|
792
|
+
height: this.height,
|
|
793
|
+
width: this.width,
|
|
794
|
+
extents: this.filteredExtents,
|
|
795
|
+
}));
|
|
796
|
+
zScale = $derived(createChartScale('z', {
|
|
797
|
+
scale: this._zScaleProp,
|
|
798
|
+
domain: this.zDomain,
|
|
799
|
+
padding: this.props.zPadding,
|
|
800
|
+
nice: this.props.zNice ?? false,
|
|
801
|
+
reverse: this.props.zReverse ?? false,
|
|
802
|
+
percentRange: this.props.percentRange ?? false,
|
|
803
|
+
range: this.props.zRange,
|
|
804
|
+
height: this.height,
|
|
805
|
+
width: this.width,
|
|
806
|
+
extents: this.filteredExtents,
|
|
807
|
+
}));
|
|
808
|
+
zGet = $derived(createGetter(this.z, this.zScale));
|
|
809
|
+
rScale = $derived(createChartScale('r', {
|
|
810
|
+
scale: this._rScaleProp,
|
|
811
|
+
domain: this.rDomain,
|
|
812
|
+
padding: this.props.rPadding,
|
|
813
|
+
nice: this.props.rNice ?? false,
|
|
814
|
+
reverse: this.props.rReverse ?? false,
|
|
815
|
+
percentRange: this.props.percentRange ?? false,
|
|
816
|
+
range: this.props.rRange,
|
|
817
|
+
height: this.height,
|
|
818
|
+
width: this.width,
|
|
819
|
+
extents: this.filteredExtents,
|
|
820
|
+
}));
|
|
821
|
+
rGet = $derived(createGetter(this.r, this.rScale));
|
|
822
|
+
x1Scale = $derived.by(() => {
|
|
823
|
+
// Explicit x1Range — existing behavior
|
|
824
|
+
if (this.props.x1Range) {
|
|
825
|
+
return createScale(this.props.x1Scale ?? autoScale(this.props.x1Domain, this.flatData, this.props.x1), this.x1Domain, this.props.x1Range, { xScale: this.xScale, width: this.width, height: this.height });
|
|
826
|
+
}
|
|
827
|
+
// Auto-derive for grouped series when x is the category axis
|
|
828
|
+
if (this.props.seriesLayout === 'group' && this.valueAxis === 'y' && this.x1Domain) {
|
|
829
|
+
const groupPadding = this.props.groupPadding ?? 0;
|
|
830
|
+
return createScale(scaleBand().padding(groupPadding), this.x1Domain, ({ xScale }) => [0, xScale.bandwidth()], { xScale: this.xScale, width: this.width, height: this.height });
|
|
831
|
+
}
|
|
832
|
+
return null;
|
|
833
|
+
});
|
|
834
|
+
x1Get = $derived(this.x1 ? createGetter(this.x1, this.x1Scale) : null);
|
|
835
|
+
y1Scale = $derived.by(() => {
|
|
836
|
+
// Explicit y1Range — existing behavior
|
|
837
|
+
if (this.props.y1Range) {
|
|
838
|
+
return createScale(this.props.y1Scale ?? autoScale(this.props.y1Domain, this.flatData, this.props.y1), this.y1Domain, this.props.y1Range, { yScale: this.yScale, width: this.width, height: this.height });
|
|
839
|
+
}
|
|
840
|
+
// Auto-derive for grouped series when y is the category axis
|
|
841
|
+
if (this.props.seriesLayout === 'group' && this.valueAxis === 'x' && this.y1Domain) {
|
|
842
|
+
const groupPadding = this.props.groupPadding ?? 0;
|
|
843
|
+
return createScale(scaleBand().padding(groupPadding), this.y1Domain, ({ yScale }) => [0, yScale.bandwidth()], { yScale: this.yScale, width: this.width, height: this.height });
|
|
844
|
+
}
|
|
845
|
+
return null;
|
|
846
|
+
});
|
|
847
|
+
y1Get = $derived(this.y1 ? createGetter(this.y1, this.y1Scale) : null);
|
|
848
|
+
cScale = $derived(this.props.cScale || this.props.cRange
|
|
849
|
+
? createScale(this.props.cScale ?? scaleOrdinal(), this.cDomain, this.props.cRange, {
|
|
850
|
+
width: this.width,
|
|
851
|
+
height: this.height,
|
|
852
|
+
})
|
|
853
|
+
: null);
|
|
854
|
+
cGet = $derived((d) => this.cScale?.(this.c(d)));
|
|
855
|
+
xDomainPossiblyNice = $derived(this.xScale.domain());
|
|
856
|
+
yDomainPossiblyNice = $derived(this.yScale.domain());
|
|
857
|
+
zDomainPossiblyNice = $derived(this.zScale.domain());
|
|
858
|
+
rDomainPossiblyNice = $derived(this.rScale.domain());
|
|
859
|
+
/** Viewport range — always [0, width] / [height, 0] for layout components (axis, grid, etc).
|
|
860
|
+
* When band scale domain transform is active, xScale.range() is wider than the viewport,
|
|
861
|
+
* so we return the base scale's range instead. */
|
|
862
|
+
xRange = $derived.by(() => {
|
|
863
|
+
if (this.transformState?.mode === 'domain' &&
|
|
864
|
+
(this.transformState.axis === 'x' || this.transformState.axis === 'both') &&
|
|
865
|
+
isScaleBand(this._xScaleProp)) {
|
|
866
|
+
return getRange(this.baseXScale);
|
|
867
|
+
}
|
|
868
|
+
return getRange(this.xScale);
|
|
869
|
+
});
|
|
870
|
+
yRange = $derived.by(() => {
|
|
871
|
+
if (this.transformState?.mode === 'domain' &&
|
|
872
|
+
(this.transformState.axis === 'y' || this.transformState.axis === 'both') &&
|
|
873
|
+
isScaleBand(this._yScaleProp)) {
|
|
874
|
+
return getRange(this.baseYScale);
|
|
875
|
+
}
|
|
876
|
+
return getRange(this.yScale);
|
|
877
|
+
});
|
|
878
|
+
zRange = $derived(getRange(this.zScale));
|
|
879
|
+
rRange = $derived(getRange(this.rScale));
|
|
880
|
+
aspectRatio = $derived(this.width / this.height);
|
|
881
|
+
// Properties that come directly from props (not derived)
|
|
882
|
+
get percentRange() {
|
|
883
|
+
return this.props.percentRange ?? false;
|
|
884
|
+
}
|
|
885
|
+
get xNice() {
|
|
886
|
+
if (this.props.xNice !== undefined)
|
|
887
|
+
return this.props.xNice;
|
|
888
|
+
// Auto-nice the value axis when valueAxis is explicitly set
|
|
889
|
+
return this.props.valueAxis === 'x';
|
|
890
|
+
}
|
|
891
|
+
get yNice() {
|
|
892
|
+
if (this.props.yNice !== undefined)
|
|
893
|
+
return this.props.yNice;
|
|
894
|
+
return this.props.valueAxis === 'y';
|
|
895
|
+
}
|
|
896
|
+
get zNice() {
|
|
897
|
+
return this.props.zNice ?? false;
|
|
898
|
+
}
|
|
899
|
+
get rNice() {
|
|
900
|
+
return this.props.rNice ?? false;
|
|
901
|
+
}
|
|
902
|
+
get xDomainSort() {
|
|
903
|
+
return this.props.xDomainSort ?? false;
|
|
904
|
+
}
|
|
905
|
+
get yDomainSort() {
|
|
906
|
+
return this.props.yDomainSort ?? false;
|
|
907
|
+
}
|
|
908
|
+
get zDomainSort() {
|
|
909
|
+
return this.props.zDomainSort ?? false;
|
|
910
|
+
}
|
|
911
|
+
get rDomainSort() {
|
|
912
|
+
return this.props.rDomainSort ?? false;
|
|
913
|
+
}
|
|
914
|
+
get xReverse() {
|
|
915
|
+
return this.props.xReverse ?? false;
|
|
916
|
+
}
|
|
917
|
+
get zReverse() {
|
|
918
|
+
return this.props.zReverse ?? false;
|
|
919
|
+
}
|
|
920
|
+
get rReverse() {
|
|
921
|
+
return this.props.rReverse ?? false;
|
|
922
|
+
}
|
|
923
|
+
get xPadding() {
|
|
924
|
+
return this.props.xPadding;
|
|
925
|
+
}
|
|
926
|
+
get yPadding() {
|
|
927
|
+
return this.props.yPadding;
|
|
928
|
+
}
|
|
929
|
+
get zPadding() {
|
|
930
|
+
return this.props.zPadding;
|
|
931
|
+
}
|
|
932
|
+
get rPadding() {
|
|
933
|
+
return this.props.rPadding;
|
|
934
|
+
}
|
|
935
|
+
get cRange() {
|
|
936
|
+
return this.props.cRange;
|
|
937
|
+
}
|
|
938
|
+
get x1Range() {
|
|
939
|
+
return this.props.x1Range;
|
|
940
|
+
}
|
|
941
|
+
get y1Range() {
|
|
942
|
+
return this.props.y1Range;
|
|
943
|
+
}
|
|
944
|
+
get xInterval() {
|
|
945
|
+
return this.props.xInterval ?? null;
|
|
946
|
+
}
|
|
947
|
+
get yInterval() {
|
|
948
|
+
return this.props.yInterval ?? null;
|
|
949
|
+
}
|
|
950
|
+
get radial() {
|
|
951
|
+
return this.props.radial ?? false;
|
|
952
|
+
}
|
|
953
|
+
get valueAxis() {
|
|
954
|
+
return (this.props.valueAxis ??
|
|
955
|
+
(this.props.yScale && isScaleBand(this.props.yScale)
|
|
956
|
+
? 'x'
|
|
957
|
+
: this.props.xScale && isScaleBand(this.props.xScale)
|
|
958
|
+
? 'y'
|
|
959
|
+
: 'y'));
|
|
960
|
+
}
|
|
961
|
+
// Fallback objects for when state hasn't been initialized yet
|
|
962
|
+
static #fallbackTooltip = {
|
|
963
|
+
x: 0,
|
|
964
|
+
y: 0,
|
|
965
|
+
data: null,
|
|
966
|
+
series: [],
|
|
967
|
+
config: {},
|
|
968
|
+
isHoveringTooltipArea: false,
|
|
969
|
+
isHoveringTooltipContent: false,
|
|
970
|
+
mode: 'manual',
|
|
971
|
+
show: () => { },
|
|
972
|
+
hide: () => { },
|
|
973
|
+
};
|
|
974
|
+
static #fallbackTransform = {
|
|
975
|
+
mode: 'none',
|
|
976
|
+
scale: 1,
|
|
977
|
+
translate: { x: 0, y: 0 },
|
|
978
|
+
moving: false,
|
|
979
|
+
dragging: false,
|
|
980
|
+
setScale: () => { },
|
|
981
|
+
setTranslate: () => { },
|
|
982
|
+
};
|
|
983
|
+
static #fallbackSeries = {
|
|
984
|
+
series: [],
|
|
985
|
+
visibleSeries: [],
|
|
986
|
+
highlightKey: null,
|
|
987
|
+
isVisible: () => true,
|
|
988
|
+
isHighlighted: () => false,
|
|
989
|
+
isDefaultSeries: true,
|
|
990
|
+
allSeriesData: [],
|
|
991
|
+
allSeriesColors: [],
|
|
992
|
+
selectedKeys: { isEmpty: () => true, isSelected: () => false },
|
|
993
|
+
};
|
|
994
|
+
// TODO: We also expose context states directly as well for `bind:` for each context (TooltipContext, GeoContext, etc).
|
|
995
|
+
get tooltip() {
|
|
996
|
+
return this.tooltipState ?? ChartState.#fallbackTooltip;
|
|
997
|
+
}
|
|
998
|
+
get geo() {
|
|
999
|
+
return this.geoState;
|
|
1000
|
+
}
|
|
1001
|
+
get brush() {
|
|
1002
|
+
return this.brushState;
|
|
1003
|
+
}
|
|
1004
|
+
get transform() {
|
|
1005
|
+
return this.transformState ?? ChartState.#fallbackTransform;
|
|
1006
|
+
}
|
|
1007
|
+
get series() {
|
|
1008
|
+
return this.seriesState ?? ChartState.#fallbackSeries;
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Convert a brush selection to transform scale/translate, zooming the chart to the brushed region.
|
|
1012
|
+
* Used by integrated brush mode when `transform.mode === 'domain'`.
|
|
1013
|
+
*/
|
|
1014
|
+
zoomToBrush(brush, axis = 'x') {
|
|
1015
|
+
const brushX = brush.x;
|
|
1016
|
+
const brushY = brush.y;
|
|
1017
|
+
if ((axis === 'x' || axis === 'both') && brushX[0] != null && brushX[1] != null) {
|
|
1018
|
+
const baseDomainX = this._baseXDomain;
|
|
1019
|
+
if (typeof baseDomainX[0] === 'string') {
|
|
1020
|
+
// Categorical: compute scale/translate from domain indices
|
|
1021
|
+
const totalCount = baseDomainX.length;
|
|
1022
|
+
const startIdx = baseDomainX.indexOf(brushX[0]);
|
|
1023
|
+
const endIdx = baseDomainX.indexOf(brushX[1]) + 1;
|
|
1024
|
+
const selectedCount = endIdx - startIdx;
|
|
1025
|
+
if (selectedCount > 0 && totalCount > 0) {
|
|
1026
|
+
const newScale = totalCount / selectedCount;
|
|
1027
|
+
const newTranslateX = -(startIdx / totalCount) * this.width * newScale;
|
|
1028
|
+
let newTranslateY = 0;
|
|
1029
|
+
if (axis === 'both' && brushY[0] != null && brushY[1] != null) {
|
|
1030
|
+
const baseDomainY = this._baseYDomain;
|
|
1031
|
+
if (typeof baseDomainY[0] === 'string') {
|
|
1032
|
+
const yTotal = baseDomainY.length;
|
|
1033
|
+
const yStart = baseDomainY.indexOf(brushY[0]);
|
|
1034
|
+
const yEnd = baseDomainY.indexOf(brushY[1]) + 1;
|
|
1035
|
+
const ySelected = yEnd - yStart;
|
|
1036
|
+
if (ySelected > 0) {
|
|
1037
|
+
newTranslateY = -(yStart / yTotal) * this.height * newScale;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
this.transform.setScale(newScale);
|
|
1042
|
+
this.transform.setTranslate({ x: newTranslateX, y: newTranslateY });
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
// Continuous: existing numeric logic
|
|
1047
|
+
const baseMinX = +baseDomainX[0];
|
|
1048
|
+
const baseRangeX = +baseDomainX[1] - baseMinX;
|
|
1049
|
+
const brushMinX = +brushX[0];
|
|
1050
|
+
const brushRangeX = +brushX[1] - brushMinX;
|
|
1051
|
+
if (brushRangeX > 0 && baseRangeX > 0) {
|
|
1052
|
+
const newScale = baseRangeX / brushRangeX;
|
|
1053
|
+
const newTranslateX = -((brushMinX - baseMinX) / baseRangeX) * this.width * newScale;
|
|
1054
|
+
let newTranslateY = 0;
|
|
1055
|
+
if (axis === 'both' && brushY[0] != null && brushY[1] != null) {
|
|
1056
|
+
const baseMinY = +this._baseYDomain[0];
|
|
1057
|
+
const baseRangeY = +this._baseYDomain[1] - baseMinY;
|
|
1058
|
+
const brushMinY = +brushY[0];
|
|
1059
|
+
newTranslateY = -((brushMinY - baseMinY) / baseRangeY) * this.height * newScale;
|
|
1060
|
+
}
|
|
1061
|
+
this.transform.setScale(newScale);
|
|
1062
|
+
this.transform.setTranslate({ x: newTranslateX, y: newTranslateY });
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
get config() {
|
|
1068
|
+
return {
|
|
1069
|
+
x: this.props.x,
|
|
1070
|
+
y: this.props.y,
|
|
1071
|
+
z: this.props.z,
|
|
1072
|
+
r: this.props.r,
|
|
1073
|
+
c: this.props.c,
|
|
1074
|
+
x1: this.props.x1,
|
|
1075
|
+
y1: this.props.y1,
|
|
1076
|
+
xDomain: this._xDomain,
|
|
1077
|
+
yDomain: this._yDomain,
|
|
1078
|
+
zDomain: this.props.zDomain,
|
|
1079
|
+
rDomain: this.props.rDomain,
|
|
1080
|
+
x1Domain: this.props.x1Domain,
|
|
1081
|
+
y1Domain: this.props.y1Domain,
|
|
1082
|
+
cDomain: this.props.cDomain,
|
|
1083
|
+
xRange: this.props.xRange,
|
|
1084
|
+
yRange: this.props.yRange,
|
|
1085
|
+
zRange: this.props.zRange,
|
|
1086
|
+
rRange: this.props.rRange,
|
|
1087
|
+
cRange: this.props.cRange,
|
|
1088
|
+
x1Range: this.props.x1Range,
|
|
1089
|
+
y1Range: this.props.y1Range,
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
}
|