svelteplot 0.5.2-pr-251.3 → 0.5.2-pr-251.4

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.
@@ -201,7 +201,7 @@
201
201
  : args.textStroke
202
202
  ? 2
203
203
  : 0,
204
- fill: args.textFill || args.stroke,
204
+ fill: args.textFill || lineData[0].stroke,
205
205
  stroke: args.textStroke
206
206
  },
207
207
  'fill',
@@ -222,7 +222,7 @@
222
222
  color={lineData[0].stroke || 'currentColor'}
223
223
  {style}
224
224
  class={styleClass}
225
- text={text ? resolveProp(text, lineData[0]) : null}
225
+ text={text ? resolveProp(text, lineData[0].datum) : null}
226
226
  startOffset={resolveProp(
227
227
  args.textStartOffset,
228
228
  lineData[0].datum,
@@ -22,7 +22,7 @@
22
22
  scaleFn: (d: RawValue) => number;
23
23
  scaleType: ScaleType;
24
24
  ticks: RawValue[];
25
- tickFormat: (d: RawValue, i: number) => string | string[];
25
+ tickFormat: (d: RawValue, i: number, ticks: RawValue[]) => string | string[];
26
26
  anchor: 'top' | 'bottom';
27
27
  tickSize: number;
28
28
  tickPadding: number;
@@ -87,7 +87,7 @@
87
87
  dx: +resolveProp(options.dx, datum, 0),
88
88
  dy: +resolveProp(options.dy, datum, 0),
89
89
  x: scaleFn(tick) + (scaleType === 'band' ? scaleFn.bandwidth() * 0.5 : 0),
90
- text: splitTick(tickFormat(tick, i)),
90
+ text: splitTick(tickFormat(tick, i, ticks)),
91
91
  element: null as SVGTextElement | null
92
92
  };
93
93
  })
@@ -3,7 +3,7 @@ type BaseAxisXProps = {
3
3
  scaleFn: (d: RawValue) => number;
4
4
  scaleType: ScaleType;
5
5
  ticks: RawValue[];
6
- tickFormat: (d: RawValue, i: number) => string | string[];
6
+ tickFormat: (d: RawValue, i: number, ticks: RawValue[]) => string | string[];
7
7
  anchor: 'top' | 'bottom';
8
8
  tickSize: number;
9
9
  tickPadding: number;
@@ -19,7 +19,7 @@
19
19
  scaleFn: (d: RawValue) => number;
20
20
  scaleType: ScaleType;
21
21
  ticks: RawValue[];
22
- tickFormat: (d: RawValue) => string | string[];
22
+ tickFormat: (d: RawValue, i: number, ticks: RawValue[]) => string | string[];
23
23
  anchor: 'left' | 'right';
24
24
  lineAnchor: 'top' | 'center' | 'bottom';
25
25
  tickSize: number;
@@ -72,7 +72,7 @@
72
72
  dx: +resolveProp(options.dx, datum, 0),
73
73
  dy: +resolveProp(options.dy, datum, 0),
74
74
  y: scaleFn(tick) + (scaleType === 'band' ? scaleFn.bandwidth() * 0.5 : 0),
75
- text: tickFormat(tick, i),
75
+ text: tickFormat(tick, i, ticks),
76
76
  element: null as SVGTextElement | null
77
77
  };
78
78
  });
@@ -3,7 +3,7 @@ type BaseAxisYProps = {
3
3
  scaleFn: (d: RawValue) => number;
4
4
  scaleType: ScaleType;
5
5
  ticks: RawValue[];
6
- tickFormat: (d: RawValue) => string | string[];
6
+ tickFormat: (d: RawValue, i: number, ticks: RawValue[]) => string | string[];
7
7
  anchor: 'left' | 'right';
8
8
  lineAnchor: 'top' | 'center' | 'bottom';
9
9
  tickSize: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.5.2-pr-251.3",
3
+ "version": "0.5.2-pr-251.4",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",