layerchart 0.58.0 → 0.58.2
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.
|
@@ -90,10 +90,17 @@
|
|
|
90
90
|
$: xOffset = isScaleBand($xScale) ? $xScale.bandwidth() / 2 : 0;
|
|
91
91
|
$: yOffset = isScaleBand($yScale) ? $yScale.bandwidth() / 2 : 0;
|
|
92
92
|
|
|
93
|
+
/** Provide initial `0` horizontal baseline and initially hide/untrack scale changes so not reactive (only set on initial mount) */
|
|
94
|
+
function defaultPathData() {
|
|
95
|
+
const [xRangeMin, xRangeMax] = $xScale.range();
|
|
96
|
+
const yRangeZero = $yScale(0);
|
|
97
|
+
return `M${xRangeMin},${yRangeZero} L${xRangeMax},${yRangeZero}`;
|
|
98
|
+
}
|
|
99
|
+
|
|
93
100
|
let d: string | null = '';
|
|
94
101
|
// @ts-expect-error
|
|
95
102
|
$: tweenedOptions = tweened ? { interpolate: interpolatePath, ...tweened } : false;
|
|
96
|
-
$: tweened_d = motionStore(
|
|
103
|
+
$: tweened_d = motionStore(defaultPathData(), { tweened: tweenedOptions });
|
|
97
104
|
$: {
|
|
98
105
|
const path = $radial
|
|
99
106
|
? lineRadial()
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
|
|
161
161
|
{#if $tooltip.data}
|
|
162
162
|
<div
|
|
163
|
-
class={cls('absolute pointer-events-none z-50', classes.root)}
|
|
163
|
+
class={cls('absolute pointer-events-none z-50 select-none', classes.root)}
|
|
164
164
|
style:top="{$yPos}px"
|
|
165
165
|
style:left="{$xPos}px"
|
|
166
166
|
transition:fade={{ duration: 100 }}
|