layerchart 0.51.1 → 0.52.0

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.
@@ -49,6 +49,7 @@ $: orientation =
49
49
  : 'vertical';
50
50
  export let scale = undefined;
51
51
  $: _scale = scale ?? (['horizontal', 'angle'].includes(orientation) ? $xScale : $yScale);
52
+ export let classes = {};
52
53
  $: [xRangeMin, xRangeMax] = extent($xRange);
53
54
  $: [yRangeMin, yRangeMax] = extent($yRange);
54
55
  $: tickVals = Array.isArray(ticks)
@@ -166,11 +167,11 @@ $: resolvedLabelProps = {
166
167
  rotate: orientation === 'vertical' && labelPlacement === 'middle' ? -90 : 0,
167
168
  capHeight: '.5rem', // text-[10px]
168
169
  ...labelProps,
169
- class: cls('label text-[10px] stroke-surface-100 [stroke-width:2px] font-light', labelProps?.class),
170
+ class: cls('label text-[10px] stroke-surface-100 [stroke-width:2px] font-light', classes.label, labelProps?.class),
170
171
  };
171
172
  </script>
172
173
 
173
- <g class="Axis placement-{placement}">
174
+ <g class={cls('Axis placement-{placement}', classes.root, $$props.class)}>
174
175
  {#if rule !== false}
175
176
  {@const lineProps = typeof rule === 'object' ? rule : null}
176
177
  {#if orientation === 'vertical'}
@@ -270,7 +271,7 @@ $: resolvedLabelProps = {
270
271
  {tweened}
271
272
  {spring}
272
273
  {...lineProps}
273
- class={cls('test grid stroke-surface-content/10', lineProps?.class)}
274
+ class={cls('grid stroke-surface-content/10', lineProps?.class)}
274
275
  />
275
276
  {:else if orientation === 'radius'}
276
277
  <circle
@@ -9,21 +9,26 @@ import Text from './Text.svelte';
9
9
  import { type AnyScale } from '../utils/scales.js';
10
10
  declare const __propDef: {
11
11
  props: {
12
- /** Location of axis */ placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
13
- /** Axis label */ label?: string;
14
- /** Location of axis label */ labelPlacement?: "start" | "middle" | "end";
15
- /** Props applied label Text */ labelProps?: Partial<ComponentProps<Text>> | undefined;
16
- /** Draw a rule line. Use Rule component for greater rendering order control */ rule?: boolean | Pick<SVGAttributes<SVGElement>, "class" | "style">;
17
- /** Draw a grid lines */ grid?: boolean | Pick<SVGAttributes<SVGElement>, "class" | "style">;
18
- /** Control the number of ticks*/ ticks?: number | any[] | ((scale: AnyScale) => any) | null | undefined;
19
- /** Length of the tick line */ tickLength?: number;
20
- /** Format tick labels */ format?: FormatType | undefined;
21
- /** Props to apply to each tick label */ tickLabelProps?: Partial<ComponentProps<Text>> | undefined;
12
+ [x: string]: any;
13
+ placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
14
+ label?: string | undefined;
15
+ labelPlacement?: ("start" | "middle" | "end") | undefined;
16
+ labelProps?: Partial<ComponentProps<Text>> | undefined;
17
+ rule?: (boolean | Pick<SVGAttributes<SVGElement>, "class" | "style">) | undefined;
18
+ grid?: (boolean | Pick<SVGAttributes<SVGElement>, "class" | "style">) | undefined;
19
+ ticks?: number | any[] | ((scale: AnyScale) => any) | null | undefined;
20
+ tickLength?: number | undefined;
21
+ format?: FormatType | undefined;
22
+ tickLabelProps?: Partial<ComponentProps<Text>> | undefined;
22
23
  spring?: boolean | Parameters<typeof springStore>[1];
23
24
  tweened?: boolean | Parameters<typeof tweenedStore>[1];
24
- transitionIn?: typeof fade | (() => {});
25
- transitionInParams?: TransitionParams;
25
+ transitionIn?: (typeof fade | (() => {})) | undefined;
26
+ transitionInParams?: TransitionParams | undefined;
26
27
  scale?: any;
28
+ classes?: {
29
+ root?: string;
30
+ label?: string;
31
+ } | undefined;
27
32
  };
28
33
  events: {
29
34
  [evt: string]: CustomEvent<any>;
@@ -1,10 +1,10 @@
1
- <script>import { SvelteComponent } from 'svelte';
1
+ <script>import {} from 'svelte';
2
2
  import { format as formatValue } from '@layerstack/utils';
3
3
  import { cls } from '@layerstack/tailwind';
4
4
  import Text from './Text.svelte';
5
5
  import { isScaleBand } from '../utils/scales.js';
6
6
  import { chartContext } from './ChartContext.svelte';
7
- import Points from './Points.svelte';
7
+ import Points, {} from './Points.svelte';
8
8
  export let placement = 'outside';
9
9
  export let offset = placement === 'center' ? 0 : 4;
10
10
  export let format = undefined;
@@ -16,6 +16,9 @@ export let tickValues = undefined;
16
16
  export let tickFontSize = 10;
17
17
  export let tickLength = 4;
18
18
  export let placement = undefined;
19
+ export let orientation = 'horizontal';
20
+ /** Determine display ramp (individual color swatches or continuous ramp)*/
21
+ export let variant = 'ramp';
19
22
  export let classes = {};
20
23
  $: if (scale == null && cScale) {
21
24
  // Read scale from chart context
@@ -124,45 +127,67 @@ else {
124
127
  >
125
128
  <div class={cls('text-[10px] font-semibold', classes.title)}>{title}</div>
126
129
  <slot values={tickValues ?? []} {scale}>
127
- <svg
128
- {width}
129
- height={height + tickLength + tickFontSize}
130
- viewBox="0 0 {width} {height + tickLength + tickFontSize}"
131
- class="overflow-visible"
132
- >
133
- <g>
134
- {#if interpolator}
135
- <ColorRamp {width} {height} {interpolator} />
136
- {:else if swatches}
137
- {#each swatches as swatch, i}
138
- <rect {...swatch} />
139
- {/each}
140
- {/if}
141
- </g>
130
+ {#if variant === 'ramp'}
131
+ <svg
132
+ {width}
133
+ height={height + tickLength + tickFontSize}
134
+ viewBox="0 0 {width} {height + tickLength + tickFontSize}"
135
+ class="overflow-visible"
136
+ >
137
+ <g>
138
+ {#if interpolator}
139
+ <ColorRamp {width} {height} {interpolator} />
140
+ {:else if swatches}
141
+ {#each swatches as swatch, i}
142
+ <rect {...swatch} />
143
+ {/each}
144
+ {/if}
145
+ </g>
142
146
 
143
- <g>
144
- {#each tickValues ?? xScale?.ticks?.(ticks) ?? [] as tick, i}
145
- <text
146
- text-anchor="middle"
147
- x={xScale(tick) + tickLabelOffset}
148
- y={height + tickLength + tickFontSize}
149
- style:font-size={tickFontSize}
150
- class={cls('fill-surface-content text-[10px]', classes.label)}
151
- >
152
- {tickFormat ? format(tick, tickFormat) : tick}
153
- </text>
147
+ <g>
148
+ {#each tickValues ?? xScale?.ticks?.(ticks) ?? [] as tick, i}
149
+ <text
150
+ text-anchor="middle"
151
+ x={xScale(tick) + tickLabelOffset}
152
+ y={height + tickLength + tickFontSize}
153
+ style:font-size={tickFontSize}
154
+ class={cls('text-[10px] fill-surface-content', classes.label)}
155
+ >
156
+ {tickFormat ? format(tick, tickFormat) : tick}
157
+ </text>
154
158
 
155
- {#if tickLine}
156
- <line
157
- x1={xScale(tick)}
158
- y1={0}
159
- x2={xScale(tick)}
160
- y2={height + tickLength}
161
- class={cls('stroke-surface-content', classes.tick)}
159
+ {#if tickLine}
160
+ <line
161
+ x1={xScale(tick)}
162
+ y1={0}
163
+ x2={xScale(tick)}
164
+ y2={height + tickLength}
165
+ class={cls('stroke-surface-content', classes.tick)}
166
+ />
167
+ {/if}
168
+ {/each}
169
+ </g>
170
+ </svg>
171
+ {:else if variant === 'swatches'}
172
+ <div
173
+ class={cls(
174
+ 'flex gap-x-4 gap-y-1',
175
+ orientation === 'vertical' && 'flex-col',
176
+ classes.swatches
177
+ )}
178
+ >
179
+ {#each tickValues ?? xScale?.ticks?.(ticks) ?? [] as tick}
180
+ <div class="flex gap-1">
181
+ <div
182
+ class={cls('h-4 w-4 rounded-full', classes.swatch)}
183
+ style:background-color={scale(tick)}
162
184
  />
163
- {/if}
185
+ <div class={cls('text-xs text-surface-content', classes.label)}>
186
+ {tickFormat ? format(tick, tickFormat) : tick}
187
+ </div>
188
+ </div>
164
189
  {/each}
165
- </g>
166
- </svg>
190
+ </div>
191
+ {/if}
167
192
  </slot>
168
193
  </div>
@@ -13,11 +13,15 @@ declare const __propDef: {
13
13
  tickFontSize?: number | undefined;
14
14
  tickLength?: number | undefined;
15
15
  placement?: ("left" | "right" | "center" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right") | undefined;
16
+ orientation?: ("horizontal" | "vertical") | undefined;
17
+ variant?: ("ramp" | "swatches") | undefined;
16
18
  classes?: {
17
19
  root?: string;
18
20
  title?: string;
19
21
  label?: string;
20
22
  tick?: string;
23
+ swatches?: string;
24
+ swatch?: string;
21
25
  } | undefined;
22
26
  };
23
27
  events: {
@@ -1,3 +1,6 @@
1
+ <script context="module">export {};
2
+ </script>
3
+
1
4
  <script>import { getContext } from 'svelte';
2
5
  import { extent } from 'd3-array';
3
6
  import { pointRadial } from 'd3-shape';
@@ -1,4 +1,12 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
+ export type Point = {
3
+ x: number;
4
+ y: number;
5
+ r: number;
6
+ xValue: any;
7
+ yValue: any;
8
+ data: any;
9
+ };
2
10
  import { type ComponentProps } from 'svelte';
3
11
  import Link from './Link.svelte';
4
12
  declare const __propDef: {
@@ -12,14 +20,7 @@ declare const __propDef: {
12
20
  fill?: string | undefined;
13
21
  stroke?: string | undefined;
14
22
  strokeWidth?: number | string | undefined;
15
- render?: ((ctx: CanvasRenderingContext2D, points: {
16
- x: number;
17
- y: number;
18
- r: number;
19
- xValue: any;
20
- yValue: any;
21
- data: any;
22
- }[]) => any) | undefined;
23
+ render?: ((ctx: CanvasRenderingContext2D, points: Point[]) => any) | undefined;
23
24
  class?: string | undefined;
24
25
  };
25
26
  events: {
@@ -27,14 +28,7 @@ declare const __propDef: {
27
28
  };
28
29
  slots: {
29
30
  default: {
30
- points: {
31
- x: number;
32
- y: number;
33
- r: number;
34
- xValue: any;
35
- yValue: any;
36
- data: any;
37
- }[];
31
+ points: Point[];
38
32
  };
39
33
  };
40
34
  };
@@ -1,8 +1,10 @@
1
1
  <script>import { extent } from 'd3-array';
2
+ import { pointRadial } from 'd3-shape';
2
3
  import { cls } from '@layerstack/tailwind';
3
4
  import { chartContext } from './ChartContext.svelte';
5
+ import Circle from './Circle.svelte';
4
6
  import Line from './Line.svelte';
5
- const { xScale, yScale, xRange, yRange } = chartContext();
7
+ const { xScale, yScale, xRange, yRange, radial } = chartContext();
6
8
  $: [xRangeMin, xRangeMax] = extent($xRange);
7
9
  $: [yRangeMin, yRangeMax] = extent($yRange);
8
10
  /**
@@ -21,28 +23,67 @@ export let x = false;
21
23
  * - Use number | Date value for annotation (xScale(value))
22
24
  */
23
25
  export let y = false;
26
+ function showRule(value, axis) {
27
+ switch (typeof value) {
28
+ case 'boolean':
29
+ return value;
30
+ case 'string':
31
+ return true;
32
+ default:
33
+ if (axis === 'x') {
34
+ return $xScale(value) >= xRangeMin && $xScale(value) <= xRangeMax;
35
+ }
36
+ else {
37
+ return $yScale(value) >= yRangeMin && $yScale(value) <= yRangeMax;
38
+ }
39
+ }
40
+ }
24
41
  </script>
25
42
 
26
43
  <g class="rule">
27
- {#if x !== false}
28
- <Line
29
- x1={x === true || x === 'left' ? xRangeMin : x === 'right' ? xRangeMax : $xScale(x)}
30
- x2={x === true || x === 'left' ? xRangeMin : x === 'right' ? xRangeMax : $xScale(x)}
31
- y1={$yRange[0] || 0}
32
- y2={$yRange[1] || 0}
33
- {...$$restProps}
34
- class={cls('stroke-surface-content/50', $$props.class)}
35
- />
44
+ {#if showRule(x, 'x')}
45
+ {@const xCoord =
46
+ x === true || x === 'left' ? xRangeMin : x === 'right' ? xRangeMax : $xScale(x)}
47
+
48
+ {#if $radial}
49
+ {@const [x1, y1] = pointRadial(xCoord, Number(yRangeMin))}
50
+ {@const [x2, y2] = pointRadial(xCoord, Number(yRangeMax))}
51
+
52
+ <Line
53
+ {x1}
54
+ {y1}
55
+ {x2}
56
+ {y2}
57
+ {...$$restProps}
58
+ class={cls('test grid stroke-surface-content/10', $$props.class)}
59
+ />
60
+ {:else}
61
+ <Line
62
+ x1={xCoord}
63
+ x2={xCoord}
64
+ y1={$yRange[0] || 0}
65
+ y2={$yRange[1] || 0}
66
+ {...$$restProps}
67
+ class={cls('stroke-surface-content/50', $$props.class)}
68
+ />
69
+ {/if}
36
70
  {/if}
37
71
 
38
- {#if y !== false}
39
- <Line
40
- x1={$xRange[0] || 0}
41
- x2={$xRange[1] || 0}
42
- y1={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
43
- y2={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
44
- {...$$restProps}
45
- class={cls('stroke-surface-content/50', $$props.class)}
46
- />
72
+ {#if showRule(y, 'y')}
73
+ {#if $radial}
74
+ <Circle
75
+ r={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
76
+ class={cls('fill-none stroke-surface-content/50', $$props.class)}
77
+ />
78
+ {:else}
79
+ <Line
80
+ x1={$xRange[0] || 0}
81
+ x2={$xRange[1] || 0}
82
+ y1={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
83
+ y2={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
84
+ {...$$restProps}
85
+ class={cls('stroke-surface-content/50', $$props.class)}
86
+ />
87
+ {/if}
47
88
  {/if}
48
89
  </g>
@@ -1,6 +1,6 @@
1
1
  <script generics="TData">import {} from 'svelte';
2
- import { scaleLinear, scaleTime } from 'd3-scale';
3
- import { stack } from 'd3-shape';
2
+ import { scaleLinear, scaleOrdinal, scaleTime } from 'd3-scale';
3
+ import { stack, stackOffsetDiverging, stackOffsetExpand, stackOffsetNone } from 'd3-shape';
4
4
  import { sum } from 'd3-array';
5
5
  import { format } from '@layerstack/utils';
6
6
  import Area from '../Area.svelte';
@@ -8,8 +8,10 @@ import Axis from '../Axis.svelte';
8
8
  import Chart from '../Chart.svelte';
9
9
  import Highlight from '../Highlight.svelte';
10
10
  import Labels from '../Labels.svelte';
11
+ import Legend from '../Legend.svelte';
11
12
  import Line from '../Line.svelte';
12
13
  import Points from '../Points.svelte';
14
+ import Rule from '../Rule.svelte';
13
15
  import Svg from '../layout/Svg.svelte';
14
16
  import * as Tooltip from '../tooltip/index.js';
15
17
  import { accessor, chartDataArray } from '../../utils/common.js';
@@ -21,9 +23,11 @@ export let radial = false;
21
23
  export let series = [{ key: 'default', value: y, color: 'hsl(var(--color-primary))' }];
22
24
  /** Determine how to layout series. Overlap (default) or stack */
23
25
  export let seriesLayout = 'overlap';
24
- $: stackSeries = seriesLayout === 'stack';
26
+ $: stackSeries = seriesLayout.startsWith('stack');
25
27
  export let axis = true;
28
+ export let rule = true;
26
29
  export let labels = false;
30
+ export let legend = false;
27
31
  export let points = false;
28
32
  export let props = {};
29
33
  $: allSeriesData = series
@@ -32,7 +36,18 @@ $: allSeriesData = series
32
36
  $: chartData = (allSeriesData.length ? allSeriesData : chartDataArray(data));
33
37
  $: if (stackSeries) {
34
38
  const seriesKeys = series.map((s) => s.key);
35
- const stackData = stack().keys(seriesKeys)(chartDataArray(data));
39
+ const offset = seriesLayout === 'stackExpand'
40
+ ? stackOffsetExpand
41
+ : seriesLayout === 'stackDiverging'
42
+ ? stackOffsetDiverging
43
+ : stackOffsetNone;
44
+ const stackData = stack()
45
+ .keys(seriesKeys)
46
+ .value((d, key) => {
47
+ const s = series.find((d) => d.key === key);
48
+ return accessor(s.value ?? s.key)(d);
49
+ })
50
+ .offset(offset)(chartDataArray(data));
36
51
  chartData = chartData.map((d, i) => {
37
52
  return {
38
53
  ...d,
@@ -50,12 +65,17 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
50
65
  {xScale}
51
66
  y={y ??
52
67
  (stackSeries
53
- ? (d) => series.map((s, i) => d.stackData[i][1])
68
+ ? (d) => series.flatMap((s, i) => d.stackData[i])
54
69
  : series.map((s) => s.value ?? s.key))}
55
70
  yBaseline={0}
56
71
  yNice
57
72
  {radial}
58
- padding={radial || axis === false ? undefined : { left: 16, bottom: 16 }}
73
+ padding={radial || axis === false
74
+ ? undefined
75
+ : {
76
+ left: axis === true || axis === 'y' ? 16 : 0,
77
+ bottom: (axis === true || axis === 'x' ? 16 : 0) + (legend === true ? 32 : 0),
78
+ }}
59
79
  tooltip={{ mode: 'bisect-x' }}
60
80
  {...$$restProps}
61
81
  let:x
@@ -72,22 +92,29 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
72
92
  <Svg center={radial}>
73
93
  <slot name="axis" {...slotProps}>
74
94
  {#if axis}
75
- <Axis
76
- placement={radial ? 'radius' : 'left'}
77
- grid
78
- rule
79
- format={(value) => format(value, undefined, { variant: 'short' })}
80
- {...typeof axis === 'object' ? axis : null}
81
- {...props.yAxis}
82
- />
83
- <Axis
84
- placement={radial ? 'angle' : 'bottom'}
85
- grid={radial}
86
- rule
87
- format={(value) => format(value, undefined, { variant: 'short' })}
88
- {...typeof axis === 'object' ? axis : null}
89
- {...props.xAxis}
90
- />
95
+ {#if axis !== 'x'}
96
+ <Axis
97
+ placement={radial ? 'radius' : 'left'}
98
+ grid
99
+ format={(value) => format(value, undefined, { variant: 'short' })}
100
+ {...typeof axis === 'object' ? axis : null}
101
+ {...props.yAxis}
102
+ />
103
+ {/if}
104
+
105
+ {#if axis !== 'y'}
106
+ <Axis
107
+ placement={radial ? 'angle' : 'bottom'}
108
+ grid={radial}
109
+ format={(value) => format(value, undefined, { variant: 'short' })}
110
+ {...typeof axis === 'object' ? axis : null}
111
+ {...props.xAxis}
112
+ />
113
+ {/if}
114
+
115
+ {#if rule}
116
+ <Rule x={0} y={0} {...typeof rule === 'object' ? rule : null} {...props.rule} />
117
+ {/if}
91
118
  {/if}
92
119
  </slot>
93
120
 
@@ -156,6 +183,21 @@ $: xScale = accessor(x)(chartData[0]) instanceof Date ? scaleTime() : scaleLinea
156
183
  {/if}
157
184
  </Svg>
158
185
 
186
+ <slot name="legend" {...slotProps}>
187
+ {#if legend}
188
+ <Legend
189
+ scale={scaleOrdinal(
190
+ series.map((s) => s.key),
191
+ series.map((s) => s.color)
192
+ )}
193
+ placement="bottom"
194
+ variant="swatches"
195
+ {...props.legend}
196
+ {...typeof legend === 'object' ? legend : null}
197
+ />
198
+ {/if}
199
+ </slot>
200
+
159
201
  <slot name="tooltip" {...slotProps}>
160
202
  <Tooltip.Root let:data>
161
203
  <Tooltip.Header>{format(x(data))}</Tooltip.Header>
@@ -4,8 +4,10 @@ import Area from '../Area.svelte';
4
4
  import Axis from '../Axis.svelte';
5
5
  import Highlight from '../Highlight.svelte';
6
6
  import Labels from '../Labels.svelte';
7
+ import Legend from '../Legend.svelte';
7
8
  import Line from '../Line.svelte';
8
9
  import Points from '../Points.svelte';
10
+ import Rule from '../Rule.svelte';
9
11
  import { type Accessor } from '../../utils/common.js';
10
12
  declare class __sveltets_Render<TData> {
11
13
  props(): {
@@ -179,37 +181,56 @@ declare class __sveltets_Render<TData> {
179
181
  }> | undefined;
180
182
  transformContext?: import("..").TransformContext;
181
183
  } & {
182
- series?: {
183
- key: string;
184
- label?: string;
185
- value?: Accessor<TData>;
186
- /** Provider series data, else uses chart data (with value/key accessor) */
187
- data?: TData[] | undefined;
188
- color?: string;
189
- props?: Partial<ComponentProps<Area>>;
190
- }[] | undefined;
191
- labels?: boolean | {
184
+ axis?: boolean | "x" | "y" | {
192
185
  [x: string]: any;
193
- placement?: ("inside" | "outside" | "center") | undefined;
194
- offset?: number | undefined;
195
- format?: import("@layerstack/utils").FormatType | undefined;
196
- };
197
- axis?: boolean | {
198
186
  placement: "top" | "bottom" | "left" | "right" | "angle" | "radius";
199
- label?: string;
200
- labelPlacement?: "start" | "middle" | "end";
187
+ label?: string | undefined;
188
+ labelPlacement?: ("start" | "middle" | "end") | undefined;
201
189
  labelProps?: Partial<ComponentProps<import("..").Text>> | undefined;
202
- rule?: boolean | Pick<import("svelte/elements").SVGAttributes<SVGElement>, "class" | "style">;
203
- grid?: boolean | Pick<import("svelte/elements").SVGAttributes<SVGElement>, "class" | "style">;
190
+ rule?: (boolean | Pick<import("svelte/elements").SVGAttributes<SVGElement>, "class" | "style">) | undefined;
191
+ grid?: (boolean | Pick<import("svelte/elements").SVGAttributes<SVGElement>, "class" | "style">) | undefined;
204
192
  ticks?: number | any[] | ((scale: import("../../utils/scales").AnyScale) => any) | null | undefined;
205
- tickLength?: number;
193
+ tickLength?: number | undefined;
206
194
  format?: import("@layerstack/utils").FormatType | undefined;
207
195
  tickLabelProps?: Partial<ComponentProps<import("..").Text>> | undefined;
208
196
  spring?: boolean | Parameters<typeof import("svelte/motion").spring>[1];
209
197
  tweened?: boolean | Parameters<typeof import("svelte/motion").tweened>[1];
210
- transitionIn?: typeof import("svelte/transition").fade | (() => {});
211
- transitionInParams?: import("svelte-ux").TransitionParams;
198
+ transitionIn?: (typeof import("svelte/transition").fade | (() => {})) | undefined;
199
+ transitionInParams?: import("svelte-ux").TransitionParams | undefined;
200
+ scale?: any;
201
+ classes?: {
202
+ root?: string;
203
+ label?: string;
204
+ } | undefined;
205
+ };
206
+ labels?: boolean | {
207
+ [x: string]: any;
208
+ placement?: ("inside" | "outside" | "center") | undefined;
209
+ offset?: number | undefined;
210
+ format?: import("@layerstack/utils").FormatType | undefined;
211
+ };
212
+ legend?: boolean | {
213
+ [x: string]: any;
212
214
  scale?: any;
215
+ title?: string | undefined;
216
+ width?: number | undefined;
217
+ height?: number | undefined;
218
+ ticks?: number | undefined;
219
+ tickFormat?: import("@layerstack/utils").FormatType | undefined;
220
+ tickValues?: any[] | undefined;
221
+ tickFontSize?: number | undefined;
222
+ tickLength?: number | undefined;
223
+ placement?: ("left" | "right" | "center" | "bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right") | undefined;
224
+ orientation?: ("horizontal" | "vertical") | undefined;
225
+ variant?: ("ramp" | "swatches") | undefined;
226
+ classes?: {
227
+ root?: string;
228
+ title?: string;
229
+ label?: string;
230
+ tick?: string;
231
+ swatches?: string;
232
+ swatch?: string;
233
+ } | undefined;
213
234
  };
214
235
  points?: boolean | {
215
236
  [x: string]: any;
@@ -221,26 +242,35 @@ declare class __sveltets_Render<TData> {
221
242
  fill?: string | undefined;
222
243
  stroke?: string | undefined;
223
244
  strokeWidth?: number | string | undefined;
224
- render?: ((ctx: CanvasRenderingContext2D, points: {
225
- x: number;
226
- y: number;
227
- r: number;
228
- xValue: any;
229
- yValue: any;
230
- data: any;
231
- }[]) => any) | undefined;
245
+ render?: ((ctx: CanvasRenderingContext2D, points: import("../Points.svelte").Point[]) => any) | undefined;
232
246
  class?: string | undefined;
233
247
  };
234
248
  props?: {
235
249
  xAxis?: Partial<ComponentProps<Axis>>;
236
250
  yAxis?: Partial<ComponentProps<Axis>>;
251
+ rule?: Partial<ComponentProps<Rule>>;
237
252
  area?: Partial<ComponentProps<Area>>;
238
253
  line?: Partial<ComponentProps<Line>>;
254
+ legend?: Partial<ComponentProps<Legend>>;
239
255
  points?: Partial<ComponentProps<Points>>;
240
256
  highlight?: Partial<ComponentProps<Highlight>>;
241
257
  labels?: Partial<ComponentProps<Labels>>;
242
258
  } | undefined;
243
- seriesLayout?: "overlap" | "stack";
259
+ rule?: boolean | {
260
+ [x: string]: any;
261
+ x?: (number | Date | boolean | "left" | "right") | undefined;
262
+ y?: (number | Date | boolean | "top" | "bottom") | undefined;
263
+ };
264
+ series?: {
265
+ key: string;
266
+ label?: string;
267
+ value?: Accessor<TData>;
268
+ /** Provider series data, else uses chart data (with value/key accessor) */
269
+ data?: TData[] | undefined;
270
+ color?: string;
271
+ props?: Partial<ComponentProps<Area>>;
272
+ }[] | undefined;
273
+ seriesLayout?: "overlap" | "stack" | "stackExpand" | "stackDiverging";
244
274
  };
245
275
  events(): {} & {
246
276
  [evt: string]: CustomEvent<any>;
@@ -252,6 +282,7 @@ declare class __sveltets_Render<TData> {
252
282
  marks: any;
253
283
  'above-marks': any;
254
284
  highlight: any;
285
+ legend: any;
255
286
  tooltip: any;
256
287
  };
257
288
  }