layerchart 0.12.0 → 0.13.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.
- package/components/Arc.svelte +8 -1
- package/components/Arc.svelte.d.ts +2 -0
- package/components/Area.svelte +3 -0
- package/components/Area.svelte.d.ts +4 -0
- package/components/AreaStack.svelte +3 -3
- package/components/Chart.svelte +9 -1
- package/components/Chart.svelte.d.ts +3 -0
- package/components/Circle.svelte +9 -1
- package/components/Circle.svelte.d.ts +4 -0
- package/components/CircleClipPath.svelte +1 -1
- package/components/CircleClipPath.svelte.d.ts +2 -0
- package/components/Group.svelte +1 -1
- package/components/Group.svelte.d.ts +2 -0
- package/components/HighlightLine.svelte +78 -60
- package/components/HighlightLine.svelte.d.ts +5 -2
- package/components/HighlightRect.svelte +50 -45
- package/components/HighlightRect.svelte.d.ts +0 -1
- package/components/Line.svelte +10 -1
- package/components/Line.svelte.d.ts +4 -0
- package/components/Path.svelte +10 -1
- package/components/Path.svelte.d.ts +4 -0
- package/components/Pie.svelte +6 -0
- package/components/Pie.svelte.d.ts +4 -0
- package/components/RectClipPath.svelte +1 -1
- package/components/RectClipPath.svelte.d.ts +2 -0
- package/components/Sankey.svelte.d.ts +1 -1
- package/components/Tooltip.svelte +39 -343
- package/components/Tooltip.svelte.d.ts +2 -13
- package/components/TooltipContext.svelte +351 -0
- package/components/TooltipContext.svelte.d.ts +46 -0
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/package.json +26 -26
- package/components/TooltipContainer.svelte +0 -18
- package/components/TooltipContainer.svelte.d.ts +0 -19
package/components/Arc.svelte
CHANGED
|
@@ -110,6 +110,13 @@ $: yOffset = -Math.cos(angle) * offset;
|
|
|
110
110
|
<path d={trackArc()} class="track" bind:this={trackArcEl} {...track} />
|
|
111
111
|
{/if}
|
|
112
112
|
|
|
113
|
-
<path
|
|
113
|
+
<path
|
|
114
|
+
d={arc()}
|
|
115
|
+
transform="translate({xOffset}, {yOffset})"
|
|
116
|
+
{...$$restProps}
|
|
117
|
+
on:click
|
|
118
|
+
on:mousemove
|
|
119
|
+
on:mouseleave
|
|
120
|
+
/>
|
|
114
121
|
|
|
115
122
|
<slot value={$tweened_value} centroid={trackArcCentroid} {boundingBox} />
|
package/components/Area.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import Area from './Area.svelte';
|
|
3
3
|
import Path from './Path.svelte';
|
|
4
|
-
const { data, yScale,
|
|
4
|
+
const { data, yScale, rGet } = getContext('LayerCake');
|
|
5
5
|
export let curve = undefined;
|
|
6
6
|
export let defined = undefined;
|
|
7
7
|
export let opacity = 0.3;
|
|
@@ -17,7 +17,7 @@ $: lineData = [...$data].reverse();
|
|
|
17
17
|
<Path
|
|
18
18
|
data={seriesData}
|
|
19
19
|
y={(d) => $yScale(d[1])}
|
|
20
|
-
color={$
|
|
20
|
+
color={$rGet(seriesData)}
|
|
21
21
|
{curve}
|
|
22
22
|
{defined}
|
|
23
23
|
{tweened}
|
|
@@ -33,7 +33,7 @@ $: lineData = [...$data].reverse();
|
|
|
33
33
|
data={seriesData}
|
|
34
34
|
y0={(d) => $yScale(d[0])}
|
|
35
35
|
y1={(d) => $yScale(d[1])}
|
|
36
|
-
color={$
|
|
36
|
+
color={$rGet(seriesData)}
|
|
37
37
|
{curve}
|
|
38
38
|
{defined}
|
|
39
39
|
{opacity}
|
package/components/Chart.svelte
CHANGED
|
@@ -10,6 +10,7 @@ export const Html = _Html;
|
|
|
10
10
|
<script>import { max, min } from 'd3-array';
|
|
11
11
|
import { get } from 'lodash-es';
|
|
12
12
|
import { isScaleBand } from '../utils/scales';
|
|
13
|
+
import TooltipContext from './TooltipContext.svelte';
|
|
13
14
|
/**
|
|
14
15
|
* Resolve a value from data based on the accessor type
|
|
15
16
|
*/
|
|
@@ -55,6 +56,7 @@ $: if (yBaseline != null) {
|
|
|
55
56
|
* see: https://github.com/mhkeller/layercake/issues/83
|
|
56
57
|
*/
|
|
57
58
|
$: yReverse = yScale ? !isScaleBand(yScale) : true;
|
|
59
|
+
export let tooltip = undefined;
|
|
58
60
|
</script>
|
|
59
61
|
|
|
60
62
|
<LayerCake
|
|
@@ -73,5 +75,11 @@ $: yReverse = yScale ? !isScaleBand(yScale) : true;
|
|
|
73
75
|
let:width
|
|
74
76
|
let:element
|
|
75
77
|
>
|
|
76
|
-
|
|
78
|
+
{#if tooltip}
|
|
79
|
+
<TooltipContext {...tooltip} let:tooltip>
|
|
80
|
+
<slot {aspectRatio} {containerHeight} {containerWidth} {height} {width} {element} {tooltip} />
|
|
81
|
+
</TooltipContext>
|
|
82
|
+
{:else}
|
|
83
|
+
<slot {aspectRatio} {containerHeight} {containerWidth} {height} {width} {element} />
|
|
84
|
+
{/if}
|
|
77
85
|
</LayerCake>
|
|
@@ -2,6 +2,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import { Svg as _Svg, Html as _Html } from 'layercake';
|
|
3
3
|
export declare const Svg: typeof _Svg;
|
|
4
4
|
export declare const Html: typeof _Html;
|
|
5
|
+
import type { ComponentProps } from 'svelte';
|
|
6
|
+
import TooltipContext from './TooltipContext.svelte';
|
|
5
7
|
declare const __propDef: {
|
|
6
8
|
props: {
|
|
7
9
|
[x: string]: any;
|
|
@@ -11,6 +13,7 @@ declare const __propDef: {
|
|
|
11
13
|
yScale?: Function;
|
|
12
14
|
xBaseline?: number | null;
|
|
13
15
|
yBaseline?: number | null;
|
|
16
|
+
tooltip?: ComponentProps<TooltipContext> | undefined;
|
|
14
17
|
};
|
|
15
18
|
events: {
|
|
16
19
|
[evt: string]: CustomEvent<any>;
|
package/components/Circle.svelte
CHANGED
|
@@ -12,4 +12,12 @@ $: tweened_cy.set(cy);
|
|
|
12
12
|
$: tweened_r.set(r);
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
|
-
<circle
|
|
15
|
+
<circle
|
|
16
|
+
cx={$tweened_cx}
|
|
17
|
+
cy={$tweened_cy}
|
|
18
|
+
r={$tweened_r}
|
|
19
|
+
{...$$restProps}
|
|
20
|
+
on:click
|
|
21
|
+
on:mousemove
|
|
22
|
+
on:mouseleave
|
|
23
|
+
/>
|
package/components/Group.svelte
CHANGED
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
|
-
import
|
|
2
|
+
import 'svelte/store';
|
|
3
3
|
import { max } from 'd3-array';
|
|
4
4
|
import { isScaleBand } from '../utils/scales';
|
|
5
5
|
import Circle from './Circle.svelte';
|
|
6
6
|
import Line from './Line.svelte';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { tooltipContext } from './TooltipContext.svelte';
|
|
8
|
+
const { xScale, xRange, xGet, yScale, yRange, yGet, rGet, y, config } = getContext('LayerCake');
|
|
9
|
+
const tooltip = tooltipContext();
|
|
9
10
|
export let color = undefined;
|
|
10
11
|
export let axis = 'x';
|
|
11
12
|
// TODO: Fix circle points being backwards for stack (see AreaStack)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
function getColor(item, index = undefined) {
|
|
14
|
+
if (color) {
|
|
15
|
+
if (typeof color === 'function') {
|
|
16
|
+
return color({ value: $y(item), item, index });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return color;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else if ($config.r) {
|
|
23
|
+
return $rGet(item);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return 'var(--color-blue-500)';
|
|
27
|
+
}
|
|
18
28
|
}
|
|
19
29
|
let lines = [];
|
|
20
|
-
|
|
30
|
+
let points = [];
|
|
31
|
+
$: if ($tooltip.data) {
|
|
32
|
+
let x = $xGet($tooltip.data);
|
|
33
|
+
let xOffset = isScaleBand($xScale) ? $xScale.bandwidth() / 2 : 0;
|
|
34
|
+
let y = $yGet($tooltip.data);
|
|
35
|
+
let yOffset = isScaleBand($yScale) ? $yScale.bandwidth() / 2 : 0;
|
|
36
|
+
// Reset lines
|
|
21
37
|
lines = [];
|
|
22
38
|
if (axis === 'x' || axis === 'both') {
|
|
23
39
|
if (Array.isArray(x)) {
|
|
@@ -69,58 +85,60 @@ $: {
|
|
|
69
85
|
];
|
|
70
86
|
}
|
|
71
87
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// Stack series
|
|
84
|
-
points = data.map((yValue, i) => ({
|
|
85
|
-
x: x + xOffset,
|
|
86
|
-
y: $yScale(yValue) + yOffset,
|
|
87
|
-
color: getColor(i)
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
points = [
|
|
92
|
-
{
|
|
88
|
+
if (Array.isArray(x)) {
|
|
89
|
+
// `x` accessor with multiple properties (ex. `x={['start', 'end']})`)
|
|
90
|
+
points = x.map((xItem, i) => ({
|
|
91
|
+
x: xItem + xOffset,
|
|
92
|
+
y: $yGet($tooltip.data) + yOffset,
|
|
93
|
+
color: getColor($tooltip.data) // TODO: improve
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
else if (Array.isArray($tooltip.data)) {
|
|
97
|
+
// Stack series
|
|
98
|
+
points = $tooltip.data.map((yValue, i) => ({
|
|
93
99
|
x: x + xOffset,
|
|
94
|
-
y: $
|
|
95
|
-
color: getColor(
|
|
96
|
-
}
|
|
97
|
-
|
|
100
|
+
y: $yScale(yValue) + yOffset,
|
|
101
|
+
color: getColor($tooltip.data) // TODO: improve
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
points = [
|
|
106
|
+
{
|
|
107
|
+
x: x + xOffset,
|
|
108
|
+
y: $yGet($tooltip.data) + yOffset,
|
|
109
|
+
// color: $rGet($tooltip.data) //getColor($tooltip.data)
|
|
110
|
+
color: getColor($tooltip.data)
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
}
|
|
98
114
|
}
|
|
99
115
|
</script>
|
|
100
116
|
|
|
101
|
-
{#
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
{#if $tooltip.data}
|
|
118
|
+
{#each lines as line}
|
|
119
|
+
<Line
|
|
120
|
+
spring
|
|
121
|
+
x1={line.x1}
|
|
122
|
+
y1={line.y1}
|
|
123
|
+
x2={line.x2}
|
|
124
|
+
y2={line.y2}
|
|
125
|
+
stroke="rgba(0,0,0,.5)"
|
|
126
|
+
stroke-width={2}
|
|
127
|
+
style="pointerEvents: none"
|
|
128
|
+
stroke-dasharray="2,2"
|
|
129
|
+
/>
|
|
130
|
+
{/each}
|
|
114
131
|
|
|
115
|
-
{#each points as point}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{/each}
|
|
132
|
+
{#each points as point}
|
|
133
|
+
<Circle
|
|
134
|
+
spring
|
|
135
|
+
cx={point.x}
|
|
136
|
+
cy={point.y}
|
|
137
|
+
r={7}
|
|
138
|
+
fill="rgba(255,255,255,.9)"
|
|
139
|
+
stroke={point.color}
|
|
140
|
+
stroke-width={2}
|
|
141
|
+
/>
|
|
142
|
+
<Circle spring cx={point.x} cy={point.y} r={3} fill={point.color} />
|
|
143
|
+
{/each}
|
|
144
|
+
{/if}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
color?: string | ((obj: {
|
|
5
|
+
value: any;
|
|
6
|
+
item: any;
|
|
7
|
+
index: number;
|
|
8
|
+
}) => string);
|
|
6
9
|
axis?: 'x' | 'y' | 'both' | 'none';
|
|
7
10
|
};
|
|
8
11
|
events: {
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
import { max, min } from 'd3-array';
|
|
3
3
|
import { isScaleBand } from '../utils/scales';
|
|
4
4
|
import Rect from './Rect.svelte';
|
|
5
|
+
import { tooltipContext } from './TooltipContext.svelte';
|
|
5
6
|
const { flatData, x, xScale, xDomain, xRange, xGet, yScale, yDomain, yRange, yGet } = getContext('LayerCake');
|
|
6
|
-
|
|
7
|
+
const tooltip = tooltipContext();
|
|
7
8
|
export let axis = isScaleBand($yScale) ? 'y' : 'x';
|
|
8
|
-
$: xCoord = $xGet(data);
|
|
9
|
-
$: yCoord = $yGet(data);
|
|
10
9
|
let dimensions = {
|
|
11
10
|
x: 0,
|
|
12
11
|
y: 0,
|
|
@@ -14,53 +13,59 @@ let dimensions = {
|
|
|
14
13
|
height: 0
|
|
15
14
|
};
|
|
16
15
|
$: {
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if ($tooltip.data) {
|
|
17
|
+
let xCoord = $xGet($tooltip.data);
|
|
18
|
+
let yCoord = $yGet($tooltip.data);
|
|
19
|
+
if (axis === 'x' || axis === 'both') {
|
|
20
|
+
if (isScaleBand($xScale)) {
|
|
21
|
+
dimensions.width = $xScale.step();
|
|
22
|
+
}
|
|
23
|
+
else if (Array.isArray(xCoord)) {
|
|
24
|
+
// `x` accessor with multiple properties (ex. `x={['start', 'end']})`)
|
|
25
|
+
// Use first/last values for width
|
|
26
|
+
dimensions.width = max(xCoord) - min(xCoord);
|
|
27
|
+
xCoord = min(xCoord); // Use left-most value for top left of rect
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// Find width to next data point
|
|
31
|
+
const index = $flatData.findIndex((d) => Number($x(d)) === Number($x($tooltip.data)));
|
|
32
|
+
const isLastPoint = index + 1 === $flatData.length;
|
|
33
|
+
const nextDataPoint = isLastPoint ? max($xDomain) : $x($flatData[index + 1]);
|
|
34
|
+
dimensions.width = ($xScale(nextDataPoint) ?? 0) - (xCoord ?? 0);
|
|
35
|
+
}
|
|
36
|
+
dimensions.x =
|
|
37
|
+
xCoord - (isScaleBand($xScale) ? ($xScale.padding() * $xScale.step()) / 2 : 0);
|
|
38
|
+
if (axis === 'x') {
|
|
39
|
+
dimensions.height = max($yRange);
|
|
40
|
+
}
|
|
20
41
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
else if (Array.isArray(xCoord)) {
|
|
44
|
-
// `y` accessor with multiple properties (ex. `y={['start', 'end']})`)
|
|
45
|
-
// Use first/last values for width
|
|
46
|
-
dimensions.height = max(yCoord) - min(yCoord);
|
|
47
|
-
yCoord = min(yCoord); // Use left-most value for top left of rect
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
// Find width to next data point
|
|
51
|
-
const index = $flatData.findIndex((d) => Number($x(d)) === Number($x(data)));
|
|
52
|
-
const isLastPoint = index + 1 === $flatData.length;
|
|
53
|
-
const nextDataPoint = isLastPoint ? max($yDomain) : $x($flatData[index + 1]);
|
|
54
|
-
dimensions.height = ($yScale(nextDataPoint) ?? 0) - (yCoord ?? 0);
|
|
55
|
-
}
|
|
56
|
-
dimensions.y = yCoord - (isScaleBand($yScale) ? ($yScale.padding() * $yScale.step()) / 2 : 0);
|
|
57
|
-
if (axis === 'y') {
|
|
58
|
-
dimensions.width = max($xRange);
|
|
42
|
+
if (axis === 'y' || axis === 'both') {
|
|
43
|
+
if (isScaleBand($yScale)) {
|
|
44
|
+
dimensions.height = $yScale.step();
|
|
45
|
+
}
|
|
46
|
+
else if (Array.isArray(xCoord)) {
|
|
47
|
+
// `y` accessor with multiple properties (ex. `y={['start', 'end']})`)
|
|
48
|
+
// Use first/last values for width
|
|
49
|
+
dimensions.height = max(yCoord) - min(yCoord);
|
|
50
|
+
yCoord = min(yCoord); // Use left-most value for top left of rect
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// Find width to next data point
|
|
54
|
+
const index = $flatData.findIndex((d) => Number($x(d)) === Number($x($tooltip.data)));
|
|
55
|
+
const isLastPoint = index + 1 === $flatData.length;
|
|
56
|
+
const nextDataPoint = isLastPoint ? max($yDomain) : $x($flatData[index + 1]);
|
|
57
|
+
dimensions.height = ($yScale(nextDataPoint) ?? 0) - (yCoord ?? 0);
|
|
58
|
+
}
|
|
59
|
+
dimensions.y =
|
|
60
|
+
yCoord - (isScaleBand($yScale) ? ($yScale.padding() * $yScale.step()) / 2 : 0);
|
|
61
|
+
if (axis === 'y') {
|
|
62
|
+
dimensions.width = max($xRange);
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
67
|
</script>
|
|
63
68
|
|
|
64
|
-
{#if
|
|
69
|
+
{#if $tooltip.data}
|
|
65
70
|
<Rect spring {...dimensions} fill="rgba(0,0,0,.1)" on:click />
|
|
66
71
|
{/if}
|
package/components/Line.svelte
CHANGED
|
@@ -15,4 +15,13 @@ $: tweened_x2.set(x2);
|
|
|
15
15
|
$: tweened_y2.set(y2);
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
<line
|
|
18
|
+
<line
|
|
19
|
+
x1={$tweened_x1}
|
|
20
|
+
y1={$tweened_y1}
|
|
21
|
+
x2={$tweened_x2}
|
|
22
|
+
y2={$tweened_y2}
|
|
23
|
+
{...$$restProps}
|
|
24
|
+
on:click
|
|
25
|
+
on:mousemove
|
|
26
|
+
on:mouseleave
|
|
27
|
+
/>
|
package/components/Path.svelte
CHANGED
|
@@ -33,7 +33,16 @@ $: {
|
|
|
33
33
|
}
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
|
-
<path
|
|
36
|
+
<path
|
|
37
|
+
class="path-line"
|
|
38
|
+
d={$tweened_d}
|
|
39
|
+
stroke={color}
|
|
40
|
+
stroke-width={width}
|
|
41
|
+
{...$$restProps}
|
|
42
|
+
on:click
|
|
43
|
+
on:mousemove
|
|
44
|
+
on:mouseleave
|
|
45
|
+
/>
|
|
37
46
|
|
|
38
47
|
<style>
|
|
39
48
|
.path-line {
|
package/components/Pie.svelte
CHANGED
|
@@ -47,6 +47,10 @@ export let tweened = undefined;
|
|
|
47
47
|
* Offset all arcs from center
|
|
48
48
|
*/
|
|
49
49
|
export let offset = 0;
|
|
50
|
+
/**
|
|
51
|
+
* Tooltip context to setup mouse events to show tooltip for related data
|
|
52
|
+
*/
|
|
53
|
+
export let tooltip = undefined;
|
|
50
54
|
const { data: contextData, x, y, xRange, rGet, config } = getContext('LayerCake');
|
|
51
55
|
$: resolved_endAngle = endAngle ?? degreesToRadians($config.xRange ? max($xRange) : max(range));
|
|
52
56
|
let tweened_endAngle = motionStore(0, { spring, tweened });
|
|
@@ -83,6 +87,8 @@ function getColor(item, index) {
|
|
|
83
87
|
{cornerRadius}
|
|
84
88
|
{offset}
|
|
85
89
|
fill={getColor(arc.data, index)}
|
|
90
|
+
on:mousemove={(e) => tooltip?.show(e, arc.data)}
|
|
91
|
+
on:mouseleave={(e) => tooltip?.hide()}
|
|
86
92
|
/>
|
|
87
93
|
{/each}
|
|
88
94
|
</slot>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { spring as springStore, tweened as tweenedStore } from 'svelte/motion';
|
|
3
|
+
import type { TooltipContextValue } from './TooltipContext.svelte';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
data?: any;
|
|
@@ -34,6 +35,9 @@ declare const __propDef: {
|
|
|
34
35
|
/**
|
|
35
36
|
* Offset all arcs from center
|
|
36
37
|
*/ offset?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Tooltip context to setup mouse events to show tooltip for related data
|
|
40
|
+
*/ tooltip?: TooltipContextValue | undefined;
|
|
37
41
|
};
|
|
38
42
|
events: {
|
|
39
43
|
[evt: string]: CustomEvent<any>;
|
|
@@ -6,7 +6,7 @@ declare const __propDef: {
|
|
|
6
6
|
nodeId?: (d: any) => any;
|
|
7
7
|
/**
|
|
8
8
|
* see: https://github.com/d3/d3-sankey#alignments
|
|
9
|
-
*/ nodeAlign?: "
|
|
9
|
+
*/ nodeAlign?: "left" | "right" | "center" | "justify" | ((node: SankeyNode<any, any>, n: number) => number);
|
|
10
10
|
nodeWidth?: number;
|
|
11
11
|
nodePadding?: number;
|
|
12
12
|
nodeSort?: any;
|