@sentropic/design-system-svelte 0.34.37 → 0.34.39
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/dist/DecompositionTreeChart.svelte +399 -0
- package/dist/DecompositionTreeChart.svelte.d.ts +48 -0
- package/dist/DecompositionTreeChart.svelte.d.ts.map +1 -0
- package/dist/Density2DChart.svelte +438 -0
- package/dist/Density2DChart.svelte.d.ts +39 -0
- package/dist/Density2DChart.svelte.d.ts.map +1 -0
- package/dist/EventFeedPanel.svelte +222 -0
- package/dist/EventFeedPanel.svelte.d.ts +45 -0
- package/dist/EventFeedPanel.svelte.d.ts.map +1 -0
- package/dist/EventFeedPanel.test.d.ts +2 -0
- package/dist/EventFeedPanel.test.d.ts.map +1 -0
- package/dist/EventFeedPanel.test.js +66 -0
- package/dist/VectorFieldChart.svelte +347 -0
- package/dist/VectorFieldChart.svelte.d.ts +43 -0
- package/dist/VectorFieldChart.svelte.d.ts.map +1 -0
- package/dist/VectorFieldChart.test.d.ts +2 -0
- package/dist/VectorFieldChart.test.d.ts.map +1 -0
- package/dist/VectorFieldChart.test.js +59 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
/**
|
|
3
|
+
* DecompositionTreeChart - arbre de décomposition hiérarchique (façon Power BI
|
|
4
|
+
* decomposition tree). Une mesure TOTALE se décompose en niveaux successifs
|
|
5
|
+
* selon des dimensions : chaque niveau = une COLONNE de nœuds (barres
|
|
6
|
+
* horizontales dont la largeur est ∝ `value` relative au niveau), reliés au
|
|
7
|
+
* parent du niveau précédent par des liens lissés.
|
|
8
|
+
* API canonique (référence Svelte, React/Vue doivent s'aligner).
|
|
9
|
+
*
|
|
10
|
+
* Modèle : une racine = la mesure totale (colonne 0), puis N niveaux de nœuds ;
|
|
11
|
+
* chaque nœud (sauf la racine) référence son `parent` par libellé. La couleur
|
|
12
|
+
* suit le NIVEAU (cycle sur category1..8). Survol d'un nœud → infobulle
|
|
13
|
+
* dimension/libellé + valeur. Statique (pas de drill) — montre tous les niveaux.
|
|
14
|
+
*
|
|
15
|
+
* Props obligatoires :
|
|
16
|
+
* data DecompositionTreeData - { measure, levels[] }
|
|
17
|
+
*
|
|
18
|
+
* Props optionnelles :
|
|
19
|
+
* label string
|
|
20
|
+
* width number (défaut 640)
|
|
21
|
+
* height number (défaut 320)
|
|
22
|
+
* size number (alias de width)
|
|
23
|
+
* class string
|
|
24
|
+
*/
|
|
25
|
+
export type DecompositionTreeNode = {
|
|
26
|
+
label: string;
|
|
27
|
+
value: number;
|
|
28
|
+
parent?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type DecompositionTreeLevel = {
|
|
32
|
+
dimension: string;
|
|
33
|
+
nodes: DecompositionTreeNode[];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type DecompositionTreeData = {
|
|
37
|
+
measure: string;
|
|
38
|
+
levels: DecompositionTreeLevel[];
|
|
39
|
+
};
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<script lang="ts">
|
|
43
|
+
import ChartDataList from "./ChartDataList.svelte";
|
|
44
|
+
|
|
45
|
+
type DecompositionTreeChartProps = {
|
|
46
|
+
data: DecompositionTreeData;
|
|
47
|
+
label?: string;
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
size?: number;
|
|
51
|
+
class?: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
let {
|
|
55
|
+
data,
|
|
56
|
+
label,
|
|
57
|
+
width,
|
|
58
|
+
height = 320,
|
|
59
|
+
size,
|
|
60
|
+
class: className
|
|
61
|
+
}: DecompositionTreeChartProps = $props();
|
|
62
|
+
|
|
63
|
+
const resolvedWidth = $derived(width ?? size ?? 640);
|
|
64
|
+
|
|
65
|
+
const MARGIN = { top: 16, right: 16, bottom: 16, left: 16 };
|
|
66
|
+
const BAR_H = 22;
|
|
67
|
+
const BAR_GAP = 10;
|
|
68
|
+
const COL_GAP = 36;
|
|
69
|
+
const BAR_W = 110;
|
|
70
|
+
|
|
71
|
+
let hoveredKey: string | null = $state(null);
|
|
72
|
+
|
|
73
|
+
// Couleur par niveau (colonne), 1..8 cyclé.
|
|
74
|
+
const toneForLevel = (level: number): string => `category${(level % 8) + 1}`;
|
|
75
|
+
|
|
76
|
+
// Tronque une étiquette à la largeur de la barre (approx. par char).
|
|
77
|
+
function ellipsize(text: string, maxChars: number): string {
|
|
78
|
+
if (text.length <= maxChars) return text;
|
|
79
|
+
if (maxChars <= 1) return "…";
|
|
80
|
+
return `${text.slice(0, maxChars - 1)}…`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function formatValue(v: number): string {
|
|
84
|
+
if (Math.abs(v) >= 1000) return `${(v / 1000).toFixed(v % 1000 === 0 ? 0 : 1)}k`;
|
|
85
|
+
if (Number.isInteger(v)) return String(v);
|
|
86
|
+
return v.toFixed(1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type Cell = {
|
|
90
|
+
key: string;
|
|
91
|
+
label: string;
|
|
92
|
+
dimension: string;
|
|
93
|
+
value: number;
|
|
94
|
+
level: number;
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
barWidth: number;
|
|
98
|
+
tone: string;
|
|
99
|
+
cx: number;
|
|
100
|
+
cy: number;
|
|
101
|
+
parentKey: string | null;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
type Link = {
|
|
105
|
+
key: string;
|
|
106
|
+
from: Cell;
|
|
107
|
+
to: Cell;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Normalise : une colonne par niveau, plus la racine (colonne 0 = mesure
|
|
111
|
+
// totale). La largeur d'une barre est ∝ value relative au max de SON niveau.
|
|
112
|
+
const layout = $derived.by(() => {
|
|
113
|
+
const cells: Cell[] = [];
|
|
114
|
+
const links: Link[] = [];
|
|
115
|
+
if (!data || typeof data.measure !== "string") return { cells, links };
|
|
116
|
+
|
|
117
|
+
const plotTop = MARGIN.top;
|
|
118
|
+
const colX = (level: number) => MARGIN.left + level * (BAR_W + COL_GAP);
|
|
119
|
+
|
|
120
|
+
// Colonne 0 : la racine (mesure totale). Sa valeur = somme du 1er niveau si
|
|
121
|
+
// disponible, sinon 1 (barre pleine).
|
|
122
|
+
const levels = (data.levels ?? []).filter(
|
|
123
|
+
(lvl) => lvl && typeof lvl.dimension === "string"
|
|
124
|
+
);
|
|
125
|
+
const firstLevelTotal = levels[0]
|
|
126
|
+
? levels[0].nodes
|
|
127
|
+
.filter((n) => n && Number.isFinite(n.value))
|
|
128
|
+
.reduce((s, n) => s + Math.max(n.value, 0), 0)
|
|
129
|
+
: 0;
|
|
130
|
+
const rootValue = firstLevelTotal > 0 ? firstLevelTotal : 1;
|
|
131
|
+
|
|
132
|
+
const rootCell: Cell = {
|
|
133
|
+
key: "root",
|
|
134
|
+
label: data.measure,
|
|
135
|
+
dimension: data.measure,
|
|
136
|
+
value: rootValue,
|
|
137
|
+
level: 0,
|
|
138
|
+
x: colX(0),
|
|
139
|
+
y: plotTop,
|
|
140
|
+
barWidth: BAR_W,
|
|
141
|
+
tone: toneForLevel(0),
|
|
142
|
+
cx: colX(0) + BAR_W / 2,
|
|
143
|
+
cy: plotTop + BAR_H / 2,
|
|
144
|
+
parentKey: null
|
|
145
|
+
};
|
|
146
|
+
cells.push(rootCell);
|
|
147
|
+
|
|
148
|
+
// Niveaux 1..N : une colonne chacun.
|
|
149
|
+
let prevColumn: Cell[] = [rootCell];
|
|
150
|
+
levels.forEach((lvl, li) => {
|
|
151
|
+
const level = li + 1;
|
|
152
|
+
const nodes = (lvl.nodes ?? []).filter(
|
|
153
|
+
(n) => n && typeof n.label === "string" && Number.isFinite(n.value)
|
|
154
|
+
);
|
|
155
|
+
const levelMax = nodes.reduce((m, n) => Math.max(m, Math.max(n.value, 0)), 0) || 1;
|
|
156
|
+
const x = colX(level);
|
|
157
|
+
const column: Cell[] = [];
|
|
158
|
+
nodes.forEach((n, ni) => {
|
|
159
|
+
const y = plotTop + ni * (BAR_H + BAR_GAP);
|
|
160
|
+
const barWidth = Math.max((Math.max(n.value, 0) / levelMax) * BAR_W, 2);
|
|
161
|
+
const parentCell =
|
|
162
|
+
(n.parent !== undefined &&
|
|
163
|
+
prevColumn.find((p) => p.label === n.parent)) ||
|
|
164
|
+
prevColumn[0] ||
|
|
165
|
+
null;
|
|
166
|
+
const cell: Cell = {
|
|
167
|
+
key: `${level}-${ni}`,
|
|
168
|
+
label: n.label,
|
|
169
|
+
dimension: lvl.dimension,
|
|
170
|
+
value: n.value,
|
|
171
|
+
level,
|
|
172
|
+
x,
|
|
173
|
+
y,
|
|
174
|
+
barWidth,
|
|
175
|
+
tone: toneForLevel(level),
|
|
176
|
+
cx: x + barWidth / 2,
|
|
177
|
+
cy: y + BAR_H / 2,
|
|
178
|
+
parentKey: parentCell ? parentCell.key : null
|
|
179
|
+
};
|
|
180
|
+
cells.push(cell);
|
|
181
|
+
column.push(cell);
|
|
182
|
+
if (parentCell) {
|
|
183
|
+
links.push({ key: `${parentCell.key}>${cell.key}`, from: parentCell, to: cell });
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
if (column.length > 0) prevColumn = column;
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
return { cells, links };
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
const cells = $derived(layout.cells);
|
|
193
|
+
const links = $derived(layout.links);
|
|
194
|
+
|
|
195
|
+
const computedHeight = $derived.by(() => {
|
|
196
|
+
if (cells.length === 0) return height;
|
|
197
|
+
const maxBottom = cells.reduce((m, c) => Math.max(m, c.y + BAR_H), MARGIN.top);
|
|
198
|
+
return Math.max(height, maxBottom + MARGIN.bottom);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const computedWidth = $derived.by(() => {
|
|
202
|
+
if (cells.length === 0) return resolvedWidth;
|
|
203
|
+
const maxRight = cells.reduce((m, c) => Math.max(m, c.x + BAR_W), MARGIN.left);
|
|
204
|
+
return Math.max(resolvedWidth, maxRight + MARGIN.right);
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// Nombre de caractères affichables avant ellipsis (approx. largeur de glyphe).
|
|
208
|
+
const charsFor = (w: number) => Math.max(0, Math.floor((w - 8) / 6.6));
|
|
209
|
+
|
|
210
|
+
// Lien lissé parent→enfant (courbe de Bézier horizontale).
|
|
211
|
+
function linkPath(link: Link): string {
|
|
212
|
+
const x1 = link.from.x + link.from.barWidth;
|
|
213
|
+
const y1 = link.from.cy;
|
|
214
|
+
const x2 = link.to.x;
|
|
215
|
+
const y2 = link.to.cy;
|
|
216
|
+
const mid = (x1 + x2) / 2;
|
|
217
|
+
return `M ${x1} ${y1} C ${mid} ${y1}, ${mid} ${y2}, ${x2} ${y2}`;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const dataValueItems = $derived(
|
|
221
|
+
cells.map((c) => `${"·".repeat(c.level)}${c.label}: ${c.value}`)
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
function handlePointerMove(event: PointerEvent) {
|
|
225
|
+
const target = event.target;
|
|
226
|
+
if (!(target instanceof Element)) {
|
|
227
|
+
hoveredKey = null;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const key = target.getAttribute("data-chart-key");
|
|
231
|
+
hoveredKey = key ?? null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const hoveredCell = $derived.by(() => {
|
|
235
|
+
if (hoveredKey === null) return null;
|
|
236
|
+
return cells.find((c) => c.key === hoveredKey) ?? null;
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const classes = () => ["st-decompositionTreeChart", className].filter(Boolean).join(" ");
|
|
240
|
+
</script>
|
|
241
|
+
|
|
242
|
+
<div class={classes()}>
|
|
243
|
+
<div
|
|
244
|
+
class="st-decompositionTreeChart__visual"
|
|
245
|
+
role="img"
|
|
246
|
+
aria-label={label}
|
|
247
|
+
onpointermove={handlePointerMove}
|
|
248
|
+
onpointerleave={() => (hoveredKey = null)}
|
|
249
|
+
>
|
|
250
|
+
<svg
|
|
251
|
+
viewBox="0 0 {computedWidth} {computedHeight}"
|
|
252
|
+
preserveAspectRatio="xMidYMid meet"
|
|
253
|
+
width="100%"
|
|
254
|
+
height="100%"
|
|
255
|
+
focusable="false"
|
|
256
|
+
aria-hidden="true"
|
|
257
|
+
>
|
|
258
|
+
<!-- liens lissés parent→enfant -->
|
|
259
|
+
{#each links as link (link.key)}
|
|
260
|
+
<path
|
|
261
|
+
class="st-decompositionTreeChart__link"
|
|
262
|
+
class:st-decompositionTreeChart__link--dim={hoveredKey !== null &&
|
|
263
|
+
hoveredKey !== link.from.key &&
|
|
264
|
+
hoveredKey !== link.to.key}
|
|
265
|
+
d={linkPath(link)}
|
|
266
|
+
/>
|
|
267
|
+
{/each}
|
|
268
|
+
|
|
269
|
+
<!-- une colonne par niveau : barre horizontale dont la largeur ∝ value -->
|
|
270
|
+
{#each cells as cell (cell.key)}
|
|
271
|
+
{@const chars = charsFor(cell.barWidth)}
|
|
272
|
+
<g class="st-decompositionTreeChart__node">
|
|
273
|
+
<rect
|
|
274
|
+
class="st-decompositionTreeChart__bar st-decompositionTreeChart__bar--{cell.tone}"
|
|
275
|
+
class:st-decompositionTreeChart__bar--dim={hoveredKey !== null && hoveredKey !== cell.key}
|
|
276
|
+
x={cell.x}
|
|
277
|
+
y={cell.y}
|
|
278
|
+
width={Math.max(cell.barWidth, 2)}
|
|
279
|
+
height={BAR_H}
|
|
280
|
+
rx="2"
|
|
281
|
+
data-chart-key={cell.key}
|
|
282
|
+
/>
|
|
283
|
+
{#if chars >= 2}
|
|
284
|
+
<text
|
|
285
|
+
class="st-decompositionTreeChart__label"
|
|
286
|
+
x={cell.x + 4}
|
|
287
|
+
y={cell.y + BAR_H / 2}
|
|
288
|
+
dominant-baseline="central"
|
|
289
|
+
>
|
|
290
|
+
{ellipsize(cell.label, chars)}
|
|
291
|
+
</text>
|
|
292
|
+
{/if}
|
|
293
|
+
</g>
|
|
294
|
+
{/each}
|
|
295
|
+
</svg>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
<ChartDataList label={label ?? "decomposition tree"} items={dataValueItems} />
|
|
299
|
+
|
|
300
|
+
{#if hoveredCell}
|
|
301
|
+
{@const cell = hoveredCell}
|
|
302
|
+
<div
|
|
303
|
+
class="st-decompositionTreeChart__tooltip"
|
|
304
|
+
role="presentation"
|
|
305
|
+
style="left: {(cell.cx / computedWidth) * 100}%; top: {(cell.cy / computedHeight) * 100}%"
|
|
306
|
+
>
|
|
307
|
+
<span class="st-decompositionTreeChart__tooltipLabel">{cell.dimension} · {cell.label}</span>
|
|
308
|
+
<span class="st-decompositionTreeChart__tooltipValue">{formatValue(cell.value)}</span>
|
|
309
|
+
</div>
|
|
310
|
+
{/if}
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<style>
|
|
314
|
+
.st-decompositionTreeChart {
|
|
315
|
+
color: var(--st-semantic-text-secondary);
|
|
316
|
+
display: block;
|
|
317
|
+
font-family: inherit;
|
|
318
|
+
position: relative;
|
|
319
|
+
width: 100%;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.st-decompositionTreeChart svg {
|
|
323
|
+
display: block;
|
|
324
|
+
overflow: visible;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.st-decompositionTreeChart__visual {
|
|
328
|
+
display: block;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.st-decompositionTreeChart__link {
|
|
332
|
+
fill: none;
|
|
333
|
+
stroke: var(--st-semantic-border-subtle);
|
|
334
|
+
stroke-width: 1.5;
|
|
335
|
+
transition: opacity 120ms ease;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.st-decompositionTreeChart__link--dim {
|
|
339
|
+
opacity: 0.3;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.st-decompositionTreeChart__bar {
|
|
343
|
+
cursor: pointer;
|
|
344
|
+
stroke: var(--st-semantic-surface-default, Canvas);
|
|
345
|
+
stroke-width: 1;
|
|
346
|
+
transition: opacity 120ms ease;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.st-decompositionTreeChart__bar--dim {
|
|
350
|
+
opacity: 0.4;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.st-decompositionTreeChart__bar--category1 { fill: var(--st-semantic-data-category1); }
|
|
354
|
+
.st-decompositionTreeChart__bar--category2 { fill: var(--st-semantic-data-category2); }
|
|
355
|
+
.st-decompositionTreeChart__bar--category3 { fill: var(--st-semantic-data-category3); }
|
|
356
|
+
.st-decompositionTreeChart__bar--category4 { fill: var(--st-semantic-data-category4); }
|
|
357
|
+
.st-decompositionTreeChart__bar--category5 { fill: var(--st-semantic-data-category5); }
|
|
358
|
+
.st-decompositionTreeChart__bar--category6 { fill: var(--st-semantic-data-category6); }
|
|
359
|
+
.st-decompositionTreeChart__bar--category7 { fill: var(--st-semantic-data-category7); }
|
|
360
|
+
.st-decompositionTreeChart__bar--category8 { fill: var(--st-semantic-data-category8); }
|
|
361
|
+
|
|
362
|
+
.st-decompositionTreeChart__label {
|
|
363
|
+
fill: var(--st-semantic-text-inverse, #fff);
|
|
364
|
+
font-size: 0.6875rem;
|
|
365
|
+
pointer-events: none;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.st-decompositionTreeChart__tooltip {
|
|
369
|
+
background: var(--st-semantic-surface-inverse);
|
|
370
|
+
border-radius: var(--st-radius-sm, 0.25rem);
|
|
371
|
+
color: var(--st-semantic-text-inverse);
|
|
372
|
+
display: inline-flex;
|
|
373
|
+
flex-direction: column;
|
|
374
|
+
font-size: 0.75rem;
|
|
375
|
+
gap: 0.125rem;
|
|
376
|
+
line-height: 1.2;
|
|
377
|
+
padding: 0.375rem 0.5rem;
|
|
378
|
+
pointer-events: none;
|
|
379
|
+
position: absolute;
|
|
380
|
+
transform: translate(-50%, calc(-100% - 8px));
|
|
381
|
+
white-space: nowrap;
|
|
382
|
+
z-index: 1;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.st-decompositionTreeChart__tooltipLabel {
|
|
386
|
+
font-weight: 600;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.st-decompositionTreeChart__tooltipValue {
|
|
390
|
+
opacity: 0.85;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
@media (prefers-reduced-motion: reduce) {
|
|
394
|
+
.st-decompositionTreeChart__bar,
|
|
395
|
+
.st-decompositionTreeChart__link {
|
|
396
|
+
transition: none;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DecompositionTreeChart - arbre de décomposition hiérarchique (façon Power BI
|
|
3
|
+
* decomposition tree). Une mesure TOTALE se décompose en niveaux successifs
|
|
4
|
+
* selon des dimensions : chaque niveau = une COLONNE de nœuds (barres
|
|
5
|
+
* horizontales dont la largeur est ∝ `value` relative au niveau), reliés au
|
|
6
|
+
* parent du niveau précédent par des liens lissés.
|
|
7
|
+
* API canonique (référence Svelte, React/Vue doivent s'aligner).
|
|
8
|
+
*
|
|
9
|
+
* Modèle : une racine = la mesure totale (colonne 0), puis N niveaux de nœuds ;
|
|
10
|
+
* chaque nœud (sauf la racine) référence son `parent` par libellé. La couleur
|
|
11
|
+
* suit le NIVEAU (cycle sur category1..8). Survol d'un nœud → infobulle
|
|
12
|
+
* dimension/libellé + valeur. Statique (pas de drill) — montre tous les niveaux.
|
|
13
|
+
*
|
|
14
|
+
* Props obligatoires :
|
|
15
|
+
* data DecompositionTreeData - { measure, levels[] }
|
|
16
|
+
*
|
|
17
|
+
* Props optionnelles :
|
|
18
|
+
* label string
|
|
19
|
+
* width number (défaut 640)
|
|
20
|
+
* height number (défaut 320)
|
|
21
|
+
* size number (alias de width)
|
|
22
|
+
* class string
|
|
23
|
+
*/
|
|
24
|
+
export type DecompositionTreeNode = {
|
|
25
|
+
label: string;
|
|
26
|
+
value: number;
|
|
27
|
+
parent?: string;
|
|
28
|
+
};
|
|
29
|
+
export type DecompositionTreeLevel = {
|
|
30
|
+
dimension: string;
|
|
31
|
+
nodes: DecompositionTreeNode[];
|
|
32
|
+
};
|
|
33
|
+
export type DecompositionTreeData = {
|
|
34
|
+
measure: string;
|
|
35
|
+
levels: DecompositionTreeLevel[];
|
|
36
|
+
};
|
|
37
|
+
type DecompositionTreeChartProps = {
|
|
38
|
+
data: DecompositionTreeData;
|
|
39
|
+
label?: string;
|
|
40
|
+
width?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
size?: number;
|
|
43
|
+
class?: string;
|
|
44
|
+
};
|
|
45
|
+
declare const DecompositionTreeChart: import("svelte").Component<DecompositionTreeChartProps, {}, "">;
|
|
46
|
+
type DecompositionTreeChart = ReturnType<typeof DecompositionTreeChart>;
|
|
47
|
+
export default DecompositionTreeChart;
|
|
48
|
+
//# sourceMappingURL=DecompositionTreeChart.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DecompositionTreeChart.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DecompositionTreeChart.svelte.ts"],"names":[],"mappings":"AAGE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,qBAAqB,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC,CAAC;AAMF,KAAK,2BAA2B,GAAG;IACjC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA6OJ,QAAA,MAAM,sBAAsB,iEAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
|