@mozaic-ds/chart 0.1.0-beta.3 → 0.1.0-beta.30

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.
Files changed (59) hide show
  1. package/dist/mozaic-chart.js +4453 -2623
  2. package/dist/mozaic-chart.umd.cjs +17 -11
  3. package/dist/style.css +1 -1
  4. package/package.json +25 -10
  5. package/src/assets/base.css +1 -1
  6. package/src/assets/img/bubbles.svg +4 -0
  7. package/src/components/bar/BarChart.stories.ts +105 -103
  8. package/src/components/bar/BarChart.vue +257 -131
  9. package/src/components/bar/index.ts +3 -3
  10. package/src/components/bubble/BubbleChart.stories.ts +66 -0
  11. package/src/components/bubble/BubbleChart.vue +363 -0
  12. package/src/components/bubble/index.ts +8 -0
  13. package/src/components/doughnut/DoughnutChart.stories.ts +38 -36
  14. package/src/components/doughnut/DoughnutChart.vue +210 -111
  15. package/src/components/doughnut/index.ts +3 -3
  16. package/src/components/index.ts +4 -4
  17. package/src/components/line/LineChart.stories.ts +52 -27
  18. package/src/components/line/LineChart.vue +346 -254
  19. package/src/components/line/index.ts +3 -3
  20. package/src/components/mixed/MixedBarLineChart.stories.ts +91 -0
  21. package/src/components/mixed/MixedBarLineChart.vue +413 -0
  22. package/src/components/mixed/index.ts +8 -0
  23. package/src/components/radar/RadarChart.stories.ts +102 -102
  24. package/src/components/radar/RadarChart.vue +204 -165
  25. package/src/components/radar/index.ts +3 -3
  26. package/src/main.ts +14 -4
  27. package/src/plugin.ts +10 -8
  28. package/src/services/BarChartFunctions.ts +136 -35
  29. package/src/services/BubbleTooltipService.ts +67 -0
  30. package/src/services/ChartsCommonLegend.ts +309 -137
  31. package/src/services/ColorFunctions.ts +1 -1
  32. package/src/services/DoughnutChartFunctions.ts +132 -55
  33. package/src/services/FormatUtilities.ts +28 -14
  34. package/src/services/GenericTooltipService.ts +140 -65
  35. package/src/services/MixedBarLineFunctions.ts +262 -0
  36. package/src/services/PatternFunctions.ts +25 -18
  37. package/src/services/RadarChartFunctions.ts +33 -12
  38. package/src/services/patterns/ChartDesign.ts +35 -24
  39. package/src/services/patterns/patternCircles.ts +63 -36
  40. package/src/services/patterns/patternDashedDiagonals.ts +64 -57
  41. package/src/services/patterns/patternDiagonals.ts +138 -106
  42. package/src/services/patterns/patternSquares.ts +86 -80
  43. package/src/services/patterns/patternVerticalLines.ts +76 -69
  44. package/src/services/patterns/patternZigzag.ts +92 -85
  45. package/src/stories/Changelog.mdx +6 -0
  46. package/src/stories/Contributing.mdx +101 -0
  47. package/src/stories/GettingStarted.mdx +92 -0
  48. package/src/stories/SupportAndOnboarding.mdx +44 -0
  49. package/src/types/AxisDefinition.ts +4 -0
  50. package/src/types/BarData.ts +1 -0
  51. package/src/types/Chart.ts +9 -7
  52. package/src/types/DoughnutData.ts +8 -0
  53. package/src/types/GenericData.ts +10 -10
  54. package/src/types/LineChart.ts +4 -4
  55. package/src/types/MixedBarLineData.ts +7 -0
  56. package/src/types/RadarData.ts +33 -29
  57. package/src/types/TooltipChartType.ts +7 -6
  58. package/src/vite-env.d.ts +3 -3
  59. package/src/App.vue +0 -80
@@ -1,11 +1,11 @@
1
1
  // RadarChart.stories.ts
2
2
 
