@carbon/charts-vue 0.50.10 → 0.51.3

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.
@@ -9967,6 +9967,20 @@ var model_ChartModel = /** @class */ (function () {
9967
9967
  });
9968
9968
  return tabularData;
9969
9969
  };
9970
+ ChartModel.prototype.getTabularDataArray = function () {
9971
+ return [];
9972
+ };
9973
+ ChartModel.prototype.exportToCSV = function () {
9974
+ var data = this.getTabularDataArray().map(function (row) {
9975
+ return row.map(function (column) { return "\"" + column + "\""; });
9976
+ });
9977
+ var csvString = '', csvData = '';
9978
+ data.forEach(function (d, i) {
9979
+ csvData = d.join(',');
9980
+ csvString += i < data.length ? csvData + '\n' : csvData;
9981
+ });
9982
+ this.services.files.downloadCSV(csvString, 'myChart.csv');
9983
+ };
9970
9984
  ChartModel.prototype.getTabularData = function (data) {
9971
9985
  // if data is not an array
9972
9986
  if (!Array.isArray(data)) {
@@ -18226,11 +18240,25 @@ var legend_Legend = /** @class */ (function (_super) {
18226
18240
  hoveredElement: hoveredItem,
18227
18241
  });
18228
18242
  });
18229
- svg.selectAll('div.legend-item div.checkbox').on('keyup', function (event, d) {
18230
- if (event.key && (event.key === 'Enter' || event.key === ' ')) {
18243
+ svg.selectAll('div.legend-item div.checkbox').on('keyup', function (event) {
18244
+ if (event.key && event.key === 'Tab') {
18245
+ // Higlight group
18246
+ self.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {
18247
+ hoveredElement: src_select(this),
18248
+ });
18249
+ }
18250
+ });
18251
+ svg.selectAll('div.legend-item div.checkbox').on('keydown', function (event, d) {
18252
+ if (event.key && event.key === ' ') {
18231
18253
  event.preventDefault();
18232
18254
  self.model.toggleDataLabel(d.name);
18233
18255
  }
18256
+ else if (event.key && event.key === 'Tab') {
18257
+ // Unhiglight group
18258
+ self.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {
18259
+ hoveredElement: src_select(this),
18260
+ });
18261
+ }
18234
18262
  });
18235
18263
  svg.selectAll('g.additional-item').on('mouseover', function (event) {
18236
18264
  var hoveredItem = src_select(this);
@@ -26929,17 +26957,6 @@ var bullet_Bullet = /** @class */ (function (_super) {
26929
26957
  // Add event listeners to elements drawn
26930
26958
  this.addEventListeners();
26931
26959
  };
26932
- Bullet.prototype.getMatchingRangeIndexForDatapoint = function (datum) {
26933
- var matchingRangeIndex;
26934
- for (var i = datum.ranges.length - 1; i > 0; i--) {
26935
- var range = datum.ranges[i];
26936
- if (datum.value >= range) {
26937
- matchingRangeIndex = i;
26938
- return matchingRangeIndex;
26939
- }
26940
- }
26941
- return 0;
26942
- };
26943
26960
  Bullet.prototype.addEventListeners = function () {
26944
26961
  var self = this;
26945
26962
  var options = this.getOptions();
@@ -26957,7 +26974,7 @@ var bullet_Bullet = /** @class */ (function (_super) {
26957
26974
  datum: datum,
26958
26975
  });
26959
26976
  var performanceAreaTitles = tools_Tools.getProperty(options, 'bullet', 'performanceAreaTitles');
26960
- var matchingRangeIndex = self.getMatchingRangeIndexForDatapoint(datum);
26977
+ var matchingRangeIndex = self.model.getMatchingRangeIndexForDatapoint(datum);
26961
26978
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
26962
26979
  event: event,
26963
26980
  hoveredElement: hoveredElement,
@@ -31561,7 +31578,9 @@ function polarToCartesianCoords(a, r, t) {
31561
31578
  if (t === void 0) { t = { x: 0, y: 0 }; }
31562
31579
  var x = r * Math.cos(a) + t.x;
31563
31580
  var y = r * Math.sin(a) + t.y;
31564
- return { x: x, y: y };
31581
+ // NaN is rendered at coordinate 0 in browsers
31582
+ // By setting it to 0, further operations can be performed
31583
+ return { x: isNaN(x) ? 0 : x, y: isNaN(y) ? 0 : y };
31565
31584
  }
31566
31585
  // Return the distance between a point (described with polar coordinates)
31567
31586
  // on a circumference and the vertical diameter.
@@ -35375,8 +35394,9 @@ var axis_Axis = /** @class */ (function (_super) {
35375
35394
  var mockTextPiece = invisibleAxisRef
35376
35395
  .append('text')
35377
35396
  .text('A');
35378
- var averageLetterWidth_1 = mockTextPiece.node().getBBox()
35379
- .width;
35397
+ var averageLetterWidth_1 = dom_utils_DOMUtils.getSVGElementSize(mockTextPiece.node(), {
35398
+ useBBox: true,
35399
+ }).width;
35380
35400
  var lastStartPosition_1;
35381
35401
  // Find out whether any text nodes roughly collide
35382
35402
  invisibleAxisRef.selectAll('g.tick').each(function () {
@@ -38551,6 +38571,7 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
38551
38571
  .append('div')
38552
38572
  .attr('class', 'toolbar-control bx--overflow-menu')
38553
38573
  .attr('role', 'button');
38574
+ var self_1 = this;
38554
38575
  var allToolbarControls = enteringToolbarControls
38555
38576
  .merge(toolbarControls)
38556
38577
  .classed('disabled', function (d) {
@@ -38561,16 +38582,23 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
38561
38582
  })
38562
38583
  .attr('aria-label', function (d) { return d.title; })
38563
38584
  .html(function (d) { return "\n\t\t\t<button\n\t\t\t\tclass=\"bx--overflow-menu__trigger\"\n\t\t\t\taria-haspopup=\"true\" aria-expanded=\"false\" id=\"" + _this.services.domUtils.generateElementIDString("control-" + d.id) + "\" aria-label=\"" + d.title + "\">\n\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\" style=\"will-change: transform; width: " + (d.iconWidth !== undefined ? d.iconWidth : '20px') + "; height: " + (d.iconWidth !== undefined ? d.iconHeight : '20px') + "\" xmlns=\"http://www.w3.org/2000/svg\" class=\"bx--overflow-menu__icon\" viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n\t\t\t\t\t" + d.iconSVGContent + "\n\t\t\t\t</svg>\n\t\t\t</button>"; })
38564
- .each(function (d) {
38585
+ .each(function (d, index) {
38565
38586
  src_select(this)
38566
38587
  .select('button')
38567
38588
  .on('click', !d.shouldBeDisabled() ? d.clickFunction : null)
38568
- .on('keyup', function (event) {
38589
+ .on('keydown', function (event) {
38569
38590
  if ((event.key && event.key === 'Enter') ||
38570
38591
  event.key === ' ') {
38571
38592
  event.preventDefault();
38572
38593
  d.clickFunction();
38573
38594
  }
38595
+ else if (event.key && event.key === 'ArrowLeft') {
38596
+ self_1.focusOnPreviousEnabledToolbarItem(index);
38597
+ }
38598
+ else if (event.key &&
38599
+ event.key === 'ArrowRight') {
38600
+ self_1.focusOnNextEnabledToolbarItem(index);
38601
+ }
38574
38602
  });
38575
38603
  });
38576
38604
  this.overflowButton = this.getComponentContainer().select("button.bx--overflow-menu__trigger#" + this.services.domUtils.generateElementIDString('control-toolbar-overflow-menu'));
@@ -38624,6 +38652,43 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
38624
38652
  this.services.events.dispatchEvent(Events.Toolbar.HIDE_OVERFLOW_MENU);
38625
38653
  }
38626
38654
  };
38655
+ // Toolbar controllers
38656
+ Toolbar.prototype.focusOnPreviousEnabledToolbarItem = function (currentItemIndex) {
38657
+ var buttonList = this.getToolbarButtonItems();
38658
+ var previousItemIndex = buttonList.length;
38659
+ for (var i = currentItemIndex - 1; i >= 0; i--) {
38660
+ var previousButtonItem = buttonList[i];
38661
+ if (!previousButtonItem.shouldBeDisabled()) {
38662
+ previousItemIndex = i;
38663
+ break;
38664
+ }
38665
+ }
38666
+ // only if previous enabled menu item found
38667
+ if (previousItemIndex < buttonList.length) {
38668
+ var previousItemNode = src_select("button#" + this.services.domUtils.generateElementIDString("control-" + buttonList[previousItemIndex].id)).node();
38669
+ if ('focus' in previousItemNode) {
38670
+ previousItemNode.focus();
38671
+ }
38672
+ }
38673
+ };
38674
+ Toolbar.prototype.focusOnNextEnabledToolbarItem = function (currentItemIndex) {
38675
+ var buttonList = this.getToolbarButtonItems();
38676
+ var nextItemIndex = -1;
38677
+ for (var i = currentItemIndex + 1; i < buttonList.length; i++) {
38678
+ var nextOverflowMenuItem = buttonList[i];
38679
+ if (!nextOverflowMenuItem.shouldBeDisabled()) {
38680
+ nextItemIndex = i;
38681
+ break;
38682
+ }
38683
+ }
38684
+ // only if next enabled menu item found
38685
+ if (nextItemIndex > -1) {
38686
+ var nextItemNode = src_select("button#" + this.services.domUtils.generateElementIDString("control-" + buttonList[nextItemIndex].id)).node();
38687
+ if ('focus' in nextItemNode) {
38688
+ nextItemNode.focus();
38689
+ }
38690
+ }
38691
+ };
38627
38692
  Toolbar.prototype.focusOnPreviousEnabledMenuItem = function (currentItemIndex) {
38628
38693
  var overflowMenuItems = this.getOverflowMenuItems();
38629
38694
  var previousItemIndex = overflowMenuItems.length;
@@ -38670,7 +38735,7 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
38670
38735
  // show overflow menu
38671
38736
  this.updateOverflowMenu(true);
38672
38737
  // setup overflow menu item event listener
38673
- var self_1 = this;
38738
+ var self_2 = this;
38674
38739
  var overflowMenuItems = this.getOverflowMenuItems();
38675
38740
  overflowMenuItems.forEach(function (menuItem, index) {
38676
38741
  var element = src_select("#" + _this.services.domUtils.generateElementIDString("control-" + menuItem.id));
@@ -38679,29 +38744,37 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
38679
38744
  // call the specified function
38680
38745
  menuItem.clickFunction();
38681
38746
  // hide overflow menu
38682
- self_1.updateOverflowMenu(false);
38747
+ self_2.updateOverflowMenu(false);
38683
38748
  });
38684
- element.on('keyup', function () {
38685
- if (event.key === 'Enter') {
38749
+ element.on('keydown', function (keyEvent) {
38750
+ if (keyEvent && keyEvent.key === 'Enter') {
38686
38751
  // call the specified function
38687
38752
  menuItem.clickFunction();
38688
38753
  }
38689
- else if (event.key === 'ArrowUp') {
38754
+ else if (keyEvent && keyEvent.key === 'ArrowUp') {
38690
38755
  // focus on previous menu item
38691
- self_1.focusOnPreviousEnabledMenuItem(index);
38756
+ self_2.focusOnPreviousEnabledMenuItem(index);
38692
38757
  }
38693
- else if (event.key === 'ArrowDown') {
38758
+ else if (keyEvent && keyEvent.key === 'ArrowDown') {
38694
38759
  // focus on next menu item
38695
- self_1.focusOnNextEnabledMenuItem(index);
38760
+ self_2.focusOnNextEnabledMenuItem(index);
38761
+ }
38762
+ else if (keyEvent && keyEvent.key === 'Escape') {
38763
+ self_2.updateOverflowMenu(false);
38696
38764
  }
38697
38765
  // Not hide overflow menu by keyboard arrow up/down event
38766
+ // Prevent page from scrolling up/down
38767
+ keyEvent.preventDefault();
38698
38768
  });
38699
38769
  }
38700
38770
  });
38701
38771
  // default to focus on the first enabled menu item
38702
- self_1.focusOnNextEnabledMenuItem(-1);
38772
+ self_2.focusOnNextEnabledMenuItem(-1);
38773
+ }
38774
+ // propogation should not be stopped for keyboard events
38775
+ if (!!event) {
38776
+ event.stopImmediatePropagation();
38703
38777
  }
38704
- event.stopImmediatePropagation();
38705
38778
  };
38706
38779
  Toolbar.prototype.getControlConfigs = function () {
38707
38780
  var _this = this;
@@ -38734,6 +38807,16 @@ var toolbar_Toolbar = /** @class */ (function (_super) {
38734
38807
  overflowMenuItemList: controlList.concat(overflowSpecificControls),
38735
38808
  };
38736
38809
  };
38810
+ Toolbar.prototype.getToolbarButtonItems = function () {
38811
+ var _a = this.getControlConfigs(), buttonList = _a.buttonList, overflowMenuItemList = _a.overflowMenuItemList;
38812
+ if (!!overflowMenuItemList) {
38813
+ buttonList.push(this.getOverflowButtonConfig());
38814
+ }
38815
+ if (!!buttonList) {
38816
+ return buttonList;
38817
+ }
38818
+ return [];
38819
+ };
38737
38820
  Toolbar.prototype.getOverflowMenuItems = function () {
38738
38821
  var overflowMenuItemList = this.getControlConfigs().overflowMenuItemList;
38739
38822
  if (!!overflowMenuItemList) {
@@ -39712,46 +39795,66 @@ var chart_Chart = /** @class */ (function () {
39712
39795
  this.model.set({ destroyed: true }, { skipUpdate: true });
39713
39796
  };
39714
39797
  Chart.prototype.getChartComponents = function (graphFrameComponents, configs) {
39715
- var titleComponent = {
39716
- id: 'title',
39717
- components: [new title_Title(this.model, this.services)],
39718
- growth: LayoutGrowth.PREFERRED,
39719
- };
39798
+ var options = this.model.getOptions();
39799
+ var toolbarEnabled = tools_Tools.getProperty(options, 'toolbar', 'enabled');
39720
39800
  var legendComponent = {
39721
39801
  id: 'legend',
39722
39802
  components: [new legend_Legend(this.model, this.services)],
39723
39803
  growth: LayoutGrowth.PREFERRED,
39724
39804
  };
39725
39805
  // if canvas zoom is enabled
39726
- var isZoomEnabled = tools_Tools.getProperty(this.model.getOptions(), 'canvasZoom', 'enabled');
39806
+ var isZoomEnabled = tools_Tools.getProperty(options, 'canvasZoom', 'enabled');
39727
39807
  if (isZoomEnabled && isZoomEnabled === true) {
39728
39808
  graphFrameComponents.push(new canvas_chart_clip_CanvasChartClip(this.model, this.services));
39729
39809
  }
39810
+ var titleAvailable = !!this.model.getOptions().title;
39811
+ var titleComponent = {
39812
+ id: 'title',
39813
+ components: [new title_Title(this.model, this.services)],
39814
+ growth: LayoutGrowth.STRETCH,
39815
+ };
39816
+ var toolbarComponent = {
39817
+ id: 'toolbar',
39818
+ components: [new toolbar_Toolbar(this.model, this.services)],
39819
+ growth: LayoutGrowth.PREFERRED,
39820
+ };
39821
+ var headerComponent = {
39822
+ id: 'header',
39823
+ components: [
39824
+ new layout_LayoutComponent(this.model, this.services, chart_spreadArrays([
39825
+ // always add title to keep layout correct
39826
+ titleComponent
39827
+ ], (toolbarEnabled ? [toolbarComponent] : [])), {
39828
+ direction: LayoutDirection.ROW,
39829
+ alignItems: LayoutAlignItems.CENTER,
39830
+ }),
39831
+ ],
39832
+ growth: LayoutGrowth.PREFERRED,
39833
+ };
39730
39834
  var graphFrameComponent = {
39731
39835
  id: 'graph-frame',
39732
39836
  components: graphFrameComponents,
39733
39837
  growth: LayoutGrowth.STRETCH,
39734
- renderType: tools_Tools.getProperty(configs, 'graphFrameRenderType') || RenderTypes.SVG,
39838
+ renderType: tools_Tools.getProperty(configs, 'graphFrameRenderType') ||
39839
+ RenderTypes.SVG,
39735
39840
  };
39736
39841
  var isLegendEnabled = tools_Tools.getProperty(configs, 'excludeLegend') !== true &&
39737
- this.model.getOptions().legend.enabled !== false;
39842
+ options.legend.enabled !== false;
39738
39843
  // TODORF - REUSE BETWEEN AXISCHART & CHART
39739
39844
  // Decide the position of the legend in reference to the chart
39740
39845
  var fullFrameComponentDirection = LayoutDirection.COLUMN;
39741
39846
  if (isLegendEnabled) {
39742
- var legendPosition = tools_Tools.getProperty(this.model.getOptions(), 'legend', 'position');
39847
+ var legendPosition = tools_Tools.getProperty(options, 'legend', 'position');
39743
39848
  if (legendPosition === 'left') {
39744
39849
  fullFrameComponentDirection = LayoutDirection.ROW;
39745
- if (!this.model.getOptions().legend.orientation) {
39746
- this.model.getOptions().legend.orientation =
39747
- LegendOrientations.VERTICAL;
39850
+ if (!options.legend.orientation) {
39851
+ options.legend.orientation = LegendOrientations.VERTICAL;
39748
39852
  }
39749
39853
  }
39750
39854
  else if (legendPosition === 'right') {
39751
39855
  fullFrameComponentDirection = LayoutDirection.ROW_REVERSE;
39752
- if (!this.model.getOptions().legend.orientation) {
39753
- this.model.getOptions().legend.orientation =
39754
- LegendOrientations.VERTICAL;
39856
+ if (!options.legend.orientation) {
39857
+ options.legend.orientation = LegendOrientations.VERTICAL;
39755
39858
  }
39756
39859
  }
39757
39860
  else if (legendPosition === 'bottom') {
@@ -39776,11 +39879,13 @@ var chart_Chart = /** @class */ (function () {
39776
39879
  };
39777
39880
  // Add chart title if it exists
39778
39881
  var topLevelLayoutComponents = [];
39779
- if (this.model.getOptions().title) {
39780
- topLevelLayoutComponents.push(titleComponent);
39882
+ if (titleAvailable || toolbarEnabled) {
39883
+ topLevelLayoutComponents.push(headerComponent);
39781
39884
  var titleSpacerComponent = {
39782
39885
  id: 'spacer',
39783
- components: [new spacer_Spacer(this.model, this.services)],
39886
+ components: [
39887
+ new spacer_Spacer(this.model, this.services, toolbarEnabled ? { size: 15 } : undefined),
39888
+ ],
39784
39889
  growth: LayoutGrowth.PREFERRED,
39785
39890
  };
39786
39891
  topLevelLayoutComponents.push(titleSpacerComponent);
@@ -39909,17 +40014,6 @@ var cartesian_charts_ChartModelCartesian = /** @class */ (function (_super) {
39909
40014
  : [])); }));
39910
40015
  return result;
39911
40016
  };
39912
- ChartModelCartesian.prototype.exportToCSV = function () {
39913
- var data = this.getTabularDataArray().map(function (row) {
39914
- return row.map(function (column) { return "\"" + column + "\""; });
39915
- });
39916
- var csvString = '', csvData = '';
39917
- data.forEach(function (d, i) {
39918
- csvData = d.join(',');
39919
- csvString += i < data.length ? csvData + '\n' : csvData;
39920
- });
39921
- this.services.files.downloadCSV(csvString, 'myChart.csv');
39922
- };
39923
40017
  ChartModelCartesian.prototype.setData = function (newData) {
39924
40018
  var data;
39925
40019
  if (newData) {
@@ -40533,6 +40627,13 @@ var model_boxplot_extends = (undefined && undefined.__extends) || (function () {
40533
40627
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
40534
40628
  };
40535
40629
  })();
40630
+ var boxplot_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
40631
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
40632
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
40633
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
40634
+ r[k] = a[j];
40635
+ return r;
40636
+ };
40536
40637
  // Internal Imports
40537
40638
 
40538
40639
 
@@ -40618,6 +40719,53 @@ var boxplot_BoxplotChartModel = /** @class */ (function (_super) {
40618
40719
  }
40619
40720
  return boxplotData;
40620
40721
  };
40722
+ BoxplotChartModel.prototype.getTabularDataArray = function () {
40723
+ var options = this.getOptions();
40724
+ var groupMapsTo = options.data.groupMapsTo;
40725
+ var boxplotData = this.getBoxplotData();
40726
+ var result = boxplot_spreadArrays([
40727
+ [
40728
+ 'Group',
40729
+ 'Minimum',
40730
+ 'Q1',
40731
+ 'Median',
40732
+ 'Q3',
40733
+ 'Maximum',
40734
+ 'IQR',
40735
+ 'Outlier(s)',
40736
+ ]
40737
+ ], boxplotData.map(function (datum) {
40738
+ var outliers = tools_Tools.getProperty(datum, 'outliers');
40739
+ if (outliers === null || outliers.length === 0) {
40740
+ outliers = ['&ndash;'];
40741
+ }
40742
+ return [
40743
+ datum[groupMapsTo],
40744
+ tools_Tools.getProperty(datum, 'whiskers', 'min') !== null
40745
+ ? tools_Tools.getProperty(datum, 'whiskers', 'min').toLocaleString()
40746
+ : '&ndash;',
40747
+ tools_Tools.getProperty(datum, 'quartiles', 'q_25') !== null
40748
+ ? tools_Tools.getProperty(datum, 'quartiles', 'q_25').toLocaleString()
40749
+ : '&ndash;',
40750
+ tools_Tools.getProperty(datum, 'quartiles', 'q_50') !== null
40751
+ ? tools_Tools.getProperty(datum, 'quartiles', 'q_50').toLocaleString()
40752
+ : '&ndash;',
40753
+ tools_Tools.getProperty(datum, 'quartiles', 'q_75') !== null
40754
+ ? tools_Tools.getProperty(datum, 'quartiles', 'q_75').toLocaleString()
40755
+ : '&ndash;',
40756
+ tools_Tools.getProperty(datum, 'whiskers', 'max') !== null
40757
+ ? tools_Tools.getProperty(datum, 'whiskers', 'max').toLocaleString()
40758
+ : '&ndash;',
40759
+ tools_Tools.getProperty(datum, 'quartiles', 'q_75') !== null &&
40760
+ tools_Tools.getProperty(datum, 'quartiles', 'q_25') !== null
40761
+ ? (tools_Tools.getProperty(datum, 'quartiles', 'q_75') -
40762
+ tools_Tools.getProperty(datum, 'quartiles', 'q_25')).toLocaleString()
40763
+ : '&ndash;',
40764
+ outliers.map(function (d) { return d.toLocaleString(); }).join(','),
40765
+ ];
40766
+ }));
40767
+ return result;
40768
+ };
40621
40769
  BoxplotChartModel.prototype.setColorClassNames = function () {
40622
40770
  // monochrome
40623
40771
  var numberOfColors = 1;
@@ -40746,6 +40894,81 @@ var bubble_BubbleChart = /** @class */ (function (_super) {
40746
40894
  }(axis_chart_AxisChart));
40747
40895
 
40748
40896
  //# sourceMappingURL=../../src/charts/bubble.js.map
40897
+ // CONCATENATED MODULE: ./node_modules/@carbon/charts/model/bullet.js
40898
+ var model_bullet_extends = (undefined && undefined.__extends) || (function () {
40899
+ var extendStatics = function (d, b) {
40900
+ extendStatics = Object.setPrototypeOf ||
40901
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
40902
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
40903
+ return extendStatics(d, b);
40904
+ };
40905
+ return function (d, b) {
40906
+ extendStatics(d, b);
40907
+ function __() { this.constructor = d; }
40908
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
40909
+ };
40910
+ })();
40911
+ var bullet_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
40912
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
40913
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
40914
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
40915
+ r[k] = a[j];
40916
+ return r;
40917
+ };
40918
+ // Internal Imports
40919
+
40920
+
40921
+ /**
40922
+ * Bullet chart model layer
40923
+ */
40924
+ var bullet_BulletChartModel = /** @class */ (function (_super) {
40925
+ model_bullet_extends(BulletChartModel, _super);
40926
+ function BulletChartModel(services) {
40927
+ return _super.call(this, services) || this;
40928
+ }
40929
+ /**
40930
+ * Determines the index of the performance area titles to use
40931
+ * @param datum
40932
+ * @returns number
40933
+ */
40934
+ BulletChartModel.prototype.getMatchingRangeIndexForDatapoint = function (datum) {
40935
+ var matchingRangeIndex;
40936
+ for (var i = datum.ranges.length - 1; i > 0; i--) {
40937
+ var range = datum.ranges[i];
40938
+ if (datum.value >= range) {
40939
+ matchingRangeIndex = i;
40940
+ return matchingRangeIndex;
40941
+ }
40942
+ }
40943
+ return 0;
40944
+ };
40945
+ BulletChartModel.prototype.getTabularDataArray = function () {
40946
+ var _this = this;
40947
+ var displayData = this.getDisplayData();
40948
+ var options = this.getOptions();
40949
+ var groupMapsTo = options.data.groupMapsTo;
40950
+ var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
40951
+ var performanceAreaTitles = tools_Tools.getProperty(options, 'bullet', 'performanceAreaTitles');
40952
+ var result = bullet_spreadArrays([
40953
+ ['Title', 'Group', 'Value', 'Target', 'Percentage', 'Performance']
40954
+ ], displayData.map(function (datum) { return [
40955
+ datum['title'],
40956
+ datum[groupMapsTo],
40957
+ datum['value'] === null ? '&ndash;' : datum['value'],
40958
+ tools_Tools.getProperty(datum, 'marker') === null
40959
+ ? '&ndash;'
40960
+ : datum['marker'],
40961
+ tools_Tools.getProperty(datum, 'marker') === null
40962
+ ? '&ndash;'
40963
+ : Math.floor((datum[rangeIdentifier] / datum.marker) * 100) + "%",
40964
+ performanceAreaTitles[_this.getMatchingRangeIndexForDatapoint(datum)],
40965
+ ]; }));
40966
+ return result;
40967
+ };
40968
+ return BulletChartModel;
40969
+ }(cartesian_charts_ChartModelCartesian));
40970
+
40971
+ //# sourceMappingURL=../../src/model/bullet.js.map
40749
40972
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/charts/bullet.js
40750
40973
  var charts_bullet_extends = (undefined && undefined.__extends) || (function () {
40751
40974
  var extendStatics = function (d, b) {
@@ -40765,12 +40988,14 @@ var charts_bullet_extends = (undefined && undefined.__extends) || (function () {
40765
40988
 
40766
40989
 
40767
40990
 
40991
+
40768
40992
  // Components
40769
40993
 
40770
40994
  var bullet_BulletChart = /** @class */ (function (_super) {
40771
40995
  charts_bullet_extends(BulletChart, _super);
40772
40996
  function BulletChart(holder, chartConfigs) {
40773
40997
  var _this = _super.call(this, holder, chartConfigs) || this;
40998
+ _this.model = new bullet_BulletChartModel(_this.services);
40774
40999
  // Merge the default options for this chart
40775
41000
  // With the user provided options
40776
41001
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.bulletChart, chartConfigs.options));
@@ -41061,6 +41286,13 @@ var model_pie_extends = (undefined && undefined.__extends) || (function () {
41061
41286
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
41062
41287
  };
41063
41288
  })();
41289
+ var pie_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
41290
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
41291
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
41292
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
41293
+ r[k] = a[j];
41294
+ return r;
41295
+ };
41064
41296
  // Internal Imports
41065
41297
 
41066
41298
  /** The charting model layer which includes mainly the chart data and options,
@@ -41084,6 +41316,20 @@ var PieChartModel = /** @class */ (function (_super) {
41084
41316
  }
41085
41317
  return tabularData;
41086
41318
  };
41319
+ PieChartModel.prototype.getTabularDataArray = function () {
41320
+ var displayData = this.getDisplayData();
41321
+ var options = this.getOptions();
41322
+ var groupMapsTo = options.data.groupMapsTo;
41323
+ var result = pie_spreadArrays([
41324
+ ['Group', 'Value']
41325
+ ], displayData.map(function (datum) { return [
41326
+ datum[groupMapsTo],
41327
+ datum['value'] === null
41328
+ ? '&ndash;'
41329
+ : datum['value'].toLocaleString(),
41330
+ ]; }));
41331
+ return result;
41332
+ };
41087
41333
  PieChartModel.prototype.sanitize = function (data) {
41088
41334
  var tabularData = this.getTabularData(data);
41089
41335
  // Sort data based on value
@@ -41210,6 +41456,13 @@ var meter_extends = (undefined && undefined.__extends) || (function () {
41210
41456
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
41211
41457
  };
41212
41458
  })();
41459
+ var meter_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
41460
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
41461
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
41462
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
41463
+ r[k] = a[j];
41464
+ return r;
41465
+ };
41213
41466
 
41214
41467
 
41215
41468
  /** The meter chart model layer which extends some of the data setting options.
@@ -41262,6 +41515,39 @@ var meter_MeterChartModel = /** @class */ (function (_super) {
41262
41515
  }
41263
41516
  return null;
41264
41517
  };
41518
+ MeterChartModel.prototype.getTabularDataArray = function () {
41519
+ var displayData = this.getDisplayData();
41520
+ var options = this.getOptions();
41521
+ var groupMapsTo = options.data.groupMapsTo;
41522
+ var status = this.getStatus();
41523
+ var proportional = tools_Tools.getProperty(options, 'meter', 'proportional');
41524
+ var result = [];
41525
+ var domainMax;
41526
+ // Display the appropriate columns and fields depending on the type of meter
41527
+ if (proportional === null) {
41528
+ domainMax = 100;
41529
+ var datum = displayData[0];
41530
+ result = [
41531
+ meter_spreadArrays(['Group', 'Value'], (status ? ['Status'] : [])),
41532
+ meter_spreadArrays([
41533
+ datum[groupMapsTo],
41534
+ datum['value']
41535
+ ], (status ? [status] : [])),
41536
+ ];
41537
+ }
41538
+ else {
41539
+ var total = tools_Tools.getProperty(proportional, 'total');
41540
+ domainMax = total ? total : this.getMaximumDomain(displayData);
41541
+ result = meter_spreadArrays([
41542
+ ['Group', 'Value', 'Percentage of total']
41543
+ ], displayData.map(function (datum) { return [
41544
+ datum[groupMapsTo],
41545
+ datum['value'],
41546
+ ((datum['value'] / domainMax) * 100).toFixed(2) + ' %',
41547
+ ]; }));
41548
+ }
41549
+ return result;
41550
+ };
41265
41551
  return MeterChartModel;
41266
41552
  }(model_ChartModel));
41267
41553
 
@@ -41623,6 +41909,59 @@ var meter_MeterChart = /** @class */ (function (_super) {
41623
41909
  }(chart_Chart));
41624
41910
 
41625
41911
  //# sourceMappingURL=../../src/charts/meter.js.map
41912
+ // CONCATENATED MODULE: ./node_modules/@carbon/charts/model/radar.js
41913
+ var model_radar_extends = (undefined && undefined.__extends) || (function () {
41914
+ var extendStatics = function (d, b) {
41915
+ extendStatics = Object.setPrototypeOf ||
41916
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
41917
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
41918
+ return extendStatics(d, b);
41919
+ };
41920
+ return function (d, b) {
41921
+ extendStatics(d, b);
41922
+ function __() { this.constructor = d; }
41923
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
41924
+ };
41925
+ })();
41926
+ var radar_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
41927
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
41928
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
41929
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
41930
+ r[k] = a[j];
41931
+ return r;
41932
+ };
41933
+ // Internal Imports
41934
+
41935
+
41936
+ /** The charting model layer which includes mainly the chart data and options,
41937
+ * as well as some misc. information to be shared among components */
41938
+ var radar_RadarChartModel = /** @class */ (function (_super) {
41939
+ model_radar_extends(RadarChartModel, _super);
41940
+ function RadarChartModel(services) {
41941
+ return _super.call(this, services) || this;
41942
+ }
41943
+ RadarChartModel.prototype.getTabularDataArray = function () {
41944
+ var options = this.getOptions();
41945
+ var groupedData = this.getGroupedData();
41946
+ var _a = tools_Tools.getProperty(options, 'radar', 'axes'), angle = _a.angle, value = _a.value;
41947
+ var additionalHeaders = tools_Tools.getProperty(groupedData, '0', 'data').map(function (d) { return d[angle]; });
41948
+ var result = radar_spreadArrays([
41949
+ radar_spreadArrays(['Group'], additionalHeaders)
41950
+ ], groupedData.map(function (datum) {
41951
+ return radar_spreadArrays([
41952
+ datum['name']
41953
+ ], additionalHeaders.map(function (additionalHeader, i) {
41954
+ return tools_Tools.getProperty(datum, 'data', i, value) !== null
41955
+ ? tools_Tools.getProperty(datum, 'data', i, value).toLocaleString()
41956
+ : '&ndash;';
41957
+ }));
41958
+ }));
41959
+ return result;
41960
+ };
41961
+ return RadarChartModel;
41962
+ }(cartesian_charts_ChartModelCartesian));
41963
+
41964
+ //# sourceMappingURL=../../src/model/radar.js.map
41626
41965
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/charts/radar.js
41627
41966
  var charts_radar_extends = (undefined && undefined.__extends) || (function () {
41628
41967
  var extendStatics = function (d, b) {
@@ -41642,16 +41981,12 @@ var charts_radar_extends = (undefined && undefined.__extends) || (function () {
41642
41981
 
41643
41982
 
41644
41983
 
41984
+
41645
41985
  var radar_RadarChart = /** @class */ (function (_super) {
41646
41986
  charts_radar_extends(RadarChart, _super);
41647
- // TODO - Optimize the use of "extending"
41648
- function RadarChart(holder, chartConfigs, extending) {
41649
- if (extending === void 0) { extending = false; }
41987
+ function RadarChart(holder, chartConfigs) {
41650
41988
  var _this = _super.call(this, holder, chartConfigs) || this;
41651
- // TODO - Optimize the use of "extending"
41652
- if (extending) {
41653
- return _this;
41654
- }
41989
+ _this.model = new radar_RadarChartModel(_this.services);
41655
41990
  // Merge the default options for this chart
41656
41991
  // With the user provided options
41657
41992
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.radarChart, chartConfigs.options));
@@ -41686,9 +42021,18 @@ var model_gauge_extends = (undefined && undefined.__extends) || (function () {
41686
42021
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
41687
42022
  };
41688
42023
  })();
42024
+ var gauge_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
42025
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
42026
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
42027
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
42028
+ r[k] = a[j];
42029
+ return r;
42030
+ };
41689
42031
  // Internal Imports
41690
42032
 
41691
- /** The gauge chart model layer */
42033
+ /**
42034
+ * The gauge chart model layer
42035
+ */
41692
42036
  var GaugeChartModel = /** @class */ (function (_super) {
41693
42037
  model_gauge_extends(GaugeChartModel, _super);
41694
42038
  function GaugeChartModel(services) {
@@ -41697,6 +42041,20 @@ var GaugeChartModel = /** @class */ (function (_super) {
41697
42041
  GaugeChartModel.prototype.getDataGroups = function () {
41698
42042
  return _super.prototype.getDataGroups.call(this).filter(function (item) { return item.name !== 'delta'; });
41699
42043
  };
42044
+ GaugeChartModel.prototype.getTabularDataArray = function () {
42045
+ var displayData = this.getDisplayData();
42046
+ var options = this.getOptions();
42047
+ var groupMapsTo = options.data.groupMapsTo;
42048
+ var result = gauge_spreadArrays([
42049
+ ['Group', 'Value']
42050
+ ], displayData.map(function (datum) { return [
42051
+ datum[groupMapsTo],
42052
+ datum['value'] === null
42053
+ ? '&ndash;'
42054
+ : datum['value'].toLocaleString(),
42055
+ ]; }));
42056
+ return result;
42057
+ };
41700
42058
  return GaugeChartModel;
41701
42059
  }(model_ChartModel));
41702
42060
 
@@ -41877,6 +42235,63 @@ var combo_ComboChart = /** @class */ (function (_super) {
41877
42235
  }(axis_chart_AxisChart));
41878
42236
 
41879
42237
  //# sourceMappingURL=../../src/charts/combo.js.map
42238
+ // CONCATENATED MODULE: ./node_modules/@carbon/charts/model/tree.js
42239
+ var model_tree_extends = (undefined && undefined.__extends) || (function () {
42240
+ var extendStatics = function (d, b) {
42241
+ extendStatics = Object.setPrototypeOf ||
42242
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
42243
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
42244
+ return extendStatics(d, b);
42245
+ };
42246
+ return function (d, b) {
42247
+ extendStatics(d, b);
42248
+ function __() { this.constructor = d; }
42249
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42250
+ };
42251
+ })();
42252
+ // Internal Imports
42253
+
42254
+ /**
42255
+ * The tree chart model layer
42256
+ */
42257
+ var TreeChartModel = /** @class */ (function (_super) {
42258
+ model_tree_extends(TreeChartModel, _super);
42259
+ function TreeChartModel(services) {
42260
+ return _super.call(this, services) || this;
42261
+ }
42262
+ TreeChartModel.prototype.getTabularDataArray = function () {
42263
+ var _this = this;
42264
+ var displayData = this.getDisplayData();
42265
+ var result = [['Child', 'Parent']];
42266
+ displayData.forEach(function (datum) {
42267
+ // Call recurisve function
42268
+ _this.getChildrenDatums(datum, result);
42269
+ result.push([datum.name, '&ndash;']);
42270
+ });
42271
+ return result;
42272
+ };
42273
+ /**
42274
+ * Determine the child parent relationship in nested data
42275
+ * @param datum: Object
42276
+ * @param result: Array<Object>
42277
+ */
42278
+ TreeChartModel.prototype.getChildrenDatums = function (datum, result) {
42279
+ var _this = this;
42280
+ if (result === void 0) { result = []; }
42281
+ // Check to see if datum has children before iterating through it
42282
+ if (datum.children) {
42283
+ if (datum.children.length > 0) {
42284
+ datum.children.forEach(function (child) {
42285
+ _this.getChildrenDatums(child, result);
42286
+ result.push([child.name, datum.name]);
42287
+ });
42288
+ }
42289
+ }
42290
+ };
42291
+ return TreeChartModel;
42292
+ }(model_ChartModel));
42293
+
42294
+ //# sourceMappingURL=../../src/model/tree.js.map
41880
42295
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/charts/tree.js
41881
42296
  var charts_tree_extends = (undefined && undefined.__extends) || (function () {
41882
42297
  var extendStatics = function (d, b) {
@@ -41895,12 +42310,14 @@ var charts_tree_extends = (undefined && undefined.__extends) || (function () {
41895
42310
 
41896
42311
 
41897
42312
 
42313
+
41898
42314
  // Components
41899
42315
 
41900
42316
  var tree_TreeChart = /** @class */ (function (_super) {
41901
42317
  charts_tree_extends(TreeChart, _super);
41902
42318
  function TreeChart(holder, chartConfigs) {
41903
42319
  var _this = _super.call(this, holder, chartConfigs) || this;
42320
+ _this.model = new TreeChartModel(_this.services);
41904
42321
  // Merge the default options for this chart
41905
42322
  // With the user provided options
41906
42323
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.treeChart, chartConfigs.options));
@@ -41923,6 +42340,44 @@ var tree_TreeChart = /** @class */ (function (_super) {
41923
42340
  }(chart_Chart));
41924
42341
 
41925
42342
  //# sourceMappingURL=../../src/charts/tree.js.map
42343
+ // CONCATENATED MODULE: ./node_modules/@carbon/charts/model/treemap.js
42344
+ var model_treemap_extends = (undefined && undefined.__extends) || (function () {
42345
+ var extendStatics = function (d, b) {
42346
+ extendStatics = Object.setPrototypeOf ||
42347
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
42348
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
42349
+ return extendStatics(d, b);
42350
+ };
42351
+ return function (d, b) {
42352
+ extendStatics(d, b);
42353
+ function __() { this.constructor = d; }
42354
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42355
+ };
42356
+ })();
42357
+ // Internal Imports
42358
+
42359
+ /**
42360
+ * The treemap chart model layer
42361
+ */
42362
+ var TreemapChartModel = /** @class */ (function (_super) {
42363
+ model_treemap_extends(TreemapChartModel, _super);
42364
+ function TreemapChartModel(services) {
42365
+ return _super.call(this, services) || this;
42366
+ }
42367
+ TreemapChartModel.prototype.getTabularDataArray = function () {
42368
+ var displayData = this.getDisplayData();
42369
+ var result = [['Child', 'Group', 'Value']];
42370
+ displayData.forEach(function (datum) {
42371
+ datum.children.forEach(function (child) {
42372
+ result.push([child.name, datum.name, child.value]);
42373
+ });
42374
+ });
42375
+ return result;
42376
+ };
42377
+ return TreemapChartModel;
42378
+ }(model_ChartModel));
42379
+
42380
+ //# sourceMappingURL=../../src/model/treemap.js.map
41926
42381
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/charts/treemap.js
41927
42382
  var charts_treemap_extends = (undefined && undefined.__extends) || (function () {
41928
42383
  var extendStatics = function (d, b) {
@@ -41941,12 +42396,14 @@ var charts_treemap_extends = (undefined && undefined.__extends) || (function ()
41941
42396
 
41942
42397
 
41943
42398
 
42399
+
41944
42400
  // Components
41945
42401
 
41946
42402
  var treemap_TreemapChart = /** @class */ (function (_super) {
41947
42403
  charts_treemap_extends(TreemapChart, _super);
41948
42404
  function TreemapChart(holder, chartConfigs) {
41949
42405
  var _this = _super.call(this, holder, chartConfigs) || this;
42406
+ _this.model = new TreemapChartModel(_this.services);
41950
42407
  // Merge the default options for this chart
41951
42408
  // With the user provided options
41952
42409
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.treemapChart, chartConfigs.options));
@@ -42100,6 +42557,57 @@ var circle_pack_CirclePackChartModel = /** @class */ (function (_super) {
42100
42557
  return circle_pack_assign(circle_pack_assign({}, node), { dataGroupName: name });
42101
42558
  }
42102
42559
  };
42560
+ CirclePackChartModel.prototype.getTabularDataArray = function () {
42561
+ var _this = this;
42562
+ var displayData = this.getDisplayData();
42563
+ var result = [['Child', 'Parent', 'Value']];
42564
+ displayData.forEach(function (datum) {
42565
+ var value = datum.value ? datum.value : 0;
42566
+ if (datum.children) {
42567
+ // Call recursive function
42568
+ value += _this.getChildrenDatums(datum.children, datum.name, result, 0);
42569
+ }
42570
+ result.push(['&ndash;', datum.name, value]);
42571
+ });
42572
+ return result;
42573
+ };
42574
+ /**
42575
+ * Recursively determine the relationship between all the nested elements in the child
42576
+ * @param children: Object
42577
+ * @param parent: String
42578
+ * @param result: Array<Object>
42579
+ * @param totalSum: number
42580
+ * @returns: number
42581
+ */
42582
+ CirclePackChartModel.prototype.getChildrenDatums = function (children, parent, result, totalSum) {
42583
+ var _this = this;
42584
+ if (result === void 0) { result = []; }
42585
+ if (totalSum === void 0) { totalSum = 0; }
42586
+ var grandParent = parent;
42587
+ children.forEach(function (child) {
42588
+ var parent = child.name;
42589
+ var sum = 0;
42590
+ if (child.children) {
42591
+ if (child.children.length > 0) {
42592
+ if (typeof child.value === 'number') {
42593
+ totalSum += child.value;
42594
+ }
42595
+ sum += _this.getChildrenDatums(child.children, parent, result, sum);
42596
+ result.push([parent, grandParent, sum]);
42597
+ totalSum += sum;
42598
+ }
42599
+ }
42600
+ else {
42601
+ var value = 0;
42602
+ if (typeof child.value === 'number') {
42603
+ value = child.value;
42604
+ totalSum += child.value;
42605
+ }
42606
+ result.push([child.name, grandParent, value]);
42607
+ }
42608
+ });
42609
+ return totalSum;
42610
+ };
42103
42611
  return CirclePackChartModel;
42104
42612
  }(model_ChartModel));
42105
42613
 
@@ -42150,6 +42658,54 @@ var circle_pack_CirclePackChart = /** @class */ (function (_super) {
42150
42658
  }(chart_Chart));
42151
42659
 
42152
42660
  //# sourceMappingURL=../../src/charts/circle-pack.js.map
42661
+ // CONCATENATED MODULE: ./node_modules/@carbon/charts/model/wordcloud.js
42662
+ var model_wordcloud_extends = (undefined && undefined.__extends) || (function () {
42663
+ var extendStatics = function (d, b) {
42664
+ extendStatics = Object.setPrototypeOf ||
42665
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
42666
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
42667
+ return extendStatics(d, b);
42668
+ };
42669
+ return function (d, b) {
42670
+ extendStatics(d, b);
42671
+ function __() { this.constructor = d; }
42672
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42673
+ };
42674
+ })();
42675
+ var wordcloud_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
42676
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
42677
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
42678
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
42679
+ r[k] = a[j];
42680
+ return r;
42681
+ };
42682
+ // Internal Imports
42683
+
42684
+ /** The charting model layer which includes mainly the chart data and options,
42685
+ * as well as some misc. information to be shared among components */
42686
+ var WordCloudModel = /** @class */ (function (_super) {
42687
+ model_wordcloud_extends(WordCloudModel, _super);
42688
+ function WordCloudModel(services) {
42689
+ return _super.call(this, services) || this;
42690
+ }
42691
+ WordCloudModel.prototype.getTabularDataArray = function () {
42692
+ var displayData = this.getDisplayData();
42693
+ var options = this.getOptions();
42694
+ var _a = options.wordCloud, fontSizeMapsTo = _a.fontSizeMapsTo, wordMapsTo = _a.wordMapsTo;
42695
+ var groupMapsTo = options.data.groupMapsTo;
42696
+ var result = wordcloud_spreadArrays([
42697
+ [options.tooltip.wordLabel, 'Group', options.tooltip.valueLabel]
42698
+ ], displayData.map(function (datum) { return [
42699
+ datum[wordMapsTo],
42700
+ datum[groupMapsTo],
42701
+ datum[fontSizeMapsTo],
42702
+ ]; }));
42703
+ return result;
42704
+ };
42705
+ return WordCloudModel;
42706
+ }(model_ChartModel));
42707
+
42708
+ //# sourceMappingURL=../../src/model/wordcloud.js.map
42153
42709
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/charts/wordcloud.js
42154
42710
  var charts_wordcloud_extends = (undefined && undefined.__extends) || (function () {
42155
42711
  var extendStatics = function (d, b) {
@@ -42164,6 +42720,8 @@ var charts_wordcloud_extends = (undefined && undefined.__extends) || (function (
42164
42720
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42165
42721
  };
42166
42722
  })();
42723
+ // Internal Imports
42724
+
42167
42725
 
42168
42726
 
42169
42727
 
@@ -42174,6 +42732,7 @@ var wordcloud_WordCloudChart = /** @class */ (function (_super) {
42174
42732
  charts_wordcloud_extends(WordCloudChart, _super);
42175
42733
  function WordCloudChart(holder, chartConfigs) {
42176
42734
  var _this = _super.call(this, holder, chartConfigs) || this;
42735
+ _this.model = new WordCloudModel(_this.services);
42177
42736
  // Merge the default options for this chart
42178
42737
  // With the user provided options
42179
42738
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.wordCloudChart, chartConfigs.options));
@@ -42197,6 +42756,54 @@ var wordcloud_WordCloudChart = /** @class */ (function (_super) {
42197
42756
  }(chart_Chart));
42198
42757
 
42199
42758
  //# sourceMappingURL=../../src/charts/wordcloud.js.map
42759
+ // CONCATENATED MODULE: ./node_modules/@carbon/charts/model/alluvial.js
42760
+ var model_alluvial_extends = (undefined && undefined.__extends) || (function () {
42761
+ var extendStatics = function (d, b) {
42762
+ extendStatics = Object.setPrototypeOf ||
42763
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
42764
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
42765
+ return extendStatics(d, b);
42766
+ };
42767
+ return function (d, b) {
42768
+ extendStatics(d, b);
42769
+ function __() { this.constructor = d; }
42770
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
42771
+ };
42772
+ })();
42773
+ var alluvial_spreadArrays = (undefined && undefined.__spreadArrays) || function () {
42774
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
42775
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
42776
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
42777
+ r[k] = a[j];
42778
+ return r;
42779
+ };
42780
+ // Internal Imports
42781
+
42782
+ /**
42783
+ * Alluvial chart model layer
42784
+ */
42785
+ var AlluvialChartModel = /** @class */ (function (_super) {
42786
+ model_alluvial_extends(AlluvialChartModel, _super);
42787
+ function AlluvialChartModel(services) {
42788
+ return _super.call(this, services) || this;
42789
+ }
42790
+ AlluvialChartModel.prototype.getTabularDataArray = function () {
42791
+ var displayData = this.getDisplayData();
42792
+ // Sort array by source to get a close depiction of the alluvial chart
42793
+ displayData.sort(function (a, b) { return a['source'].localeCompare(b['source']); });
42794
+ var result = alluvial_spreadArrays([
42795
+ ['Source', 'Target', 'Value']
42796
+ ], displayData.map(function (datum) { return [
42797
+ datum['source'],
42798
+ datum['target'],
42799
+ datum['value'],
42800
+ ]; }));
42801
+ return result;
42802
+ };
42803
+ return AlluvialChartModel;
42804
+ }(cartesian_charts_ChartModelCartesian));
42805
+
42806
+ //# sourceMappingURL=../../src/model/alluvial.js.map
42200
42807
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/charts/alluvial.js
42201
42808
  var charts_alluvial_extends = (undefined && undefined.__extends) || (function () {
42202
42809
  var extendStatics = function (d, b) {
@@ -42215,12 +42822,14 @@ var charts_alluvial_extends = (undefined && undefined.__extends) || (function ()
42215
42822
 
42216
42823
 
42217
42824
 
42825
+
42218
42826
  // Components
42219
42827
 
42220
42828
  var alluvial_AlluvialChart = /** @class */ (function (_super) {
42221
42829
  charts_alluvial_extends(AlluvialChart, _super);
42222
42830
  function AlluvialChart(holder, chartConfigs) {
42223
42831
  var _this = _super.call(this, holder, chartConfigs) || this;
42832
+ _this.model = new AlluvialChartModel(_this.services);
42224
42833
  // Merge the default options for this chart
42225
42834
  // With the user provided options
42226
42835
  _this.model.setOptions(tools_Tools.mergeDefaultChartOptions(configuration_options.alluvialChart, chartConfigs.options));