layerchart 0.93.10 → 0.94.1

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.
@@ -339,6 +339,8 @@
339
339
  }}
340
340
 
341
341
  <slot {...slotProps}>
342
+ <slot name="belowContext" {...slotProps} />
343
+
342
344
  <svelte:component this={renderContext === 'canvas' ? Canvas : Svg} center={radial} {debug}>
343
345
  <slot name="grid" {...slotProps}>
344
346
  {#if grid}
@@ -402,17 +404,12 @@
402
404
  {#each visibleSeries as s, i (s.key)}
403
405
  {@const seriesTooltipData =
404
406
  s.data && tooltip.data ? findRelatedData(s.data, tooltip.data, x) : null}
407
+ {@const highlightPointsProps =
408
+ typeof props.highlight?.points === 'object' ? props.highlight.points : null}
405
409
 
406
410
  <Highlight
407
411
  data={seriesTooltipData}
408
412
  y={stackSeries ? (d) => d.stackData[i][1] : (s.value ?? (s.data ? undefined : s.key))}
409
- points={{
410
- fill: s.color,
411
- class: cls(
412
- 'transition-opacity',
413
- highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
414
- ),
415
- }}
416
413
  lines={i == 0}
417
414
  onpointclick={onpointclick
418
415
  ? (e, detail) => onpointclick(e, { ...detail, series: s })
@@ -420,6 +417,15 @@
420
417
  onpointenter={() => (highlightSeriesKey = s.key)}
421
418
  onpointleave={() => (highlightSeriesKey = null)}
422
419
  {...props.highlight}
420
+ points={{
421
+ ...highlightPointsProps,
422
+ fill: s.color,
423
+ class: cls(
424
+ 'transition-opacity',
425
+ highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
426
+ highlightPointsProps?.class
427
+ ),
428
+ }}
423
429
  />
424
430
  {/each}
425
431
  </slot>
@@ -432,6 +438,8 @@
432
438
  </ChartClipPath>
433
439
  </svelte:component>
434
440
 
441
+ <slot name="aboveContext" {...slotProps} />
442
+
435
443
  <slot name="legend" {...slotProps}>
436
444
  {#if legend}
437
445
  <Legend
@@ -345,6 +345,8 @@
345
345
  getLabelsProps,
346
346
  }}
347
347
  <slot {...slotProps}>
348
+ <slot name="belowContext" {...slotProps} />
349
+
348
350
  <svelte:component this={renderContext === 'canvas' ? Canvas : Svg} {debug}>
349
351
  <slot name="grid" {...slotProps}>
350
352
  {#if grid}
@@ -421,6 +423,8 @@
421
423
  {/if}
422
424
  </svelte:component>
423
425
 
426
+ <slot name="aboveContext" {...slotProps} />
427
+
424
428
  <slot name="legend" {...slotProps}>
425
429
  {#if legend}
426
430
  <Legend
@@ -269,6 +269,8 @@
269
269
  getSplineProps,
270
270
  }}
271
271
  <slot {...slotProps}>
272
+ <slot name="belowContext" {...slotProps} />
273
+
272
274
  <svelte:component this={renderContext === 'canvas' ? Canvas : Svg} center={radial} {debug}>
273
275
  <slot name="grid" {...slotProps}>
274
276
  {#if grid}
@@ -332,16 +334,12 @@
332
334
  {#each visibleSeries as s, i (s.key)}
333
335
  {@const seriesTooltipData =
334
336
  s.data && tooltip.data ? findRelatedData(s.data, tooltip.data, x) : null}
337
+ {@const highlightPointsProps =
338
+ typeof props.highlight?.points === 'object' ? props.highlight.points : null}
339
+
335
340
  <Highlight
336
341
  data={seriesTooltipData}
337
342
  y={s.value ?? (s.data ? undefined : s.key)}
338
- points={{
339
- fill: s.color,
340
- class: cls(
341
- 'transition-opacity',
342
- highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10'
343
- ),
344
- }}
345
343
  lines={i === 0}
346
344
  onpointclick={onpointclick
347
345
  ? (e, detail) => onpointclick(e, { ...detail, series: s })
@@ -349,12 +347,23 @@
349
347
  onpointenter={() => (highlightSeriesKey = s.key)}
350
348
  onpointleave={() => (highlightSeriesKey = null)}
351
349
  {...props.highlight}
350
+ points={{
351
+ ...highlightPointsProps,
352
+ fill: s.color,
353
+ class: cls(
354
+ 'transition-opacity',
355
+ highlightSeriesKey && highlightSeriesKey !== s.key && 'opacity-10',
356
+ highlightPointsProps?.class
357
+ ),
358
+ }}
352
359
  />
353
360
  {/each}
354
361
  </slot>
355
362
  </ChartClipPath>
356
363
  </svelte:component>
357
364
 
365
+ <slot name="aboveContext" {...slotProps} />
366
+
358
367
  <slot name="legend" {...slotProps}>
359
368
  {#if legend}
360
369
  <Legend
@@ -206,6 +206,8 @@
206
206
  visibleData,
207
207
  }}
208
208
  <slot {...slotProps}>
209
+ <slot name="belowContext" {...slotProps} />
210
+
209
211
  <svelte:component this={renderContext === 'canvas' ? Canvas : Svg} {center} {debug}>
210
212
  <slot name="belowMarks" {...slotProps} />
211
213
 
@@ -293,6 +295,8 @@
293
295
  <slot name="aboveMarks" {...slotProps} />
294
296
  </svelte:component>
295
297
 
298
+ <slot name="aboveContext" {...slotProps} />
299
+
296
300
  <slot name="legend" {...slotProps}>
297
301
  {#if legend}
298
302
  <Legend
@@ -340,9 +340,11 @@ declare class __sveltets_Render<TData> {
340
340
  };
341
341
  slots(): {
342
342
  default: any;
343
+ belowContext: any;
343
344
  belowMarks: any;
344
345
  marks: any;
345
346
  aboveMarks: any;
347
+ aboveContext: any;
346
348
  legend: any;
347
349
  tooltip: any;
348
350
  };
@@ -235,6 +235,8 @@
235
235
  : null}
236
236
 
237
237
  <slot {...slotProps}>
238
+ <slot name="belowContext" {...slotProps} />
239
+
238
240
  <svelte:component this={renderContext === 'canvas' ? Canvas : Svg} {debug}>
239
241
  <slot name="grid" {...slotProps}>
240
242
  {#if grid}
@@ -284,10 +286,13 @@
284
286
  <ChartClipPath disabled={!brush} full>
285
287
  <slot name="highlight" {...slotProps}>
286
288
  <Highlight
287
- points={{ fill: activeSeries?.color }}
288
289
  lines
289
290
  axis="both"
290
291
  {...props.highlight}
292
+ points={{
293
+ fill: activeSeries?.color,
294
+ ...(typeof props.highlight?.points === 'object' ? props.highlight.points : null),
295
+ }}
291
296
  />
292
297
  </slot>
293
298
 
@@ -299,6 +304,8 @@
299
304
  </ChartClipPath>
300
305
  </svelte:component>
301
306
 
307
+ <slot name="aboveContext" {...slotProps} />
308
+
302
309
  <slot name="legend" {...slotProps}>
303
310
  {#if legend}
304
311
  <Legend
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Sean Lynch <techniq35@gmail.com>",
5
5
  "license": "MIT",
6
6
  "repository": "techniq/layerchart",
7
- "version": "0.93.10",
7
+ "version": "0.94.1",
8
8
  "devDependencies": {
9
9
  "@changesets/cli": "^2.27.12",
10
10
  "@mdi/js": "^7.4.47",