3
- import type { Meta, StoryObj } from "@storybook/vue3";
4
- import RadarChart from "./RadarChart.vue";
3
+ import type { Meta, StoryObj } from '@storybook/vue3';
4
+ import RadarChart from './RadarChart.vue';
5
5
 
6
6
  const meta = {
7
- title: "Charts/Radar",
8
- component: RadarChart,
7
+ title: 'Charts/Radar',
8
+ component: RadarChart
9
9
  } satisfies Meta<typeof RadarChart>;
10
10
 
11
11
  export default meta;
@@ -13,334 +13,334 @@ type Story = StoryObj<typeof meta>;
13
13
 
14
14
  export const Default = {
15
15
  args: {
16
- height: "400px",
17
- labels: ["Label 1", "Label 2", "Label 3", "Label 4", "Label 5"],
18
- areas: [
16
+ height: '400px',
17
+ labels: ['Label 1', 'Label 2', 'Label 3', 'Label 4', 'Label 5'],
18
+ datasets: [
19
19
  {
20
- label: "currentYear",
20
+ label: 'currentYear',
21
21
  areaData: [
22
22
  {
23
23
  value: 88.524115665,
24
24
  position: 60.98,
25
- unit: "D",
25
+ unit: 'D',
26
26
  label: null,
27
27
  rate: null,
28
- color: "red",
28
+ color: 'red',
29
29
  trendValue: null,
30
30
  trendUnit: null,
31
- tooltips: null,
31
+ tooltips: null
32
32
  },
33
33
  {
34
34
  value: -3.5998021,
35
35
  position: 46.4,
36
- unit: "%",
36
+ unit: '%',
37
37
  label: null,
38
38
  rate: null,
39
- color: "green",
39
+ color: 'green',
40
40
  trendValue: null,
41
41
  trendUnit: null,
42
- tooltips: null,
42
+ tooltips: null
43
43
  },
44
44
  {
45
45
  value: 3.1604936,
46
46
  position: 53.16,
47
- unit: "%",
47
+ unit: '%',
48
48
  label: null,
49
49
  rate: null,
50
- color: "green",
50
+ color: 'green',
51
51
  trendValue: null,
52
52
  trendUnit: null,
53
- tooltips: null,
53
+ tooltips: null
54
54
  },
55
55
  {
56
56
  value: 7.787256,
57
57
  position: 57.79,
58
- unit: "%",
58
+ unit: '%',
59
59
  label: null,
60
60
  rate: null,
61
- color: "green",
61
+ color: 'green',
62
62
  trendValue: null,
63
63
  trendUnit: null,
64
- tooltips: null,
64
+ tooltips: null
65
65
  },
66
66
  {
67
67
  value: 62.2866732,
68
68
  position: 79.76,
69
- unit: "%",
69
+ unit: '%',
70
70
  label: null,
71
71
  rate: null,
72
- color: "red",
72
+ color: 'red',
73
73
  trendValue: null,
74
74
  trendUnit: null,
75
- tooltips: null,
76
- },
77
- ],
75
+ tooltips: null
76
+ }
77
+ ]
78
78
  },
79
79
  {
80
- label: "previousYear",
80
+ label: 'previousYear',
81
81
  areaData: [
82
82
  {
83
83
  value: 78.752887008,
84
84
  position: 67.5,
85
- unit: "D",
85
+ unit: 'D',
86
86
  label: null,
87
87
  rate: null,
88
88
  color: null,
89
89
  trendValue: null,
90
90
  trendUnit: null,
91
- tooltips: null,
91
+ tooltips: null
92
92
  },
93
93
  {
94
94
  value: -22.7389942,
95
95
  position: 27.26,
96
- unit: "%",
96
+ unit: '%',
97
97
  label: null,
98
98
  rate: null,
99
99
  color: null,
100
100
  trendValue: null,
101
101
  trendUnit: null,
102
- tooltips: null,
102
+ tooltips: null
103
103
  },
104
104
  {
105
105
  value: -4.9793614,
106
106
  position: 45.02,
107
- unit: "%",
107
+ unit: '%',
108
108
  label: null,
109
109
  rate: null,
110
110
  color: null,
111
111
  trendValue: null,
112
112
  trendUnit: null,
113
- tooltips: null,
114
- },
115
- ],
116
- },
117
- ],
118
- },
113
+ tooltips: null
114
+ }
115
+ ]
116
+ }
117
+ ]
118
+ }
119
119
  } satisfies Story;
