@fundar/data-chart-telling 0.0.14 → 0.0.16
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/README.md +121 -17
- package/dist/charts/{Chart.svelte → BaseChart.svelte} +2 -0
- package/dist/charts/{Chart.svelte.d.ts → BaseChart.svelte.d.ts} +3 -3
- package/dist/charts/bar/Chart.svelte +5 -5
- package/dist/charts/bar/Chart.svelte.d.ts +1 -2
- package/dist/charts/heatmap/Chart.svelte +8 -7
- package/dist/charts/heatmap/Chart.svelte.d.ts +2 -3
- package/dist/charts/line/Chart.svelte +5 -5
- package/dist/charts/line/Chart.svelte.d.ts +1 -2
- package/dist/charts/pyramid/Chart.svelte +7 -6
- package/dist/charts/pyramid/Chart.svelte.d.ts +2 -3
- package/dist/configuration/config.svelte.js +2 -1
- package/dist/configuration/themes/index.d.ts +60 -40
- package/dist/index.d.ts +27 -13
- package/dist/index.js +12 -7
- package/dist/layout/facet/FacetLayout.svelte +1 -1
- package/dist/layout/facet/FacetLayout.svelte.d.ts +1 -1
- package/dist/layout/geo/GeoLayout.svelte +47 -0
- package/dist/layout/geo/GeoLayout.svelte.d.ts +22 -0
- package/dist/layout/geo/resolveProjection.d.ts +10 -0
- package/dist/layout/geo/resolveProjection.js +48 -0
- package/dist/layout/legend/ContinuousSection.svelte +158 -17
- package/dist/layout/legend/DiscreteSection.svelte +56 -4
- package/dist/layout/legend/interaction.svelte.d.ts +7 -0
- package/dist/layout/legend/interaction.svelte.js +24 -0
- package/dist/layout/plot/AxisLayout.svelte +95 -0
- package/dist/layout/plot/AxisLayout.svelte.d.ts +39 -0
- package/dist/layout/plot/BasePlotLayout.svelte +302 -0
- package/dist/layout/plot/BasePlotLayout.svelte.d.ts +95 -0
- package/dist/layout/plot/GridLayout.svelte +30 -0
- package/dist/layout/plot/GridLayout.svelte.d.ts +27 -0
- package/dist/layout/plot/RuleLayout.svelte +111 -0
- package/dist/layout/plot/RuleLayout.svelte.d.ts +40 -0
- package/dist/layout/plot/margins.d.ts +34 -0
- package/dist/layout/plot/margins.js +26 -0
- package/dist/layout/timeline/TimelineLayout.svelte +1 -1
- package/dist/layout/timeline/TimelineLayout.svelte.d.ts +1 -1
- package/dist/layout/tooltip/Tooltip.svelte +15 -0
- package/dist/layout/tooltip/Tooltip.svelte.d.ts +7 -0
- package/dist/layout/tooltip/TooltipLayout.svelte +45 -0
- package/dist/layout/tooltip/TooltipLayout.svelte.d.ts +41 -0
- package/dist/layout/tooltip/controller.svelte.d.ts +4 -3
- package/dist/layout/tooltip/controller.svelte.js +5 -6
- package/dist/layout/tooltip/hover.svelte.d.ts +1 -1
- package/dist/layout/tooltip/hover.svelte.js +1 -1
- package/dist/layout/tooltip/utils.d.ts +2 -2
- package/dist/markers/ContourClipMarker.svelte +77 -0
- package/dist/markers/ContourClipMarker.svelte.d.ts +10 -0
- package/dist/{plots/markers → markers}/DeltaMarker.svelte +4 -4
- package/dist/{plots/markers → markers}/DeltaMarker.svelte.d.ts +3 -3
- package/dist/{plots/markers → markers}/DotMarker.svelte +3 -3
- package/dist/{plots/markers → markers}/DotMarker.svelte.d.ts +3 -3
- package/dist/markers/HoverMarker.svelte +136 -0
- package/dist/{plots/markers → markers}/HoverMarker.svelte.d.ts +4 -4
- package/dist/{plots/markers → markers}/PeakMarker.svelte +2 -2
- package/dist/{plots/markers → markers}/PeakMarker.svelte.d.ts +2 -2
- package/dist/{plots/markers → markers}/TextMarker.svelte +11 -4
- package/dist/{plots/markers → markers}/TextMarker.svelte.d.ts +3 -3
- package/dist/markers/inset/InsetMarker.svelte +170 -0
- package/dist/markers/inset/InsetMarker.svelte.d.ts +51 -0
- package/dist/markers/inset/insetLayout.d.ts +25 -0
- package/dist/markers/inset/insetLayout.js +39 -0
- package/dist/markers/inset/insetProjection.d.ts +8 -0
- package/dist/markers/inset/insetProjection.js +39 -0
- package/dist/plots/bar/BarSegments.svelte +69 -0
- package/dist/plots/bar/BarSegments.svelte.d.ts +40 -0
- package/dist/plots/bar/Plot.svelte +140 -74
- package/dist/plots/bar/Plot.svelte.d.ts +7 -3
- package/dist/plots/bar/ValueLabels.svelte +89 -0
- package/dist/plots/bar/ValueLabels.svelte.d.ts +39 -0
- package/dist/plots/bar/hoverPoints.d.ts +15 -0
- package/dist/plots/bar/hoverPoints.js +35 -0
- package/dist/plots/bar/layout.svelte.d.ts +37 -0
- package/dist/plots/bar/layout.svelte.js +132 -0
- package/dist/plots/geo/Plot.svelte +577 -0
- package/dist/plots/geo/Plot.svelte.d.ts +29 -0
- package/dist/plots/geo/TileLayer.svelte +77 -0
- package/dist/plots/geo/TileLayer.svelte.d.ts +11 -0
- package/dist/plots/geo/projections/argentina.d.ts +8 -0
- package/dist/plots/geo/projections/argentina.js +35 -0
- package/dist/plots/geo/projections/fit.d.ts +8 -0
- package/dist/plots/geo/projections/fit.js +14 -0
- package/dist/plots/geo/rotate.svelte.d.ts +26 -0
- package/dist/plots/geo/rotate.svelte.js +79 -0
- package/dist/plots/geo/zoom.svelte.d.ts +32 -0
- package/dist/plots/geo/zoom.svelte.js +50 -0
- package/dist/plots/heatmap/Plot.svelte +171 -58
- package/dist/plots/heatmap/Plot.svelte.d.ts +7 -3
- package/dist/plots/line/Plot.svelte +67 -30
- package/dist/plots/line/Plot.svelte.d.ts +7 -3
- package/dist/plots/pyramid/Plot.svelte +88 -35
- package/dist/plots/pyramid/Plot.svelte.d.ts +7 -3
- package/dist/plots/utils/delta.d.ts +1 -1
- package/dist/plots/utils/geoAccessors.d.ts +64 -0
- package/dist/plots/utils/geoAccessors.js +188 -0
- package/dist/plots/utils/geoSegments.d.ts +14 -0
- package/dist/plots/utils/geoSegments.js +17 -0
- package/dist/plots/utils/legendDisabled.d.ts +15 -0
- package/dist/plots/utils/legendDisabled.js +41 -0
- package/dist/plots/utils/segments.d.ts +14 -5
- package/dist/plots/utils/segments.js +25 -13
- package/dist/plots/utils/tiles.d.ts +89 -0
- package/dist/plots/utils/tiles.js +159 -0
- package/dist/plots/utils/topojson.d.ts +9 -0
- package/dist/plots/utils/topojson.js +30 -0
- package/dist/types/charts/common.d.ts +2 -1
- package/dist/types/charts/legend.d.ts +32 -1
- package/dist/types/charts/props.d.ts +9 -6
- package/dist/types/configuration/styling.d.ts +13 -5
- package/dist/types/layout/legend.d.ts +26 -0
- package/dist/types/layout/tooltip.d.ts +14 -21
- package/dist/types/{plots/markers.d.ts → markers/common.d.ts} +2 -18
- package/dist/types/markers/geo.d.ts +237 -0
- package/dist/types/markers/props.d.ts +11 -0
- package/dist/types/markers/props.js +1 -0
- package/dist/types/plots/axis.d.ts +55 -0
- package/dist/types/plots/axis.js +1 -0
- package/dist/types/plots/constants.d.ts +30 -0
- package/dist/types/plots/constants.js +1 -0
- package/dist/types/plots/data/common.d.ts +40 -0
- package/dist/types/plots/data/common.js +1 -0
- package/dist/types/plots/data/geo.d.ts +74 -0
- package/dist/types/plots/data/geo.js +1 -0
- package/dist/types/plots/delta.d.ts +2 -2
- package/dist/types/plots/props.d.ts +105 -16
- package/dist/types/plots/scales/geo.d.ts +44 -0
- package/dist/types/plots/scales/geo.js +1 -0
- package/dist/types/plots/segments/common.d.ts +25 -0
- package/dist/types/plots/segments/common.js +1 -0
- package/dist/types/plots/segments/config.d.ts +51 -0
- package/dist/types/plots/segments/config.js +1 -0
- package/dist/types/plots/styles/common.d.ts +37 -0
- package/dist/types/plots/styles/common.js +1 -0
- package/dist/types/plots/styles/geo.d.ts +42 -0
- package/dist/types/plots/styles/geo.js +1 -0
- package/dist/types/plots/styling.d.ts +45 -0
- package/dist/types/plots/styling.js +1 -0
- package/dist/utils/grouping.d.ts +2 -1
- package/dist/utils/interpolate.d.ts +2 -1
- package/package.json +27 -13
- package/dist/layout/plot/PlotLayout.svelte +0 -294
- package/dist/layout/plot/PlotLayout.svelte.d.ts +0 -70
- package/dist/plots/markers/HoverMarker.svelte +0 -98
- package/dist/types/plots/common.d.ts +0 -97
- package/dist/types/plots/styles.d.ts +0 -187
- /package/dist/types/{plots/common.js → layout/legend.js} +0 -0
- /package/dist/types/{plots/markers.js → markers/common.js} +0 -0
- /package/dist/types/{plots/styles.js → markers/geo.js} +0 -0
|
@@ -48,6 +48,7 @@ export declare const THEMES: {
|
|
|
48
48
|
titleWeight?: string | number | undefined;
|
|
49
49
|
gap?: string | undefined;
|
|
50
50
|
swatchSize?: string | undefined;
|
|
51
|
+
disabledOpacity?: number | undefined;
|
|
51
52
|
} | undefined;
|
|
52
53
|
axis?: {
|
|
53
54
|
color?: string | undefined;
|
|
@@ -69,10 +70,10 @@ export declare const THEMES: {
|
|
|
69
70
|
border?: string | undefined;
|
|
70
71
|
} | undefined;
|
|
71
72
|
margins?: {
|
|
72
|
-
top?: number | undefined;
|
|
73
|
-
right?: number | undefined;
|
|
74
|
-
bottom?: number | undefined;
|
|
75
|
-
left?: number | undefined;
|
|
73
|
+
top?: number | "auto" | undefined;
|
|
74
|
+
right?: number | "auto" | undefined;
|
|
75
|
+
bottom?: number | "auto" | undefined;
|
|
76
|
+
left?: number | "auto" | undefined;
|
|
76
77
|
} | undefined;
|
|
77
78
|
palette?: string[] | undefined;
|
|
78
79
|
continuous?: {
|
|
@@ -95,8 +96,8 @@ export declare const THEMES: {
|
|
|
95
96
|
strokeWidth?: number | undefined;
|
|
96
97
|
strokeOpacity?: number | undefined;
|
|
97
98
|
strokeDasharray?: (string | import("../..").LineStyle) | undefined;
|
|
98
|
-
strokeLinecap?: import("
|
|
99
|
-
strokeLinejoin?: import("
|
|
99
|
+
strokeLinecap?: import("../..").LineCap | undefined;
|
|
100
|
+
strokeLinejoin?: import("../..").LineJoin | undefined;
|
|
100
101
|
} | undefined;
|
|
101
102
|
dot?: {
|
|
102
103
|
dotRadius?: number | undefined;
|
|
@@ -111,15 +112,19 @@ export declare const THEMES: {
|
|
|
111
112
|
font?: {
|
|
112
113
|
fill?: string | undefined;
|
|
113
114
|
fontSize?: number | undefined;
|
|
114
|
-
fontWeight?: "
|
|
115
|
-
fontStyle?: "
|
|
116
|
-
textAnchor?: "
|
|
117
|
-
lineAnchor?: "
|
|
115
|
+
fontWeight?: import("../..").FontWeight | undefined;
|
|
116
|
+
fontStyle?: import("../..").FontStyleKeyword | undefined;
|
|
117
|
+
textAnchor?: import("../..").TextAnchor | undefined;
|
|
118
|
+
lineAnchor?: import("../..").LineAnchor | undefined;
|
|
119
|
+
lineHeight?: number | undefined;
|
|
120
|
+
rotate?: number | undefined;
|
|
118
121
|
stroke?: string | undefined;
|
|
119
122
|
strokeWidth?: number | undefined;
|
|
120
123
|
paintOrder?: string | undefined;
|
|
121
124
|
dx?: number | undefined;
|
|
122
125
|
dy?: number | undefined;
|
|
126
|
+
class?: string | undefined;
|
|
127
|
+
textClass?: string | undefined;
|
|
123
128
|
} | undefined;
|
|
124
129
|
} | undefined;
|
|
125
130
|
};
|
|
@@ -166,6 +171,7 @@ export declare const THEMES: {
|
|
|
166
171
|
titleWeight?: string | number | undefined;
|
|
167
172
|
gap?: string | undefined;
|
|
168
173
|
swatchSize?: string | undefined;
|
|
174
|
+
disabledOpacity?: number | undefined;
|
|
169
175
|
} | undefined;
|
|
170
176
|
axis?: {
|
|
171
177
|
color?: string | undefined;
|
|
@@ -187,10 +193,10 @@ export declare const THEMES: {
|
|
|
187
193
|
border?: string | undefined;
|
|
188
194
|
} | undefined;
|
|
189
195
|
margins?: {
|
|
190
|
-
top?: number | undefined;
|
|
191
|
-
right?: number | undefined;
|
|
192
|
-
bottom?: number | undefined;
|
|
193
|
-
left?: number | undefined;
|
|
196
|
+
top?: number | "auto" | undefined;
|
|
197
|
+
right?: number | "auto" | undefined;
|
|
198
|
+
bottom?: number | "auto" | undefined;
|
|
199
|
+
left?: number | "auto" | undefined;
|
|
194
200
|
} | undefined;
|
|
195
201
|
palette?: string[] | undefined;
|
|
196
202
|
continuous?: {
|
|
@@ -213,8 +219,8 @@ export declare const THEMES: {
|
|
|
213
219
|
strokeWidth?: number | undefined;
|
|
214
220
|
strokeOpacity?: number | undefined;
|
|
215
221
|
strokeDasharray?: (string | import("../..").LineStyle) | undefined;
|
|
216
|
-
strokeLinecap?: import("
|
|
217
|
-
strokeLinejoin?: import("
|
|
222
|
+
strokeLinecap?: import("../..").LineCap | undefined;
|
|
223
|
+
strokeLinejoin?: import("../..").LineJoin | undefined;
|
|
218
224
|
} | undefined;
|
|
219
225
|
dot?: {
|
|
220
226
|
dotRadius?: number | undefined;
|
|
@@ -229,15 +235,19 @@ export declare const THEMES: {
|
|
|
229
235
|
font?: {
|
|
230
236
|
fill?: string | undefined;
|
|
231
237
|
fontSize?: number | undefined;
|
|
232
|
-
fontWeight?: "
|
|
233
|
-
fontStyle?: "
|
|
234
|
-
textAnchor?: "
|
|
235
|
-
lineAnchor?: "
|
|
238
|
+
fontWeight?: import("../..").FontWeight | undefined;
|
|
239
|
+
fontStyle?: import("../..").FontStyleKeyword | undefined;
|
|
240
|
+
textAnchor?: import("../..").TextAnchor | undefined;
|
|
241
|
+
lineAnchor?: import("../..").LineAnchor | undefined;
|
|
242
|
+
lineHeight?: number | undefined;
|
|
243
|
+
rotate?: number | undefined;
|
|
236
244
|
stroke?: string | undefined;
|
|
237
245
|
strokeWidth?: number | undefined;
|
|
238
246
|
paintOrder?: string | undefined;
|
|
239
247
|
dx?: number | undefined;
|
|
240
248
|
dy?: number | undefined;
|
|
249
|
+
class?: string | undefined;
|
|
250
|
+
textClass?: string | undefined;
|
|
241
251
|
} | undefined;
|
|
242
252
|
} | undefined;
|
|
243
253
|
};
|
|
@@ -284,6 +294,7 @@ export declare const THEMES: {
|
|
|
284
294
|
titleWeight?: string | number | undefined;
|
|
285
295
|
gap?: string | undefined;
|
|
286
296
|
swatchSize?: string | undefined;
|
|
297
|
+
disabledOpacity?: number | undefined;
|
|
287
298
|
} | undefined;
|
|
288
299
|
axis?: {
|
|
289
300
|
color?: string | undefined;
|
|
@@ -305,10 +316,10 @@ export declare const THEMES: {
|
|
|
305
316
|
border?: string | undefined;
|
|
306
317
|
} | undefined;
|
|
307
318
|
margins?: {
|
|
308
|
-
top?: number | undefined;
|
|
309
|
-
right?: number | undefined;
|
|
310
|
-
bottom?: number | undefined;
|
|
311
|
-
left?: number | undefined;
|
|
319
|
+
top?: number | "auto" | undefined;
|
|
320
|
+
right?: number | "auto" | undefined;
|
|
321
|
+
bottom?: number | "auto" | undefined;
|
|
322
|
+
left?: number | "auto" | undefined;
|
|
312
323
|
} | undefined;
|
|
313
324
|
palette?: string[] | undefined;
|
|
314
325
|
continuous?: {
|
|
@@ -331,8 +342,8 @@ export declare const THEMES: {
|
|
|
331
342
|
strokeWidth?: number | undefined;
|
|
332
343
|
strokeOpacity?: number | undefined;
|
|
333
344
|
strokeDasharray?: (string | import("../..").LineStyle) | undefined;
|
|
334
|
-
strokeLinecap?: import("
|
|
335
|
-
strokeLinejoin?: import("
|
|
345
|
+
strokeLinecap?: import("../..").LineCap | undefined;
|
|
346
|
+
strokeLinejoin?: import("../..").LineJoin | undefined;
|
|
336
347
|
} | undefined;
|
|
337
348
|
dot?: {
|
|
338
349
|
dotRadius?: number | undefined;
|
|
@@ -347,15 +358,19 @@ export declare const THEMES: {
|
|
|
347
358
|
font?: {
|
|
348
359
|
fill?: string | undefined;
|
|
349
360
|
fontSize?: number | undefined;
|
|
350
|
-
fontWeight?: "
|
|
351
|
-
fontStyle?: "
|
|
352
|
-
textAnchor?: "
|
|
353
|
-
lineAnchor?: "
|
|
361
|
+
fontWeight?: import("../..").FontWeight | undefined;
|
|
362
|
+
fontStyle?: import("../..").FontStyleKeyword | undefined;
|
|
363
|
+
textAnchor?: import("../..").TextAnchor | undefined;
|
|
364
|
+
lineAnchor?: import("../..").LineAnchor | undefined;
|
|
365
|
+
lineHeight?: number | undefined;
|
|
366
|
+
rotate?: number | undefined;
|
|
354
367
|
stroke?: string | undefined;
|
|
355
368
|
strokeWidth?: number | undefined;
|
|
356
369
|
paintOrder?: string | undefined;
|
|
357
370
|
dx?: number | undefined;
|
|
358
371
|
dy?: number | undefined;
|
|
372
|
+
class?: string | undefined;
|
|
373
|
+
textClass?: string | undefined;
|
|
359
374
|
} | undefined;
|
|
360
375
|
} | undefined;
|
|
361
376
|
};
|
|
@@ -402,6 +417,7 @@ export declare const THEMES: {
|
|
|
402
417
|
titleWeight?: string | number | undefined;
|
|
403
418
|
gap?: string | undefined;
|
|
404
419
|
swatchSize?: string | undefined;
|
|
420
|
+
disabledOpacity?: number | undefined;
|
|
405
421
|
} | undefined;
|
|
406
422
|
axis?: {
|
|
407
423
|
color?: string | undefined;
|
|
@@ -423,10 +439,10 @@ export declare const THEMES: {
|
|
|
423
439
|
border?: string | undefined;
|
|
424
440
|
} | undefined;
|
|
425
441
|
margins?: {
|
|
426
|
-
top?: number | undefined;
|
|
427
|
-
right?: number | undefined;
|
|
428
|
-
bottom?: number | undefined;
|
|
429
|
-
left?: number | undefined;
|
|
442
|
+
top?: number | "auto" | undefined;
|
|
443
|
+
right?: number | "auto" | undefined;
|
|
444
|
+
bottom?: number | "auto" | undefined;
|
|
445
|
+
left?: number | "auto" | undefined;
|
|
430
446
|
} | undefined;
|
|
431
447
|
palette?: string[] | undefined;
|
|
432
448
|
continuous?: {
|
|
@@ -449,8 +465,8 @@ export declare const THEMES: {
|
|
|
449
465
|
strokeWidth?: number | undefined;
|
|
450
466
|
strokeOpacity?: number | undefined;
|
|
451
467
|
strokeDasharray?: (string | import("../..").LineStyle) | undefined;
|
|
452
|
-
strokeLinecap?: import("
|
|
453
|
-
strokeLinejoin?: import("
|
|
468
|
+
strokeLinecap?: import("../..").LineCap | undefined;
|
|
469
|
+
strokeLinejoin?: import("../..").LineJoin | undefined;
|
|
454
470
|
} | undefined;
|
|
455
471
|
dot?: {
|
|
456
472
|
dotRadius?: number | undefined;
|
|
@@ -465,15 +481,19 @@ export declare const THEMES: {
|
|
|
465
481
|
font?: {
|
|
466
482
|
fill?: string | undefined;
|
|
467
483
|
fontSize?: number | undefined;
|
|
468
|
-
fontWeight?: "
|
|
469
|
-
fontStyle?: "
|
|
470
|
-
textAnchor?: "
|
|
471
|
-
lineAnchor?: "
|
|
484
|
+
fontWeight?: import("../..").FontWeight | undefined;
|
|
485
|
+
fontStyle?: import("../..").FontStyleKeyword | undefined;
|
|
486
|
+
textAnchor?: import("../..").TextAnchor | undefined;
|
|
487
|
+
lineAnchor?: import("../..").LineAnchor | undefined;
|
|
488
|
+
lineHeight?: number | undefined;
|
|
489
|
+
rotate?: number | undefined;
|
|
472
490
|
stroke?: string | undefined;
|
|
473
491
|
strokeWidth?: number | undefined;
|
|
474
492
|
paintOrder?: string | undefined;
|
|
475
493
|
dx?: number | undefined;
|
|
476
494
|
dy?: number | undefined;
|
|
495
|
+
class?: string | undefined;
|
|
496
|
+
textClass?: string | undefined;
|
|
477
497
|
} | undefined;
|
|
478
498
|
} | undefined;
|
|
479
499
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,35 +2,49 @@ export { default as BarPlot } from './plots/bar/Plot.svelte';
|
|
|
2
2
|
export { default as HeatmapPlot } from './plots/heatmap/Plot.svelte';
|
|
3
3
|
export { default as LinePlot } from './plots/line/Plot.svelte';
|
|
4
4
|
export { default as PyramidPlot } from './plots/pyramid/Plot.svelte';
|
|
5
|
-
export { default as
|
|
5
|
+
export { default as GeoPlot } from './plots/geo/Plot.svelte';
|
|
6
|
+
export { default as BaseChart } from './charts/BaseChart.svelte';
|
|
6
7
|
export { default as BarChart } from './charts/bar/Chart.svelte';
|
|
7
8
|
export { default as HeatmapChart } from './charts/heatmap/Chart.svelte';
|
|
8
9
|
export { default as LineChart } from './charts/line/Chart.svelte';
|
|
9
10
|
export { default as PyramidChart } from './charts/pyramid/Chart.svelte';
|
|
10
11
|
export { default as ChartContainer } from './charts/container/ChartContainer.svelte';
|
|
11
|
-
export { default as
|
|
12
|
+
export { default as BasePlotLayout } from './layout/plot/BasePlotLayout.svelte';
|
|
13
|
+
export { default as GeoLayout } from './layout/geo/GeoLayout.svelte';
|
|
14
|
+
export { default as TileLayer } from './plots/geo/TileLayer.svelte';
|
|
15
|
+
export { argentinaBicontinental } from './plots/geo/projections/argentina';
|
|
12
16
|
export { default as Timeline } from './layout/timeline/Timeline.svelte';
|
|
13
17
|
export { default as TimelineLayout } from './layout/timeline/TimelineLayout.svelte';
|
|
14
18
|
export { default as FacetLayout } from './layout/facet/FacetLayout.svelte';
|
|
15
19
|
export { default as LegendLayout } from './layout/legend/LegendLayout.svelte';
|
|
16
20
|
export { default as Tooltip } from './layout/tooltip/Tooltip.svelte';
|
|
17
|
-
export { default as DeltaMarker } from './
|
|
18
|
-
export { default as DotMarker } from './
|
|
19
|
-
export { default as HoverMarker } from './
|
|
20
|
-
export { default as PeakMarker } from './
|
|
21
|
-
export { default as TextMarker } from './
|
|
21
|
+
export { default as DeltaMarker } from './markers/DeltaMarker.svelte';
|
|
22
|
+
export { default as DotMarker } from './markers/DotMarker.svelte';
|
|
23
|
+
export { default as HoverMarker } from './markers/HoverMarker.svelte';
|
|
24
|
+
export { default as PeakMarker } from './markers/PeakMarker.svelte';
|
|
25
|
+
export { default as TextMarker } from './markers/TextMarker.svelte';
|
|
22
26
|
export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG, } from './configuration/config.svelte';
|
|
23
27
|
export { THEMES } from './configuration/themes';
|
|
24
28
|
export type { ThemeName } from './configuration/themes';
|
|
25
29
|
export { groupBy, buildSeries } from './utils/grouping';
|
|
26
30
|
export { makeColorScale, normalize, resolveCssColor, paletteColor } from './utils/color';
|
|
27
|
-
export type { AxisValue,
|
|
31
|
+
export type { AxisValue, AxisScale } from './types/plots/axis';
|
|
32
|
+
export type { Accessor, Series, SeriesProps, DataProps } from './types/plots/data/common';
|
|
33
|
+
export type { BasePlotProps, StylesConfig, MarkersConfig, SegmentsConfig, AxisBasedScalesConfig, GeoScalesConfig, ScalesConfig, MarginConfig, TooltipConfig, } from './types/plots/props';
|
|
28
34
|
export type { DeltaConfig, } from './types/plots/delta';
|
|
29
|
-
export type {
|
|
30
|
-
export type {
|
|
31
|
-
export type {
|
|
35
|
+
export type { ValuesStyle, ColorsStyle, BasePlotStyles, } from './types/plots/styles/common';
|
|
36
|
+
export type { LineSegmentStyle, BarSegmentStyle, CellSegmentStyle, GeoSegmentStyle } from './types/plots/segments/common';
|
|
37
|
+
export type { Range, Area, Segment } from './types/plots/segments/config';
|
|
38
|
+
export type { ValueAnchor, SymbolType, LineStyle, LineCap, LineJoin, FontWeight, FontStyleKeyword, TextAnchor, LineAnchor, } from './types/plots/constants';
|
|
39
|
+
export type { FontStyle, StrokeStyle, DotStyle } from './types/plots/styling';
|
|
40
|
+
export type { Marker } from './types/markers/common';
|
|
41
|
+
export type { MarkerProps } from './types/markers/props';
|
|
42
|
+
export type { GeoFeature, GeoJsonInput, GeoDataProps, Topology } from './types/plots/data/geo';
|
|
43
|
+
export type { GeoProjectionName, GeoProjectionConfig, GeoCustomProjection, GeoCustomProjectionFactory, } from './types/plots/scales/geo';
|
|
44
|
+
export type { GeoStyles, GeoTileLayerConfig, GeoZoomConfig } from './types/plots/styles/geo';
|
|
45
|
+
export type { GeoMarker, GeoInsetMarker, GeoInsetLocation, GeoInsetProjectionName, GeoInsetProjectionConfig, } from './types/markers/geo';
|
|
32
46
|
export type { TimeValue, Orientation, FacetColumns, FacetConfig, TimelineConfig, ChartPlotContext, ChartPlotSnippet, } from './types/charts/common';
|
|
33
|
-
export type { LegendSection, DiscreteLegendSection, ContinuousLegendSection, LegendItem, } from './types/charts/legend';
|
|
34
|
-
export type { HoverStrategy, TooltipOptions, TooltipProp,
|
|
47
|
+
export type { LegendSection, DiscreteLegendSection, ContinuousLegendSection, LegendItem, LegendDisabledStyle, } from './types/charts/legend';
|
|
48
|
+
export type { HoverStrategy, TooltipOptions, TooltipProp, } from './types/layout/tooltip';
|
|
35
49
|
export type { ChartConfig, ChartConfigInput, TextStyle } from './types/configuration/styling';
|
|
36
50
|
export type { ChartProps } from './types/charts/props';
|
package/dist/index.js
CHANGED
|
@@ -4,27 +4,32 @@ export { default as BarPlot } from './plots/bar/Plot.svelte';
|
|
|
4
4
|
export { default as HeatmapPlot } from './plots/heatmap/Plot.svelte';
|
|
5
5
|
export { default as LinePlot } from './plots/line/Plot.svelte';
|
|
6
6
|
export { default as PyramidPlot } from './plots/pyramid/Plot.svelte';
|
|
7
|
+
export { default as GeoPlot } from './plots/geo/Plot.svelte';
|
|
7
8
|
// ── Charts ──────────────────────────────────────────────────────────────────
|
|
8
9
|
// High-level, plot-agnostic chrome plus ready-made chart kinds.
|
|
9
|
-
export { default as
|
|
10
|
+
export { default as BaseChart } from './charts/BaseChart.svelte';
|
|
10
11
|
export { default as BarChart } from './charts/bar/Chart.svelte';
|
|
11
12
|
export { default as HeatmapChart } from './charts/heatmap/Chart.svelte';
|
|
12
13
|
export { default as LineChart } from './charts/line/Chart.svelte';
|
|
13
14
|
export { default as PyramidChart } from './charts/pyramid/Chart.svelte';
|
|
14
15
|
// Interchangeable layout primitives (compose your own chart kinds with these).
|
|
15
16
|
export { default as ChartContainer } from './charts/container/ChartContainer.svelte';
|
|
16
|
-
export { default as
|
|
17
|
+
export { default as BasePlotLayout } from './layout/plot/BasePlotLayout.svelte';
|
|
18
|
+
export { default as GeoLayout } from './layout/geo/GeoLayout.svelte';
|
|
19
|
+
export { default as TileLayer } from './plots/geo/TileLayer.svelte';
|
|
20
|
+
// Custom geo projections — usable as `scales.projection.type`.
|
|
21
|
+
export { argentinaBicontinental } from './plots/geo/projections/argentina';
|
|
17
22
|
export { default as Timeline } from './layout/timeline/Timeline.svelte';
|
|
18
23
|
export { default as TimelineLayout } from './layout/timeline/TimelineLayout.svelte';
|
|
19
24
|
export { default as FacetLayout } from './layout/facet/FacetLayout.svelte';
|
|
20
25
|
export { default as LegendLayout } from './layout/legend/LegendLayout.svelte';
|
|
21
26
|
export { default as Tooltip } from './layout/tooltip/Tooltip.svelte';
|
|
22
27
|
// Markers
|
|
23
|
-
export { default as DeltaMarker } from './
|
|
24
|
-
export { default as DotMarker } from './
|
|
25
|
-
export { default as HoverMarker } from './
|
|
26
|
-
export { default as PeakMarker } from './
|
|
27
|
-
export { default as TextMarker } from './
|
|
28
|
+
export { default as DeltaMarker } from './markers/DeltaMarker.svelte';
|
|
29
|
+
export { default as DotMarker } from './markers/DotMarker.svelte';
|
|
30
|
+
export { default as HoverMarker } from './markers/HoverMarker.svelte';
|
|
31
|
+
export { default as PeakMarker } from './markers/PeakMarker.svelte';
|
|
32
|
+
export { default as TextMarker } from './markers/TextMarker.svelte';
|
|
28
33
|
export { setConfiguration, getConfiguration, resetConfiguration, configToCssVars, cssVarsStyle, DEFAULT_CONFIG, } from './configuration/config.svelte';
|
|
29
34
|
export { THEMES } from './configuration/themes';
|
|
30
35
|
// ── Utils ─────────────────────────────────────────────────────────────────────
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
FacetColumns,
|
|
6
6
|
FacetCellSnippet,
|
|
7
7
|
} from '../../types/charts/common';
|
|
8
|
-
import type { Accessor } from '../../types/plots/common';
|
|
8
|
+
import type { Accessor } from '../../types/plots/data/common';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Small-multiples layout. It splits the data by `by`, arranges the groups in a
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FacetColumns, FacetCellSnippet } from '../../types/charts/common';
|
|
2
|
-
import type { Accessor } from '../../types/plots/common';
|
|
2
|
+
import type { Accessor } from '../../types/plots/data/common';
|
|
3
3
|
declare function $$render<TRow extends Record<string, unknown>>(): {
|
|
4
4
|
props: {
|
|
5
5
|
data: TRow[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import TileLayer from '../../plots/geo/TileLayer.svelte';
|
|
4
|
+
import type { GeoTileLayerConfig } from '../../types/plots/styles/geo';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Geo-only chrome nested inside `BasePlotLayout` (the `GeoPlot` analog of
|
|
8
|
+
* `AxisLayout`/`GridLayout`/`RuleLayout`) — just the pan/zoom transform
|
|
9
|
+
* group and the raster tile layer underneath the map's own marks.
|
|
10
|
+
* Everything else GeoPlot used to duplicate from `BasePlotLayout` (the hover
|
|
11
|
+
* state machine, `<Plot>` itself, `<Pointer>`, the tooltip) now lives
|
|
12
|
+
* exclusively in `BasePlotLayout`; the zoom/rotate *gesture* state itself lives
|
|
13
|
+
* in `GeoPlot`'s own `Plot.svelte` (it also feeds the projection's
|
|
14
|
+
* `rotate`, which has to reach `BasePlotLayout`'s `<Plot projection>` prop —
|
|
15
|
+
* something a component nested *inside* that same `<Plot>` has no way to
|
|
16
|
+
* reach back out to), and is only handed down here as an already-resolved
|
|
17
|
+
* `zoomTransform` to apply.
|
|
18
|
+
*/
|
|
19
|
+
let {
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
numericMargins,
|
|
23
|
+
zoomTransform,
|
|
24
|
+
tileLayer,
|
|
25
|
+
children,
|
|
26
|
+
}: {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
numericMargins: { top: number; right: number; bottom: number; left: number };
|
|
30
|
+
zoomTransform: { x: number; y: number; k: number };
|
|
31
|
+
tileLayer?: GeoTileLayerConfig;
|
|
32
|
+
children: Snippet;
|
|
33
|
+
} = $props();
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<g transform="translate({zoomTransform.x}, {zoomTransform.y}) scale({zoomTransform.k})">
|
|
37
|
+
{#if tileLayer}
|
|
38
|
+
<TileLayer
|
|
39
|
+
config={tileLayer}
|
|
40
|
+
left={numericMargins.left}
|
|
41
|
+
top={numericMargins.top}
|
|
42
|
+
width={Math.max(0, width - numericMargins.left - numericMargins.right)}
|
|
43
|
+
height={Math.max(0, height - numericMargins.top - numericMargins.bottom)}
|
|
44
|
+
/>
|
|
45
|
+
{/if}
|
|
46
|
+
{@render children()}
|
|
47
|
+
</g>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { GeoTileLayerConfig } from '../../types/plots/styles/geo';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
numericMargins: {
|
|
7
|
+
top: number;
|
|
8
|
+
right: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
left: number;
|
|
11
|
+
};
|
|
12
|
+
zoomTransform: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
k: number;
|
|
16
|
+
};
|
|
17
|
+
tileLayer?: GeoTileLayerConfig;
|
|
18
|
+
children: Snippet;
|
|
19
|
+
};
|
|
20
|
+
declare const GeoLayout: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
21
|
+
type GeoLayout = ReturnType<typeof GeoLayout>;
|
|
22
|
+
export default GeoLayout;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GeoProjectionConfig } from '../../types/plots/scales/geo';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a `GeoScalesConfig['projection']` into what svelteplot's own
|
|
4
|
+
* `<Plot projection>` expects — kept separate from `GeoPlot`'s own
|
|
5
|
+
* `Plot.svelte` so adding more projection-level behavior (like the
|
|
6
|
+
* `domain: 'data'` sentinel below) doesn't grow that component itself.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveProjection<TFeature extends Record<string, unknown> & {
|
|
9
|
+
geometry?: unknown;
|
|
10
|
+
}>(projection: GeoProjectionConfig | undefined, data: TFeature[]): GeoProjectionConfig;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data` (see `resolveProjection`) is one row per disjoint geometry *part*
|
|
3
|
+
* (see `Plot.svelte`'s `hoverCandidates` — needed so hover-matching finds
|
|
4
|
+
* every part of a multi-part feature, not just whichever one its combined
|
|
5
|
+
* centroid happens to land near), not one row per feature. Several rows
|
|
6
|
+
* therefore share the exact same `geometry` object by reference — spread
|
|
7
|
+
* from the same tagged feature, only `__cx`/`__cy` differ. Deduping by that
|
|
8
|
+
* reference before handing rows to d3-geo's bounds/fit computation matters:
|
|
9
|
+
* a feature with many parts (e.g. a province whose `MultiPolygon` has
|
|
10
|
+
* hundreds of small islands) would otherwise have its *entire* geometry
|
|
11
|
+
* re-traversed once per part it contributed, an accidental O(parts²) cost
|
|
12
|
+
* that got severe enough to be visible (multi-second) on real IGN data.
|
|
13
|
+
*/
|
|
14
|
+
function dedupeByGeometry(data) {
|
|
15
|
+
const seen = new Set();
|
|
16
|
+
const result = [];
|
|
17
|
+
for (const row of data) {
|
|
18
|
+
if (seen.has(row.geometry))
|
|
19
|
+
continue;
|
|
20
|
+
seen.add(row.geometry);
|
|
21
|
+
result.push(row);
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolves a `GeoScalesConfig['projection']` into what svelteplot's own
|
|
27
|
+
* `<Plot projection>` expects — kept separate from `GeoPlot`'s own
|
|
28
|
+
* `Plot.svelte` so adding more projection-level behavior (like the
|
|
29
|
+
* `domain: 'data'` sentinel below) doesn't grow that component itself.
|
|
30
|
+
*/
|
|
31
|
+
export function resolveProjection(projection, data) {
|
|
32
|
+
if (!projection)
|
|
33
|
+
return 'equal-earth';
|
|
34
|
+
if (typeof projection === 'string')
|
|
35
|
+
return projection;
|
|
36
|
+
const domain = projection.domain === 'data'
|
|
37
|
+
? { type: 'FeatureCollection', features: dedupeByGeometry(data) }
|
|
38
|
+
: projection.domain;
|
|
39
|
+
return {
|
|
40
|
+
type: projection.type,
|
|
41
|
+
rotate: projection.rotate,
|
|
42
|
+
center: projection.center,
|
|
43
|
+
parallels: projection.parallels,
|
|
44
|
+
inset: projection.inset,
|
|
45
|
+
clip: projection.clip,
|
|
46
|
+
domain,
|
|
47
|
+
};
|
|
48
|
+
}
|