@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,74 +1,81 @@
1
- export default function PatternVerticalLines(hover: boolean, color: string = '#8C1551', disableAccessibility: boolean = false): CanvasPattern {
2
- const canvasPattern: HTMLCanvasElement = document.createElement('canvas');
3
- const ctx: CanvasRenderingContext2D | null = canvasPattern.getContext('2d');
4
- if (!ctx) {
5
- return new CanvasPattern;
6
- }
1
+ export default function PatternVerticalLines(
2
+ hover: boolean,
3
+ color: string = '#8C1551',
4
+ disableAccessibility: boolean = false
5
+ ): CanvasPattern {
6
+ const canvasPattern: HTMLCanvasElement = document.createElement('canvas');
7
+ const ctx: CanvasRenderingContext2D | null = canvasPattern.getContext('2d');
8
+ if (!ctx) {
9
+ return new CanvasPattern();
10
+ }
7
11
 
8
- const patternSize = 50;
9
- const lineSize = patternSize * 0.15;
12
+ const patternSize = 50;
13
+ const lineSize = patternSize * 0.15;
14
+
15
+ canvasPattern.width = patternSize;
16
+ canvasPattern.height = patternSize;
17
+
18
+ if (disableAccessibility === true) {
19
+ ctx.beginPath();
20
+ ctx.fillStyle = color;
21
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
22
+ ctx.fill();
23
+ } else {
24
+ // background
25
+ ctx.beginPath();
26
+ ctx.fillStyle = '#FFFFFF';
27
+ ctx.lineWidth = 0.005 * patternSize;
28
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
29
+ ctx.fill();
30
+ ctx.beginPath();
31
+ ctx.globalAlpha = 0.1;
32
+ ctx.fillStyle = color;
33
+ ctx.lineWidth = 0.005 * patternSize;
34
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
35
+ ctx.fill();
10
36
 
11
- canvasPattern.width = patternSize;
12
- canvasPattern.height = patternSize;
13
-
14
- if (disableAccessibility === true) {
15
- ctx.beginPath();
16
- ctx.fillStyle = color;
17
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
18
- ctx.fill();
19
- } else {
20
- // background
21
- ctx.beginPath();
22
- ctx.fillStyle = '#FFFFFF';
23
- ctx.lineWidth = 0.005 * patternSize;
24
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
25
- ctx.fill();
26
- ctx.beginPath();
27
- ctx.globalAlpha = 0.1;
28
- ctx.fillStyle = color;
29
- ctx.lineWidth = 0.005 * patternSize;
30
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
31
- ctx.fill();
32
-
33
37
  // #rect4
34
- ctx.beginPath();
35
- ctx.globalAlpha = 0.3;
36
- ctx.fillStyle = color;
37
- ctx.lineWidth = 0.005 * patternSize;
38
- ctx.rect(0.000000, 0.000000, lineSize, patternSize);
39
- ctx.fill();
40
-
38
+ ctx.beginPath();
39
+ ctx.globalAlpha = 0.3;
40
+ ctx.fillStyle = color;
41
+ ctx.lineWidth = 0.005 * patternSize;
42
+ ctx.rect(0.0, 0.0, lineSize, patternSize);
43
+ ctx.fill();
44
+
41
45
  // #rect6
42
- ctx.beginPath();
43
- ctx.globalAlpha = 0.7;
44
- ctx.fillStyle = color;
45
- ctx.lineWidth = 0.005 * patternSize;
46
- ctx.rect(patternSize / 2, 0.000000, lineSize, patternSize);
47
- ctx.fill();
48
- }
46
+ ctx.beginPath();
47
+ ctx.globalAlpha = 0.7;
48
+ ctx.fillStyle = color;
49
+ ctx.lineWidth = 0.005 * patternSize;
50
+ ctx.rect(patternSize / 2, 0.0, lineSize, patternSize);
51
+ ctx.fill();
52
+ }
53
+
54
+ // Hover Style
55
+ if (hover) {
56
+ ctx.beginPath();
57
+ ctx.globalAlpha = 0.5;
58
+ ctx.fillStyle = '#FFFFFF';
59
+ ctx.lineWidth = 0.006 * patternSize;
60
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
61
+ ctx.fill();
62
+ }
63
+
64
+ const canvas: HTMLCanvasElement = document.createElement('canvas');
65
+ const context: CanvasRenderingContext2D | null = canvas.getContext('2d');
66
+ if (!context) {
67
+ return new CanvasPattern();
68
+ }
69
+ const pattern: CanvasPattern | null = context.createPattern(
70
+ canvasPattern,
71
+ 'repeat'
72
+ );
73
+ if (!pattern) {
74
+ return new CanvasPattern();
75
+ }
76
+
77
+ context.fillStyle = pattern;
78
+ context.fillRect(0, 0, patternSize, patternSize);
49
79
 
50
- // Hover Style
51
- if (hover) {
52
- ctx.beginPath();
53
- ctx.globalAlpha = 0.5;
54
- ctx.fillStyle = '#FFFFFF';
55
- ctx.lineWidth = 0.006 * patternSize;
56
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
57
- ctx.fill();
58
- }
59
-
60
- const canvas: HTMLCanvasElement = document.createElement('canvas');
61
- const context: CanvasRenderingContext2D | null = canvas.getContext('2d');
62
- if (!context) {
63
- return new CanvasPattern;
64
- }
65
- const pattern: CanvasPattern | null = context.createPattern(canvasPattern, 'repeat');
66
- if (!pattern) {
67
- return new CanvasPattern;
68
- }
69
-
70
- context.fillStyle = pattern;
71
- context.fillRect(0, 0, patternSize, patternSize);
72
-
73
- return pattern;
74
- }
80
+ return pattern;
81
+ }
@@ -1,101 +1,108 @@
1
- export default function PatternZigzag(hover: boolean, color: string = '#00A3B2', disableAccessibility: boolean = false): CanvasPattern {
1
+ export default function PatternZigzag(
2
+ hover: boolean,
3
+ color: string = '#00A3B2',
4
+ disableAccessibility: boolean = false
5
+ ): CanvasPattern {
2
6
  const canvasPattern: HTMLCanvasElement = document.createElement('canvas');
3
7
  const ctx: CanvasRenderingContext2D | null = canvasPattern.getContext('2d');
4
8
  if (!ctx) {
5
- return new CanvasPattern;
9
+ return new CanvasPattern();
6
10
  }
7
-
11
+
8
12
  const patternSize = 50;
9
-
13
+
10
14
  canvasPattern.width = patternSize;
11
15
  canvasPattern.height = patternSize;
12
16
 
13
17
  if (disableAccessibility === true) {
14
18
  ctx.beginPath();
15
19
  ctx.fillStyle = color;
16
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
20
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
17
21
  ctx.fill();
18
22
  } else {
19
- // background
20
- ctx.beginPath();
21
- ctx.fillStyle = '#FFFFFF';
22
- ctx.lineWidth = 0.005 * patternSize;
23
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
24
- ctx.fill();
25
- ctx.beginPath();
26
- ctx.globalAlpha = 0.1;
27
- ctx.fillStyle = color;
28
- ctx.lineWidth = 0.005 * patternSize;
29
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
30
- ctx.fill();
31
-
32
- // #path4
33
- ctx.beginPath();
34
- ctx.globalAlpha = 0.7;
35
- ctx.strokeStyle = color;
36
- ctx.lineWidth = 0.08 * patternSize;
37
- ctx.moveTo(- patternSize / 2, patternSize / 2);
38
- ctx.lineTo(0.000000, 0.000000);
39
- ctx.lineTo(patternSize / 2, patternSize / 2);
40
- ctx.lineTo(patternSize, 0.000000);
41
- ctx.stroke();
42
-
43
- // #path6
44
- ctx.beginPath();
45
- ctx.globalAlpha = 0.3;
46
- ctx.strokeStyle = color;
47
- ctx.lineWidth = 0.08 * patternSize;
48
- ctx.moveTo(- patternSize / 2, patternSize);
49
- ctx.lineTo(0.000000, patternSize / 2);
50
- ctx.lineTo(patternSize / 2, patternSize);
51
- ctx.lineTo(patternSize, patternSize / 2);
52
- ctx.lineTo(patternSize + (patternSize / 2), patternSize);
53
- ctx.stroke();
54
-
55
- // #path6-6
56
- ctx.beginPath();
57
- ctx.globalAlpha = 0.3;
58
- ctx.strokeStyle = color;
59
- ctx.lineWidth = 0.08 * patternSize;
60
- ctx.moveTo(- patternSize / 2, 0.000111);
61
- ctx.lineTo(0.000004 * patternSize, - patternSize / 2);
62
- ctx.lineTo(patternSize / 2, 0.000111);
63
- ctx.lineTo(patternSize, - patternSize / 2);
64
- ctx.lineTo(patternSize + (patternSize / 2), 0.000111);
65
- ctx.stroke();
66
-
67
- // #path6-5
68
- ctx.beginPath();
69
- ctx.globalAlpha = 0.7;
70
- ctx.strokeStyle = color;
71
- ctx.lineWidth = 0.08 * patternSize;
72
- ctx.moveTo(- patternSize / 2, patternSize + (patternSize / 2));
73
- ctx.lineTo(0.000000, patternSize);
74
- ctx.lineTo(patternSize / 2, patternSize + (patternSize / 2));
75
- ctx.lineTo(patternSize, patternSize);
76
- ctx.lineTo(patternSize + (patternSize / 2), patternSize + (patternSize / 2));
77
- ctx.stroke();
78
- }
23
+ // background
24
+ ctx.beginPath();
25
+ ctx.fillStyle = '#FFFFFF';
26
+ ctx.lineWidth = 0.005 * patternSize;
27
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
28
+ ctx.fill();
29
+ ctx.beginPath();
30
+ ctx.globalAlpha = 0.1;
31
+ ctx.fillStyle = color;
32
+ ctx.lineWidth = 0.005 * patternSize;
33
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
34
+ ctx.fill();
35
+
36
+ // #path4
37
+ ctx.beginPath();
38
+ ctx.globalAlpha = 0.7;
39
+ ctx.strokeStyle = color;
40
+ ctx.lineWidth = 0.08 * patternSize;
41
+ ctx.moveTo(-patternSize / 2, patternSize / 2);
42
+ ctx.lineTo(0.0, 0.0);
43
+ ctx.lineTo(patternSize / 2, patternSize / 2);
44
+ ctx.lineTo(patternSize, 0.0);
45
+ ctx.stroke();
79
46
 
80
- // Hover Style
81
- if (hover) {
82
- ctx.beginPath();
83
- ctx.globalAlpha = 0.5;
84
- ctx.fillStyle = '#FFFFFF';
85
- ctx.lineWidth = 0.006 * patternSize;
86
- ctx.rect(0.000000, 0.000000, patternSize, patternSize);
87
- ctx.fill();
88
- }
47
+ // #path6
48
+ ctx.beginPath();
49
+ ctx.globalAlpha = 0.3;
50
+ ctx.strokeStyle = color;
51
+ ctx.lineWidth = 0.08 * patternSize;
52
+ ctx.moveTo(-patternSize / 2, patternSize);
53
+ ctx.lineTo(0.0, patternSize / 2);
54
+ ctx.lineTo(patternSize / 2, patternSize);
55
+ ctx.lineTo(patternSize, patternSize / 2);
56
+ ctx.lineTo(patternSize + patternSize / 2, patternSize);
57
+ ctx.stroke();
89
58
 
90
- const canvas: HTMLCanvasElement = document.createElement('canvas');
91
- const context: CanvasRenderingContext2D | null = canvas.getContext('2d');
92
- if (!context) {
93
- return new CanvasPattern;
94
- }
95
- const pattern: CanvasPattern | null = context.createPattern(canvasPattern, 'repeat');
96
- if (!pattern) {
97
- return new CanvasPattern;
98
- }
59
+ // #path6-6
60
+ ctx.beginPath();
61
+ ctx.globalAlpha = 0.3;
62
+ ctx.strokeStyle = color;
63
+ ctx.lineWidth = 0.08 * patternSize;
64
+ ctx.moveTo(-patternSize / 2, 0.000111);
65
+ ctx.lineTo(0.000004 * patternSize, -patternSize / 2);
66
+ ctx.lineTo(patternSize / 2, 0.000111);
67
+ ctx.lineTo(patternSize, -patternSize / 2);
68
+ ctx.lineTo(patternSize + patternSize / 2, 0.000111);
69
+ ctx.stroke();
99
70
 
100
- return pattern;
101
- }
71
+ // #path6-5
72
+ ctx.beginPath();
73
+ ctx.globalAlpha = 0.7;
74
+ ctx.strokeStyle = color;
75
+ ctx.lineWidth = 0.08 * patternSize;
76
+ ctx.moveTo(-patternSize / 2, patternSize + patternSize / 2);
77
+ ctx.lineTo(0.0, patternSize);
78
+ ctx.lineTo(patternSize / 2, patternSize + patternSize / 2);
79
+ ctx.lineTo(patternSize, patternSize);
80
+ ctx.lineTo(patternSize + patternSize / 2, patternSize + patternSize / 2);
81
+ ctx.stroke();
82
+ }
83
+
84
+ // Hover Style
85
+ if (hover) {
86
+ ctx.beginPath();
87
+ ctx.globalAlpha = 0.5;
88
+ ctx.fillStyle = '#FFFFFF';
89
+ ctx.lineWidth = 0.006 * patternSize;
90
+ ctx.rect(0.0, 0.0, patternSize, patternSize);
91
+ ctx.fill();
92
+ }
93
+
94
+ const canvas: HTMLCanvasElement = document.createElement('canvas');
95
+ const context: CanvasRenderingContext2D | null = canvas.getContext('2d');
96
+ if (!context) {
97
+ return new CanvasPattern();
98
+ }
99
+ const pattern: CanvasPattern | null = context.createPattern(
100
+ canvasPattern,
101
+ 'repeat'
102
+ );
103
+ if (!pattern) {
104
+ return new CanvasPattern();
105
+ }
106
+
107
+ return pattern;
108
+ }
@@ -0,0 +1,6 @@
1
+ import { Meta, Markdown } from '@storybook/blocks';
2
+ import Changelog from '../../CHANGELOG.md?raw';
3
+
4
+ <Meta title="Changelog" />
5
+
6
+ <Markdown>{Changelog}</Markdown>
@@ -0,0 +1,101 @@
1
+ import { Meta } from '@storybook/blocks';
2
+ import { Mermaid } from 'mdx-mermaid/Mermaid';
3
+
4
+ <Meta title="Contributing" />
5
+
6
+ # Be part of something bigger!
7
+
8
+ **Mozaic-Chart** is made possible by an incredible community that finds issues and creates pull requests.<br/>
9
+ It is our job to enable you to create amazing applications.
10
+
11
+ Most of the time, you find something that can be made better. You could find a bug, or you have an idea for additional functionality.<br/>
12
+ That's great! It's as easy as cloning the [mozaic-chart repository](https://github.com/adeo/mozaic-chart) to get started working in the development environment.
13
+
14
+ Hopefully this document makes the process for contributing clear and answers some questions that you may have.<br/>
15
+ If you have any questions, please reach out to us on our [slack channel](https://adeo-tech-community.slack.com/archives/CN4K3A99R).
16
+
17
+ ## Contribution model
18
+
19
+ The contribution process can be summarized as follows:
20
+
21
+ <Mermaid
22
+ chart={`flowchart TD;
23
+ A((I have a need <br/>fix or new feature));
24
+ A --> B{An issue already exists?};
25
+ B --> |YES| I;
26
+ I([The issue corresponds to my needs <br/>or I complete it]);
27
+ I --> D;
28
+ B --> |NO| C;
29
+ C([I create an issue <br/>]);
30
+ C --> D;
31
+ D{I can contribute?};
32
+ D --> |YES| E;
33
+ D --> |NO| J;
34
+ E([I clone the repo <br/>& create a PR associated to the issue]);
35
+ E --> F;
36
+ F([The PR is ready <br/>and I assign it to reviewers]);
37
+ F --> G;
38
+ G{The proofreading is OK <br/>and the PR is validated?};
39
+ G --> |YES| H;
40
+ G --> |NO| K;
41
+ H([The PR is merged and will be released soon]);
42
+ H;
43
+ J([In this case, I wait for the issue <br/>to be traited and delivered.]);
44
+ K([I make the requested changes]);
45
+ K --> F;
46
+ click B "https://github.com/adeo/mozaic-chart/issues" _blank;
47
+ click C "https://github.com/adeo/mozaic-chart/issues/new/choose" _blank;
48
+ `}
49
+ />
50
+
51
+ You can now discover the details of each of these steps below.
52
+
53
+ ## Reporting issues
54
+
55
+ ### Where to find known issues
56
+
57
+ We are using [GitHub Issues](https://github.com/adeo/mozaic-chart/issues) for our bugs.<br/>
58
+ We keep a close eye on this and try to make it clear when we have an internal fix in progress.<br/>
59
+
60
+ **Before filing a new task, try to make sure your problem doesn't already exist.**
61
+
62
+ ### Reporting new issue
63
+
64
+ The best way to get your bug fixed is to provide a reduced test case.
65
+
66
+ Once you've gathered all information, please fill out an issue [here](https://github.com/adeo/mozaic-chart/issues/new/choose).
67
+
68
+ ## Proposing a change
69
+
70
+ If you intend to add a new component, or make any non-trivial changes, we recommend filing an issue.
71
+
72
+ This will lets us prepare an agreement on your proposal before you put significant effort into it.
73
+
74
+ If you’re only fixing a bug, it should be fine to submit a pull request but we still recommend to submit an issue detailing what you’re looking to fix.
75
+
76
+ ## Setup Dev Environment
77
+
78
+ ### Project setup
79
+
80
+ ```bash
81
+ // Clone mozaic-chart repo
82
+ git clone git@github.com:adeo/mozaic-chart.git
83
+
84
+ // Go to the cloned directory
85
+ cd mozaic-chart
86
+
87
+ // Checkout the branch you are working on
88
+ git checkout <branch name>
89
+
90
+ // Install dependencies
91
+ npm install
92
+ ```
93
+
94
+ ## Submitting Changes/ Pull Requests
95
+
96
+ Working on your first Pull Request?<br/>
97
+ You can learn how from this video series:
98
+ [How to contribute to an open source project on Github](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).
99
+
100
+ Mozaic's team is keeping an eye on pull requests.<br/>
101
+ We will check your pull request, either merge it, request changes or close it with explanation.
@@ -0,0 +1,92 @@
1
+ import { Meta } from '@storybook/blocks';
2
+ import { Badge, OutlineCTA, Link } from '@storybook/design-system';
3
+ import pkg from '../../package.json';
4
+
5
+ <Meta title="Getting Started" />
6
+
7
+ <style>
8
+ {`
9
+ .outlineCTA {
10
+ margin: 16px auto;
11
+ display: flex;
12
+ align-items: center;
13
+ gap: 4px;
14
+ }
15
+ .outlineCTA span {
16
+ font-size: 14px;
17
+ }
18
+ .outlineCTA p {
19
+ margin: 0;
20
+ }
21
+ `}
22
+ </style>
23
+
24
+ # Getting Started
25
+
26
+ **Mozaic-Chart** is the [Chart.js](https://vuejs.org/) implementation for [Vue.js](https://vuejs.org/) of [Mozaic Design System Dataviz](https://mozaic.adeo.cloud/)
27
+
28
+ <OutlineCTA
29
+ className="outlineCTA"
30
+ badge={<Badge status="positive">Vue.js 3</Badge>}
31
+ >
32
+ Note that this package is built to be used only with <strong>Vue.js 3</strong>
33
+ </OutlineCTA>
34
+
35
+ ## Installation
36
+
37
+ > **PREREQUISITES:**<br/>
38
+ > To allow you to include and use our package, we assume that you are using a module bundlers like [Webpack](https://webpack.js.org/), [Parcel](https://parceljs.org/) or [rollup.js](https://rollupjs.org/guide/en/), or that your project has been initiated with [Vue CLI >= 5](https://cli.vuejs.org/) or [Vite](https://vitejs.dev/guide/). Otherwise, the package might not work.<br/>
39
+ > Minimum Vue.js version required: **{pkg.dependencies.vue.slice(1)}**
40
+
41
+ In order to use **Mozaic-Chart** in your **Vue.js** project, you must first install the [npm package](https://www.npmjs.com/package/@mozaic-ds/chart):
42
+
43
+ ```bash
44
+ npm install @mozaic-ds/chart --save --save-exact
45
+ ```
46
+
47
+ Or with **Yarn**:
48
+
49
+ ```bash
50
+ yarn add @mozaic-ds/chart -E
51
+ ```
52
+
53
+ ## Set up
54
+
55
+ After installing **Mozaic-Chart**, you need to set up the library.
56
+
57
+ The easiest way to do this is to import all components and make them globally available in your application.
58
+
59
+ In your entry point file, insert the following code:
60
+
61
+ ```javascript
62
+ // In the entry point file of your application - usually src/main.js
63
+
64
+ import MozaicChart from '@mozaic-ds/chart';
65
+ import '@mozaic-ds/chart/dist/style.css';
66
+
67
+ Vue.use(MozaicChart);
68
+ ```
69
+
70
+ <br />
71
+
72
+ ### Global/local component registration
73
+
74
+ As indicated in [its documentation](https://vuejs.org/guide/components/registration.html), **Vue.js** proposes to register/import the components in a global or local way:
75
+
76
+ - The global import allows you to make your components accessible throughout your application
77
+ - The local import, on the other hand, makes a component accessible only in the part of the application that uses it
78
+
79
+ > Learn more about the notion of global/local registration on [the associated Vue.js documentation](https://vuejs.org/guide/components/registration.html).
80
+
81
+ {/* > Learn more about how to import globally or locally the components of **Mozaic-Chart** into your project, by visiting [the dedicated documentation](?path=/docs/importing-components--docs). */}
82
+
83
+ ## Usage
84
+
85
+ That's it! You’re all set! ✅ <br/>
86
+ You are now able to use the **Mozaic-Chart** components in your **Vue.js** project.
87
+
88
+ Simply call the component as follows:
89
+
90
+ ```vue-html
91
+ <BarChart :labels="labels" :datasets="datasets" />
92
+ ```
@@ -0,0 +1,44 @@
1
+ import { Meta } from '@storybook/blocks';
2
+ import { Button } from '@storybook/design-system';
3
+
4
+ <Meta
5
+ title="Support & Onboarding"
6
+ parameters={{
7
+ layout: 'fullscreen',
8
+ viewMode: 'docs',
9
+ previewTabs: {
10
+ canvas: { hidden: true }
11
+ }
12
+ }}
13
+ />
14
+
15
+ # Need help?
16
+
17
+ ## Support
18
+
19
+ Any feedback, ideas or questions?
20
+
21
+ The **Mozaic Design System team** would welcome any feedback, ideas, or requirements that you have.<br/>
22
+ Our goal is to make your lives easier.
23
+
24
+ If you want to get more detailed information on the components or any other topic related to **Mozaic-Vue**, you can contact us through the channels below:
25
+
26
+ - Join the [#ads-charts](https://app.slack.com/client/T4R6RCZFA/C04DE3DN8LD) channel on **Slack**
27
+ - Join the [#mozaic-support](https://app.slack.com/client/T4R6RCZFA/CKQJZL7C4/) channel on **Slack**
28
+
29
+ ## Onboarding Sessions
30
+
31
+ Are you new to using a design system, and in particular Mozaic?<br/>
32
+ Do you want to know more about how **Mozaic** works, and more specifically how to use **Mozaic-Vue**?<br/>
33
+ You need a personalized support to install or configure your project?
34
+
35
+ The **Mozaic Design System team** is at your disposal for that.
36
+
37
+ Do not hesitate to book a slot for **an onboarding session**, by going to this url:
38
+
39
+ <Button
40
+ appearance="secondary"
41
+ isLink
42
+ href="https://calendar.app.google/Tk9JkMdKTzM2DeX36"
43
+ target="_blank"
44
+ >{`I book an Onboarding Session`}</Button>
@@ -0,0 +1,4 @@
1
+ export interface AxisDefinition {
2
+ title: string;
3
+ unit: string;
4
+ }
@@ -8,4 +8,5 @@ export interface BarData {
8
8
  label: string;
9
9
  backgroundColor?: string;
10
10
  data: DataBarData[];
11
+ stack?: number;
11
12
  }
@@ -1,10 +1,12 @@
1
+ import { Plugin } from 'chart.js';
2
+
1
3
  export interface ChartData {
2
- data: any;
3
- loading: boolean;
4
- error: boolean;
4
+ data: any;
5
+ loading: boolean;
6
+ error: boolean;
5
7
  }
6
8
 
7
- export interface HTMLLegendPlugin {
8
- id: string;
9
- afterUpdate: (chart: any) => void;
10
- }
9
+ export type HTMLLegendPlugin = Plugin<
10
+ 'bar' | 'doughnut' | 'line',
11
+ Record<string, any>
12
+ >;
@@ -1,6 +1,14 @@
1
+ import { ChartData, Plugin } from 'chart.js';
2
+
3
+ type AnyObject = Record<string, any>;
4
+
1
5
  export interface DoughnutData {
2
6
  tooltipLabel?: number;
3
7
  value: number;
4
8
  unit: string;
5
9
  rate: number;
6
10
  }
11
+
12
+ export type DoughnutPlugin = Plugin<'doughnut', AnyObject>;
13
+
14
+ export type DoughnutChartData = ChartData<'doughnut', number[]>;
@@ -1,11 +1,11 @@
1
1
  export interface GenericData {
2
- value: number;
3
- position?: number;
4
- unit?: string;
5
- label?: string;
6
- rate?: number;
7
- color?: string;
8
- trendValue?: number
9
- trendMetricUnit?: string,
10
- tooltips?: [],
11
- }
2
+ value: number;
3
+ position?: number;
4
+ unit?: string;
5
+ label?: string;
6
+ rate?: number;
7
+ color?: string;
8
+ trendValue?: number;
9
+ trendMetricUnit?: string;
10
+ tooltips?: [];
11
+ }
@@ -1,5 +1,5 @@
1
1
  export interface LineData {
2
- label: string;
3
- data: number[];
4
- unit?: string;
5
- }
2
+ label: string;
3
+ data: number[];
4
+ unit?: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ export interface MixedBarLineData {
2
+ type: any;
3
+ label: string;
4
+ data: number[];
5
+ borderColor: string;
6
+ backgroundColor?: string;
7
+ }