@carbon/charts-vue 0.54.10 → 0.54.13

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/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.54.13](https://github.com/carbon-design-system/carbon-charts/compare/v0.54.12...v0.54.13) (2022-03-09)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.54.12](https://github.com/carbon-design-system/carbon-charts/compare/v0.54.11...v0.54.12) (2022-02-04)
15
+
16
+ **Note:** Version bump only for package @carbon/charts-vue
17
+
18
+
19
+
20
+
21
+
22
+ ## [0.54.11](https://github.com/carbon-design-system/carbon-charts/compare/v0.54.10...v0.54.11) (2022-02-02)
23
+
24
+ **Note:** Version bump only for package @carbon/charts-vue
25
+
26
+
27
+
28
+
29
+
6
30
  ## [0.54.10](https://github.com/carbon-design-system/carbon-charts/compare/v0.54.9...v0.54.10) (2022-01-27)
7
31
 
8
32
  **Note:** Version bump only for package @carbon/charts-vue
@@ -8759,6 +8759,7 @@ var meterChart = tools_Tools.merge({}, chart, {
8759
8759
  clickable: false,
8760
8760
  },
8761
8761
  meter: {
8762
+ showLabels: true,
8762
8763
  proportional: null,
8763
8764
  statusBar: {
8764
8765
  percentageIndicator: {
@@ -31110,26 +31111,6 @@ function constantZero() {
31110
31111
  return treemap;
31111
31112
  });
31112
31113
 
31113
- // CONCATENATED MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/d3-array/src/sum.js
31114
- function sum_sum(values, valueof) {
31115
- let sum = 0;
31116
- if (valueof === undefined) {
31117
- for (let value of values) {
31118
- if (value = +value) {
31119
- sum += value;
31120
- }
31121
- }
31122
- } else {
31123
- let index = -1;
31124
- for (let value of values) {
31125
- if (value = +valueof(value, ++index, values)) {
31126
- sum += value;
31127
- }
31128
- }
31129
- }
31130
- return sum;
31131
- }
31132
-
31133
31114
  // CONCATENATED MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/@carbon/colors/es/index.js
31134
31115
  /**
31135
31116
  * Copyright IBM Corp. 2018, 2018
@@ -31755,7 +31736,6 @@ var treemap_extends = (undefined && undefined.__extends) || (function () {
31755
31736
 
31756
31737
 
31757
31738
 
31758
-
31759
31739
  // Carbon colors
31760
31740
 
31761
31741
  var findColorShade = function (hex) {
@@ -31849,9 +31829,6 @@ var treemap_Treemap = /** @class */ (function (_super) {
31849
31829
  })
31850
31830
  .sum(function (d) { return d.value; })
31851
31831
  .sort(function (a, b) { return b.value - a.value; });
31852
- var total = sum_sum(allData, function (d) {
31853
- return sum_sum(d.children, function (child) { return child.value; });
31854
- });
31855
31832
  var root = src_treemap()
31856
31833
  .size([width, height])
31857
31834
  .paddingInner(1)
@@ -33956,7 +33933,7 @@ var wordcloud_WordCloud = /** @class */ (function (_super) {
33956
33933
 
33957
33934
  //# sourceMappingURL=../../../src/components/graphs/wordcloud.js.map
33958
33935
  // CONCATENATED MODULE: /home/runner/work/carbon-charts/carbon-charts/node_modules/d3-sankey/node_modules/d3-array/src/sum.js
33959
- function src_sum_sum(values, valueof) {
33936
+ function sum_sum(values, valueof) {
33960
33937
  let sum = 0;
33961
33938
  if (valueof === undefined) {
33962
33939
  for (let value of values) {
@@ -34203,7 +34180,7 @@ function Sankey() {
34203
34180
  function computeNodeValues({nodes}) {
34204
34181
  for (const node of nodes) {
34205
34182
  node.value = node.fixedValue === undefined
34206
- ? Math.max(src_sum_sum(node.sourceLinks, sankey_value), src_sum_sum(node.targetLinks, sankey_value))
34183
+ ? Math.max(sum_sum(node.sourceLinks, sankey_value), sum_sum(node.targetLinks, sankey_value))
34207
34184
  : node.fixedValue;
34208
34185
  }
34209
34186
  }
@@ -34263,7 +34240,7 @@ function Sankey() {
34263
34240
  }
34264
34241
 
34265
34242
  function initializeNodeBreadths(columns) {
34266
- const ky = src_min_min(columns, c => (y1 - y0 - (c.length - 1) * py) / src_sum_sum(c, sankey_value));
34243
+ const ky = src_min_min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum_sum(c, sankey_value));
34267
34244
  for (const nodes of columns) {
34268
34245
  let y = y0;
34269
34246
  for (const node of nodes) {
@@ -42992,6 +42969,13 @@ var charts_meter_extends = (undefined && undefined.__extends) || (function () {
42992
42969
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42993
42970
  };
42994
42971
  })();
42972
+ var charts_meter_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
42973
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
42974
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
42975
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
42976
+ r[k] = a[j];
42977
+ return r;
42978
+ };
42995
42979
  // Internal Imports
42996
42980
 
42997
42981
 
@@ -43018,29 +43002,41 @@ var meter_MeterChart = /** @class */ (function (_super) {
43018
43002
  return _this;
43019
43003
  }
43020
43004
  MeterChart.prototype.getComponents = function () {
43021
- // Specify what to render inside the graph only
43022
- var graph = {
43023
- id: 'meter-graph',
43024
- components: [new meter_Meter(this.model, this.services)],
43025
- growth: LayoutGrowth.STRETCH,
43026
- renderType: RenderTypes.SVG,
43027
- };
43028
- // Meter has an unique dataset title within the graph
43029
- var titleComponent = {
43030
- id: 'meter-title',
43031
- components: [new title_meter_MeterTitle(this.model, this.services)],
43032
- growth: LayoutGrowth.STRETCH,
43033
- renderType: RenderTypes.SVG,
43034
- };
43035
- // create the title spacer
43036
- var titleSpacerComponent = {
43037
- id: 'spacer',
43038
- components: [new spacer_Spacer(this.model, this.services, { size: 8 })],
43039
- growth: LayoutGrowth.STRETCH,
43040
- };
43005
+ var showLabels = tools_Tools.getProperty(this.model.getOptions(), 'meter', 'showLabels');
43006
+ var meterComponents = charts_meter_spreadArrays((showLabels
43007
+ ? [
43008
+ // Meter has a unique dataset title within the graph
43009
+ {
43010
+ id: 'meter-title',
43011
+ components: [
43012
+ new title_meter_MeterTitle(this.model, this.services),
43013
+ ],
43014
+ growth: LayoutGrowth.STRETCH,
43015
+ renderType: RenderTypes.SVG,
43016
+ },
43017
+ // Create the title spacer
43018
+ {
43019
+ id: 'spacer',
43020
+ components: [
43021
+ new spacer_Spacer(this.model, this.services, {
43022
+ size: 8,
43023
+ }),
43024
+ ],
43025
+ growth: LayoutGrowth.STRETCH,
43026
+ },
43027
+ ]
43028
+ : []), [
43029
+ // Specify what to render inside the graph only
43030
+ {
43031
+ id: 'meter-graph',
43032
+ components: [new meter_Meter(this.model, this.services)],
43033
+ growth: LayoutGrowth.STRETCH,
43034
+ renderType: RenderTypes.SVG,
43035
+ },
43036
+ ]);
43041
43037
  // the graph frame for meter includes the custom title (and spacer)
43042
43038
  var graphFrame = [
43043
- new layout_LayoutComponent(this.model, this.services, [titleComponent, titleSpacerComponent, graph], {
43039
+ new layout_LayoutComponent(this.model, this.services, meterComponents, {
43044
43040
  direction: LayoutDirection.COLUMN,
43045
43041
  }),
43046
43042
  ];
@@ -43501,10 +43497,11 @@ var model_treemap_extends = (undefined && undefined.__extends) || (function () {
43501
43497
  })();
43502
43498
  // Internal Imports
43503
43499
 
43500
+
43504
43501
  /**
43505
43502
  * The treemap chart model layer
43506
43503
  */
43507
- var TreemapChartModel = /** @class */ (function (_super) {
43504
+ var treemap_TreemapChartModel = /** @class */ (function (_super) {
43508
43505
  model_treemap_extends(TreemapChartModel, _super);
43509
43506
  function TreemapChartModel(services) {
43510
43507
  return _super.call(this, services) || this;
@@ -43513,9 +43510,15 @@ var TreemapChartModel = /** @class */ (function (_super) {
43513
43510
  var displayData = this.getDisplayData();
43514
43511
  var result = [['Child', 'Group', 'Value']];
43515
43512
  displayData.forEach(function (datum) {
43516
- datum.children.forEach(function (child) {
43517
- result.push([child.name, datum.name, child.value]);
43518
- });
43513
+ if (Array.isArray(datum.children)) {
43514
+ datum.children.forEach(function (child) {
43515
+ result.push([child.name, datum.name, child.value]);
43516
+ });
43517
+ }
43518
+ else if (tools_Tools.getProperty(datum.name) !== null &&
43519
+ tools_Tools.getProperty(datum.value)) {
43520
+ result.push(["–", datum.name, datum.value]);
43521
+ }
43519
43522
  });
43520
43523
  return result;
43521
43524
  };
@@ -43548,7 +43551,7 @@ var treemap_TreemapChart = /** @class */ (function (_super) {
43548
43551
  charts_treemap_extends(TreemapChart, _super);
43549
43552
  function TreemapChart(holder, chartConfigs) {
43550
43553
  var _this = _super.call(this, holder, chartConfigs) || this;
43551
- _this.model = new TreemapChartModel(_this.services);
43554
+ _this.model = new treemap_TreemapChartModel(_this.services);
43552
43555
  // Merge the default options for this chart
43553
43556
  // With the user provided options
43554
43557
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.treemapChart, chartConfigs.options));