svelteplot 0.9.2-pr-341.0 → 0.9.2-pr-342.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.
@@ -48,7 +48,7 @@
48
48
  import { getPlotDefaults } from '../hooks/plotDefaults.js';
49
49
  import { usePlot } from '../hooks/usePlot.svelte.js';
50
50
 
51
- const defaultRadius = 3;
51
+ const defaultRadius = 3.5;
52
52
 
53
53
  // The size of the arrowhead is proportional to its length, but we still allow
54
54
  // the relative size of the head to be controlled via the mark's width option;
@@ -58,14 +58,14 @@
58
58
 
59
59
  let markProps: VectorMarkProps = $props();
60
60
  const DEFAULTS = {
61
- ...getPlotDefaults().vector,
62
- r: defaultRadius
61
+ ...getPlotDefaults().vector
63
62
  };
64
63
  const {
65
64
  data = [{}],
66
65
  canvas,
67
66
  shape = 'arrow',
68
67
  anchor = 'middle',
68
+ r = defaultRadius,
69
69
  ...options
70
70
  }: VectorMarkProps = $derived({
71
71
  ...DEFAULTS,
@@ -74,6 +74,9 @@
74
74
 
75
75
  const plot = usePlot();
76
76
 
77
+ const { getTestFacet } = getContext<FacetContext>('svelteplot/facet');
78
+ const testFacet = $derived(getTestFacet());
79
+
77
80
  const shapeArrow: ShapeRenderer = {
78
81
  draw(context: D3Path, l: number, r: number) {
79
82
  const wing = (l * r) / wingRatio;
@@ -165,14 +168,15 @@
165
168
  'strokeOpacity'
166
169
  ]}
167
170
  {...args}>
168
- {#snippet children({ scaledData, usedScales })}
171
+ {#snippet children({ mark, scaledData, usedScales })}
169
172
  <g class="vector" data-l={usedScales.length}>
170
173
  {#if canvas}
171
174
  <text x="30" y="30" style="color:red"
172
175
  >implement canvas rendering for vector mark</text>
173
176
  {:else}
174
177
  {#each scaledData as d, i (i)}
175
- {#if d.valid && isValid(d.r)}
178
+ {@const r = resolveChannel('r', d.datum, { r: 3, ...args })}
179
+ {#if d.valid && isValid(r)}
176
180
  {@const [style, styleClass] = resolveStyles(
177
181
  plot,
178
182
  d,
@@ -186,7 +190,7 @@
186
190
  usedScales
187
191
  )}
188
192
  <path
189
- d={shapePath(shape, d.length, d.r ?? r)}
193
+ d={shapePath(shape, d.length, r)}
190
194
  transform="translate({d.x}, {d.y}) rotate({resolveProp(
191
195
  args.rotate,
192
196
  d.datum,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.9.2-pr-341.0",
3
+ "version": "0.9.2-pr-342.0",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",