layerchart 2.0.0-next.61 → 2.0.0-next.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas.d.ts +2 -2
- package/dist/canvas.js +2 -2
- package/dist/components/Arc/Arc.base.svelte +49 -11
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-full-circle--360-degree-range--1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-full-circle--360-degree-range--2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-innerRadius-of-0--pie-slice--1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-innerRadius-of-0--pie-slice--2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-negative-domain-values-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-negative-domain-values-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-partial-arc--e-g---180-degrees--1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-partial-arc--e-g---180-degrees--2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-at-max-domain-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-at-max-domain-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-below-domain-min-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-below-domain-min-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-exceeding-domain-max-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-exceeding-domain-max-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-of-0-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-edge-cases-should-handle-value-of-0-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-enter-events-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-enter-events-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-move-events-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-pointer-move-events-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-touch-move-events-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-events-should-handle-touch-move-events-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-custom-class-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-custom-class-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-fill-color-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-fill-color-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-fillOpacity-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-fillOpacity-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-offset-to-arc-position-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-offset-to-arc-position-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-opacity-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-opacity-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-stroke-color-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-stroke-color-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-strokeWidth-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-strokeWidth-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-zero-offset-by-default-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-zero-offset-by-default-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-hide-on-pointer-leave-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-hide-on-pointer-leave-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-show-on-pointer-enter-with-data-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-call-tooltip-show-on-pointer-enter-with-data-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-handle-custom-start-angle-in-range-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-handle-custom-start-angle-in-range-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-have-stroke--none--by-default-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-have-stroke--none--by-default-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-an-arc-path-with-value-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-an-arc-path-with-value-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-when-track-prop-is-provided-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-when-track-prop-is-provided-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-custom-class-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-custom-class-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackCornerRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackCornerRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackEndAngle-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackEndAngle-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-and-trackOuterRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackInnerRadius-and-trackOuterRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackOuterRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackOuterRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackPadAngle-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackPadAngle-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-and-trackEndAngle-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-track-with-trackStartAngle-and-trackEndAngle-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-both-startAngle-and-endAngle-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-both-startAngle-and-endAngle-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-cornerRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-cornerRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-and-range-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-domain-and-range-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-range-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-custom-range-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-endAngle-in-radians-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-endAngle-in-radians-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-and-outerRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-innerRadius-and-outerRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-outerRadius-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-outerRadius-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-padAngle-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-padAngle-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-startAngle-in-radians-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-render-with-startAngle-in-radians-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-should-render-Arc-element-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-should-render-Arc-element-2.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-should-render-track-1.png +0 -0
- package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-should-render-track-2.png +0 -0
- package/dist/components/{ArcLabel.svelte.test.js → ArcLabel/ArcLabel.svelte.test.js} +3 -3
- package/dist/components/ArcLabel/__screenshots__/ArcLabel.svelte.test.ts/ArcLabel-renders-a-text-element-with-the-supplied-value-at-the-centroid-1.png +0 -0
- package/dist/components/ArcLabel/__screenshots__/ArcLabel.svelte.test.ts/ArcLabel-renders-a-text-element-with-the-supplied-value-at-the-centroid-2.png +0 -0
- package/dist/components/Blur/Blur.canvas.svelte +25 -0
- package/dist/components/Blur/Blur.canvas.svelte.d.ts +4 -0
- package/dist/components/Blur/Blur.html.svelte +11 -0
- package/dist/components/Blur/Blur.html.svelte.d.ts +4 -0
- package/dist/components/{Blur.svelte.d.ts → Blur/Blur.shared.svelte.d.ts} +3 -5
- package/dist/components/Blur/Blur.svelte +23 -0
- package/dist/components/Blur/Blur.svelte.d.ts +4 -0
- package/dist/components/Blur/Blur.svg.svelte +24 -0
- package/dist/components/Blur/Blur.svg.svelte.d.ts +4 -0
- package/dist/components/Chart/Chart.base.svelte +13 -7
- package/dist/components/Chart/ChartCore.svelte.test.d.ts +1 -0
- package/dist/components/{ChartCore.svelte.test.js → Chart/ChartCore.svelte.test.js} +1 -1
- package/dist/components/Link/Link.base.svelte +15 -9
- package/dist/components/Path/Path.canvas.svelte +5 -2
- package/dist/components/Path/Path.shared.svelte.d.ts +17 -4
- package/dist/components/Path/Path.shared.svelte.js +26 -8
- package/dist/components/Path/Path.svg.svelte +75 -60
- package/dist/components/RectClipPath/RectClipPath.base.svelte +25 -1
- package/dist/components/RectClipPath/RectClipPath.shared.svelte.d.ts +8 -0
- package/dist/components/Trail/Trail.base.svelte +10 -7
- package/dist/components/charts/__screenshots__/ArcChart.svelte.test.ts/ArcChart-uses-the-chart-value-accessor-for-explicit-per-series-tooltip-values-1.png +0 -0
- package/dist/components/charts/__screenshots__/ArcChart.svelte.test.ts/ArcChart-uses-the-chart-value-accessor-for-explicit-per-series-tooltip-values-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__/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/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/html.d.ts +2 -2
- package/dist/html.js +2 -2
- package/dist/states/chart.svelte.d.ts +4 -2
- package/dist/states/chart.svelte.js +45 -18
- package/dist/states/chart.svelte.test.js +1 -1
- package/dist/states/series.svelte.js +9 -13
- package/dist/states/series.svelte.test.js +5 -1
- package/dist/svg.d.ts +2 -2
- package/dist/svg.js +2 -2
- package/package.json +1 -1
- package/dist/components/Blur.svelte +0 -49
- /package/dist/components/{ArcLabel.svelte.test.d.ts → ArcLabel/ArcLabel.svelte.test.d.ts} +0 -0
- /package/dist/components/{ChartCore.svelte.test.d.ts → Blur/Blur.shared.svelte.js} +0 -0
package/dist/canvas.d.ts
CHANGED
|
@@ -124,8 +124,8 @@ export { default as Graticule } from './components/geo/Graticule/Graticule.canva
|
|
|
124
124
|
export type { GraticuleProps, GraticulePropsWithoutHTML, } from './components/geo/Graticule/Graticule.shared.svelte.js';
|
|
125
125
|
export { default as Ribbon } from './components/graph/Ribbon/Ribbon.canvas.svelte';
|
|
126
126
|
export type { RibbonProps, RibbonPropsWithoutHTML, } from './components/graph/Ribbon/Ribbon.shared.svelte.js';
|
|
127
|
-
export { default as Blur } from './components/Blur.svelte';
|
|
128
|
-
export * from './components/Blur.svelte';
|
|
127
|
+
export { default as Blur } from './components/Blur/Blur.svelte';
|
|
128
|
+
export * from './components/Blur/Blur.svelte';
|
|
129
129
|
export { default as Bounds } from './components/Bounds.svelte';
|
|
130
130
|
export * from './components/Bounds.svelte';
|
|
131
131
|
export { default as BrushContext } from './components/BrushContext.svelte';
|
package/dist/canvas.js
CHANGED
|
@@ -75,8 +75,8 @@ export { default as Ribbon } from './components/graph/Ribbon/Ribbon.canvas.svelt
|
|
|
75
75
|
// helpers, context providers, or composite chart wrappers). Re-exported here
|
|
76
76
|
// so the per-layer sub-path has a complete API.
|
|
77
77
|
// Helpers / context providers
|
|
78
|
-
export { default as Blur } from './components/Blur.svelte';
|
|
79
|
-
export * from './components/Blur.svelte';
|
|
78
|
+
export { default as Blur } from './components/Blur/Blur.svelte';
|
|
79
|
+
export * from './components/Blur/Blur.svelte';
|
|
80
80
|
export { default as Bounds } from './components/Bounds.svelte';
|
|
81
81
|
export * from './components/Bounds.svelte';
|
|
82
82
|
export { default as BrushContext } from './components/BrushContext.svelte';
|
|
@@ -20,24 +20,66 @@
|
|
|
20
20
|
Path,
|
|
21
21
|
ref: refProp = $bindable(),
|
|
22
22
|
trackRef: trackRefProp = $bindable(),
|
|
23
|
-
|
|
24
|
-
fillOpacity,
|
|
23
|
+
// Override the `.lc-path` CSS stroke default so arcs don't get a visible outline
|
|
25
24
|
stroke = 'none',
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
// Arc-specific config — extracted out of `...restProps` so it doesn't
|
|
26
|
+
// leak onto `<Path>`. `motion` in particular would otherwise make Path
|
|
27
|
+
// also tween the path-string on top of the end-angle tween that
|
|
28
|
+
// `ArcState` already drives, producing visibly wrong arcs.
|
|
29
|
+
motion,
|
|
30
|
+
value,
|
|
31
|
+
initialValue,
|
|
32
|
+
domain,
|
|
33
|
+
range,
|
|
34
|
+
startAngle,
|
|
35
|
+
endAngle,
|
|
36
|
+
innerRadius,
|
|
37
|
+
outerRadius,
|
|
38
|
+
cornerRadius,
|
|
39
|
+
padAngle,
|
|
40
|
+
trackStartAngle,
|
|
41
|
+
trackEndAngle,
|
|
42
|
+
trackInnerRadius,
|
|
43
|
+
trackOuterRadius,
|
|
44
|
+
trackCornerRadius,
|
|
45
|
+
trackPadAngle,
|
|
46
|
+
offset,
|
|
47
|
+
// Pointer / tooltip wiring
|
|
28
48
|
data,
|
|
49
|
+
tooltip,
|
|
50
|
+
track = false,
|
|
29
51
|
onpointerenter = () => {},
|
|
30
52
|
onpointermove = () => {},
|
|
31
53
|
onpointerleave = () => {},
|
|
32
54
|
ontouchmove = () => {},
|
|
33
|
-
tooltip,
|
|
34
|
-
track = false,
|
|
35
55
|
children,
|
|
36
56
|
class: className,
|
|
37
57
|
...restProps
|
|
38
58
|
}: ArcBaseProps = $props();
|
|
39
59
|
|
|
40
|
-
const c = new ArcState(
|
|
60
|
+
const c = new ArcState(
|
|
61
|
+
() =>
|
|
62
|
+
({
|
|
63
|
+
motion,
|
|
64
|
+
value,
|
|
65
|
+
initialValue,
|
|
66
|
+
domain,
|
|
67
|
+
range,
|
|
68
|
+
startAngle,
|
|
69
|
+
endAngle,
|
|
70
|
+
innerRadius,
|
|
71
|
+
outerRadius,
|
|
72
|
+
cornerRadius,
|
|
73
|
+
padAngle,
|
|
74
|
+
trackStartAngle,
|
|
75
|
+
trackEndAngle,
|
|
76
|
+
trackInnerRadius,
|
|
77
|
+
trackOuterRadius,
|
|
78
|
+
trackCornerRadius,
|
|
79
|
+
trackPadAngle,
|
|
80
|
+
offset,
|
|
81
|
+
}) as ArcProps
|
|
82
|
+
);
|
|
41
83
|
|
|
42
84
|
let ref = $state<SVGPathElement>();
|
|
43
85
|
|
|
@@ -78,11 +120,7 @@
|
|
|
78
120
|
bind:pathRef={ref}
|
|
79
121
|
pathData={c.arc()}
|
|
80
122
|
transform="translate({c.xOffset}, {c.yOffset})"
|
|
81
|
-
{fill}
|
|
82
|
-
{fillOpacity}
|
|
83
123
|
{stroke}
|
|
84
|
-
{strokeWidth}
|
|
85
|
-
{opacity}
|
|
86
124
|
{...restProps}
|
|
87
125
|
class={cls('lc-arc-line', className)}
|
|
88
126
|
onpointerenter={onPointerEnter}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-opacity-1.png
ADDED
|
Binary file
|
package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-props-should-apply-opacity-2.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-should-render-Arc-element-1.png
ADDED
|
Binary file
|
package/dist/components/Arc/__screenshots__/Arc.svelte.test.ts/Arc-should-render-Arc-element-2.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
import { render } from 'vitest-browser-svelte';
|
|
3
3
|
import { page } from 'vitest/browser';
|
|
4
|
-
import TestHarness, { componentTestId } from '
|
|
5
|
-
import Arc from '
|
|
6
|
-
import ArcLabel from './ArcLabel
|
|
4
|
+
import TestHarness, { componentTestId } from '../tests/TestHarness.svelte';
|
|
5
|
+
import Arc from '../Arc/Arc.svelte';
|
|
6
|
+
import ArcLabel from './ArcLabel.svelte';
|
|
7
7
|
const defaultArcProps = {
|
|
8
8
|
fill: 'currentColor',
|
|
9
9
|
value: 50,
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type { BlurProps, BlurPropsWithoutHTML } from './Blur.shared.svelte.js';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { getChartContext } from '../../contexts/chart.js';
|
|
7
|
+
import type { BlurProps } from './Blur.shared.svelte.js';
|
|
8
|
+
|
|
9
|
+
let { stdDeviation = 5, children }: BlurProps = $props();
|
|
10
|
+
|
|
11
|
+
const chartCtx = getChartContext();
|
|
12
|
+
|
|
13
|
+
chartCtx.registerComponent({
|
|
14
|
+
name: 'Blur',
|
|
15
|
+
kind: 'group',
|
|
16
|
+
canvasRender: {
|
|
17
|
+
render: (ctx) => {
|
|
18
|
+
ctx.filter = `blur(${stdDeviation}px)`;
|
|
19
|
+
},
|
|
20
|
+
deps: () => [stdDeviation],
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
{@render children?.()}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type { BlurProps, BlurPropsWithoutHTML } from './Blur.shared.svelte.js';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { BlurProps } from './Blur.shared.svelte.js';
|
|
7
|
+
|
|
8
|
+
let { children }: BlurProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{@render children?.()}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type BlurPropsWithoutHTML = {
|
|
2
3
|
/**
|
|
3
4
|
* A unique id for the filter.
|
|
4
5
|
*/
|
|
@@ -15,7 +16,4 @@ export type BlurProps = {
|
|
|
15
16
|
*/
|
|
16
17
|
children?: Snippet;
|
|
17
18
|
};
|
|
18
|
-
|
|
19
|
-
declare const Blur: import("svelte").Component<BlurProps, {}, "">;
|
|
20
|
-
type Blur = ReturnType<typeof Blur>;
|
|
21
|
-
export default Blur;
|
|
19
|
+
export type BlurProps = BlurPropsWithoutHTML;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type { BlurProps, BlurPropsWithoutHTML } from './Blur.shared.svelte.js';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { getLayerContext } from '../../contexts/layer.js';
|
|
7
|
+
import BlurSvg from './Blur.svg.svelte';
|
|
8
|
+
import BlurCanvas from './Blur.canvas.svelte';
|
|
9
|
+
import BlurHtml from './Blur.html.svelte';
|
|
10
|
+
import type { BlurProps } from './Blur.shared.svelte.js';
|
|
11
|
+
|
|
12
|
+
const layerCtx = getLayerContext();
|
|
13
|
+
|
|
14
|
+
let props: BlurProps = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if layerCtx === 'svg'}
|
|
18
|
+
<BlurSvg {...props} />
|
|
19
|
+
{:else if layerCtx === 'canvas'}
|
|
20
|
+
<BlurCanvas {...props} />
|
|
21
|
+
{:else if layerCtx === 'html'}
|
|
22
|
+
<BlurHtml {...props} />
|
|
23
|
+
{/if}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type { BlurProps, BlurPropsWithoutHTML } from './Blur.shared.svelte.js';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { createId } from '../../utils/createId.js';
|
|
7
|
+
import type { BlurProps } from './Blur.shared.svelte.js';
|
|
8
|
+
|
|
9
|
+
const uid = $props.id();
|
|
10
|
+
|
|
11
|
+
let { id = createId('blur-', uid), stdDeviation = 5, children }: BlurProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<defs>
|
|
15
|
+
<filter {id} class="lc-blur-filter">
|
|
16
|
+
<feGaussianBlur in="SourceGraphic" {stdDeviation} />
|
|
17
|
+
</filter>
|
|
18
|
+
</defs>
|
|
19
|
+
|
|
20
|
+
{#if children}
|
|
21
|
+
<g filter="url(#{id})" class="lc-blur-g">
|
|
22
|
+
{@render children()}
|
|
23
|
+
</g>
|
|
24
|
+
{/if}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
import { getSettings } from '../../contexts/settings.js';
|
|
30
30
|
import { setChartContext } from '../../contexts/chart.js';
|
|
31
31
|
import { ChartState } from '../../states/chart.svelte.js';
|
|
32
|
+
import type { ChartPropsWithoutHTML } from './Chart.shared.svelte.js';
|
|
32
33
|
import { isScaleBand } from '../../utils/scales.svelte.js';
|
|
33
34
|
import { getObjectOrNull } from '../../utils/common.js';
|
|
34
35
|
import {
|
|
@@ -71,13 +72,18 @@
|
|
|
71
72
|
let brushXDomain = $state<BrushDomainType>();
|
|
72
73
|
let brushYDomain = $state<BrushDomainType>();
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
// Pass the `$props()` proxy directly — `props.X` reads stay reactive and
|
|
76
|
+
// don't pay the cost of an `{...props}` spread (recursive `ownKeys` across
|
|
77
|
+
// nested rest/spread proxies). Brush selections are supplied as getters so
|
|
78
|
+
// the chart's domain calculation can layer them on top of `props.xDomain`
|
|
79
|
+
// / `props.yDomain` at the read sites.
|
|
80
|
+
const chartState = new ChartState<TData, XScale, YScale>(
|
|
81
|
+
props as ChartPropsWithoutHTML<TData, XScale, YScale>,
|
|
82
|
+
{
|
|
83
|
+
brushXDomain: () => brushXDomain,
|
|
84
|
+
brushYDomain: () => brushYDomain,
|
|
85
|
+
}
|
|
86
|
+
);
|
|
81
87
|
|
|
82
88
|
let ref = $state<HTMLElement>();
|
|
83
89
|
$effect.pre(() => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
import { render } from 'vitest-browser-svelte';
|
|
3
3
|
import { tick } from 'svelte';
|
|
4
|
-
import ChartCoreTestHarness from '
|
|
4
|
+
import ChartCoreTestHarness from '../tests/ChartCoreTestHarness.svelte';
|
|
5
5
|
const data = [
|
|
6
6
|
{ x: 0, y: 10 },
|
|
7
7
|
{ x: 1, y: 20 },
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
getLinkRadialPresetPath,
|
|
19
19
|
} from '../../utils/linkUtils.js';
|
|
20
20
|
import { getChartContext } from '../../contexts/chart.js';
|
|
21
|
-
import { extractLayerProps } from '../../utils/attributes.js';
|
|
22
21
|
import { accessor, type Accessor } from '../../utils/common.js';
|
|
23
22
|
import { cls } from '@layerstack/tailwind';
|
|
24
23
|
import {
|
|
@@ -203,11 +202,20 @@
|
|
|
203
202
|
}
|
|
204
203
|
: undefined;
|
|
205
204
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
// Pass `tweenOptions` (possibly undefined) so `createMotion` takes its
|
|
206
|
+
// fast-path passthrough when no tween is configured — avoids allocating
|
|
207
|
+
// a MotionNone container + per-instance `$effect` that fires on every
|
|
208
|
+
// x1/y1/x2/y2 change. Critical for force-simulation graphs which can
|
|
209
|
+
// have hundreds of links updating on every tick.
|
|
210
|
+
const motionPath = createMotion('', () => singlePathData, tweenOptions);
|
|
211
|
+
|
|
212
|
+
// Stable getter handed to `<Path>` instead of `motionPath.current`.
|
|
213
|
+
// Reading `motionPath.current` directly in the template would subscribe
|
|
214
|
+
// *this* component's template to per-tick updates, forcing the entire
|
|
215
|
+
// `<Path>` block to re-evaluate (and re-spread props) on every change.
|
|
216
|
+
// By passing a function reference, the per-tick `current` read happens
|
|
217
|
+
// inside `<Path>`'s own template — the parent stays stable.
|
|
218
|
+
const getPathData = () => motionPath.current;
|
|
211
219
|
|
|
212
220
|
const arrayRows = $derived(isArrayMode ? data ?? ctx.data ?? [] : []);
|
|
213
221
|
|
|
@@ -237,7 +245,6 @@
|
|
|
237
245
|
{markerStart}
|
|
238
246
|
{markerMid}
|
|
239
247
|
{markerEnd}
|
|
240
|
-
{...extractLayerProps(restProps, 'lc-link')}
|
|
241
248
|
{...restProps}
|
|
242
249
|
stroke={resolvedStroke}
|
|
243
250
|
fill={resolvePerDatum(fillProp, d)}
|
|
@@ -247,13 +254,12 @@
|
|
|
247
254
|
{/each}
|
|
248
255
|
{:else}
|
|
249
256
|
<Path
|
|
250
|
-
pathData={
|
|
257
|
+
pathData={getPathData}
|
|
251
258
|
bind:pathRef
|
|
252
259
|
{marker}
|
|
253
260
|
{markerStart}
|
|
254
261
|
{markerMid}
|
|
255
262
|
{markerEnd}
|
|
256
|
-
{...extractLayerProps(restProps, 'lc-link')}
|
|
257
263
|
{...restProps}
|
|
258
264
|
class={cls('lc-link', typeof classProp === 'string' ? classProp : undefined)}
|
|
259
265
|
/>
|