@carbon/charts 0.43.0 → 0.45.1

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 (50) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +4 -4
  3. package/build/demo/data/bar.d.ts +20 -0
  4. package/build/demo/data/donut.d.ts +11 -0
  5. package/build/demo/data/pie.d.ts +11 -0
  6. package/build/src/interfaces/charts.d.ts +5 -0
  7. package/build/src/model/model.d.ts +2 -1
  8. package/build/src/tools.d.ts +2 -1
  9. package/bundle.js +1 -1
  10. package/charts/bar-stacked.js +2 -1
  11. package/charts/bar-stacked.js.map +1 -1
  12. package/charts/line.js +2 -1
  13. package/charts/line.js.map +1 -1
  14. package/components/graphs/bar-stacked.js +19 -5
  15. package/components/graphs/bar-stacked.js.map +1 -1
  16. package/components/graphs/donut.js +1 -1
  17. package/components/graphs/donut.js.map +1 -1
  18. package/components/graphs/pie.js +10 -9
  19. package/components/graphs/pie.js.map +1 -1
  20. package/configuration.js +1 -0
  21. package/configuration.js.map +1 -1
  22. package/demo/create-codesandbox.js +6 -5
  23. package/demo/create-codesandbox.js.map +1 -1
  24. package/demo/data/bar.d.ts +20 -0
  25. package/demo/data/bar.js +25 -0
  26. package/demo/data/bar.js.map +1 -1
  27. package/demo/data/bundle.js +1 -1
  28. package/demo/data/donut.d.ts +11 -0
  29. package/demo/data/donut.js +10 -1
  30. package/demo/data/donut.js.map +1 -1
  31. package/demo/data/index.js +15 -0
  32. package/demo/data/index.js.map +1 -1
  33. package/demo/data/line.js +6 -6
  34. package/demo/data/line.js.map +1 -1
  35. package/demo/data/pie.d.ts +11 -0
  36. package/demo/data/pie.js +16 -0
  37. package/demo/data/pie.js.map +1 -1
  38. package/demo/tsconfig.tsbuildinfo +9 -9
  39. package/interfaces/charts.d.ts +5 -0
  40. package/interfaces/charts.js.map +1 -1
  41. package/model/model.d.ts +2 -1
  42. package/model/model.js +6 -3
  43. package/model/model.js.map +1 -1
  44. package/package.json +1 -1
  45. package/services/scales-cartesian.js +14 -4
  46. package/services/scales-cartesian.js.map +1 -1
  47. package/tools.d.ts +2 -1
  48. package/tools.js +4 -3
  49. package/tools.js.map +1 -1
  50. package/tsconfig.tsbuildinfo +13 -13
