svelteplot 0.4.0 → 0.4.1-pr-181.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.
Files changed (47) hide show
  1. package/dist/Mark.svelte +3 -3
  2. package/dist/helpers/autoScales.js +1 -1
  3. package/dist/helpers/colors.d.ts +1 -1
  4. package/dist/helpers/index.d.ts +2 -2
  5. package/dist/helpers/mergeDeep.js +0 -1
  6. package/dist/helpers/reduce.js +0 -1
  7. package/dist/helpers/resolve.d.ts +1 -1
  8. package/dist/helpers/scales.d.ts +1 -1
  9. package/dist/helpers/scales.js +1 -1
  10. package/dist/helpers/typeChecks.d.ts +4 -4
  11. package/dist/marks/AreaX.svelte.d.ts +31 -30
  12. package/dist/marks/AreaY.svelte.d.ts +31 -30
  13. package/dist/marks/AxisX.svelte.d.ts +1 -1
  14. package/dist/marks/AxisY.svelte.d.ts +1 -1
  15. package/dist/marks/BarX.svelte.d.ts +1 -1
  16. package/dist/marks/BollingerX.svelte.d.ts +2 -73
  17. package/dist/marks/BollingerY.svelte.d.ts +2 -73
  18. package/dist/marks/BoxY.svelte.d.ts +6 -65
  19. package/dist/marks/CustomMark.svelte.d.ts +2 -80
  20. package/dist/marks/DifferenceY.svelte.d.ts +7 -66
  21. package/dist/marks/DotX.svelte.d.ts +29 -29
  22. package/dist/marks/DotY.svelte.d.ts +29 -29
  23. package/dist/marks/Frame.svelte +10 -4
  24. package/dist/marks/Frame.svelte.d.ts +1 -0
  25. package/dist/marks/Line.svelte.d.ts +2 -2
  26. package/dist/marks/LineX.svelte.d.ts +34 -33
  27. package/dist/marks/LineY.svelte.d.ts +34 -33
  28. package/dist/marks/Link.svelte +1 -4
  29. package/dist/marks/Rect.svelte +7 -4
  30. package/dist/marks/RuleX.svelte +3 -5
  31. package/dist/marks/RuleY.svelte +4 -5
  32. package/dist/marks/Spike.svelte.d.ts +27 -27
  33. package/dist/marks/Text.svelte +4 -3
  34. package/dist/marks/Text.svelte.d.ts +2 -2
  35. package/dist/marks/Vector.svelte +1 -3
  36. package/dist/marks/helpers/MultilineText.svelte +3 -7
  37. package/dist/marks/helpers/RectPath.svelte +2 -4
  38. package/dist/transforms/bollinger.d.ts +1 -66
  39. package/dist/transforms/group.d.ts +4 -12
  40. package/dist/transforms/interval.d.ts +2 -122
  41. package/dist/transforms/select.d.ts +7 -427
  42. package/dist/transforms/sort.d.ts +3 -242
  43. package/dist/transforms/stack.d.ts +3 -23
  44. package/dist/transforms/window.d.ts +2 -130
  45. package/dist/types/data.d.ts +3 -3
  46. package/dist/types/index.d.ts +1 -1
  47. package/package.json +126 -125
@@ -1,32 +1,33 @@
1
+ import { recordizeY } from '../index.js';
1
2
  import type { DataRow } from '../index.js';
