@samizdata/mozaic 0.0.0-stage → 0.3.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/LICENSE +674 -0
- package/README.md +44 -2
- package/dist/annotations/Arrow.svelte +50 -0
- package/dist/annotations/Arrow.svelte.d.ts +18 -0
- package/dist/annotations/Callout.svelte +87 -0
- package/dist/annotations/Callout.svelte.d.ts +22 -0
- package/dist/annotations/Label.svelte +55 -0
- package/dist/annotations/Label.svelte.d.ts +19 -0
- package/dist/annotations/RefBand.svelte +46 -0
- package/dist/annotations/RefBand.svelte.d.ts +18 -0
- package/dist/annotations/RefLine.svelte +107 -0
- package/dist/annotations/RefLine.svelte.d.ts +27 -0
- package/dist/annotations/callout-geometry.d.ts +23 -0
- package/dist/annotations/callout-geometry.js +45 -0
- package/dist/annotations/index.d.ts +6 -0
- package/dist/annotations/index.js +6 -0
- package/dist/core/Canvas.svelte +55 -0
- package/dist/core/Canvas.svelte.d.ts +19 -0
- package/dist/core/Facets.svelte +80 -0
- package/dist/core/Facets.svelte.d.ts +49 -0
- package/dist/core/Html.svelte +38 -0
- package/dist/core/Html.svelte.d.ts +13 -0
- package/dist/core/Plot.svelte +202 -0
- package/dist/core/Plot.svelte.d.ts +60 -0
- package/dist/core/Svg.svelte +58 -0
- package/dist/core/Svg.svelte.d.ts +17 -0
- package/dist/core/accessor.d.ts +5 -0
- package/dist/core/accessor.js +3 -0
- package/dist/core/context.d.ts +25 -0
- package/dist/core/context.js +69 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.js +9 -0
- package/dist/core/scales.d.ts +16 -0
- package/dist/core/scales.js +32 -0
- package/dist/core/types.d.ts +78 -0
- package/dist/core/types.js +1 -0
- package/dist/core/units.d.ts +6 -0
- package/dist/core/units.js +10 -0
- package/dist/embed/Embed.svelte +50 -0
- package/dist/embed/Embed.svelte.d.ts +14 -0
- package/dist/embed/code.d.ts +18 -0
- package/dist/embed/code.js +9 -0
- package/dist/embed/host.d.ts +6 -0
- package/dist/embed/host.js +20 -0
- package/dist/embed/index.d.ts +6 -0
- package/dist/embed/index.js +5 -0
- package/dist/embed/manifest.d.ts +16 -0
- package/dist/embed/manifest.js +1 -0
- package/dist/embed/params.svelte.d.ts +10 -0
- package/dist/embed/params.svelte.js +27 -0
- package/dist/embed/resize.d.ts +13 -0
- package/dist/embed/resize.js +28 -0
- package/dist/export/download.d.ts +13 -0
- package/dist/export/download.js +52 -0
- package/dist/export/figure-to-svg.d.ts +21 -0
- package/dist/export/figure-to-svg.js +187 -0
- package/dist/export/fonts.d.ts +26 -0
- package/dist/export/fonts.js +112 -0
- package/dist/export/index.d.ts +2 -0
- package/dist/export/index.js +2 -0
- package/dist/frame/Byline.svelte +26 -0
- package/dist/frame/Byline.svelte.d.ts +8 -0
- package/dist/frame/Chart.svelte +144 -0
- package/dist/frame/Chart.svelte.d.ts +37 -0
- package/dist/frame/ChartTools.svelte +259 -0
- package/dist/frame/ChartTools.svelte.d.ts +17 -0
- package/dist/frame/DataDownload.svelte +34 -0
- package/dist/frame/DataDownload.svelte.d.ts +34 -0
- package/dist/frame/DataTable.svelte +49 -0
- package/dist/frame/DataTable.svelte.d.ts +34 -0
- package/dist/frame/Footer.svelte +39 -0
- package/dist/frame/Footer.svelte.d.ts +10 -0
- package/dist/frame/Header.svelte +21 -0
- package/dist/frame/Header.svelte.d.ts +9 -0
- package/dist/frame/Logo.svelte +57 -0
- package/dist/frame/Logo.svelte.d.ts +8 -0
- package/dist/frame/Notes.svelte +29 -0
- package/dist/frame/Notes.svelte.d.ts +9 -0
- package/dist/frame/Source.svelte +29 -0
- package/dist/frame/Source.svelte.d.ts +9 -0
- package/dist/frame/Subtitle.svelte +22 -0
- package/dist/frame/Subtitle.svelte.d.ts +9 -0
- package/dist/frame/Title.svelte +31 -0
- package/dist/frame/Title.svelte.d.ts +9 -0
- package/dist/frame/index.d.ts +12 -0
- package/dist/frame/index.js +12 -0
- package/dist/guides/AxisX.svelte +101 -0
- package/dist/guides/AxisX.svelte.d.ts +22 -0
- package/dist/guides/AxisY.svelte +107 -0
- package/dist/guides/AxisY.svelte.d.ts +25 -0
- package/dist/guides/ColorRamp.svelte +93 -0
- package/dist/guides/ColorRamp.svelte.d.ts +25 -0
- package/dist/guides/GridX.svelte +35 -0
- package/dist/guides/GridX.svelte.d.ts +9 -0
- package/dist/guides/GridY.svelte +35 -0
- package/dist/guides/GridY.svelte.d.ts +9 -0
- package/dist/guides/Key.svelte +48 -0
- package/dist/guides/Key.svelte.d.ts +14 -0
- package/dist/guides/Legend.svelte +112 -0
- package/dist/guides/Legend.svelte.d.ts +26 -0
- package/dist/guides/SizeLegend.svelte +62 -0
- package/dist/guides/SizeLegend.svelte.d.ts +15 -0
- package/dist/guides/index.d.ts +9 -0
- package/dist/guides/index.js +9 -0
- package/dist/guides/ticks.d.ts +6 -0
- package/dist/guides/ticks.js +15 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -0
- package/dist/interactive/ButtonGroup.svelte +98 -0
- package/dist/interactive/ButtonGroup.svelte.d.ts +42 -0
- package/dist/interactive/PointerArea.svelte +49 -0
- package/dist/interactive/PointerArea.svelte.d.ts +18 -0
- package/dist/interactive/Scroller.svelte +147 -0
- package/dist/interactive/Scroller.svelte.d.ts +54 -0
- package/dist/interactive/Tooltip.svelte +116 -0
- package/dist/interactive/Tooltip.svelte.d.ts +34 -0
- package/dist/interactive/index.d.ts +4 -0
- package/dist/interactive/index.js +4 -0
- package/dist/interactive/tooltip-position.d.ts +12 -0
- package/dist/interactive/tooltip-position.js +16 -0
- package/dist/locale/definitions.d.ts +145 -0
- package/dist/locale/definitions.js +138 -0
- package/dist/locale/index.d.ts +23 -0
- package/dist/locale/index.js +34 -0
- package/dist/marks/Arcs.svelte +93 -0
- package/dist/marks/Arcs.svelte.d.ts +47 -0
- package/dist/marks/Area.svelte +44 -0
- package/dist/marks/Area.svelte.d.ts +43 -0
- package/dist/marks/Arrows.svelte +93 -0
- package/dist/marks/Arrows.svelte.d.ts +50 -0
- package/dist/marks/Bars.svelte +111 -0
- package/dist/marks/Bars.svelte.d.ts +61 -0
- package/dist/marks/Beeswarm.svelte +84 -0
- package/dist/marks/Beeswarm.svelte.d.ts +42 -0
- package/dist/marks/Dumbbell.svelte +71 -0
- package/dist/marks/Dumbbell.svelte.d.ts +42 -0
- package/dist/marks/GeoPath.svelte +56 -0
- package/dist/marks/GeoPath.svelte.d.ts +42 -0
- package/dist/marks/Hemicycle.svelte +182 -0
- package/dist/marks/Hemicycle.svelte.d.ts +78 -0
- package/dist/marks/Intervals.svelte +128 -0
- package/dist/marks/Intervals.svelte.d.ts +60 -0
- package/dist/marks/Line.svelte +64 -0
- package/dist/marks/Line.svelte.d.ts +43 -0
- package/dist/marks/LineEndLabels.svelte +70 -0
- package/dist/marks/LineEndLabels.svelte.d.ts +41 -0
- package/dist/marks/Points.svelte +70 -0
- package/dist/marks/Points.svelte.d.ts +46 -0
- package/dist/marks/Rects.svelte +92 -0
- package/dist/marks/Rects.svelte.d.ts +47 -0
- package/dist/marks/Rules.svelte +46 -0
- package/dist/marks/Rules.svelte.d.ts +15 -0
- package/dist/marks/Slope.svelte +112 -0
- package/dist/marks/Slope.svelte.d.ts +41 -0
- package/dist/marks/Text.svelte +75 -0
- package/dist/marks/Text.svelte.d.ts +47 -0
- package/dist/marks/Treemap.svelte +89 -0
- package/dist/marks/Treemap.svelte.d.ts +45 -0
- package/dist/marks/Voronoi.svelte +61 -0
- package/dist/marks/Voronoi.svelte.d.ts +39 -0
- package/dist/marks/Waffle.svelte +77 -0
- package/dist/marks/Waffle.svelte.d.ts +45 -0
- package/dist/marks/bar-path.d.ts +5 -0
- package/dist/marks/bar-path.js +15 -0
- package/dist/marks/index.d.ts +20 -0
- package/dist/marks/index.js +20 -0
- package/dist/recipes/ArrowChart.svelte +247 -0
- package/dist/recipes/ArrowChart.svelte.d.ts +73 -0
- package/dist/recipes/BarChart.svelte +122 -0
- package/dist/recipes/BarChart.svelte.d.ts +58 -0
- package/dist/recipes/BarDotChart.svelte +204 -0
- package/dist/recipes/BarDotChart.svelte.d.ts +75 -0
- package/dist/recipes/ColumnChart.svelte +119 -0
- package/dist/recipes/ColumnChart.svelte.d.ts +56 -0
- package/dist/recipes/LineChart.svelte +159 -0
- package/dist/recipes/LineChart.svelte.d.ts +61 -0
- package/dist/recipes/MosaicChart.svelte +256 -0
- package/dist/recipes/MosaicChart.svelte.d.ts +83 -0
- package/dist/recipes/ScatterChart.svelte +167 -0
- package/dist/recipes/ScatterChart.svelte.d.ts +63 -0
- package/dist/recipes/StackedBarChart.svelte +222 -0
- package/dist/recipes/StackedBarChart.svelte.d.ts +83 -0
- package/dist/recipes/index.d.ts +10 -0
- package/dist/recipes/index.js +19 -0
- package/dist/styles/base.d.ts +5 -0
- package/dist/styles/base.js +102 -0
- package/dist/styles/check.d.ts +8 -0
- package/dist/styles/check.js +32 -0
- package/dist/styles/color.d.ts +11 -0
- package/dist/styles/color.js +29 -0
- package/dist/styles/index.d.ts +9 -0
- package/dist/styles/index.js +17 -0
- package/dist/styles/types.d.ts +90 -0
- package/dist/styles/types.js +1 -0
- package/dist/table/Sparkline.svelte +59 -0
- package/dist/table/Sparkline.svelte.d.ts +16 -0
- package/dist/table/Table.svelte +287 -0
- package/dist/table/Table.svelte.d.ts +44 -0
- package/dist/table/csv.d.ts +3 -0
- package/dist/table/csv.js +12 -0
- package/dist/table/index.d.ts +4 -0
- package/dist/table/index.js +3 -0
- package/dist/table/types.d.ts +26 -0
- package/dist/table/types.js +1 -0
- package/dist/transforms/bin.d.ts +15 -0
- package/dist/transforms/bin.js +18 -0
- package/dist/transforms/dodge.d.ts +10 -0
- package/dist/transforms/dodge.js +35 -0
- package/dist/transforms/group.d.ts +14 -0
- package/dist/transforms/group.js +14 -0
- package/dist/transforms/hemicycle.d.ts +30 -0
- package/dist/transforms/hemicycle.js +51 -0
- package/dist/transforms/index.d.ts +8 -0
- package/dist/transforms/index.js +8 -0
- package/dist/transforms/labels.d.ts +6 -0
- package/dist/transforms/labels.js +20 -0
- package/dist/transforms/smooth.d.ts +61 -0
- package/dist/transforms/smooth.js +105 -0
- package/dist/transforms/stack.d.ts +25 -0
- package/dist/transforms/stack.js +61 -0
- package/dist/transforms/treemap.d.ts +21 -0
- package/dist/transforms/treemap.js +31 -0
- package/package.json +152 -3
- package/src/lib/recipes/ArrowChart.svelte +247 -0
- package/src/lib/recipes/BarChart.svelte +122 -0
- package/src/lib/recipes/BarDotChart.svelte +204 -0
- package/src/lib/recipes/ColumnChart.svelte +119 -0
- package/src/lib/recipes/LineChart.svelte +159 -0
- package/src/lib/recipes/MosaicChart.svelte +256 -0
- package/src/lib/recipes/ScatterChart.svelte +167 -0
- package/src/lib/recipes/StackedBarChart.svelte +222 -0
- package/src/lib/recipes/index.ts +20 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { FormatLocaleDefinition } from 'd3-format';
|
|
2
|
+
import type { TimeLocaleDefinition } from 'd3-time-format';
|
|
3
|
+
export interface LocaleStrings {
|
|
4
|
+
source: string;
|
|
5
|
+
sources: string;
|
|
6
|
+
note: string;
|
|
7
|
+
notes: string;
|
|
8
|
+
graphic: string;
|
|
9
|
+
showData: string;
|
|
10
|
+
downloadData: string;
|
|
11
|
+
/** The control under a chart that shows its embed code, the code's label, and its copy button. */
|
|
12
|
+
embed: string;
|
|
13
|
+
embedCode: string;
|
|
14
|
+
copy: string;
|
|
15
|
+
copied: string;
|
|
16
|
+
/** The control under a chart that saves it as an image ("Download" PNG · SVG). */
|
|
17
|
+
downloadImage: string;
|
|
18
|
+
noData: string;
|
|
19
|
+
search: string;
|
|
20
|
+
showAll: (n: number) => string;
|
|
21
|
+
showFewer: string;
|
|
22
|
+
}
|
|
23
|
+
export interface LocaleDefinition {
|
|
24
|
+
/** BCP 47 language tag for the `lang` attribute. */
|
|
25
|
+
lang: string;
|
|
26
|
+
number: FormatLocaleDefinition;
|
|
27
|
+
time: TimeLocaleDefinition;
|
|
28
|
+
strings: LocaleStrings;
|
|
29
|
+
}
|
|
30
|
+
export declare const definitions: {
|
|
31
|
+
en: {
|
|
32
|
+
lang: string;
|
|
33
|
+
number: {
|
|
34
|
+
decimal: string;
|
|
35
|
+
thousands: string;
|
|
36
|
+
grouping: number[];
|
|
37
|
+
currency: [string, string];
|
|
38
|
+
minus: string;
|
|
39
|
+
};
|
|
40
|
+
time: {
|
|
41
|
+
dateTime: string;
|
|
42
|
+
date: string;
|
|
43
|
+
time: string;
|
|
44
|
+
periods: [string, string];
|
|
45
|
+
days: [string, string, string, string, string, string, string];
|
|
46
|
+
shortDays: [string, string, string, string, string, string, string];
|
|
47
|
+
months: [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
48
|
+
shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
49
|
+
};
|
|
50
|
+
strings: {
|
|
51
|
+
source: string;
|
|
52
|
+
sources: string;
|
|
53
|
+
note: string;
|
|
54
|
+
notes: string;
|
|
55
|
+
graphic: string;
|
|
56
|
+
showData: string;
|
|
57
|
+
downloadData: string;
|
|
58
|
+
embed: string;
|
|
59
|
+
embedCode: string;
|
|
60
|
+
copy: string;
|
|
61
|
+
copied: string;
|
|
62
|
+
downloadImage: string;
|
|
63
|
+
noData: string;
|
|
64
|
+
search: string;
|
|
65
|
+
showAll: (n: number) => string;
|
|
66
|
+
showFewer: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
ro: {
|
|
70
|
+
lang: string;
|
|
71
|
+
number: {
|
|
72
|
+
decimal: string;
|
|
73
|
+
thousands: string;
|
|
74
|
+
grouping: number[];
|
|
75
|
+
currency: [string, string];
|
|
76
|
+
minus: string;
|
|
77
|
+
};
|
|
78
|
+
time: {
|
|
79
|
+
dateTime: string;
|
|
80
|
+
date: string;
|
|
81
|
+
time: string;
|
|
82
|
+
periods: [string, string];
|
|
83
|
+
days: [string, string, string, string, string, string, string];
|
|
84
|
+
shortDays: [string, string, string, string, string, string, string];
|
|
85
|
+
months: [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
86
|
+
shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
87
|
+
};
|
|
88
|
+
strings: {
|
|
89
|
+
source: string;
|
|
90
|
+
sources: string;
|
|
91
|
+
note: string;
|
|
92
|
+
notes: string;
|
|
93
|
+
graphic: string;
|
|
94
|
+
showData: string;
|
|
95
|
+
downloadData: string;
|
|
96
|
+
embed: string;
|
|
97
|
+
embedCode: string;
|
|
98
|
+
copy: string;
|
|
99
|
+
copied: string;
|
|
100
|
+
downloadImage: string;
|
|
101
|
+
noData: string;
|
|
102
|
+
search: string;
|
|
103
|
+
showAll: (n: number) => string;
|
|
104
|
+
showFewer: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
ru: {
|
|
108
|
+
lang: string;
|
|
109
|
+
number: {
|
|
110
|
+
decimal: string;
|
|
111
|
+
thousands: string;
|
|
112
|
+
grouping: number[];
|
|
113
|
+
currency: [string, string];
|
|
114
|
+
minus: string;
|
|
115
|
+
};
|
|
116
|
+
time: {
|
|
117
|
+
dateTime: string;
|
|
118
|
+
date: string;
|
|
119
|
+
time: string;
|
|
120
|
+
periods: [string, string];
|
|
121
|
+
days: [string, string, string, string, string, string, string];
|
|
122
|
+
shortDays: [string, string, string, string, string, string, string];
|
|
123
|
+
months: [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
124
|
+
shortMonths: [string, string, string, string, string, string, string, string, string, string, string, string];
|
|
125
|
+
};
|
|
126
|
+
strings: {
|
|
127
|
+
source: string;
|
|
128
|
+
sources: string;
|
|
129
|
+
note: string;
|
|
130
|
+
notes: string;
|
|
131
|
+
graphic: string;
|
|
132
|
+
showData: string;
|
|
133
|
+
downloadData: string;
|
|
134
|
+
embed: string;
|
|
135
|
+
embedCode: string;
|
|
136
|
+
copy: string;
|
|
137
|
+
copied: string;
|
|
138
|
+
downloadImage: string;
|
|
139
|
+
noData: string;
|
|
140
|
+
search: string;
|
|
141
|
+
showAll: (n: number) => string;
|
|
142
|
+
showFewer: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Moldova-oriented locales: currency is the Moldovan leu in ro and ru.
|
|
2
|
+
export const definitions = {
|
|
3
|
+
en: {
|
|
4
|
+
lang: 'en-GB',
|
|
5
|
+
number: { decimal: '.', thousands: ',', grouping: [3], currency: ['£', ''], minus: '−' },
|
|
6
|
+
time: {
|
|
7
|
+
dateTime: '%a %e %b %X %Y',
|
|
8
|
+
date: '%d/%m/%Y',
|
|
9
|
+
time: '%H:%M:%S',
|
|
10
|
+
periods: ['AM', 'PM'],
|
|
11
|
+
days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
12
|
+
shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
13
|
+
months: [
|
|
14
|
+
'January',
|
|
15
|
+
'February',
|
|
16
|
+
'March',
|
|
17
|
+
'April',
|
|
18
|
+
'May',
|
|
19
|
+
'June',
|
|
20
|
+
'July',
|
|
21
|
+
'August',
|
|
22
|
+
'September',
|
|
23
|
+
'October',
|
|
24
|
+
'November',
|
|
25
|
+
'December'
|
|
26
|
+
],
|
|
27
|
+
shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
28
|
+
},
|
|
29
|
+
strings: {
|
|
30
|
+
source: 'Source',
|
|
31
|
+
sources: 'Sources',
|
|
32
|
+
note: 'Note',
|
|
33
|
+
notes: 'Notes',
|
|
34
|
+
graphic: 'Graphic',
|
|
35
|
+
showData: 'Show the data',
|
|
36
|
+
downloadData: 'Download the data (CSV)',
|
|
37
|
+
embed: 'Embed',
|
|
38
|
+
embedCode: 'Embed code',
|
|
39
|
+
copy: 'Copy the code',
|
|
40
|
+
copied: 'Copied',
|
|
41
|
+
downloadImage: 'Download',
|
|
42
|
+
noData: 'No data',
|
|
43
|
+
search: 'Search',
|
|
44
|
+
showAll: (n) => `Show all ${n} rows`,
|
|
45
|
+
showFewer: 'Show fewer rows'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
ro: {
|
|
49
|
+
lang: 'ro-MD',
|
|
50
|
+
number: { decimal: ',', thousands: '.', grouping: [3], currency: ['', ' lei'], minus: '−' },
|
|
51
|
+
time: {
|
|
52
|
+
dateTime: '%A, %e %B %Y, %X',
|
|
53
|
+
date: '%d.%m.%Y',
|
|
54
|
+
time: '%H:%M:%S',
|
|
55
|
+
periods: ['AM', 'PM'],
|
|
56
|
+
days: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'],
|
|
57
|
+
shortDays: ['dum.', 'lun.', 'mar.', 'mie.', 'joi', 'vin.', 'sâm.'],
|
|
58
|
+
months: [
|
|
59
|
+
'ianuarie',
|
|
60
|
+
'februarie',
|
|
61
|
+
'martie',
|
|
62
|
+
'aprilie',
|
|
63
|
+
'mai',
|
|
64
|
+
'iunie',
|
|
65
|
+
'iulie',
|
|
66
|
+
'august',
|
|
67
|
+
'septembrie',
|
|
68
|
+
'octombrie',
|
|
69
|
+
'noiembrie',
|
|
70
|
+
'decembrie'
|
|
71
|
+
],
|
|
72
|
+
shortMonths: ['ian.', 'feb.', 'mar.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.']
|
|
73
|
+
},
|
|
74
|
+
strings: {
|
|
75
|
+
source: 'Sursa',
|
|
76
|
+
sources: 'Surse',
|
|
77
|
+
note: 'Notă',
|
|
78
|
+
notes: 'Note',
|
|
79
|
+
graphic: 'Grafic',
|
|
80
|
+
showData: 'Arată datele',
|
|
81
|
+
downloadData: 'Descarcă datele (CSV)',
|
|
82
|
+
embed: 'Încorporează',
|
|
83
|
+
embedCode: 'Codul de încorporare',
|
|
84
|
+
copy: 'Copiază codul',
|
|
85
|
+
copied: 'Copiat',
|
|
86
|
+
downloadImage: 'Descarcă',
|
|
87
|
+
noData: 'Fără date',
|
|
88
|
+
search: 'Caută',
|
|
89
|
+
showAll: (n) => `Arată toate cele ${n} rânduri`,
|
|
90
|
+
showFewer: 'Arată mai puține rânduri'
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
ru: {
|
|
94
|
+
lang: 'ru-MD',
|
|
95
|
+
number: { decimal: ',', thousands: ' ', grouping: [3], currency: ['', ' лей'], minus: '−' },
|
|
96
|
+
time: {
|
|
97
|
+
dateTime: '%A, %e %B %Y г. %X',
|
|
98
|
+
date: '%d.%m.%Y',
|
|
99
|
+
time: '%H:%M:%S',
|
|
100
|
+
periods: ['AM', 'PM'],
|
|
101
|
+
days: ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'],
|
|
102
|
+
shortDays: ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
|
|
103
|
+
months: [
|
|
104
|
+
'январь',
|
|
105
|
+
'февраль',
|
|
106
|
+
'март',
|
|
107
|
+
'апрель',
|
|
108
|
+
'май',
|
|
109
|
+
'июнь',
|
|
110
|
+
'июль',
|
|
111
|
+
'август',
|
|
112
|
+
'сентябрь',
|
|
113
|
+
'октябрь',
|
|
114
|
+
'ноябрь',
|
|
115
|
+
'декабрь'
|
|
116
|
+
],
|
|
117
|
+
shortMonths: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек']
|
|
118
|
+
},
|
|
119
|
+
strings: {
|
|
120
|
+
source: 'Источник',
|
|
121
|
+
sources: 'Источники',
|
|
122
|
+
note: 'Примечание',
|
|
123
|
+
notes: 'Примечания',
|
|
124
|
+
graphic: 'Графика',
|
|
125
|
+
showData: 'Показать данные',
|
|
126
|
+
downloadData: 'Скачать данные (CSV)',
|
|
127
|
+
embed: 'Встроить',
|
|
128
|
+
embedCode: 'Код для встраивания',
|
|
129
|
+
copy: 'Скопировать код',
|
|
130
|
+
copied: 'Скопировано',
|
|
131
|
+
downloadImage: 'Скачать',
|
|
132
|
+
noData: 'Нет данных',
|
|
133
|
+
search: 'Поиск',
|
|
134
|
+
showAll: (n) => `Показать все строки (${n})`,
|
|
135
|
+
showFewer: 'Показать меньше строк'
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { definitions, type LocaleDefinition, type LocaleStrings } from './definitions.js';
|
|
2
|
+
export { definitions };
|
|
3
|
+
export type { LocaleDefinition, LocaleStrings };
|
|
4
|
+
export type LocaleCode = keyof typeof definitions;
|
|
5
|
+
export interface Locale {
|
|
6
|
+
code: LocaleCode;
|
|
7
|
+
/** BCP 47 tag for the `lang` attribute. */
|
|
8
|
+
lang: string;
|
|
9
|
+
strings: LocaleStrings;
|
|
10
|
+
/** d3-format specifier → formatter, using this locale's separators. */
|
|
11
|
+
format(specifier: string): (n: number) => string;
|
|
12
|
+
/** d3-time-format specifier → formatter, using this locale's month and day names. */
|
|
13
|
+
timeFormat(specifier: string): (d: Date) => string;
|
|
14
|
+
/** 1234.5 → "1,234.5" (en) / "1.234,5" (ro) / "1 234,5" (ru). Trailing zeros removed. */
|
|
15
|
+
number: (n: number) => string;
|
|
16
|
+
/** 0.123 → "12%". */
|
|
17
|
+
percent: (n: number) => string;
|
|
18
|
+
/** 0.123 → "+12%"; −0.05 → "−5%". */
|
|
19
|
+
signedPercent: (n: number) => string;
|
|
20
|
+
}
|
|
21
|
+
export declare function createLocale(code: LocaleCode): Locale;
|
|
22
|
+
/** Default tick label for a date: the year on 1 January, the month on the 1st, otherwise day and month. */
|
|
23
|
+
export declare function multiTimeFormat(locale: Locale): (d: Date) => string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { formatLocale } from 'd3-format';
|
|
2
|
+
import { timeFormatLocale } from 'd3-time-format';
|
|
3
|
+
import { definitions } from './definitions.js';
|
|
4
|
+
export { definitions };
|
|
5
|
+
const cache = new Map();
|
|
6
|
+
export function createLocale(code) {
|
|
7
|
+
const cached = cache.get(code);
|
|
8
|
+
if (cached)
|
|
9
|
+
return cached;
|
|
10
|
+
const def = definitions[code];
|
|
11
|
+
if (!def)
|
|
12
|
+
throw new Error(`Unknown mozaic locale "${code}". Known locales: ${Object.keys(definitions).join(', ')}`);
|
|
13
|
+
const numbers = formatLocale(def.number);
|
|
14
|
+
const times = timeFormatLocale(def.time);
|
|
15
|
+
const locale = {
|
|
16
|
+
code,
|
|
17
|
+
lang: def.lang,
|
|
18
|
+
strings: def.strings,
|
|
19
|
+
format: (specifier) => numbers.format(specifier),
|
|
20
|
+
timeFormat: (specifier) => times.format(specifier),
|
|
21
|
+
number: numbers.format(',~f'),
|
|
22
|
+
percent: numbers.format('.0%'),
|
|
23
|
+
signedPercent: numbers.format('+.0%')
|
|
24
|
+
};
|
|
25
|
+
cache.set(code, locale);
|
|
26
|
+
return locale;
|
|
27
|
+
}
|
|
28
|
+
/** Default tick label for a date: the year on 1 January, the month on the 1st, otherwise day and month. */
|
|
29
|
+
export function multiTimeFormat(locale) {
|
|
30
|
+
const year = locale.timeFormat('%Y');
|
|
31
|
+
const month = locale.timeFormat('%b');
|
|
32
|
+
const day = locale.timeFormat('%e %b');
|
|
33
|
+
return (d) => (d.getMonth() === 0 && d.getDate() === 1 ? year(d) : d.getDate() === 1 ? month(d) : day(d));
|
|
34
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
Pie or donut slices centred in the plot area. Use sparingly: bars compare
|
|
4
|
+
values better. A donut (innerRadius 0.6) with ≤ 5 slices and direct labels
|
|
5
|
+
is the acceptable case.
|
|
6
|
+
-->
|
|
7
|
+
<script lang="ts" generics="T">
|
|
8
|
+
import { arc, pie, type PieArcDatum } from 'd3-shape';
|
|
9
|
+
import { useChart, usePlot } from '../core/context.js';
|
|
10
|
+
import { access, type Accessor } from '../core/accessor.js';
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
data: T[];
|
|
14
|
+
value: (d: T) => number;
|
|
15
|
+
fill?: Accessor<T, string>;
|
|
16
|
+
/** Inner radius as a fraction of the outer radius (0 = pie). */
|
|
17
|
+
innerRadius?: number;
|
|
18
|
+
/** Gap between slices, radians. */
|
|
19
|
+
padAngle?: number;
|
|
20
|
+
cornerRadius?: number;
|
|
21
|
+
/** Keep data order (default) or sort largest first. */
|
|
22
|
+
sort?: boolean;
|
|
23
|
+
/** Text label drawn outside each slice. */
|
|
24
|
+
label?: (d: T) => string;
|
|
25
|
+
title?: (d: T) => string;
|
|
26
|
+
onpointerenter?: (d: T, event: PointerEvent) => void;
|
|
27
|
+
onpointerleave?: (d: T, event: PointerEvent) => void;
|
|
28
|
+
class?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let {
|
|
32
|
+
data,
|
|
33
|
+
value,
|
|
34
|
+
fill,
|
|
35
|
+
innerRadius = 0.6,
|
|
36
|
+
padAngle = 0.01,
|
|
37
|
+
cornerRadius = 0,
|
|
38
|
+
sort = false,
|
|
39
|
+
label,
|
|
40
|
+
title,
|
|
41
|
+
onpointerenter,
|
|
42
|
+
onpointerleave,
|
|
43
|
+
class: className = ''
|
|
44
|
+
}: Props = $props();
|
|
45
|
+
|
|
46
|
+
const chart = useChart();
|
|
47
|
+
const plot = usePlot();
|
|
48
|
+
|
|
49
|
+
const radius = $derived(Math.max(0, Math.min(plot.width, plot.height) / 2 - (label ? 24 : 0)));
|
|
50
|
+
const slices = $derived.by(() => {
|
|
51
|
+
const generator = pie<T>().value(value).padAngle(padAngle);
|
|
52
|
+
return (sort ? generator.sort((a: T, b: T) => value(b) - value(a)) : generator.sort(null))(data);
|
|
53
|
+
});
|
|
54
|
+
const shape = $derived(
|
|
55
|
+
arc<PieArcDatum<T>>()
|
|
56
|
+
.innerRadius(radius * innerRadius)
|
|
57
|
+
.outerRadius(radius)
|
|
58
|
+
.cornerRadius(cornerRadius)
|
|
59
|
+
);
|
|
60
|
+
const labelArc = $derived(
|
|
61
|
+
arc<PieArcDatum<T>>()
|
|
62
|
+
.innerRadius(radius + 12)
|
|
63
|
+
.outerRadius(radius + 12)
|
|
64
|
+
);
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<g class="mz-arcs {className}" transform="translate({plot.width / 2},{plot.height / 2})">
|
|
68
|
+
{#each slices as slice, i}
|
|
69
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
70
|
+
<path
|
|
71
|
+
d={shape(slice) ?? ''}
|
|
72
|
+
fill={fill
|
|
73
|
+
? access(fill, slice.data, i)
|
|
74
|
+
: chart.theme.palettes.categorical[i % chart.theme.palettes.categorical.length]}
|
|
75
|
+
stroke="var(--mz-color-bg)"
|
|
76
|
+
stroke-width={1}
|
|
77
|
+
onpointerenter={onpointerenter ? (e) => onpointerenter(slice.data, e) : undefined}
|
|
78
|
+
onpointerleave={onpointerleave ? (e) => onpointerleave(slice.data, e) : undefined}
|
|
79
|
+
>{#if title}<title>{title(slice.data)}</title>{/if}</path
|
|
80
|
+
>
|
|
81
|
+
{#if label}
|
|
82
|
+
{@const [lx, ly] = labelArc.centroid(slice)}
|
|
83
|
+
<text x={lx} y={ly} dy="0.32em" text-anchor={lx >= 0 ? 'start' : 'end'}>{label(slice.data)}</text>
|
|
84
|
+
{/if}
|
|
85
|
+
{/each}
|
|
86
|
+
</g>
|
|
87
|
+
|
|
88
|
+
<style>
|
|
89
|
+
text {
|
|
90
|
+
fill: var(--mz-color-text);
|
|
91
|
+
font-size: var(--mz-size-axis);
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Accessor } from '../core/accessor.js';
|
|
2
|
+
declare function $$render<T>(): {
|
|
3
|
+
props: {
|
|
4
|
+
data: T[];
|
|
5
|
+
value: (d: T) => number;
|
|
6
|
+
fill?: Accessor<T, string>;
|
|
7
|
+
/** Inner radius as a fraction of the outer radius (0 = pie). */
|
|
8
|
+
innerRadius?: number;
|
|
9
|
+
/** Gap between slices, radians. */
|
|
10
|
+
padAngle?: number;
|
|
11
|
+
cornerRadius?: number;
|
|
12
|
+
/** Keep data order (default) or sort largest first. */
|
|
13
|
+
sort?: boolean;
|
|
14
|
+
/** Text label drawn outside each slice. */
|
|
15
|
+
label?: (d: T) => string;
|
|
16
|
+
title?: (d: T) => string;
|
|
17
|
+
onpointerenter?: (d: T, event: PointerEvent) => void;
|
|
18
|
+
onpointerleave?: (d: T, event: PointerEvent) => void;
|
|
19
|
+
class?: string;
|
|
20
|
+
};
|
|
21
|
+
exports: {};
|
|
22
|
+
bindings: "";
|
|
23
|
+
slots: {};
|
|
24
|
+
events: {};
|
|
25
|
+
};
|
|
26
|
+
declare class __sveltets_Render<T> {
|
|
27
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
28
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
29
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
30
|
+
bindings(): "";
|
|
31
|
+
exports(): {};
|
|
32
|
+
}
|
|
33
|
+
interface $$IsomorphicComponent {
|
|
34
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
35
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
36
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
37
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
38
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Pie or donut slices centred in the plot area. Use sparingly: bars compare
|
|
42
|
+
* values better. A donut (innerRadius 0.6) with ≤ 5 slices and direct labels
|
|
43
|
+
* is the acceptable case.
|
|
44
|
+
*/
|
|
45
|
+
declare const Arcs: $$IsomorphicComponent;
|
|
46
|
+
type Arcs<T> = InstanceType<typeof Arcs<T>>;
|
|
47
|
+
export default Arcs;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
A filled area between `y0` (default 0) and `y` along x. For stacked areas,
|
|
4
|
+
use `stack()` and pass `y0={d => d.start}` and `y={d => d.end}` per series.
|
|
5
|
+
Pair a light area (opacity ~0.1–0.2) with a `<Line>` on top for emphasis.
|
|
6
|
+
-->
|
|
7
|
+
<script lang="ts" generics="T">
|
|
8
|
+
import { area, curveLinear, type CurveFactory } from 'd3-shape';
|
|
9
|
+
import { useChart, usePlot } from '../core/context.js';
|
|
10
|
+
import { scaled } from '../core/scales.js';
|
|
11
|
+
import { access, type Accessor } from '../core/accessor.js';
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
data: T[];
|
|
15
|
+
x: (d: T, i: number) => any;
|
|
16
|
+
/** Top edge. */
|
|
17
|
+
y: (d: T, i: number) => any;
|
|
18
|
+
/** Bottom edge (value, or function for stacks). */
|
|
19
|
+
y0?: Accessor<T, number>;
|
|
20
|
+
curve?: CurveFactory;
|
|
21
|
+
defined?: (d: T, i: number) => boolean;
|
|
22
|
+
fill?: string;
|
|
23
|
+
opacity?: number;
|
|
24
|
+
class?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let { data, x, y, y0 = 0, curve = curveLinear, defined, fill, opacity = 1, class: className = '' }: Props = $props();
|
|
28
|
+
|
|
29
|
+
const chart = useChart();
|
|
30
|
+
const plot = usePlot();
|
|
31
|
+
|
|
32
|
+
const d = $derived(
|
|
33
|
+
area<T>()
|
|
34
|
+
.x((p, i) => scaled(plot.x, x(p, i)))
|
|
35
|
+
.y1((p, i) => scaled(plot.y, y(p, i)))
|
|
36
|
+
.y0((p, i) => scaled(plot.y, access(y0, p, i)))
|
|
37
|
+
.defined((p, i) =>
|
|
38
|
+
defined ? defined(p, i) : Number.isFinite(scaled(plot.x, x(p, i))) && Number.isFinite(scaled(plot.y, y(p, i)))
|
|
39
|
+
)
|
|
40
|
+
.curve(curve)(data) ?? ''
|
|
41
|
+
);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<path class="mz-area {className}" {d} fill={fill ?? chart.theme.palettes.categorical[0]} fill-opacity={opacity} />
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type CurveFactory } from 'd3-shape';
|
|
2
|
+
import { type Accessor } from '../core/accessor.js';
|
|
3
|
+
declare function $$render<T>(): {
|
|
4
|
+
props: {
|
|
5
|
+
data: T[];
|
|
6
|
+
x: (d: T, i: number) => any;
|
|
7
|
+
/** Top edge. */
|
|
8
|
+
y: (d: T, i: number) => any;
|
|
9
|
+
/** Bottom edge (value, or function for stacks). */
|
|
10
|
+
y0?: Accessor<T, number>;
|
|
11
|
+
curve?: CurveFactory;
|
|
12
|
+
defined?: (d: T, i: number) => boolean;
|
|
13
|
+
fill?: string;
|
|
14
|
+
opacity?: number;
|
|
15
|
+
class?: string;
|
|
16
|
+
};
|
|
17
|
+
exports: {};
|
|
18
|
+
bindings: "";
|
|
19
|
+
slots: {};
|
|
20
|
+
events: {};
|
|
21
|
+
};
|
|
22
|
+
declare class __sveltets_Render<T> {
|
|
23
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
24
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
25
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
26
|
+
bindings(): "";
|
|
27
|
+
exports(): {};
|
|
28
|
+
}
|
|
29
|
+
interface $$IsomorphicComponent {
|
|
30
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
31
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
32
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
33
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
34
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A filled area between `y0` (default 0) and `y` along x. For stacked areas,
|
|
38
|
+
* use `stack()` and pass `y0={d => d.start}` and `y={d => d.end}` per series.
|
|
39
|
+
* Pair a light area (opacity ~0.1–0.2) with a `<Line>` on top for emphasis.
|
|
40
|
+
*/
|
|
41
|
+
declare const Area: $$IsomorphicComponent;
|
|
42
|
+
type Area<T> = InstanceType<typeof Area<T>>;
|
|
43
|
+
export default Area;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
One horizontal arrow per row, from a start value to an end value: how each
|
|
4
|
+
category changed between two dates (an arrow plot). Needs a band y scale (one
|
|
5
|
+
row per category) and a continuous x scale. Arrows shorter than their head
|
|
6
|
+
are drawn as the head alone, so a tiny change still shows its direction.
|
|
7
|
+
-->
|
|
8
|
+
<script lang="ts" generics="T">
|
|
9
|
+
import { useChart, usePlot } from '../core/context.js';
|
|
10
|
+
import { access, type Accessor } from '../core/accessor.js';
|
|
11
|
+
import { scaled } from '../core/scales.js';
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
data: T[];
|
|
15
|
+
y: (d: T) => string;
|
|
16
|
+
/** Start value (e.g. the earlier date): the arrow's tail. */
|
|
17
|
+
x1: (d: T) => number;
|
|
18
|
+
/** End value (e.g. the later date): the arrowhead. */
|
|
19
|
+
x2: (d: T) => number;
|
|
20
|
+
/** Arrow colour; defaults to the first categorical colour. */
|
|
21
|
+
stroke?: Accessor<T, string>;
|
|
22
|
+
/** Line width in px. */
|
|
23
|
+
strokeWidth?: number;
|
|
24
|
+
/** Arrowhead length in px (its width is the same). */
|
|
25
|
+
headSize?: number;
|
|
26
|
+
opacity?: Accessor<T, number>;
|
|
27
|
+
/** Accessible label per arrow (adds a <title>). */
|
|
28
|
+
title?: (d: T) => string;
|
|
29
|
+
onpointerenter?: (d: T, event: PointerEvent) => void;
|
|
30
|
+
onpointerleave?: (d: T, event: PointerEvent) => void;
|
|
31
|
+
class?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let {
|
|
35
|
+
data,
|
|
36
|
+
y,
|
|
37
|
+
x1,
|
|
38
|
+
x2,
|
|
39
|
+
stroke,
|
|
40
|
+
strokeWidth = 2,
|
|
41
|
+
headSize = 8,
|
|
42
|
+
opacity = 1,
|
|
43
|
+
title,
|
|
44
|
+
onpointerenter,
|
|
45
|
+
onpointerleave,
|
|
46
|
+
class: className = ''
|
|
47
|
+
}: Props = $props();
|
|
48
|
+
|
|
49
|
+
const chart = useChart();
|
|
50
|
+
const plot = usePlot();
|
|
51
|
+
const fallback = $derived(chart.theme.palettes.categorical[0]);
|
|
52
|
+
|
|
53
|
+
const geometry = (d: T) => {
|
|
54
|
+
const cy = scaled(plot.y, y(d));
|
|
55
|
+
const sx = plot.x(x1(d)) ?? 0;
|
|
56
|
+
const ex = plot.x(x2(d)) ?? 0;
|
|
57
|
+
const dir = ex >= sx ? 1 : -1;
|
|
58
|
+
// The head ends exactly at the end value; the line stops where the head begins.
|
|
59
|
+
const base = Math.abs(ex - sx) > headSize ? ex - dir * headSize : sx;
|
|
60
|
+
const half = headSize / 2;
|
|
61
|
+
return {
|
|
62
|
+
line: Math.abs(ex - sx) > headSize ? `M${sx},${cy}H${base}` : '',
|
|
63
|
+
head: `M${ex},${cy}L${ex - dir * headSize},${cy - half}L${ex - dir * headSize},${cy + half}Z`
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<g class="mz-arrows {className}">
|
|
69
|
+
{#each data as d, i}
|
|
70
|
+
{@const g = geometry(d)}
|
|
71
|
+
{@const c = stroke === undefined ? fallback : access(stroke, d, i)}
|
|
72
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
73
|
+
<g
|
|
74
|
+
opacity={access(opacity, d, i)}
|
|
75
|
+
onpointerenter={onpointerenter ? (e) => onpointerenter(d, e) : undefined}
|
|
76
|
+
onpointerleave={onpointerleave ? (e) => onpointerleave(d, e) : undefined}
|
|
77
|
+
>
|
|
78
|
+
{#if title}<title>{title(d)}</title>{/if}
|
|
79
|
+
{#if g.line}<path class="mz-arrows-line" d={g.line} stroke={c} stroke-width={strokeWidth} />{/if}
|
|
80
|
+
<path class="mz-arrows-head" d={g.head} fill={c} />
|
|
81
|
+
</g>
|
|
82
|
+
{/each}
|
|
83
|
+
</g>
|
|
84
|
+
|
|
85
|
+
<style>
|
|
86
|
+
.mz-arrows-line {
|
|
87
|
+
fill: none;
|
|
88
|
+
stroke-linecap: butt;
|
|
89
|
+
}
|
|
90
|
+
.mz-arrows-head {
|
|
91
|
+
stroke: none;
|
|
92
|
+
}
|
|
93
|
+
</style>
|