package/CHANGELOG.md CHANGED
@@ -3,6 +3,44 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.45.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.45.0...v0.45.1) (2021-08-23)
7
+
8
+ **Note:** Version bump only for package @carbon/charts
9
+
10
+
11
+
12
+
13
+
14
+ # [0.45.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.44.1...v0.45.0) (2021-08-19)
15
+
16
+
17
+ ### Features
18
+
19
+ * **core:** Add options to map value to other keys ([#1122](https://github.com/carbon-design-system/carbon-charts/issues/1122)) ([1835192](https://github.com/carbon-design-system/carbon-charts/commit/18351924acc182c24a7467dfc989fdc1e5c759dc)), closes [#1110](https://github.com/carbon-design-system/carbon-charts/issues/1110) [#1110](https://github.com/carbon-design-system/carbon-charts/issues/1110) [#1110](https://github.com/carbon-design-system/carbon-charts/issues/1110) [#1110](https://github.com/carbon-design-system/carbon-charts/issues/1110) [#1110](https://github.com/carbon-design-system/carbon-charts/issues/1110)
20
+
21
+
22
+
23
+
24
+
25
+ ## [0.44.1](https://github.com/carbon-design-system/carbon-charts/compare/v0.44.0...v0.44.1) (2021-08-19)
26
+
27
+ **Note:** Version bump only for package @carbon/charts
28
+
29
+
30
+
31
+
32
+
33
+ # [0.44.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.43.0...v0.44.0) (2021-08-18)
34
+
35
+
36
+ ### Features
37
+
38
+ * **core:** support negative values in stacked bar ([#1121](https://github.com/carbon-design-system/carbon-charts/issues/1121)) ([b71cc79](https://github.com/carbon-design-system/carbon-charts/commit/b71cc79876fe56b49cbb08441f41e17ee37fbcff))
39
+
40
+
41
+
42
+
43
+
6
44
  # [0.43.0](https://github.com/carbon-design-system/carbon-charts/compare/v0.42.1...v0.43.0) (2021-08-17)
7
45
 
8
46
 
package/README.md CHANGED
@@ -7,14 +7,14 @@
7
7
  Run the following command using [npm](https://www.npmjs.com/):
8
8
 
9
9
  ```bash
10
- npm install -S @carbon/charts d3@5.x
10
+ npm install -S @carbon/charts d3
11
11
  ```
12
12
 
13
13
  If you prefer [Yarn](https://yarnpkg.com/en/), use the following command
14
14
  instead:
15
15
 
16
16
  ```bash
17
- yarn add @carbon/charts d3@5.x
17
+ yarn add @carbon/charts d3
18
18
  ```
19
19
 
20
20
  **Note:** you'd also need to install `carbon-components` if you're not using a
@@ -23,7 +23,7 @@ bundled version of the library.
23
23
  ## Step-by-step instructions
24
24
 
25
25
  Read
26
- [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials-getting-started--vanilla)
26
+ [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-getting-started--vanilla)
27
27
 
28
28
  ## Codesandbox examples
29
29
 
@@ -42,7 +42,7 @@ For instance in the case of a donut chart you're able to pass in an additional
42
42
  field called `center` in your options configuring the donut center.
43
43
 
44
44
  For instructions on using the **tabular data format**, see
45
- [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/tutorials--tabular-data-format)
45
+ [here](https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format)
46
46
 
47
47
  There are also additional options available depending on the chart type being
48
48
  used,
@@ -352,6 +352,26 @@ export declare const stackedBarOptions: {
352
352
  };
353
353
  };
354
354
  };
355
+ export declare const stackedBarNegativeData: {
356
+ group: string;
357
+ key: string;
358
+ value: number;
359
+ }[];
360
+ export declare const stackedBarNegativeOptions: {
361
+ title: string;
362
+ axes: {
363
+ left: {
364
+ mapsTo: string;
365
+ stacked: boolean;
366
+ };
367
+ bottom: {
368
+ mapsTo: string;
369
+ scaleType: string;
370
+ };
371
+ };
372
+ } & {
373
+ title: string;
374
+ };
355
375
  export declare const stackedHorizontalBarData: {
356
376
  group: string;
357
377
  key: string;
@@ -28,6 +28,17 @@ export declare const donutCenteredOptions: {
28
28
  alignment: string;
29
29
  };
30
30
  };
31
+ export declare const donutDataMapsTo: {
32
+ group: string;
33
+ count: number;
34
+ }[];
35
+ export declare const donutMapsToOptions: {
36
+ title: string;
37
+ resizable: boolean;
38
+ pie: {
39
+ valueMapsTo: string;
40
+ };
41
+ };
31
42
  export declare const donutEmptyStateData: any[];
32
43
  export declare const donutEmptyStateOptions: {
33
44
  title: string;
@@ -20,6 +20,17 @@ export declare const pieCenteredOptions: {
20
20
  alignment: string;
21
21
  };
22
22
  };
23
+ export declare const pieDataMapsTo: {
24
+ group: string;
25
+ count: number;
26
+ }[];
27
+ export declare const pieMapToOptions: {
28
+ title: string;
29
+ resizable: boolean;
30
+ pie: {
31
+ valueMapsTo: string;
32
+ };
33
+ };
23
34
  export declare const pieEmptyStateData: any[];
24
35
  export declare const pieEmptyStateOptions: {
25
36
  title: string;
@@ -292,6 +292,11 @@ export interface PieChartOptions extends BaseChartOptions {
292
292
  enabled?: Boolean;
293
293
  };
294
294
  alignment?: Alignments;
295
+ /**
296
+ * identifier for value key in your charting data
297
+ * defaults to value
298
+ */
299
+ valueMapsTo?: string;
295
300
  sortFunction?: (a: any, b: any) => number;
296
301
  };
297
302
  }
@@ -47,9 +47,10 @@ export declare class ChartModel {
47
47
  bins?: any;
48
48
  groups?: any;
49
49
  }): any;
50
- getStackedData({ percentage, groups }: {
50
+ getStackedData({ percentage, groups, divergent }: {
51
51
  percentage?: boolean;
52
52
  groups?: any;
53
+ divergent?: boolean;
53
54
  }): any[][];
54
55
  /**
55
56
  * @return {Object} The chart's options
@@ -85,9 +85,10 @@ export declare namespace Tools {
85
85
  * @export
86
86
  * @param {any} item
87
87
  * @param {any} fullData
88
+ * @param {string} key
88
89
  * @returns The percentage in the form of a number (1 significant digit if necessary)
89
90
  */
90
- export function convertValueToPercentage(item: any, fullData: any): number;
91
+ export function convertValueToPercentage(item: any, fullData: any, key?: string): number;
91
92
  /**
92
93
  * Truncate the labels
93
94
  * @export