2
3
  declare class __sveltets_Render<Datum extends DataRow> {
3
4
  props(): Omit<import("../types").MarkerOptions & Partial<{
4
- filter?: import("../types").ConstantAccessor<boolean, import("../types").DataRecord>;
5
+ filter?: import("../types").ConstantAccessor<boolean, Record<string | symbol, import("../types").RawValue>>;
5
6
  facet?: "auto" | "include" | "exclude";
6
- fx: import("../types").ChannelAccessor<import("../types").DataRecord>;
7
- fy: import("../types").ChannelAccessor<import("../types").DataRecord>;
8
- dx: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
9
- dy: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
10
- fill: import("../types").ChannelAccessor<import("../types").DataRecord>;
11
- fillOpacity: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
7
+ fx: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
8
+ fy: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
9
+ dx: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
10
+ dy: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
11
+ fill: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
12
+ fillOpacity: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
12
13
  sort: {
13
14
  channel: string;
14
15
  order?: "ascending" | "descending";
15
- } | ((a: import("../types").RawValue, b: import("../types").RawValue) => number) | import("../types").ConstantAccessor<import("../types").RawValue, import("../types").DataRecord>;
16
- stroke: import("../types").ChannelAccessor<import("../types").DataRecord>;
17
- strokeWidth: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
18
- strokeOpacity: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
19
- strokeLinejoin: import("../types").ConstantAccessor<import("csstype").Property.StrokeLinejoin, import("../types").DataRecord>;
20
- strokeLinecap: import("../types").ConstantAccessor<import("csstype").Property.StrokeLinecap, import("../types").DataRecord>;
21
- strokeMiterlimit: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
22
- opacity: import("../types").ChannelAccessor<import("../types").DataRecord>;
23
- strokeDasharray: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
24
- strokeDashoffset: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
25
- mixBlendMode: import("../types").ConstantAccessor<import("csstype").Property.MixBlendMode, import("../types").DataRecord>;
16
+ } | ((a: import("../types").RawValue, b: import("../types").RawValue) => number) | import("../types").ConstantAccessor<import("../types").RawValue, Record<string | symbol, import("../types").RawValue>>;
17
+ stroke: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
18
+ strokeWidth: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
19
+ strokeOpacity: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
20
+ strokeLinejoin: import("../types").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Record<string | symbol, import("../types").RawValue>>;
21
+ strokeLinecap: import("../types").ConstantAccessor<import("csstype").Property.StrokeLinecap, Record<string | symbol, import("../types").RawValue>>;
22
+ strokeMiterlimit: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
23
+ opacity: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
24
+ strokeDasharray: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
25
+ strokeDashoffset: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
26
+ mixBlendMode: import("../types").ConstantAccessor<import("csstype").Property.MixBlendMode, Record<string | symbol, import("../types").RawValue>>;
26
27
  clipPath: string;
27
- imageFilter: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
28
- shapeRendering: import("../types").ConstantAccessor<import("csstype").Property.ShapeRendering, import("../types").DataRecord>;
29
- paintOrder: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
28
+ imageFilter: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
29
+ shapeRendering: import("../types").ConstantAccessor<import("csstype").Property.ShapeRendering, Record<string | symbol, import("../types").RawValue>>;
30
+ paintOrder: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
30
31
  onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
31
32
  ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
32
33
  onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
@@ -58,26 +59,26 @@ declare class __sveltets_Render<Datum extends DataRow> {
58
59
  oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
59
60
  onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
61
  class: string | null;
61
- cursor: import("../types").ConstantAccessor<import("csstype").Property.Cursor, import("../types").DataRecord>;
62
+ cursor: import("../types").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types").RawValue>>;
62
63
  }> & {
63
- data?: import("../types").DataRecord[] | undefined;
64
- x?: import("../types").ChannelAccessor<import("../types").DataRecord>;
65
- y?: import("../types").ChannelAccessor<import("../types").DataRecord>;
66
- z?: import("../types").ChannelAccessor<import("../types").DataRecord>;
64
+ data?: Record<string | symbol, import("../types").RawValue>[] | undefined;
65
+ x?: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
66
+ y?: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
67
+ z?: import("../types").ChannelAccessor<Record<string | symbol, import("../types").RawValue>>;
67
68
  outlineStroke?: string;
68
69
  outlineStrokeWidth?: number;
69
70
  outlineStrokeOpacity?: number;
70
71
  curve?: import("../types").CurveName | import("d3-shape").CurveFactory | "auto";
71
72
  tension?: number;
72
- sort?: import("../types").ConstantAccessor<import("../types").RawValue, import("../types").DataRecord> | {
73
+ sort?: import("../types").ConstantAccessor<recordizeY, Datum_1> | {
73
74
  channel: "stroke" | "fill";
74
75
  };
75
- text?: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
76
- textFill?: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
77
- textStroke?: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
78
- textStartOffset?: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
79
- textStrokeWidth?: import("../types").ConstantAccessor<number, import("../types").DataRecord>;
80
- lineClass?: import("../types").ConstantAccessor<string, import("../types").DataRecord>;
76
+ text?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
77
+ textFill?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
78
+ textStroke?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
79
+ textStartOffset?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
80
+ textStrokeWidth?: import("../types").ConstantAccessor<number, Record<string | symbol, import("../types").RawValue>>;
81
+ lineClass?: import("../types").ConstantAccessor<string, Record<string | symbol, import("../types").RawValue>>;
81
82
  canvas?: boolean;
82
83
  }, "x" | "data"> & {
83
84
  data: Datum[];
@@ -157,8 +157,6 @@
157
157
  <g class={['link', className]} data-use-x={usedScales.x ? 1 : 0}>
158
158
  {#each scaledData as d, i (i)}
159
159
  {#if d.valid || true}
160
- {@const dx = resolveProp(args.dx, d.datum, 0)}
161
- {@const dy = resolveProp(args.dx, d.datum, 0)}
162
160
  {@const [style, styleClass] = resolveStyles(
163
161
  plot,
164
162
  d,
@@ -196,8 +194,7 @@
196
194
  text={text ? resolveProp(text, d.datum) : null}
197
195
  startOffset={resolveProp(args.textStartOffset, d.datum, '50%')}
198
196
  {textStyle}
199
- {textStyleClass}
200
- transform={dx || dy ? `translate(${dx}, ${dy})` : null} />
197
+ {textStyleClass} />
201
198
  {/if}
202
199
  {/each}
203
200
  </g>
@@ -31,6 +31,7 @@
31
31
  } from '../types/index.js';
32
32
  import GroupMultiple from './helpers/GroupMultiple.svelte';
33
33
  import RectPath from './helpers/RectPath.svelte';
34
+ import { resolveProp } from '../helpers/resolve';
34
35
 
35
36
  let markProps: RectMarkProps = $props();
36
37
 
@@ -64,10 +65,12 @@
64
65
  <GroupMultiple class={scaledData.length > 1 ? className : null} length={scaledData.length}>
65
66
  {#each scaledData as d, i (i)}
66
67
  {#if d.valid}
67
- {@const x1 = d.x1 == null ? plot.options.marginLeft : d.x1}
68
- {@const x2 = d.x2 == null ? plot.options.marginLeft + plot.facetWidth : d.x2}
69
- {@const y1 = d.y1 == null ? plot.options.marginTop : d.y1}
70
- {@const y2 = d.y2 == null ? plot.options.marginTop + plot.facetHeight : d.y2}
68
+ {@const x1 = d.x1 == null ? plot.options.marginLeft + d.dx : d.x1}
69
+ {@const x2 =
70
+ d.x2 == null ? plot.options.marginLeft + plot.facetWidth + d.dx : d.x2}
71
+ {@const y1 = d.y1 == null ? plot.options.marginTop + d.dy : d.y1}
72
+ {@const y2 =
73
+ d.y2 == null ? plot.options.marginTop + plot.facetHeight + d.dy : d.y2}
71
74
 
72
75
  {@const miny = Math.min(y1, y2)}
73
76
  {@const maxy = Math.max(y1, y2)}
@@ -52,15 +52,13 @@
52
52
  {@const inset = resolveProp(args.inset, d.datum, 0)}
53
53
  {@const insetTop = resolveProp(args.insetTop, d.datum, 0)}
54
54
  {@const insetBottom = resolveProp(args.insetBottom, d.datum, 0)}
55
- {@const dx = resolveProp(args.dx, d.datum, 0)}
56
- {@const dy = resolveProp(args.dy, d.datum, 0)}
57
55
  {@const [style, styleClass] = resolveStyles(plot, d, args, 'stroke', usedScales)}
58
56
  <line
59
- transform="translate({d.x + dx}, {dy})"
57
+ transform="translate({d.x}, 0)"
60
58
  {style}
61
59
  class={[styleClass]}
62
- y1={(inset || insetTop) + (d.y1 != null ? d.y1 : plot.options.marginTop)}
63
- y2={(d.y2 != null ? d.y2 : plot.facetHeight + plot.options.marginTop) -
60
+ y1={(inset || insetTop) + (d.y1 != null ? d.y1 : plot.options.marginTop + d.dy)}
61
+ y2={(d.y2 != null ? d.y2 : plot.facetHeight + plot.options.marginTop + d.dy) -
64
62
  (inset || insetBottom)} />
65
63
  {/each}
66
64
  </GroupMultiple>
@@ -51,15 +51,14 @@
51
51
  {@const inset = resolveProp(args.inset, d.datum, 0)}
52
52
  {@const insetLeft = resolveProp(args.insetLeft, d.datum, 0)}
53
53
  {@const insetRight = resolveProp(args.insetRight, d.datum, 0)}
54
- {@const dx = resolveProp(args.dx, d.datum, 0)}
55
- {@const dy = resolveProp(args.dy, d.datum, 0)}
56
54
  {@const [style, styleClass] = resolveStyles(plot, d, args, 'stroke', usedScales)}
57
55
  <line
58
- transform="translate({dx}, {d.y + dy})"
56
+ transform="translate(0, {d.y})"
59
57
  {style}
60
58
  class={[styleClass]}
61
- x1={(inset || insetLeft) + (d.x1 != null ? d.x1 : plot.options.marginLeft)}
62
- x2={(d.x2 != null ? d.x2 : plot.facetWidth + plot.options.marginLeft) -
59
+ x1={(inset || insetLeft) +
60
+ (d.x1 != null ? d.x1 : plot.options.marginLeft + d.dx)}
61
+ x2={(d.x2 != null ? d.x2 : plot.facetWidth + plot.options.marginLeft + d.dx) -
63
62
  (inset || insetRight)} />
64
63
  {/each}
65
64
  </GroupMultiple>
@@ -1,32 +1,32 @@
1
1
  import type { ChannelAccessor, DataRecord } from '../types/index.js';
2
2
  declare class __sveltets_Render<Datum extends DataRecord> {
3
3
  props(): Omit<Partial<{
4
- filter?: import("../types/index.js").ConstantAccessor<boolean, DataRecord>;
4
+ filter?: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/data").RawValue>>;
5
5
  facet?: "auto" | "include" | "exclude";
6
- fx: ChannelAccessor<DataRecord>;
7
- fy: ChannelAccessor<DataRecord>;
8
- dx: import("../types/index.js").ConstantAccessor<number, DataRecord>;
9
- dy: import("../types/index.js").ConstantAccessor<number, DataRecord>;
10
- fill: ChannelAccessor<DataRecord>;
11
- fillOpacity: import("../types/index.js").ConstantAccessor<number, DataRecord>;
6
+ fx: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
7
+ fy: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
8
+ dx: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
9
+ dy: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
10
+ fill: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
11
+ fillOpacity: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
12
12
  sort: {
13
13
  channel: string;
14
14
  order?: "ascending" | "descending";
15
- } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, DataRecord>;
16
- stroke: ChannelAccessor<DataRecord>;
17
- strokeWidth: import("../types/index.js").ConstantAccessor<number, DataRecord>;
18
- strokeOpacity: import("../types/index.js").ConstantAccessor<number, DataRecord>;
19
- strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, DataRecord>;
20
- strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, DataRecord>;
21
- strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, DataRecord>;
22
- opacity: ChannelAccessor<DataRecord>;
23
- strokeDasharray: import("../types/index.js").ConstantAccessor<string, DataRecord>;
24
- strokeDashoffset: import("../types/index.js").ConstantAccessor<number, DataRecord>;
25
- mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, DataRecord>;
15
+ } | ((a: import("../types/data").RawValue, b: import("../types/data").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/data").RawValue, Record<string | symbol, import("../types/data").RawValue>>;
16
+ stroke: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
17
+ strokeWidth: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
18
+ strokeOpacity: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
19
+ strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Record<string | symbol, import("../types/data").RawValue>>;
20
+ strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Record<string | symbol, import("../types/data").RawValue>>;
21
+ strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
22
+ opacity: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
23
+ strokeDasharray: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
24
+ strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/data").RawValue>>;
25
+ mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Record<string | symbol, import("../types/data").RawValue>>;
26
26
  clipPath: string;
27
- imageFilter: import("../types/index.js").ConstantAccessor<string, DataRecord>;
28
- shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, DataRecord>;
29
- paintOrder: import("../types/index.js").ConstantAccessor<string, DataRecord>;
27
+ imageFilter: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
28
+ shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Record<string | symbol, import("../types/data").RawValue>>;
29
+ paintOrder: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/data").RawValue>>;
30
30
  onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
31
31
  ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
32
32
  onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
@@ -58,14 +58,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
58
58
  oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
59
59
  onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
60
60
  class: string | null;
61
- cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, DataRecord>;
61
+ cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types/data").RawValue>>;
62
62
  }> & {
63
- data: DataRecord[];
64
- x: ChannelAccessor<DataRecord>;
65
- y: ChannelAccessor<DataRecord>;
63
+ data: Record<string | symbol, import("../types/data").RawValue>[];
64
+ x: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
65
+ y: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
66
66
  r?: number;
67
- length?: ChannelAccessor<DataRecord>;
68
- rotate?: ChannelAccessor<DataRecord>;
67
+ length?: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
68
+ rotate?: ChannelAccessor<Record<string | symbol, import("../types/data").RawValue>>;
69
69
  anchor?: "start" | "middle" | "end";
70
70
  shape?: "arrow" | "spike" | "arrow-filled" | import("./Vector.svelte").ShapeRenderer;
71
71
  children?: import("svelte").Snippet;
@@ -17,7 +17,7 @@
17
17
  * the font size of the text
18
18
  */
19
19
  fontFamily?: ConstantAccessor<CSS.Property.FontFamily, Datum>;
20
- fontSize?: ConstantAccessor<CSS.Property.FontSize, Datum>;
20
+ fontSize?: ConstantAccessor<CSS.Property.FontSize | number, Datum>;
21
21
  fontWeight?: ConstantAccessor<CSS.Property.FontWeight, Datum>;
22
22
  fontStyle?: ConstantAccessor<CSS.Property.FontStyle, Datum>;
23
23
  fontVariant?: ConstantAccessor<CSS.Property.FontVariant, Datum>;
@@ -46,7 +46,8 @@
46
46
  | 'top-left'
47
47
  | 'bottom-left'
48
48
  | 'top-right'
49
- | 'bottom-right',
49
+ | 'bottom-right'
50
+ | 'middle',
50
51
  Datum
51
52
  >;
52
53
  /**
@@ -75,7 +76,7 @@
75
76
  fontSize: 12,
76
77
  c: 500,
77
78
  strokeWidth: 1.6,
78
- frameAnchor: 'center',
79
+ frameAnchor: 'middle' as const,
79
80
  lineHeight: 1.1,
80
81
  rotate: 0,
81
82
  ...getContext<PlotDefaults>('svelteplot/_defaults').text
@@ -72,7 +72,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
72
72
  * the font size of the text
73
73
  */
74
74
  fontFamily?: ConstantAccessor<CSS.Property.FontFamily, Datum>;
75
- fontSize?: ConstantAccessor<CSS.Property.FontSize<0 | (string & {})>, Datum>;
75
+ fontSize?: ConstantAccessor<number | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | (string & {}) | "small" | "medium" | "large" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "larger" | "smaller", Datum>;
76
76
  fontWeight?: ConstantAccessor<CSS.Property.FontWeight, Datum>;
77
77
  fontStyle?: ConstantAccessor<CSS.Property.FontStyle, Datum>;
78
78
  fontVariant?: ConstantAccessor<CSS.Property.FontVariant, Datum>;
@@ -93,7 +93,7 @@ declare class __sveltets_Render<Datum extends DataRecord> {
93
93
  * @default 1.2
94
94
  */
95
95
  lineHeight?: ConstantAccessor<number, Datum>;
96
- frameAnchor?: ConstantAccessor<"bottom" | "top" | "left" | "right" | "top-left" | "bottom-left" | "top-right" | "bottom-right", Datum>;
96
+ frameAnchor?: ConstantAccessor<"bottom" | "top" | "left" | "right" | "middle" | "top-left" | "bottom-left" | "top-right" | "bottom-right", Datum>;
97
97
  /**
98
98
  * rotate text by angle in degrees
99
99
  */
@@ -177,8 +177,6 @@
177
177
  {#each scaledData as d, i (i)}
178
178
  {@const r = resolveChannel('r', d.datum, { r: 3, ...args })}
179
179
  {#if d.valid && isValid(r)}
180
- {@const dx = +resolveProp(args.dx, d.datum, 0)}
181
- {@const dy = +resolveProp(args.dx, d.datum, 0)}
182
180
  {@const [style, styleClass] = resolveStyles(
183
181
  plot,
184
182
  d,
@@ -193,7 +191,7 @@
193
191
  )}
194
192
  <path
195
193
  d={shapePath(shape, d.length, r)}
196
- transform="translate({d.x + dx}, {d.y + dy}) rotate({resolveProp(
194
+ transform="translate({d.x}, {d.y}) rotate({resolveProp(
197
195
  args.rotate,
198
196
  d.datum,
199
197
  0
@@ -70,9 +70,6 @@
70
70
  ]
71
71
  );
72
72
 
73
- const dx = $derived(+resolveProp(args.dx, d.datum, 0));
74
- const dy = $derived(+resolveProp(args.dy, d.datum, 0));
75
-
76
73
  const [style, styleClass] = $derived(
77
74
  resolveStyles(
78
75
  plot,
@@ -126,9 +123,8 @@
126
123
  bind:this={textElement}
127
124
  class={[textClassName]}
128
125
  dominant-baseline={LINE_ANCHOR[lineAnchor]}
129
- transform="translate({Math.round(x + dx)},{Math.round(
130
- y +
131
- dy -
126
+ transform="translate({Math.round(x)},{Math.round(
127
+ y -
132
128
  (lineAnchor === 'bottom'
133
129
  ? textLines.length - 1
134
130
  : lineAnchor === 'middle'
@@ -148,7 +144,7 @@
148
144
  <text
149
145
  class={[textClassName, styleClass]}
150
146
  dominant-baseline={LINE_ANCHOR[lineAnchor]}
151
- transform="translate({Math.round(x + dx)},{Math.round(y + dy)}) rotate({rotate})"
147
+ transform="translate({Math.round(x)},{Math.round(y)}) rotate({rotate})"
152
148
  {style}
153
149
  >{textLines[0]}{#if title}<title>{title}</title>{/if}</text>
154
150
  {/if}
@@ -58,8 +58,6 @@ Helper component for rendering rectangular marks in SVG
58
58
  const { getPlotState } = getContext<PlotContext>('svelteplot');
59
59
  const plot = $derived(getPlotState());
60
60
 
61
- const dx = $derived(+(resolveProp(options.dx, datum?.datum, 0) as number));
62
- const dy = $derived(+(resolveProp(options.dy, datum?.datum, 0) as number));
63
61
  const inset = $derived(+(resolveProp(options.inset, datum?.datum, 0) as number));
64
62
  const insetLeft = $derived(
65
63
  +(resolveProp(
@@ -108,7 +106,7 @@ Helper component for rendering rectangular marks in SVG
108
106
  <Anchor {options} datum={datum?.datum}>
109
107
  {#if hasBorderRadius}
110
108
  <path
111
- transform="translate({x + dx + insetLeft},{y + insetBottom + dy})"
109
+ transform="translate({x + insetLeft},{y + insetBottom})"
112
110
  d={roundedRect(
113
111
  0,
114
112
  0,
@@ -125,7 +123,7 @@ Helper component for rendering rectangular marks in SVG
125
123
  }} />
126
124
  {:else}
127
125
  <rect
128
- transform="translate({x + dx + insetLeft},{y + insetBottom + dy})"
126
+ transform="translate({x + insetLeft},{y + insetBottom})"
129
127
  width={width - insetLeft - insetRight}
130
128
  height={height - insetTop - insetBottom}
131
129
  class={[styleClass, className]}
@@ -11,69 +11,4 @@ export type BollingerOptions = {
11
11
  };
12
12
  export declare function bollingerX(args: TransformArg<DataRecord>, options?: BollingerOptions): TransformArg<DataRecord>;
13
13
  export declare function bollingerY(args: TransformArg<DataRecord>, options?: BollingerOptions): TransformArg<DataRecord>;
14
- export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions): {
15
- filter?: import("../types/index.js").ConstantAccessor<boolean, DataRecord>;
16
- facet?: "auto" | "include" | "exclude" | undefined;
17
- fx?: import("../types/index.js").ChannelAccessor<DataRecord>;
18
- fy?: import("../types/index.js").ChannelAccessor<DataRecord>;
19
- dx?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
20
- dy?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
21
- fill?: import("../types/index.js").ChannelAccessor<DataRecord>;
22
- fillOpacity?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
23
- sort?: {
24
- channel: string;
25
- order?: "ascending" | "descending";
26
- } | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, DataRecord>;
27
- stroke?: import("../types/index.js").ChannelAccessor<DataRecord>;
28
- strokeWidth?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
29
- strokeOpacity?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
30
- strokeLinejoin?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, DataRecord>;
31
- strokeLinecap?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, DataRecord>;
32
- strokeMiterlimit?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
33
- opacity?: import("../types/index.js").ChannelAccessor<DataRecord>;
34
- strokeDasharray?: import("../types/index.js").ConstantAccessor<string, DataRecord>;
35
- strokeDashoffset?: import("../types/index.js").ConstantAccessor<number, DataRecord>;
36
- mixBlendMode?: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, DataRecord>;
37
- clipPath?: string | undefined;
38
- imageFilter?: import("../types/index.js").ConstantAccessor<string, DataRecord>;
39
- shapeRendering?: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, DataRecord>;
40
- paintOrder?: import("../types/index.js").ConstantAccessor<string, DataRecord>;
41
- onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
42
- ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
43
- onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
44
- onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
45
- onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
46
- onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
47
- onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
48
- onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
49
- onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
50
- onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
51
- onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
52
- onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
53
- onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
54
- onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
55
- onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
56
- onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
57
- onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
58
- ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
59
- ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
60
- ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
61
- ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
62
- ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
63
- ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
64
- ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
65
- ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
66
- ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
67
- ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
68
- ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
69
- oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
70
- onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
71
- class?: string | null | undefined;
72
- cursor?: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, DataRecord>;
73
- data: {
74
- __x: import("../types/index.js").RawValue;
75
- __lo: number;
76
- __avg: number;
77
- __hi: number;
78
- }[];
79
- };
14
+ export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions): any;
@@ -38,29 +38,21 @@ type GroupZOptions = GroupXOptions | GroupYOptions;
38
38
  * groups the dataset by x and y channel and optionally reduces the group items
39
39
  * to output channels fill, stroke, r, opacity, fillOpacity, or strokeOpacity
40
40
  */
41
- export declare function group({ data, ...channels }: TransformArg<T, DataRecord>, options?: GroupXOptions): {
42
- data: DataRecord[];
43
- };
41
+ export declare function group({ data, ...channels }: TransformArg<T, DataRecord>, options?: GroupXOptions): any;
44
42
  /**
45
43
  * groups the dataset by the x channel and optionally reduces the group items
46
44
  * to output channels y, y1, y2, fill, stroke, r, opacity, fillOpacity, or strokeOpacity
47
45
  */
48
- export declare function groupX(input: TransformArg<T, DataRecord>, options?: GroupXOptions): {
49
- data: DataRecord[];
50
- };
46
+ export declare function groupX(input: TransformArg<T, DataRecord>, options?: GroupXOptions): any;
51
47
  /**
52
48
  * groups the dataset by the y channel and optionally reduces the group items
53
49
  * to output channels x, x1, x2, fill, stroke, r, opacity, fillOpacity, or strokeOpacity
54
50
  */
55
- export declare function groupY(input: TransformArg<T, DataRecord>, options?: GroupYOptions): {
56
- data: DataRecord[];
57
- };
51
+ export declare function groupY(input: TransformArg<T, DataRecord>, options?: GroupYOptions): any;
58
52
  /**
59
53
  * groups the dataset by the z channel and optionally reduces the group items
60
54
  * to output channels x, x1, x2, y, y1, y2, fill, stroke, r, opacity, fillOpacity,
61
55
  * or strokeOpacity
62
56
  */
63
- export declare function groupZ(input: TransformArg<T, DataRecord>, options?: GroupZOptions): {
64
- data: DataRecord[];
65
- };
57
+ export declare function groupZ(input: TransformArg<T, DataRecord>, options?: GroupZOptions): any;
66
58
  export {};