120
120
 
121
121
  export const MultipleData = {
122
122
  args: {
123
- height: "400px",
123
+ height: '400px',
124
124
  labels: [
125
- "Label 1",
126
- "Label 2",
127
- "Label 3",
128
- "Label 4",
129
- "Label 5",
130
- "Label 6",
131
- "Label 7",
132
- "Label 8",
133
- "Label 9",
125
+ 'Label 1',
126
+ 'Label 2',
127
+ 'Label 3',
128
+ 'Label 4',
129
+ 'Label 5',
130
+ 'Label 6',
131
+ 'Label 7',
132
+ 'Label 8',
133
+ 'Label 9'
134
134
  ],
135
- areas: [
135
+ datasets: [
136
136
  {
137
- label: "currentYear",
137
+ label: 'currentYear',
138
138
  areaData: [
139
139
  {
140
140
  value: 88.524115665,
141
141
  position: 60.98,
142
- unit: "D",
142
+ unit: 'D',
143
143
  label: null,
144
144
  rate: null,
145
- color: "red",
145
+ color: 'red',
146
146
  trendValue: null,
147
147
  trendUnit: null,
148
- tooltips: null,
148
+ tooltips: null
149
149
  },
150
150
  {
151
151
  value: -3.5998021,
152
152
  position: 46.4,
153
- unit: "%",
153
+ unit: '%',
154
154
  label: null,
155
155
  rate: null,
156
- color: "green",
156
+ color: 'green',
157
157
  trendValue: null,
158
158
  trendUnit: null,
159
- tooltips: null,
159
+ tooltips: null
160
160
  },
161
161
  {
162
162
  value: 3.1604936,
163
163
  position: 53.16,
164
- unit: "%",
164
+ unit: '%',
165
165
  label: null,
166
166
  rate: null,
167
- color: "green",
167
+ color: 'green',
168
168
  trendValue: null,
169
169
  trendUnit: null,
170
- tooltips: null,
170
+ tooltips: null
171
171
  },
172
172
  {
173
173
  value: 7.787256,
174
174
  position: 57.79,
175
- unit: "%",
175
+ unit: '%',
176
176
  label: null,
177
177
  rate: null,
178
- color: "green",
178
+ color: 'green',
179
179
  trendValue: null,
180
180
  trendUnit: null,
181
- tooltips: null,
181
+ tooltips: null
182
182
  },
183
183
  {
184
184
  value: 62.2866732,
185
185
  position: 79.76,
186
- unit: "%",
186
+ unit: '%',
187
187
  label: null,
188
188
  rate: null,
189
- color: "red",
189
+ color: 'red',
190
190
  trendValue: null,
191
191
  trendUnit: null,
192
- tooltips: null,
192
+ tooltips: null
193
193
  },
194
194
  {
195
195
  value: 3.8,
196
196
  position: 76,
197
- unit: "*",
197
+ unit: '*',
198
198
  label: null,
199
199
  rate: null,
200
- color: "red",
200
+ color: 'red',
201
201
  trendValue: null,
202
202
  trendUnit: null,
203
- tooltips: null,
203
+ tooltips: null
204
204
  },
205
205
  {
206
206
  value: 86.8082515,
207
207
  position: 89.45,
208
- unit: "%",
208
+ unit: '%',
209
209
  label: null,
210
210
  rate: null,
211
- color: "green",
211
+ color: 'green',
212
212
  trendValue: null,
213
213
  trendUnit: null,
214
- tooltips: null,
214
+ tooltips: null
215
215
  },
216
216
  {
217
217
  value: 94.8386888,
218
218
  position: 79.35,
219
- unit: "%",
219
+ unit: '%',
220
220
  label: null,
221
221
  rate: null,
222
- color: "red",
222
+ color: 'red',
223
223
  trendValue: null,
224
224
  trendUnit: null,
225
- tooltips: null,
225
+ tooltips: null
226
226
  },
227
227
  {
228
228
  value: 72.2144111,
229
229
  position: 54.81,
230
- unit: "%",
230
+ unit: '%',
231
231
  label: null,
232
232
  rate: null,
233
- color: "red",
233
+ color: 'red',
234
234
  trendValue: null,
235
235
  trendUnit: null,
236
- tooltips: null,
237
- },
238
- ],
236
+ tooltips: null
237
+ }
238
+ ]
239
239
  },
240
240
  {
241
- label: "previousYear",
241
+ label: 'previousYear',
242
242
  areaData: [
243
243
  {
244
244
  value: 78.752887008,
245
245
  position: 67.5,
246
- unit: "D",
246
+ unit: 'D',
247
247
  label: null,
248
248
  rate: null,
249
249
  color: null,
250
250
  trendValue: null,
251
251
  trendUnit: null,
252
- tooltips: null,
252
+ tooltips: null
253
253
  },
254
254
  {
255
255
  value: -22.7389942,
256
256
  position: 27.26,
257
- unit: "%",
257
+ unit: '%',
258
258
  label: null,
259
259
  rate: null,
260
260
  color: null,
261
261
  trendValue: null,
262
262
  trendUnit: null,
263
- tooltips: null,
263
+ tooltips: null
264
264
  },
265
265
  {
266
266
  value: -4.9793614,
267
267
  position: 45.02,
268
- unit: "%",
268
+ unit: '%',
269
269
  label: null,
270
270
  rate: null,
271
271
  color: null,
272
272
  trendValue: null,
273
273
  trendUnit: null,
274
- tooltips: null,
274
+ tooltips: null
275
275
  },
276
276
  {
277
277
  value: -22.8576595,
278
278
  position: 27.14,
279
- unit: "%",
279
+ unit: '%',
280
280
  label: null,
281
281
  rate: null,
282
282
  color: null,
283
283
  trendValue: null,
284
284
  trendUnit: null,
285
- tooltips: null,
285
+ tooltips: null
286
286
  },
287
287
  {
288
288
  value: 65.1835015,
289
289
  position: 83.07,
290
- unit: "%",
290
+ unit: '%',
291
291
  label: null,
292
292
  rate: null,
293
293
  color: null,
294
294
  trendValue: null,
295
295
  trendUnit: null,
296
- tooltips: null,
296
+ tooltips: null
297
297
  },
298
298
  {
299
299
  value: 4.181034483,
300
300
  position: 83.62,
301
- unit: "*",
301
+ unit: '*',
302
302
  label: null,
303
303
  rate: null,
304
304
  color: null,
305
305
  trendValue: null,
306
306
  trendUnit: null,
307
- tooltips: null,
307
+ tooltips: null
308
308
  },
309
309
  {
310
310
  value: 86.8082515,
311
311
  position: 89.45,
312
- unit: "%",
312
+ unit: '%',
313
313
  label: null,
314
314
  rate: null,
315
315
  color: null,
316
316
  trendValue: null,
317
317
  trendUnit: null,
318
- tooltips: null,
318
+ tooltips: null
319
319
  },
320
320
  {
321
321
  value: 98.120897,
322
322
  position: 92.48,
323
- unit: "%",
323
+ unit: '%',
324
324
  label: null,
325
325
  rate: null,
326
326
  color: null,
327
327
  trendValue: null,
328
328
  trendUnit: null,
329
- tooltips: null,
329
+ tooltips: null
330
330
  },
331
331
  {
332
332
  value: 97.2715978,
333
333
  position: 94.54,
334
- unit: "%",
334
+ unit: '%',
335
335
  label: null,
336
336
  rate: null,
337
337
  color: null,
338
338
  trendValue: null,
339
339
  trendUnit: null,
340
- tooltips: null,
341
- },
342
- ],
343
- },
344
- ],
345
- },
340
+ tooltips: null
341
+ }
342
+ ]
343
+ }
344
+ ]
345
+ }
346
346
  } satisfies Story;