@carbon/charts-vue 0.32.10 → 0.33.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.
@@ -6834,7 +6834,7 @@ var tools_Tools;
6834
6834
  function getDimensions(el) {
6835
6835
  return {
6836
6836
  width: parseFloat(el.style.width.replace("px", "") || el.offsetWidth),
6837
- height: parseFloat(el.style.height.replace("px", "") || el.offsetHeight),
6837
+ height: parseFloat(el.style.height.replace("px", "") || el.offsetHeight)
6838
6838
  };
6839
6839
  }
6840
6840
  Tools.getDimensions = getDimensions;
@@ -6864,7 +6864,7 @@ var tools_Tools;
6864
6864
  .split(",");
6865
6865
  return {
6866
6866
  tx: transforms[0],
6867
- ty: transforms[1],
6867
+ ty: transforms[1]
6868
6868
  };
6869
6869
  }
6870
6870
  return null;
@@ -6886,7 +6886,7 @@ var tools_Tools;
6886
6886
  var xyString = match.split(",");
6887
6887
  return {
6888
6888
  x: parseFloat(xyString[0]),
6889
- y: parseFloat(xyString[1]),
6889
+ y: parseFloat(xyString[1])
6890
6890
  };
6891
6891
  }
6892
6892
  Tools.getTranformOffsets = getTranformOffsets;
@@ -6933,19 +6933,21 @@ var tools_Tools;
6933
6933
  }
6934
6934
  Tools.convertValueToPercentage = convertValueToPercentage;
6935
6935
  /**
6936
- * Truncate the labels
6937
- * @export
6938
- * @param {any} fullText
6939
- * @param {any} truncationType
6940
- * @param {any} numCharacter
6941
- * @returns Truncated text
6942
- */
6936
+ * Truncate the labels
6937
+ * @export
6938
+ * @param {any} fullText
6939
+ * @param {any} truncationType
6940
+ * @param {any} numCharacter
6941
+ * @returns Truncated text
6942
+ */
6943
6943
  function truncateLabel(fullText, truncationType, numCharacter) {
6944
6944
  if (numCharacter > fullText.length) {
6945
6945
  return fullText;
6946
6946
  }
6947
6947
  if (truncationType === TruncationTypes.MID_LINE) {
6948
- return fullText.substr(0, numCharacter / 2) + "..." + fullText.substr(-numCharacter / 2);
6948
+ return (fullText.substr(0, numCharacter / 2) +
6949
+ "..." +
6950
+ fullText.substr(-numCharacter / 2));
6949
6951
  }
6950
6952
  else if (truncationType === TruncationTypes.FRONT_LINE) {
6951
6953
  return "..." + fullText.substr(-numCharacter);
@@ -6970,7 +6972,7 @@ var tools_Tools;
6970
6972
  function arrayDifferences(oldArray, newArray) {
6971
6973
  var difference = {
6972
6974
  missing: [],
6973
- added: [],
6975
+ added: []
6974
6976
  };
6975
6977
  oldArray.forEach(function (element) {
6976
6978
  if (newArray.indexOf(element) === -1) {
@@ -7057,7 +7059,7 @@ var tools_Tools;
7057
7059
  y0: verticalCoordinates.x0,
7058
7060
  y1: verticalCoordinates.x1,
7059
7061
  x0: verticalCoordinates.y0,
7060
- x1: verticalCoordinates.y1,
7062
+ x1: verticalCoordinates.y1
7061
7063
  };
7062
7064
  }
7063
7065
  return verticalCoordinates;
@@ -7096,7 +7098,7 @@ var en_US_default = /*#__PURE__*/__webpack_require__.n(en_US);
7096
7098
  var standardTruncationOptions = {
7097
7099
  type: TruncationTypes.END_LINE,
7098
7100
  threshold: 16,
7099
- numCharacter: 14,
7101
+ numCharacter: 14
7100
7102
  };
7101
7103
  /**
7102
7104
  * Legend options
@@ -7116,9 +7118,9 @@ var legend = {
7116
7118
  },
7117
7119
  checkbox: {
7118
7120
  radius: 6.5,
7119
- spaceAfter: 4,
7121
+ spaceAfter: 4
7120
7122
  },
7121
- truncation: standardTruncationOptions,
7123
+ truncation: standardTruncationOptions
7122
7124
  };
7123
7125
  /**
7124
7126
  * Grid options
@@ -7164,19 +7166,19 @@ var barChartTooltip = tools_Tools.merge({}, axisChartTooltip, {
7164
7166
  var configuration_axes = {
7165
7167
  top: {
7166
7168
  includeZero: true,
7167
- truncation: standardTruncationOptions,
7169
+ truncation: standardTruncationOptions
7168
7170
  },
7169
7171
  bottom: {
7170
7172
  includeZero: true,
7171
- truncation: standardTruncationOptions,
7173
+ truncation: standardTruncationOptions
7172
7174
  },
7173
7175
  left: {
7174
7176
  includeZero: true,
7175
- truncation: standardTruncationOptions,
7177
+ truncation: standardTruncationOptions
7176
7178
  },
7177
7179
  right: {
7178
7180
  includeZero: true,
7179
- truncation: standardTruncationOptions,
7181
+ truncation: standardTruncationOptions
7180
7182
  }
7181
7183
  };
7182
7184
  var timeScale = {
@@ -7209,7 +7211,8 @@ var configuration_chart = {
7209
7211
  },
7210
7212
  data: {
7211
7213
  groupMapsTo: "group",
7212
- loading: false
7214
+ loading: false,
7215
+ selectedGroups: []
7213
7216
  },
7214
7217
  color: {
7215
7218
  scale: null
@@ -7345,7 +7348,11 @@ var gaugeChart = tools_Tools.merge({}, configuration_chart, {
7345
7348
  numberSpacing: 10,
7346
7349
  deltaFontSize: function (radius) { return radius / 8; },
7347
7350
  valueFontSize: function (radius) { return radius / 2.5; },
7348
- numberFormatter: function (number) { return (number.toFixed(2) % 1 !== 0) ? number.toFixed(2).toLocaleString() : number.toFixed().toLocaleString(); }
7351
+ numberFormatter: function (number) {
7352
+ return number.toFixed(2) % 1 !== 0
7353
+ ? number.toFixed(2).toLocaleString()
7354
+ : number.toFixed().toLocaleString();
7355
+ }
7349
7356
  }
7350
7357
  });
7351
7358
  /**
@@ -7772,7 +7779,7 @@ var getColor = function (obj, shade) { return obj[shade]; };
7772
7779
  magenta: function (shade) { return getColor(magenta, shade); },
7773
7780
  purple: function (shade) { return getColor(purple, shade); },
7774
7781
  red: function (shade) { return getColor(red, shade); },
7775
- teal: function (shade) { return getColor(teal, shade); },
7782
+ teal: function (shade) { return getColor(teal, shade); }
7776
7783
  });
7777
7784
  //# sourceMappingURL=../../src/services/colors.js.map
7778
7785
  // CONCATENATED MODULE: ./node_modules/@carbon/charts/services/colorPalettes.js
@@ -7794,7 +7801,7 @@ var WHITE = [
7794
7801
  services_colors.teal(50),
7795
7802
  services_colors.cyan(90),
7796
7803
  "#8a3800",
7797
- services_colors.purple(50),
7804
+ services_colors.purple(50)
7798
7805
  ];
7799
7806
  var DARK = [
7800
7807
  services_colors.purple(60),
@@ -7810,7 +7817,7 @@ var DARK = [
7810
7817
  services_colors.teal(40),
7811
7818
  services_colors.cyan(20),
7812
7819
  "#ba4e00",
7813
- services_colors.purple(30),
7820
+ services_colors.purple(30)
7814
7821
  ];
7815
7822
  var G10 = WHITE;
7816
7823
  var G90 = DARK;
@@ -12182,11 +12189,10 @@ var model_ChartModel = /** @class */ (function () {
12182
12189
  this.colorScale = {};
12183
12190
  this.services = services;
12184
12191
  }
12185
- ChartModel.prototype.getDisplayData = function () {
12192
+ ChartModel.prototype.getAllDataFromDomain = function () {
12186
12193
  if (!this.get("data")) {
12187
12194
  return null;
12188
12195
  }
12189
- var ACTIVE = legend.items.status.ACTIVE;
12190
12196
  var dataGroups = this.getDataGroups();
12191
12197
  // Remove datasets that have been disabled
12192
12198
  var displayData = tools_Tools.clone(this.get("data"));
@@ -12205,12 +12211,26 @@ var model_ChartModel = /** @class */ (function () {
12205
12211
  else {
12206
12212
  var _a = axesOptions[axis].domain, start_1 = _a[0], end_1 = _a[1];
12207
12213
  // Filter out data outside domain
12208
- displayData = displayData.filter(function (datum) { return datum[mapsTo_1] >= start_1 && datum[mapsTo_1] <= end_1; });
12214
+ displayData = displayData.filter(function (datum) {
12215
+ return datum[mapsTo_1] >= start_1 && datum[mapsTo_1] <= end_1;
12216
+ });
12209
12217
  }
12210
12218
  }
12211
12219
  });
12212
12220
  }
12213
12221
  return displayData.filter(function (datum) {
12222
+ return dataGroups.find(function (group) { return group.name === datum[groupMapsTo]; });
12223
+ });
12224
+ };
12225
+ ChartModel.prototype.getDisplayData = function () {
12226
+ if (!this.get("data")) {
12227
+ return null;
12228
+ }
12229
+ var ACTIVE = legend.items.status.ACTIVE;
12230
+ var dataGroups = this.getDataGroups();
12231
+ var groupMapsTo = this.getOptions().data.groupMapsTo;
12232
+ var allDataFromDomain = this.getAllDataFromDomain();
12233
+ return allDataFromDomain.filter(function (datum) {
12214
12234
  var group = dataGroups.find(function (group) { return group.name === datum[groupMapsTo]; });
12215
12235
  return group.status === ACTIVE;
12216
12236
  });
@@ -12273,6 +12293,20 @@ var model_ChartModel = /** @class */ (function () {
12273
12293
  var domainIdentifier = this.services.cartesianScales.getDomainIdentifier();
12274
12294
  var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
12275
12295
  var stackKeys = src_map(displayData, function (datum) { return datum[domainIdentifier]; }).keys();
12296
+ var axisPosition = this.services.cartesianScales.domainAxisPosition;
12297
+ var scaleType = options.axes[axisPosition].scaleType;
12298
+ // Sort keys
12299
+ if (scaleType === ScaleTypes.TIME) {
12300
+ stackKeys.sort(function (a, b) {
12301
+ var dateA = new Date(a);
12302
+ var dateB = new Date(b);
12303
+ return dateA - dateB;
12304
+ });
12305
+ }
12306
+ else if (scaleType === ScaleTypes.LOG ||
12307
+ scaleType === ScaleTypes.LINEAR) {
12308
+ stackKeys.sort(function (a, b) { return a - b; });
12309
+ }
12276
12310
  var dataGroupNames = this.getDataGroupNames();
12277
12311
  return stackKeys.map(function (key) {
12278
12312
  var correspondingValues = { sharedStackKey: key };
@@ -12401,6 +12435,19 @@ var model_ChartModel = /** @class */ (function () {
12401
12435
  group.name === changedLabel ? ACTIVE : DISABLED;
12402
12436
  });
12403
12437
  }
12438
+ // Updates selected groups
12439
+ var updatedActiveItems = dataGroups.filter(function (group) { return group.status === ACTIVE; });
12440
+ var options = this.getOptions();
12441
+ var hasUpdatedDeactivatedItems = dataGroups.some(function (group) { return group.status === DISABLED; });
12442
+ // If there are deactivated items, map the item name into selected groups
12443
+ if (hasUpdatedDeactivatedItems) {
12444
+ options.data.selectedGroups = updatedActiveItems.map(function (activeItem) { return activeItem.name; });
12445
+ }
12446
+ else {
12447
+ // If every item is active, clear array
12448
+ options.data.selectedGroups = [];
12449
+ }
12450
+ ;
12404
12451
  // dispatch legend filtering event with the status of all the dataLabels
12405
12452
  this.services.events.dispatchEvent(Events.Legend.ITEMS_UPDATE, {
12406
12453
  dataGroups: dataGroups
@@ -12528,11 +12575,27 @@ var model_ChartModel = /** @class */ (function () {
12528
12575
  };
12529
12576
  ChartModel.prototype.generateDataGroups = function (data) {
12530
12577
  var groupMapsTo = this.getOptions().data.groupMapsTo;
12531
- var ACTIVE = legend.items.status.ACTIVE;
12578
+ var _a = legend.items.status, ACTIVE = _a.ACTIVE, DISABLED = _a.DISABLED;
12579
+ var options = this.getOptions();
12532
12580
  var uniqueDataGroups = src_map(data, function (datum) { return datum[groupMapsTo]; }).keys();
12581
+ // check if selectedGroups can be applied to chart with current data groups
12582
+ if (options.data.selectedGroups.length) {
12583
+ var hasAllSelectedGroups = options.data.selectedGroups
12584
+ .every(function (groupName) { return uniqueDataGroups.includes(groupName); });
12585
+ if (!hasAllSelectedGroups) {
12586
+ options.data.selectedGroups = [];
12587
+ }
12588
+ ;
12589
+ }
12590
+ // Get group status based on items in selected groups
12591
+ var getStatus = function (groupName) {
12592
+ return !options.data.selectedGroups.length || options.data.selectedGroups.includes(groupName)
12593
+ ? ACTIVE
12594
+ : DISABLED;
12595
+ };
12533
12596
  return uniqueDataGroups.map(function (groupName) { return ({
12534
12597
  name: groupName,
12535
- status: ACTIVE
12598
+ status: getStatus(groupName)
12536
12599
  }); });
12537
12600
  };
12538
12601
  /*
@@ -13663,7 +13726,7 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
13663
13726
  }
13664
13727
  var finalDimensions = {
13665
13728
  width: 0,
13666
- height: 0,
13729
+ height: 0
13667
13730
  };
13668
13731
  var validateAndSetDimensions = function (dimensions) {
13669
13732
  if (dimensions) {
@@ -13682,7 +13745,7 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
13682
13745
  };
13683
13746
  var attrDimensions = {
13684
13747
  width: svgSelector.attr("width"),
13685
- height: svgSelector.attr("height"),
13748
+ height: svgSelector.attr("height")
13686
13749
  };
13687
13750
  var bbox, bboxDimensions, boundingRect, boundingRectDimensions;
13688
13751
  // In many versions of Firefox
@@ -13691,7 +13754,7 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
13691
13754
  bbox = svgSelector.node().getBBox();
13692
13755
  bboxDimensions = {
13693
13756
  width: bbox.width,
13694
- height: bbox.height,
13757
+ height: bbox.height
13695
13758
  };
13696
13759
  }
13697
13760
  catch (e) { }
@@ -13699,13 +13762,13 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
13699
13762
  boundingRect = svgSelector.node().getBoundingClientRect();
13700
13763
  boundingRectDimensions = {
13701
13764
  width: boundingRect.width,
13702
- height: boundingRect.height,
13765
+ height: boundingRect.height
13703
13766
  };
13704
13767
  }
13705
13768
  catch (e) { }
13706
13769
  var clientDimensions = {
13707
13770
  width: svgSelector.node().clientWidth,
13708
- height: svgSelector.node().clientHeight,
13771
+ height: svgSelector.node().clientHeight
13709
13772
  };
13710
13773
  // If both attribute values are numbers
13711
13774
  // And not percentages or NaN
@@ -13738,7 +13801,7 @@ var dom_utils_DOMUtils = /** @class */ (function (_super) {
13738
13801
  try {
13739
13802
  var nativeDimensions = {
13740
13803
  width: tools_Tools.getProperty(svgSelector.node(), "width", "baseVal", "value"),
13741
- height: tools_Tools.getProperty(svgSelector.node(), "height", "baseVal", "value"),
13804
+ height: tools_Tools.getProperty(svgSelector.node(), "height", "baseVal", "value")
13742
13805
  };
13743
13806
  validateAndSetDimensions(nativeDimensions);
13744
13807
  }
@@ -13893,7 +13956,7 @@ var events_Events = /** @class */ (function (_super) {
13893
13956
  var newEvent;
13894
13957
  if (eventDetail) {
13895
13958
  newEvent = new CustomEvent(eventType, {
13896
- detail: eventDetail,
13959
+ detail: eventDetail
13897
13960
  });
13898
13961
  }
13899
13962
  else {
@@ -16436,13 +16499,13 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16436
16499
  top: null,
16437
16500
  right: null,
16438
16501
  bottom: null,
16439
- left: null,
16502
+ left: null
16440
16503
  };
16441
16504
  _this.scales = {
16442
16505
  top: null,
16443
16506
  right: null,
16444
16507
  bottom: null,
16445
- left: null,
16508
+ left: null
16446
16509
  };
16447
16510
  return _this;
16448
16511
  }
@@ -16502,7 +16565,7 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16502
16565
  CartesianScales.prototype.getMainXAxisPosition = function () {
16503
16566
  var possibleXAxisPositions = [
16504
16567
  AxisPositions.BOTTOM,
16505
- AxisPositions.TOP,
16568
+ AxisPositions.TOP
16506
16569
  ];
16507
16570
  return [this.domainAxisPosition, this.rangeAxisPosition].find(function (position) { return possibleXAxisPositions.indexOf(position) > -1; });
16508
16571
  };
@@ -16510,7 +16573,7 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16510
16573
  CartesianScales.prototype.getMainYAxisPosition = function () {
16511
16574
  var possibleYAxisPositions = [
16512
16575
  AxisPositions.LEFT,
16513
- AxisPositions.RIGHT,
16576
+ AxisPositions.RIGHT
16514
16577
  ];
16515
16578
  return [this.domainAxisPosition, this.rangeAxisPosition].find(function (position) { return possibleYAxisPositions.indexOf(position) > -1; });
16516
16579
  };
@@ -16551,7 +16614,7 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16551
16614
  var axisOptions = tools_Tools.getProperty(options, "axes", this.rangeAxisPosition);
16552
16615
  return axisOptions.mapsTo;
16553
16616
  };
16554
- /** Uses the primary Y Axis to get data items associated with that value. */
16617
+ /** Uses the Y Axis to get data items associated with that value. */
16555
16618
  CartesianScales.prototype.getDataFromDomain = function (domainValue) {
16556
16619
  var displayData = this.model.getDisplayData();
16557
16620
  var domainIdentifier = this.getDomainIdentifier();
@@ -16610,7 +16673,7 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16610
16673
  var mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR;
16611
16674
  var result = {
16612
16675
  domainAxisPosition: null,
16613
- rangeAxisPosition: null,
16676
+ rangeAxisPosition: null
16614
16677
  };
16615
16678
  if (mainHorizontalScaleType === ScaleTypes.LABELS ||
16616
16679
  mainHorizontalScaleType === ScaleTypes.TIME) {
@@ -16716,7 +16779,7 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16716
16779
  }
16717
16780
  return {
16718
16781
  threshold: highestThreshold,
16719
- scaleValue: domainScale(highestThreshold.value),
16782
+ scaleValue: domainScale(highestThreshold.value)
16720
16783
  };
16721
16784
  };
16722
16785
  CartesianScales.prototype.getHighestRangeThreshold = function () {
@@ -16731,7 +16794,7 @@ var scales_cartesian_CartesianScales = /** @class */ (function (_super) {
16731
16794
  var highestThreshold = thresholds.sort(function (a, b) { return b.value - a.value; })[0];
16732
16795
  return {
16733
16796
  threshold: highestThreshold,
16734
- scaleValue: rangeScale(highestThreshold.value),
16797
+ scaleValue: rangeScale(highestThreshold.value)
16735
16798
  };
16736
16799
  };
16737
16800
  return CartesianScales;
@@ -16743,49 +16806,49 @@ function addSpacingToTimeDomain(domain, spaceToAddToEdges) {
16743
16806
  if (differenceInYears(endDate, startDate) > 1) {
16744
16807
  return [
16745
16808
  subYears(startDate, spaceToAddToEdges),
16746
- addYears(endDate, spaceToAddToEdges),
16809
+ addYears(endDate, spaceToAddToEdges)
16747
16810
  ];
16748
16811
  }
16749
16812
  if (differenceInMonths(endDate, startDate) > 1) {
16750
16813
  return [
16751
16814
  subMonths(startDate, spaceToAddToEdges),
16752
- addMonths(endDate, spaceToAddToEdges),
16815
+ addMonths(endDate, spaceToAddToEdges)
16753
16816
  ];
16754
16817
  }
16755
16818
  if (differenceInDays(endDate, startDate) > 1) {
16756
16819
  return [
16757
16820
  subDays(startDate, spaceToAddToEdges),
16758
- addDays(endDate, spaceToAddToEdges),
16821
+ addDays(endDate, spaceToAddToEdges)
16759
16822
  ];
16760
16823
  }
16761
16824
  if (differenceInHours(endDate, startDate) > 1) {
16762
16825
  return [
16763
16826
  subHours(startDate, spaceToAddToEdges),
16764
- addHours(endDate, spaceToAddToEdges),
16827
+ addHours(endDate, spaceToAddToEdges)
16765
16828
  ];
16766
16829
  }
16767
16830
  if (differenceInMinutes(endDate, startDate) > 30) {
16768
16831
  return [
16769
16832
  subMinutes(startDate, spaceToAddToEdges * 30),
16770
- addMinutes(endDate, spaceToAddToEdges * 30),
16833
+ addMinutes(endDate, spaceToAddToEdges * 30)
16771
16834
  ];
16772
16835
  }
16773
16836
  if (differenceInMinutes(endDate, startDate) > 1) {
16774
16837
  return [
16775
16838
  subMinutes(startDate, spaceToAddToEdges),
16776
- addMinutes(endDate, spaceToAddToEdges),
16839
+ addMinutes(endDate, spaceToAddToEdges)
16777
16840
  ];
16778
16841
  }
16779
16842
  if (differenceInSeconds(endDate, startDate) > 15) {
16780
16843
  return [
16781
16844
  subSeconds(startDate, spaceToAddToEdges * 15),
16782
- addSeconds(endDate, spaceToAddToEdges * 15),
16845
+ addSeconds(endDate, spaceToAddToEdges * 15)
16783
16846
  ];
16784
16847
  }
16785
16848
  if (differenceInSeconds(endDate, startDate) > 1) {
16786
16849
  return [
16787
16850
  subSeconds(startDate, spaceToAddToEdges),
16788
- addSeconds(endDate, spaceToAddToEdges),
16851
+ addSeconds(endDate, spaceToAddToEdges)
16789
16852
  ];
16790
16853
  }
16791
16854
  return [startDate, endDate];
@@ -17766,7 +17829,7 @@ var curves_Curves = /** @class */ (function (_super) {
17766
17829
  curveNatural: natural,
17767
17830
  curveStep: curve_step,
17768
17831
  curveStepAfter: stepAfter,
17769
- curveStepBefore: stepBefore,
17832
+ curveStepBefore: stepBefore
17770
17833
  };
17771
17834
  return _this;
17772
17835
  }
@@ -17915,7 +17978,10 @@ var legend_Legend = /** @class */ (function (_super) {
17915
17978
  var addedLegendItems = legendItems
17916
17979
  .enter()
17917
17980
  .append("g")
17918
- .classed("legend-item", true);
17981
+ .classed("legend-item", true)
17982
+ .classed("active", function (d, i) {
17983
+ return d.status === options.legend.items.status.ACTIVE;
17984
+ });
17919
17985
  // Configs
17920
17986
  var checkboxRadius = options.legend.checkbox.radius;
17921
17987
  // Truncation
@@ -17944,8 +18010,7 @@ var legend_Legend = /** @class */ (function (_super) {
17944
18010
  .merge(legendItems.select("text"));
17945
18011
  // truncate the legend label if it's too long
17946
18012
  if (truncationType !== TruncationTypes.NONE) {
17947
- addedLegendItemsText
17948
- .html(function (d) {
18013
+ addedLegendItemsText.html(function (d) {
17949
18014
  if (d.name.length > truncationThreshold) {
17950
18015
  return tools_Tools.truncateLabel(d.name, truncationType, truncationNumCharacter);
17951
18016
  }
@@ -17955,8 +18020,7 @@ var legend_Legend = /** @class */ (function (_super) {
17955
18020
  });
17956
18021
  }
17957
18022
  else {
17958
- addedLegendItemsText
17959
- .html(function (d) { return d.name; });
18023
+ addedLegendItemsText.html(function (d) { return d.name; });
17960
18024
  }
17961
18025
  this.breakItemsIntoLines(addedLegendItems);
17962
18026
  // Remove old elements as needed.
@@ -18036,11 +18100,19 @@ var legend_Legend = /** @class */ (function (_super) {
18036
18100
  legendItem
18037
18101
  .select("text")
18038
18102
  .attr("x", startingPoint + spaceNeededForCheckbox)
18039
- .attr("y", yOffset + yPosition + 2);
18103
+ .attr("y", yOffset + yPosition + 3);
18040
18104
  lastYPosition = yPosition;
18105
+ // Test if legendItems are placed in the correct direction
18106
+ var testHorizontal = (!legendOrientation ||
18107
+ legendOrientation === LegendOrientations.HORIZONTAL) &&
18108
+ legendItem.select("rect.checkbox").attr("y") === '0';
18109
+ var testVertical = legendOrientation === LegendOrientations.VERTICAL &&
18110
+ legendItem.select("rect.checkbox").attr("x") === '0';
18111
+ var hasCorrectLegendDirection = testHorizontal || testVertical;
18041
18112
  // Render checkbox check icon
18042
18113
  if (hasDeactivatedItems &&
18043
- legendItem.select("g.check").empty()) {
18114
+ legendItem.select("g.check").empty() &&
18115
+ hasCorrectLegendDirection) {
18044
18116
  legendItem.append("g").classed("check", true).html("\n\t\t\t\t\t\t\t<svg focusable=\"false\" preserveAspectRatio=\"xMidYMid meet\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 32 32\" aria-hidden=\"true\"\n\t\t\t\t\t\t\t\tstyle=\"will-change: transform;\">\n\t\t\t\t\t\t\t\t<path d=\"M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z\"></path>\n\t\t\t\t\t\t\t\t<title>Checkmark</title>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t");
18045
18117
  legendItem
18046
18118
  .select("g.check svg")
@@ -18065,7 +18137,7 @@ var legend_Legend = /** @class */ (function (_super) {
18065
18137
  svg.selectAll("g.legend-item")
18066
18138
  .on("mouseover", function () {
18067
18139
  self.services.events.dispatchEvent(Events.Legend.ITEM_HOVER, {
18068
- hoveredElement: src_select(this),
18140
+ hoveredElement: src_select(this)
18069
18141
  });
18070
18142
  // Configs
18071
18143
  var checkboxRadius = options.legend.checkbox.radius;
@@ -18083,7 +18155,7 @@ var legend_Legend = /** @class */ (function (_super) {
18083
18155
  })
18084
18156
  .on("click", function () {
18085
18157
  self.services.events.dispatchEvent(Events.Legend.ITEM_CLICK, {
18086
- clickedElement: src_select(this),
18158
+ clickedElement: src_select(this)
18087
18159
  });
18088
18160
  var clickedItem = src_select(this);
18089
18161
  var clickedItemData = clickedItem.datum();
@@ -18095,7 +18167,7 @@ var legend_Legend = /** @class */ (function (_super) {
18095
18167
  if (hoveredItemData.name.length > truncationThreshold) {
18096
18168
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
18097
18169
  hoveredElement: hoveredItem,
18098
- type: TooltipTypes.LEGEND,
18170
+ type: TooltipTypes.LEGEND
18099
18171
  });
18100
18172
  }
18101
18173
  })
@@ -18104,7 +18176,7 @@ var legend_Legend = /** @class */ (function (_super) {
18104
18176
  hoveredItem.select("rect.hover-stroke").remove();
18105
18177
  self.services.events.dispatchEvent(Events.Tooltip.HIDE);
18106
18178
  self.services.events.dispatchEvent(Events.Legend.ITEM_MOUSEOUT, {
18107
- hoveredElement: hoveredItem,
18179
+ hoveredElement: hoveredItem
18108
18180
  });
18109
18181
  });
18110
18182
  };
@@ -20678,7 +20750,7 @@ var TIME_INTERVALS = [
20678
20750
  ["daily", 24 * 60 * 60 * 1000],
20679
20751
  ["monthly", 30 * 24 * 60 * 60 * 1000],
20680
20752
  ["quarterly", 3 * 30 * 24 * 60 * 60 * 1000],
20681
- ["yearly", 12 * 30 * 24 * 60 * 60 * 1000],
20753
+ ["yearly", 12 * 30 * 24 * 60 * 60 * 1000]
20682
20754
  ];
20683
20755
  // Return true if the tick is a primary tick, false otherwise
20684
20756
  function isTickPrimary(tick, i, interval, showDayName) {
@@ -20748,7 +20820,7 @@ function getTimeformats(timestamp) {
20748
20820
  d: date.getDate(),
20749
20821
  H: date.getHours(),
20750
20822
  m: date.getMinutes(),
20751
- s: date.getSeconds(),
20823
+ s: date.getSeconds() // seconds: 0-59
20752
20824
  };
20753
20825
  }
20754
20826
  // Find the differences between consecutive numbers in an array
@@ -20904,7 +20976,7 @@ var threshold_Threshold = /** @class */ (function (_super) {
20904
20976
  if (scaleType === ScaleTypes.TIME) {
20905
20977
  var isVertical = [
20906
20978
  AxisPositions.LEFT,
20907
- AxisPositions.RIGHT,
20979
+ AxisPositions.RIGHT
20908
20980
  ].includes(axisPosition);
20909
20981
  var mainXScale = this.services.cartesianScales.getMainXScale();
20910
20982
  var mainYScale = this.services.cartesianScales.getMainYScale();
@@ -20935,20 +21007,20 @@ var threshold_Threshold = /** @class */ (function (_super) {
20935
21007
  // Find out whether threshold label should be shown on the left or right side
20936
21008
  var bestPlacementOption = this.positionService.findBestPlacementAt({
20937
21009
  left: mouseRelativePos[0],
20938
- top: mouseRelativePos[1],
21010
+ top: mouseRelativePos[1]
20939
21011
  }, target, [
20940
21012
  PLACEMENTS.RIGHT,
20941
21013
  PLACEMENTS.LEFT,
20942
21014
  PLACEMENTS.TOP,
20943
- PLACEMENTS.BOTTOM,
21015
+ PLACEMENTS.BOTTOM
20944
21016
  ], function () { return ({
20945
21017
  width: holder.offsetWidth,
20946
- height: holder.offsetHeight,
21018
+ height: holder.offsetHeight
20947
21019
  }); });
20948
21020
  // Get coordinates to where label should be positioned
20949
21021
  var pos = this.positionService.findPositionAt({
20950
21022
  left: mouseRelativePos[0],
20951
- top: mouseRelativePos[1],
21023
+ top: mouseRelativePos[1]
20952
21024
  }, target, bestPlacementOption);
20953
21025
  this.positionService.setElement(target, pos);
20954
21026
  };
@@ -20959,13 +21031,13 @@ var threshold_Threshold = /** @class */ (function (_super) {
20959
21031
  .on("mouseover mousemove", function () {
20960
21032
  self.threshold.classed("active", true);
20961
21033
  self.services.events.dispatchEvent(Events.Threshold.SHOW, {
20962
- hoveredElement: src_select(self.threshold),
21034
+ hoveredElement: src_select(self.threshold)
20963
21035
  });
20964
21036
  })
20965
21037
  .on("mouseout", function () {
20966
21038
  self.threshold.classed("active", false);
20967
21039
  self.services.events.dispatchEvent(Events.Threshold.HIDE, {
20968
- hoveredElement: src_select(self.threshold),
21040
+ hoveredElement: src_select(self.threshold)
20969
21041
  });
20970
21042
  });
20971
21043
  };
@@ -21033,12 +21105,12 @@ var title_Title = /** @class */ (function (_super) {
21033
21105
  .on("mouseenter", function () {
21034
21106
  self_1.services.events.dispatchEvent(Events.Tooltip.SHOW, {
21035
21107
  hoveredElement: title,
21036
- type: TooltipTypes.TITLE,
21108
+ type: TooltipTypes.TITLE
21037
21109
  });
21038
21110
  })
21039
21111
  .on("mouseout", function () {
21040
21112
  self_1.services.events.dispatchEvent(Events.Tooltip.HIDE, {
21041
- hoveredElement: title,
21113
+ hoveredElement: title
21042
21114
  });
21043
21115
  });
21044
21116
  }
@@ -21125,8 +21197,8 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
21125
21197
  tools_Tools.getProperty(_this.model.getOptions(), "tooltip", "datapoint", "enabled")) ||
21126
21198
  (e.detail.type === TooltipTypes.GRIDLINE &&
21127
21199
  tools_Tools.getProperty(_this.model.getOptions(), "tooltip", "gridline", "enabled")) ||
21128
- (e.detail.type === TooltipTypes.LEGEND) ||
21129
- (e.detail.type === TooltipTypes.AXISLABEL)) {
21200
+ e.detail.type === TooltipTypes.LEGEND ||
21201
+ e.detail.type === TooltipTypes.AXISLABEL) {
21130
21202
  var data = src_select(on_event.target).datum();
21131
21203
  // Generate default tooltip
21132
21204
  var defaultHTML = void 0;
@@ -21230,7 +21302,7 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
21230
21302
  left: elementPosition.left -
21231
21303
  holderPosition.left +
21232
21304
  elementPosition.width / 2,
21233
- top: elementPosition.top - holderPosition.top - verticalOffset,
21305
+ top: elementPosition.top - holderPosition.top - verticalOffset
21234
21306
  };
21235
21307
  return { placement: TooltipPosition.BOTTOM, position: tooltipPos };
21236
21308
  };
@@ -21251,15 +21323,15 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
21251
21323
  // Find out whether tooltip should be shown on the left or right side
21252
21324
  var bestPlacementOption = this.positionService.findBestPlacementAt({
21253
21325
  left: mouseRelativePos[0],
21254
- top: mouseRelativePos[1],
21326
+ top: mouseRelativePos[1]
21255
21327
  }, target, [
21256
21328
  PLACEMENTS.RIGHT,
21257
21329
  PLACEMENTS.LEFT,
21258
21330
  PLACEMENTS.TOP,
21259
- PLACEMENTS.BOTTOM,
21331
+ PLACEMENTS.BOTTOM
21260
21332
  ], function () { return ({
21261
21333
  width: holder.offsetWidth,
21262
- height: holder.offsetHeight,
21334
+ height: holder.offsetHeight
21263
21335
  }); });
21264
21336
  var horizontalOffset = this.model.getOptions().tooltip.datapoint.horizontalOffset;
21265
21337
  if (bestPlacementOption === PLACEMENTS.LEFT) {
@@ -21268,7 +21340,7 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
21268
21340
  // Get coordinates to where tooltip should be positioned
21269
21341
  pos = this.positionService.findPositionAt({
21270
21342
  left: mouseRelativePos[0] + horizontalOffset,
21271
- top: mouseRelativePos[1],
21343
+ top: mouseRelativePos[1]
21272
21344
  }, target, bestPlacementOption);
21273
21345
  }
21274
21346
  this.positionService.setElement(target, pos);
@@ -21320,8 +21392,8 @@ var tooltip_bar_TooltipBar = /** @class */ (function (_super) {
21320
21392
  tools_Tools.getProperty(_this.model.getOptions(), "tooltip", "datapoint", "enabled")) ||
21321
21393
  (e.detail.type === TooltipTypes.GRIDLINE &&
21322
21394
  tools_Tools.getProperty(_this.model.getOptions(), "tooltip", "gridline", "enabled")) ||
21323
- (e.detail.type === TooltipTypes.LEGEND) ||
21324
- (e.detail.type === TooltipTypes.AXISLABEL)) {
21395
+ e.detail.type === TooltipTypes.LEGEND ||
21396
+ e.detail.type === TooltipTypes.AXISLABEL) {
21325
21397
  var data = e.detail.hoveredElement.datum();
21326
21398
  var hoveredElement = e.detail.hoveredElement.node();
21327
21399
  var defaultHTML = void 0;
@@ -21349,7 +21421,8 @@ var tooltip_bar_TooltipBar = /** @class */ (function (_super) {
21349
21421
  // default tooltip
21350
21422
  tooltipTextContainer.html(defaultHTML);
21351
21423
  }
21352
- if ((e.detail.type === TooltipTypes.LEGEND) || (e.detail.type === TooltipTypes.AXISLABEL)) {
21424
+ if (e.detail.type === TooltipTypes.LEGEND ||
21425
+ e.detail.type === TooltipTypes.AXISLABEL) {
21353
21426
  _this.positionTooltip();
21354
21427
  }
21355
21428
  else {
@@ -21400,7 +21473,7 @@ var tooltip_bar_TooltipBar = /** @class */ (function (_super) {
21400
21473
  left: barPosition.left -
21401
21474
  holderPosition.left +
21402
21475
  barPosition.width / 2,
21403
- top: barPosition.bottom - holderPosition.top + verticalOffset,
21476
+ top: barPosition.bottom - holderPosition.top + verticalOffset
21404
21477
  };
21405
21478
  return { placement: TooltipPosition.BOTTOM, position: tooltipPos };
21406
21479
  }
@@ -21410,7 +21483,7 @@ var tooltip_bar_TooltipBar = /** @class */ (function (_super) {
21410
21483
  left: barPosition.left -
21411
21484
  holderPosition.left +
21412
21485
  barPosition.width / 2,
21413
- top: barPosition.top - holderPosition.top - verticalOffset,
21486
+ top: barPosition.top - holderPosition.top - verticalOffset
21414
21487
  };
21415
21488
  return { placement: TooltipPosition.TOP, position: tooltipPos };
21416
21489
  }
@@ -21426,9 +21499,10 @@ var tooltip_bar_TooltipBar = /** @class */ (function (_super) {
21426
21499
  else if (type === TooltipTypes.AXISLABEL) {
21427
21500
  return "<div class=\"axis-tooltip\"><p class=\"label\">" + data + "</p></div>";
21428
21501
  }
21502
+ var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
21429
21503
  var formattedValue = tools_Tools.getProperty(this.model.getOptions(), "tooltip", "valueFormatter")
21430
21504
  ? this.model.getOptions().tooltip.valueFormatter(data.value)
21431
- : data.value.toLocaleString("en");
21505
+ : data[rangeIdentifier].toLocaleString("en");
21432
21506
  return "<div class=\"datapoint-tooltip\"><p class=\"value\">" + formattedValue + "</p></div>";
21433
21507
  };
21434
21508
  /**
@@ -22057,11 +22131,13 @@ var area_stacked_StackedArea = /** @class */ (function (_super) {
22057
22131
  _this.type = "area-stacked";
22058
22132
  _this.handleLegendOnHover = function (event) {
22059
22133
  var hoveredElement = event.detail.hoveredElement;
22134
+ var options = _this.model.getOptions();
22135
+ var groupMapsTo = options.data.groupMapsTo;
22060
22136
  _this.parent
22061
22137
  .selectAll("path.area")
22062
22138
  .transition(_this.services.transitions.getTransition("legend-hover-area"))
22063
22139
  .attr("opacity", function (d) {
22064
- if (d[0].group !== hoveredElement.datum().name) {
22140
+ if (d[0][groupMapsTo] !== hoveredElement.datum().name) {
22065
22141
  return configuration_area.opacity.unselected;
22066
22142
  }
22067
22143
  return configuration_area.opacity.selected;
@@ -22087,6 +22163,7 @@ var area_stacked_StackedArea = /** @class */ (function (_super) {
22087
22163
  var svg = this.getContainerSVG();
22088
22164
  var self = this;
22089
22165
  var options = this.model.getOptions();
22166
+ var groupMapsTo = options.data.groupMapsTo;
22090
22167
  var mainXScale = this.services.cartesianScales.getMainXScale();
22091
22168
  var mainYScale = this.services.cartesianScales.getMainYScale();
22092
22169
  var domainAxisPosition = this.services.cartesianScales.getDomainAxisPosition();
@@ -22095,13 +22172,11 @@ var area_stacked_StackedArea = /** @class */ (function (_super) {
22095
22172
  if (!isTimeSeries) {
22096
22173
  return;
22097
22174
  }
22098
- var percentage = Object.keys(options.axes).some(function (axis) {
22099
- return options.axes[axis].percentage;
22100
- });
22175
+ var percentage = Object.keys(options.axes).some(function (axis) { return options.axes[axis].percentage; });
22101
22176
  var stackedData = this.model.getStackedData({ percentage: percentage });
22102
22177
  var areas = svg
22103
22178
  .selectAll("path.area")
22104
- .data(stackedData, function (d) { return d[0].group; });
22179
+ .data(stackedData, function (d) { return d[0][groupMapsTo]; });
22105
22180
  // D3 area generator function
22106
22181
  this.areaGenerator = src_area()
22107
22182
  // @ts-ignore
@@ -22113,8 +22188,8 @@ var area_stacked_StackedArea = /** @class */ (function (_super) {
22113
22188
  var enteringAreas = areas.enter().append("path").attr("opacity", 0);
22114
22189
  enteringAreas
22115
22190
  .merge(areas)
22116
- .data(stackedData, function (d) { return d[0].group; })
22117
- .attr("fill", function (d) { return self.model.getFillColor(d[0].group); })
22191
+ .data(stackedData, function (d) { return d[0][groupMapsTo]; })
22192
+ .attr("fill", function (d) { return self.model.getFillColor(d[0][groupMapsTo]); })
22118
22193
  .attr("role", Roles.GRAPHICS_SYMBOL)
22119
22194
  .attr("aria-roledescription", "area")
22120
22195
  .transition(this.services.transitions.getTransition("area-update-enter", animate))
@@ -22281,25 +22356,25 @@ var bar_simple_SimpleBar = /** @class */ (function (_super) {
22281
22356
  // Dispatch mouse event
22282
22357
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {
22283
22358
  element: hoveredElement,
22284
- datum: datum,
22359
+ datum: datum
22285
22360
  });
22286
22361
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
22287
22362
  hoveredElement: hoveredElement,
22288
- type: TooltipTypes.DATAPOINT,
22363
+ type: TooltipTypes.DATAPOINT
22289
22364
  });
22290
22365
  })
22291
22366
  .on("mousemove", function (datum) {
22292
22367
  // Dispatch mouse event
22293
22368
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {
22294
22369
  element: src_select(this),
22295
- datum: datum,
22370
+ datum: datum
22296
22371
  });
22297
22372
  })
22298
22373
  .on("click", function (datum) {
22299
22374
  // Dispatch mouse event
22300
22375
  self.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {
22301
22376
  element: src_select(this),
22302
- datum: datum,
22377
+ datum: datum
22303
22378
  });
22304
22379
  })
22305
22380
  .on("mouseout", function (datum) {
@@ -22313,11 +22388,11 @@ var bar_simple_SimpleBar = /** @class */ (function (_super) {
22313
22388
  // Dispatch mouse event
22314
22389
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {
22315
22390
  element: hoveredElement,
22316
- datum: datum,
22391
+ datum: datum
22317
22392
  });
22318
22393
  // Hide tooltip
22319
22394
  self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
22320
- hoveredElement: hoveredElement,
22395
+ hoveredElement: hoveredElement
22321
22396
  });
22322
22397
  });
22323
22398
  };
@@ -22487,26 +22562,26 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
22487
22562
  // Dispatch mouse event
22488
22563
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {
22489
22564
  element: hoveredElement,
22490
- datum: datum,
22565
+ datum: datum
22491
22566
  });
22492
22567
  // Show tooltip
22493
22568
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
22494
22569
  hoveredElement: hoveredElement,
22495
- type: TooltipTypes.DATAPOINT,
22570
+ type: TooltipTypes.DATAPOINT
22496
22571
  });
22497
22572
  })
22498
22573
  .on("mousemove", function (datum) {
22499
22574
  // Dispatch mouse event
22500
22575
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEMOVE, {
22501
22576
  element: src_select(this),
22502
- datum: datum,
22577
+ datum: datum
22503
22578
  });
22504
22579
  })
22505
22580
  .on("click", function (datum) {
22506
22581
  // Dispatch mouse event
22507
22582
  self.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {
22508
22583
  element: src_select(this),
22509
- datum: datum,
22584
+ datum: datum
22510
22585
  });
22511
22586
  })
22512
22587
  .on("mouseout", function (datum) {
@@ -22521,11 +22596,11 @@ var bar_grouped_GroupedBar = /** @class */ (function (_super) {
22521
22596
  // Dispatch mouse event
22522
22597
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {
22523
22598
  element: hoveredElement,
22524
- datum: datum,
22599
+ datum: datum
22525
22600
  });
22526
22601
  // Hide tooltip
22527
22602
  self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
22528
- hoveredElement: hoveredElement,
22603
+ hoveredElement: hoveredElement
22529
22604
  });
22530
22605
  });
22531
22606
  };
@@ -22736,7 +22811,7 @@ var bar_stacked_StackedBar = /** @class */ (function (_super) {
22736
22811
  // Dispatch mouse event
22737
22812
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOVER, {
22738
22813
  element: hoveredElement,
22739
- datum: datum,
22814
+ datum: datum
22740
22815
  });
22741
22816
  })
22742
22817
  .on("mousemove", function (datum) {
@@ -22763,14 +22838,14 @@ var bar_stacked_StackedBar = /** @class */ (function (_super) {
22763
22838
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
22764
22839
  hoveredElement: hoveredElement,
22765
22840
  data: matchingDataPoint,
22766
- type: TooltipTypes.DATAPOINT,
22841
+ type: TooltipTypes.DATAPOINT
22767
22842
  });
22768
22843
  })
22769
22844
  .on("click", function (datum) {
22770
22845
  // Dispatch mouse event
22771
22846
  self.services.events.dispatchEvent(Events.Bar.BAR_CLICK, {
22772
22847
  element: src_select(this),
22773
- datum: datum,
22848
+ datum: datum
22774
22849
  });
22775
22850
  })
22776
22851
  .on("mouseout", function (datum) {
@@ -22784,11 +22859,11 @@ var bar_stacked_StackedBar = /** @class */ (function (_super) {
22784
22859
  // Dispatch mouse event
22785
22860
  self.services.events.dispatchEvent(Events.Bar.BAR_MOUSEOUT, {
22786
22861
  element: hoveredElement,
22787
- datum: datum,
22862
+ datum: datum
22788
22863
  });
22789
22864
  // Hide tooltip
22790
22865
  self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
22791
- hoveredElement: hoveredElement,
22866
+ hoveredElement: hoveredElement
22792
22867
  });
22793
22868
  });
22794
22869
  };
@@ -22887,9 +22962,7 @@ var scatter_Scatter = /** @class */ (function (_super) {
22887
22962
  var stacked = this.configs.stacked;
22888
22963
  var scatterData;
22889
22964
  if (stacked) {
22890
- var percentage = Object.keys(options.axes).some(function (axis) {
22891
- return options.axes[axis].percentage;
22892
- });
22965
+ var percentage = Object.keys(options.axes).some(function (axis) { return options.axes[axis].percentage; });
22893
22966
  scatterData = this.model.getStackedData({ percentage: percentage });
22894
22967
  }
22895
22968
  else {
@@ -23019,7 +23092,7 @@ var scatter_Scatter = /** @class */ (function (_super) {
23019
23092
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
23020
23093
  hoveredElement: hoveredElement,
23021
23094
  multidata: overlappingData.length > 1 ? overlappingData : null,
23022
- type: TooltipTypes.DATAPOINT,
23095
+ type: TooltipTypes.DATAPOINT
23023
23096
  });
23024
23097
  var eventNameToDispatch = on_event.type === "mouseover"
23025
23098
  ? Events.Scatter.SCATTER_MOUSEOVER
@@ -23027,14 +23100,14 @@ var scatter_Scatter = /** @class */ (function (_super) {
23027
23100
  // Dispatch mouse event
23028
23101
  self.services.events.dispatchEvent(eventNameToDispatch, {
23029
23102
  element: hoveredElement,
23030
- datum: datum,
23103
+ datum: datum
23031
23104
  });
23032
23105
  })
23033
23106
  .on("click", function (datum) {
23034
23107
  // Dispatch mouse event
23035
23108
  self.services.events.dispatchEvent(Events.Scatter.SCATTER_CLICK, {
23036
23109
  element: src_select(this),
23037
- datum: datum,
23110
+ datum: datum
23038
23111
  });
23039
23112
  })
23040
23113
  .on("mouseout", function (datum) {
@@ -23046,11 +23119,11 @@ var scatter_Scatter = /** @class */ (function (_super) {
23046
23119
  // Dispatch mouse event
23047
23120
  self.services.events.dispatchEvent(Events.Scatter.SCATTER_MOUSEOUT, {
23048
23121
  element: hoveredElement,
23049
- datum: datum,
23122
+ datum: datum
23050
23123
  });
23051
23124
  // Hide tooltip
23052
23125
  self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
23053
- hoveredElement: hoveredElement,
23126
+ hoveredElement: hoveredElement
23054
23127
  });
23055
23128
  });
23056
23129
  };
@@ -23228,18 +23301,22 @@ var line_Line = /** @class */ (function (_super) {
23228
23301
  });
23229
23302
  var data = [];
23230
23303
  if (this.configs.stacked) {
23231
- var percentage = Object.keys(options.axes).some(function (axis) {
23232
- return options.axes[axis].percentage;
23233
- });
23304
+ var percentage = Object.keys(options.axes).some(function (axis) { return options.axes[axis].percentage; });
23305
+ var groupMapsTo_1 = options.data.groupMapsTo;
23234
23306
  var stackedData = this.model.getStackedData({ percentage: percentage });
23307
+ var domainIdentifier_1 = this.services.cartesianScales.getDomainIdentifier();
23308
+ var rangeIdentifier_1 = this.services.cartesianScales.getRangeIdentifier();
23235
23309
  data = stackedData.map(function (d) { return ({
23236
- name: d[0].group,
23237
- data: d.map(function (datum) { return ({
23238
- date: datum.data.sharedStackKey,
23239
- group: datum.group,
23240
- value: datum[1],
23241
- }); }),
23242
- hidden: !tools_Tools.some(d, function (datum) { return datum[0] !== datum[1]; }),
23310
+ name: d[0][groupMapsTo_1],
23311
+ data: d.map(function (datum) {
23312
+ var _a;
23313
+ return (_a = {},
23314
+ _a[domainIdentifier_1] = datum.data.sharedStackKey,
23315
+ _a[groupMapsTo_1] = datum[groupMapsTo_1],
23316
+ _a[rangeIdentifier_1] = datum[1],
23317
+ _a);
23318
+ }),
23319
+ hidden: !tools_Tools.some(d, function (datum) { return datum[0] !== datum[1]; })
23243
23320
  }); });
23244
23321
  }
23245
23322
  else {
@@ -23331,14 +23408,12 @@ var scatter_stacked_StackedScatter = /** @class */ (function (_super) {
23331
23408
  var groupMapsTo = options.data.groupMapsTo;
23332
23409
  var domainIdentifier = this.services.cartesianScales.getDomainIdentifier();
23333
23410
  var rangeIdentifier = this.services.cartesianScales.getRangeIdentifier();
23334
- var percentage = Object.keys(options.axes).some(function (axis) {
23335
- return options.axes[axis].percentage;
23336
- });
23411
+ var percentage = Object.keys(options.axes).some(function (axis) { return options.axes[axis].percentage; });
23337
23412
  var stackedData = this.model.getStackedData({ percentage: percentage });
23338
23413
  // Update data on dot groups
23339
23414
  var circleGroups = svg
23340
23415
  .selectAll("g.dots")
23341
- .data(stackedData, function (d) { return d[0].group; });
23416
+ .data(stackedData, function (d) { return d[0][groupMapsTo]; });
23342
23417
  // Remove dot groups that need to be removed
23343
23418
  circleGroups.exit().attr("opacity", 0).remove();
23344
23419
  // Add the dot groups that need to be introduced
@@ -23958,12 +24033,12 @@ var pie_Pie = /** @class */ (function (_super) {
23958
24033
  if (direction === CalloutDirections.RIGHT) {
23959
24034
  d.startPos = {
23960
24035
  x: xPosition,
23961
- y: yPosition + d.textOffsetY,
24036
+ y: yPosition + d.textOffsetY
23962
24037
  };
23963
24038
  // end position for the callout line
23964
24039
  d.endPos = {
23965
24040
  x: xPosition + options.pie.callout.offsetX,
23966
- y: yPosition - options.pie.callout.offsetY + d.textOffsetY,
24041
+ y: yPosition - options.pie.callout.offsetY + d.textOffsetY
23967
24042
  };
23968
24043
  // the intersection point of the vertical and horizontal line
23969
24044
  d.intersectPointX =
@@ -23973,12 +24048,12 @@ var pie_Pie = /** @class */ (function (_super) {
23973
24048
  // start position for the callout line
23974
24049
  d.startPos = {
23975
24050
  x: xPosition,
23976
- y: yPosition + d.textOffsetY,
24051
+ y: yPosition + d.textOffsetY
23977
24052
  };
23978
24053
  // end position for the callout line should be bottom aligned to the title
23979
24054
  d.endPos = {
23980
24055
  x: xPosition - options.pie.callout.offsetX,
23981
- y: yPosition - options.pie.callout.offsetY + d.textOffsetY,
24056
+ y: yPosition - options.pie.callout.offsetY + d.textOffsetY
23982
24057
  };
23983
24058
  // the intersection point of the vertical and horizontal line
23984
24059
  d.intersectPointX =
@@ -24024,7 +24099,7 @@ var pie_Pie = /** @class */ (function (_super) {
24024
24099
  // Dispatch mouse event
24025
24100
  self.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOVER, {
24026
24101
  element: src_select(this),
24027
- datum: datum,
24102
+ datum: datum
24028
24103
  });
24029
24104
  })
24030
24105
  .on("mousemove", function (datum) {
@@ -24036,19 +24111,19 @@ var pie_Pie = /** @class */ (function (_super) {
24036
24111
  // Dispatch mouse event
24037
24112
  self.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEMOVE, {
24038
24113
  element: hoveredElement,
24039
- datum: datum,
24114
+ datum: datum
24040
24115
  });
24041
24116
  // Show tooltip
24042
24117
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
24043
24118
  hoveredElement: hoveredElement,
24044
- type: TooltipTypes.DATAPOINT,
24119
+ type: TooltipTypes.DATAPOINT
24045
24120
  });
24046
24121
  })
24047
24122
  .on("click", function (datum) {
24048
24123
  // Dispatch mouse event
24049
24124
  self.services.events.dispatchEvent(Events.Pie.SLICE_CLICK, {
24050
24125
  element: src_select(this),
24051
- datum: datum,
24126
+ datum: datum
24052
24127
  });
24053
24128
  })
24054
24129
  .on("mouseout", function (datum) {
@@ -24060,11 +24135,11 @@ var pie_Pie = /** @class */ (function (_super) {
24060
24135
  // Dispatch mouse event
24061
24136
  self.services.events.dispatchEvent(Events.Pie.SLICE_MOUSEOUT, {
24062
24137
  element: hoveredElement,
24063
- datum: datum,
24138
+ datum: datum
24064
24139
  });
24065
24140
  // Hide tooltip
24066
24141
  self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
24067
- hoveredElement: hoveredElement,
24142
+ hoveredElement: hoveredElement
24068
24143
  });
24069
24144
  });
24070
24145
  };
@@ -24072,7 +24147,7 @@ var pie_Pie = /** @class */ (function (_super) {
24072
24147
  Pie.prototype.computeRadius = function () {
24073
24148
  var options = this.model.getOptions();
24074
24149
  var _a = dom_utils_DOMUtils.getSVGElementSize(this.parent, {
24075
- useAttrs: true,
24150
+ useAttrs: true
24076
24151
  }), width = _a.width, height = _a.height;
24077
24152
  var radius = Math.min(width, height) / 2;
24078
24153
  return radius + options.pie.radiusOffset;
@@ -24278,15 +24353,16 @@ var gauge_Gauge = /** @class */ (function (_super) {
24278
24353
  ? tools_Tools.getProperty(options, "gauge", "deltaFontSize")
24279
24354
  : function () { return 0; };
24280
24355
  // use numberFormatter here only if there is a delta supplied
24281
- var numberFormatter = delta ? tools_Tools.getProperty(options, "gauge", "numberFormatter") : function () { return null; };
24356
+ var numberFormatter = delta
24357
+ ? tools_Tools.getProperty(options, "gauge", "numberFormatter")
24358
+ : function () { return null; };
24282
24359
  var arrowSize = tools_Tools.getProperty(options, "gauge", "deltaArrow", "size");
24283
24360
  var numberSpacing = tools_Tools.getProperty(options, "gauge", "numberSpacing");
24284
24361
  var numbersGroup = dom_utils_DOMUtils.appendOrSelect(svg, "g.gauge-numbers");
24285
24362
  // Add the smaller number of the delta
24286
24363
  var deltaGroup = dom_utils_DOMUtils.appendOrSelect(numbersGroup, "g.gauge-delta").attr("transform", "translate(0, " + (deltaFontSize(radius) + numberSpacing) + ")");
24287
24364
  var deltaNumber = dom_utils_DOMUtils.appendOrSelect(deltaGroup, "text.gauge-delta-number");
24288
- deltaNumber
24289
- .data(delta === null ? [] : [delta]);
24365
+ deltaNumber.data(delta === null ? [] : [delta]);
24290
24366
  deltaNumber
24291
24367
  .enter()
24292
24368
  .append("text")
@@ -24518,7 +24594,7 @@ var skeleton_Skeleton = /** @class */ (function (_super) {
24518
24594
  var svg = this.parent;
24519
24595
  var parent = svg.node().parentNode;
24520
24596
  var _a = dom_utils_DOMUtils.getSVGElementSize(parent, {
24521
- useAttrs: true,
24597
+ useAttrs: true
24522
24598
  }), width = _a.width, height = _a.height;
24523
24599
  svg.attr("width", width).attr("height", height);
24524
24600
  var isDataEmpty = this.model.isDataEmpty();
@@ -24597,7 +24673,7 @@ var skeleton_Skeleton = /** @class */ (function (_super) {
24597
24673
  var svg = this.parent;
24598
24674
  var parent = svg.node().parentNode;
24599
24675
  var _a = dom_utils_DOMUtils.getSVGElementSize(parent, {
24600
- useAttrs: true,
24676
+ useAttrs: true
24601
24677
  }), width = _a.width, height = _a.height;
24602
24678
  this.backdrop = dom_utils_DOMUtils.appendOrSelect(svg, "svg.chart-skeleton.DAII")
24603
24679
  .attr("width", width)
@@ -24704,7 +24780,7 @@ var skeleton_Skeleton = /** @class */ (function (_super) {
24704
24780
  var stopShimmerClass = "stop-shimmer";
24705
24781
  var container = this.parent.select(".chart-skeleton");
24706
24782
  var width = dom_utils_DOMUtils.getSVGElementSize(this.parent, {
24707
- useAttrs: true,
24783
+ useAttrs: true
24708
24784
  }).width;
24709
24785
  var startPoint = 0;
24710
24786
  var endPoint = width;
@@ -25305,10 +25381,10 @@ var layout_LayoutComponent = /** @class */ (function (_super) {
25305
25381
  // Get parent SVG to render inside of
25306
25382
  var svg = this.parent;
25307
25383
  var _a = dom_utils_DOMUtils.getSVGElementSize(svg, {
25308
- useAttrs: true,
25384
+ useAttrs: true
25309
25385
  }), width = _a.width, height = _a.height;
25310
25386
  var root = hierarchy({
25311
- children: this.children,
25387
+ children: this.children
25312
25388
  }).sum(function (d) { return d.size; });
25313
25389
  // Grab the correct treemap tile function based on direction
25314
25390
  var tileType = this.configs.direction === LayoutDirection.ROW ||
@@ -25354,6 +25430,12 @@ var layout_LayoutComponent = /** @class */ (function (_super) {
25354
25430
  // Calculate preffered children sizes after internal rendering
25355
25431
  var growth = tools_Tools.getProperty(d, "data", "growth", "x");
25356
25432
  var matchingSVGDimensions = dom_utils_DOMUtils.getSVGElementSize(src_select(this), { useBBox: true });
25433
+ if (d.data.id === "legend") {
25434
+ var svgSize = dom_utils_DOMUtils.getSVGElementSize(src_select(this), { useAttrs: true });
25435
+ if (svgSize.height < 40) {
25436
+ matchingSVGDimensions.height = svgSize.height;
25437
+ }
25438
+ }
25357
25439
  if (growth === LayoutGrowth.PREFERRED) {
25358
25440
  var matchingSVGWidth = horizontal
25359
25441
  ? matchingSVGDimensions.width
@@ -25377,7 +25459,7 @@ var layout_LayoutComponent = /** @class */ (function (_super) {
25377
25459
  // Pass children data to the hierarchy layout
25378
25460
  // And calculate sum of sizes
25379
25461
  root = hierarchy({
25380
- children: this.children,
25462
+ children: this.children
25381
25463
  }).sum(function (d) { return d.size; });
25382
25464
  // Compute the position of all elements within the layout
25383
25465
  src_treemap().tile(tileType).size([width, height]).padding(0)(root);
@@ -25664,7 +25746,7 @@ var axis_Axis = /** @class */ (function (_super) {
25664
25746
  var timeScaleOptions = tools_Tools.getProperty(options, "timeScale");
25665
25747
  var svg = this.getContainerSVG();
25666
25748
  var _a = dom_utils_DOMUtils.getSVGElementSize(this.parent, {
25667
- useAttrs: true,
25749
+ useAttrs: true
25668
25750
  }), width = _a.width, height = _a.height;
25669
25751
  var startPosition, endPosition;
25670
25752
  if (axisPosition === AxisPositions.BOTTOM ||
@@ -25722,7 +25804,7 @@ var axis_Axis = /** @class */ (function (_super) {
25722
25804
  var fakeTick = dom_utils_DOMUtils.appendOrSelect(invisibleAxisRef, "g.tick");
25723
25805
  var fakeTickText = dom_utils_DOMUtils.appendOrSelect(fakeTick, "text").text("0");
25724
25806
  var tickHeight = dom_utils_DOMUtils.getSVGElementSize(fakeTickText.node(), {
25725
- useBBox: true,
25807
+ useBBox: true
25726
25808
  }).height;
25727
25809
  fakeTick.remove();
25728
25810
  var isTimeScaleType = this.scaleType === ScaleTypes.TIME ||
@@ -25753,13 +25835,15 @@ var axis_Axis = /** @class */ (function (_super) {
25753
25835
  axis.tickValues([]);
25754
25836
  }
25755
25837
  else {
25756
- var tickValues = scale
25757
- .nice(numberOfTicks)
25758
- .ticks(numberOfTicks);
25838
+ var addSpaceOnEdges = tools_Tools.getProperty(options, "timeScale", "addSpaceOnEdges");
25839
+ var tickValues = void 0;
25840
+ if (addSpaceOnEdges) {
25841
+ tickValues = scale.nice(numberOfTicks);
25842
+ }
25843
+ tickValues = scale.ticks(numberOfTicks);
25759
25844
  // Remove labels on the edges
25760
25845
  // If there are more than 2 labels to show
25761
- if (tools_Tools.getProperty(options, "timeScale", "addSpaceOnEdges") &&
25762
- tickValues.length > 2) {
25846
+ if (addSpaceOnEdges && tickValues.length > 2) {
25763
25847
  tickValues.splice(tickValues.length - 1, 1);
25764
25848
  tickValues.splice(0, 1);
25765
25849
  }
@@ -25839,7 +25923,7 @@ var axis_Axis = /** @class */ (function (_super) {
25839
25923
  break;
25840
25924
  case AxisPositions.TOP:
25841
25925
  var titleHeight = dom_utils_DOMUtils.getSVGElementSize(axisTitleRef, {
25842
- useBBox: true,
25926
+ useBBox: true
25843
25927
  }).height;
25844
25928
  axisTitleRef
25845
25929
  .attr("transform", "translate(" + (this.margins.left / 2 + scale.range()[1] / 2) + ", " + titleHeight / 2 + ")")
@@ -25929,14 +26013,15 @@ var axis_Axis = /** @class */ (function (_super) {
25929
26013
  }
25930
26014
  // truncate the label if it's too long
25931
26015
  // only applies to discrete type
25932
- if (truncationType !== TruncationTypes.NONE && axisScaleType === ScaleTypes.LABELS) {
26016
+ if (truncationType !== TruncationTypes.NONE &&
26017
+ axisScaleType === ScaleTypes.LABELS) {
25933
26018
  var dataGroups = this.model.getDataValuesGroupedByKeys();
25934
26019
  if (dataGroups.length > 0) {
25935
26020
  var activeDataGroups = dataGroups.map(function (d) { return d.sharedStackKey; });
25936
- var tick_html = svg.select("g.axis." + axisPosition + " g.ticks g.tick").html();
25937
- container
25938
- .selectAll("g.ticks g.tick")
25939
- .html(tick_html);
26021
+ var tick_html = svg
26022
+ .select("g.axis." + axisPosition + " g.ticks g.tick")
26023
+ .html();
26024
+ container.selectAll("g.ticks g.tick").html(tick_html);
25940
26025
  container
25941
26026
  .selectAll("g.tick text")
25942
26027
  .data(activeDataGroups)
@@ -25962,9 +26047,7 @@ var axis_Axis = /** @class */ (function (_super) {
25962
26047
  container
25963
26048
  .selectAll("g.ticks")
25964
26049
  .html(this.getInvisibleAxisRef().html());
25965
- container
25966
- .selectAll("g.tick text")
25967
- .data(activeDataGroups);
26050
+ container.selectAll("g.tick text").data(activeDataGroups);
25968
26051
  }
25969
26052
  }
25970
26053
  // Add event listeners to elements drawn
@@ -25987,19 +26070,20 @@ var axis_Axis = /** @class */ (function (_super) {
25987
26070
  // Dispatch mouse event
25988
26071
  self.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOVER, {
25989
26072
  element: src_select(this),
25990
- datum: datum,
26073
+ datum: datum
25991
26074
  });
25992
26075
  })
25993
26076
  .on("mousemove", function (datum) {
25994
26077
  // Dispatch mouse event
25995
26078
  self.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEMOVE, {
25996
26079
  element: src_select(this),
25997
- datum: datum,
26080
+ datum: datum
25998
26081
  });
25999
- if (axisScaleType === ScaleTypes.LABELS && datum.length > truncationThreshold) {
26082
+ if (axisScaleType === ScaleTypes.LABELS &&
26083
+ datum.length > truncationThreshold) {
26000
26084
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
26001
26085
  hoveredElement: src_select(this),
26002
- type: TooltipTypes.AXISLABEL,
26086
+ type: TooltipTypes.AXISLABEL
26003
26087
  });
26004
26088
  }
26005
26089
  })
@@ -26007,14 +26091,14 @@ var axis_Axis = /** @class */ (function (_super) {
26007
26091
  // Dispatch mouse event
26008
26092
  self.services.events.dispatchEvent(Events.Axis.LABEL_CLICK, {
26009
26093
  element: src_select(this),
26010
- datum: datum,
26094
+ datum: datum
26011
26095
  });
26012
26096
  })
26013
26097
  .on("mouseout", function (datum) {
26014
26098
  // Dispatch mouse event
26015
26099
  self.services.events.dispatchEvent(Events.Axis.LABEL_MOUSEOUT, {
26016
26100
  element: src_select(this),
26017
- datum: datum,
26101
+ datum: datum
26018
26102
  });
26019
26103
  if (axisScaleType === ScaleTypes.LABELS) {
26020
26104
  self.services.events.dispatchEvent(Events.Tooltip.HIDE);
@@ -26091,7 +26175,7 @@ var two_dimensional_axes_TwoDimensionalAxes = /** @class */ (function (_super) {
26091
26175
  top: 0,
26092
26176
  right: 0,
26093
26177
  bottom: 0,
26094
- left: 0,
26178
+ left: 0
26095
26179
  };
26096
26180
  return _this;
26097
26181
  }
@@ -26116,7 +26200,7 @@ var two_dimensional_axes_TwoDimensionalAxes = /** @class */ (function (_super) {
26116
26200
  var axisComponent = new axis_Axis(_this.model, _this.services, {
26117
26201
  position: axisPosition,
26118
26202
  axes: _this.configs.axes,
26119
- margins: _this.margins,
26203
+ margins: _this.margins
26120
26204
  });
26121
26205
  // Set model, services & parent for the new axis component
26122
26206
  axisComponent.setModel(_this.model);
@@ -26146,7 +26230,7 @@ var two_dimensional_axes_TwoDimensionalAxes = /** @class */ (function (_super) {
26146
26230
  }
26147
26231
  else {
26148
26232
  offset = dom_utils_DOMUtils.getSVGElementSize(child.getTitleRef(), {
26149
- useBBox: true,
26233
+ useBBox: true
26150
26234
  }).height;
26151
26235
  }
26152
26236
  switch (axisPosition) {
@@ -26346,7 +26430,7 @@ var grid_Grid = /** @class */ (function (_super) {
26346
26430
  // threshold for when to display a gridline tooltip
26347
26431
  var bounds = {
26348
26432
  min: Number(translations.tx) - threshold,
26349
- max: Number(translations.tx) + threshold,
26433
+ max: Number(translations.tx) + threshold
26350
26434
  };
26351
26435
  return bounds.min <= position[0] && position[0] <= bounds.max;
26352
26436
  });
@@ -26432,7 +26516,7 @@ var ruler_Ruler = /** @class */ (function (_super) {
26432
26516
  var _b = rangeScale.range(), yScaleEnd = _b[0], yScaleStart = _b[1];
26433
26517
  var scaledData = displayData.map(function (d) { return ({
26434
26518
  domainValue: _this.services.cartesianScales.getDomainValue(d),
26435
- originalData: d,
26519
+ originalData: d
26436
26520
  }); });
26437
26521
  /**
26438
26522
  * Find matches, reduce is used instead of filter
@@ -26495,7 +26579,7 @@ var ruler_Ruler = /** @class */ (function (_super) {
26495
26579
  this.services.events.dispatchEvent("show-tooltip", {
26496
26580
  hoveredElement: rulerLine,
26497
26581
  multidata: tooltipData,
26498
- type: TooltipTypes.GRIDLINE,
26582
+ type: TooltipTypes.GRIDLINE
26499
26583
  });
26500
26584
  ruler.attr("opacity", 1);
26501
26585
  // line snaps to matching point
@@ -26613,7 +26697,7 @@ var zero_line_ZeroLine = /** @class */ (function (_super) {
26613
26697
  x0: x0,
26614
26698
  x1: x1,
26615
26699
  y0: yPosition,
26616
- y1: yPosition,
26700
+ y1: yPosition
26617
26701
  }, this.services.cartesianScales.getOrientation());
26618
26702
  var line = dom_utils_DOMUtils.appendOrSelect(svg, "line.domain");
26619
26703
  line.transition(this.services.transitions.getTransition("zero-line-update", animate))
@@ -26874,7 +26958,7 @@ var axis_chart_AxisChart = /** @class */ (function (_super) {
26874
26958
  var _this = _super.call(this, holder, chartConfigs) || this;
26875
26959
  _this.services = Object.assign(_this.services, {
26876
26960
  cartesianScales: scales_cartesian_CartesianScales,
26877
- curves: curves_Curves,
26961
+ curves: curves_Curves
26878
26962
  });
26879
26963
  return _this;
26880
26964
  }
@@ -26884,24 +26968,24 @@ var axis_chart_AxisChart = /** @class */ (function (_super) {
26884
26968
  components: [new title_Title(this.model, this.services)],
26885
26969
  growth: {
26886
26970
  x: LayoutGrowth.PREFERRED,
26887
- y: LayoutGrowth.FIXED,
26888
- },
26971
+ y: LayoutGrowth.FIXED
26972
+ }
26889
26973
  };
26890
26974
  var legendComponent = {
26891
26975
  id: "legend",
26892
26976
  components: [new legend_Legend(this.model, this.services)],
26893
26977
  growth: {
26894
26978
  x: LayoutGrowth.PREFERRED,
26895
- y: LayoutGrowth.FIXED,
26896
- },
26979
+ y: LayoutGrowth.FIXED
26980
+ }
26897
26981
  };
26898
26982
  var graphFrameComponent = {
26899
26983
  id: "graph-frame",
26900
26984
  components: graphFrameComponents,
26901
26985
  growth: {
26902
26986
  x: LayoutGrowth.STRETCH,
26903
- y: LayoutGrowth.FIXED,
26904
- },
26987
+ y: LayoutGrowth.FIXED
26988
+ }
26905
26989
  };
26906
26990
  var isLegendEnabled = this.model.getOptions().legend.enabled !== false;
26907
26991
  // Decide the position of the legend in reference to the chart
@@ -26931,23 +27015,23 @@ var axis_chart_AxisChart = /** @class */ (function (_super) {
26931
27015
  components: [new spacer_Spacer(this.model, this.services)],
26932
27016
  growth: {
26933
27017
  x: LayoutGrowth.PREFERRED,
26934
- y: LayoutGrowth.FIXED,
26935
- },
27018
+ y: LayoutGrowth.FIXED
27019
+ }
26936
27020
  };
26937
27021
  var fullFrameComponent = {
26938
27022
  id: "full-frame",
26939
27023
  components: [
26940
27024
  new layout_LayoutComponent(this.model, this.services, axis_chart_spreadArrays((isLegendEnabled ? [legendComponent] : []), [
26941
27025
  legendSpacerComponent,
26942
- graphFrameComponent,
27026
+ graphFrameComponent
26943
27027
  ]), {
26944
- direction: fullFrameComponentDirection,
26945
- }),
27028
+ direction: fullFrameComponentDirection
27029
+ })
26946
27030
  ],
26947
27031
  growth: {
26948
27032
  x: LayoutGrowth.STRETCH,
26949
- y: LayoutGrowth.FIXED,
26950
- },
27033
+ y: LayoutGrowth.FIXED
27034
+ }
26951
27035
  };
26952
27036
  // Add chart title if it exists
26953
27037
  var topLevelLayoutComponents = [];
@@ -26958,16 +27042,16 @@ var axis_chart_AxisChart = /** @class */ (function (_super) {
26958
27042
  components: [new spacer_Spacer(this.model, this.services)],
26959
27043
  growth: {
26960
27044
  x: LayoutGrowth.PREFERRED,
26961
- y: LayoutGrowth.FIXED,
26962
- },
27045
+ y: LayoutGrowth.FIXED
27046
+ }
26963
27047
  };
26964
27048
  topLevelLayoutComponents.push(titleSpacerComponent);
26965
27049
  }
26966
27050
  topLevelLayoutComponents.push(fullFrameComponent);
26967
27051
  return [
26968
27052
  new layout_LayoutComponent(this.model, this.services, topLevelLayoutComponents, {
26969
- direction: LayoutDirection.COLUMN,
26970
- }),
27053
+ direction: LayoutDirection.COLUMN
27054
+ })
26971
27055
  ];
26972
27056
  };
26973
27057
  return AxisChart;
@@ -27015,8 +27099,8 @@ var area_AreaChart = /** @class */ (function (_super) {
27015
27099
  new area_Area(this.model, this.services),
27016
27100
  new scatter_Scatter(this.model, this.services, {
27017
27101
  fadeInOnChartHolderMouseover: true,
27018
- handleThresholds: true,
27019
- }),
27102
+ handleThresholds: true
27103
+ })
27020
27104
  ];
27021
27105
  var components = this.getAxisChartComponents(graphFrameComponents);
27022
27106
  components.push(new tooltip_scatter_TooltipScatter(this.model, this.services));
@@ -27068,8 +27152,8 @@ var area_stacked_StackedAreaChart = /** @class */ (function (_super) {
27068
27152
  new scatter_stacked_StackedScatter(this.model, this.services, {
27069
27153
  fadeInOnChartHolderMouseover: true,
27070
27154
  handleThresholds: true,
27071
- stacked: true,
27072
- }),
27155
+ stacked: true
27156
+ })
27073
27157
  ];
27074
27158
  var components = this.getAxisChartComponents(graphFrameComponents);
27075
27159
  // TODO add tooltip
@@ -27120,8 +27204,8 @@ var bar_simple_SimpleBarChart = /** @class */ (function (_super) {
27120
27204
  new bar_simple_SimpleBar(this.model, this.services),
27121
27205
  new zero_line_ZeroLine(this.model, this.services),
27122
27206
  new skeleton_Skeleton(this.model, this.services, {
27123
- skeleton: Skeletons.VERT_OR_HORIZ,
27124
- }),
27207
+ skeleton: Skeletons.VERT_OR_HORIZ
27208
+ })
27125
27209
  ];
27126
27210
  var components = this.getAxisChartComponents(graphFrameComponents);
27127
27211
  components.push(new tooltip_bar_TooltipBar(this.model, this.services));
@@ -27171,8 +27255,8 @@ var bar_grouped_GroupedBarChart = /** @class */ (function (_super) {
27171
27255
  new bar_grouped_GroupedBar(this.model, this.services),
27172
27256
  new zero_line_ZeroLine(this.model, this.services),
27173
27257
  new skeleton_Skeleton(this.model, this.services, {
27174
- skeleton: Skeletons.VERT_OR_HORIZ,
27175
- }),
27258
+ skeleton: Skeletons.VERT_OR_HORIZ
27259
+ })
27176
27260
  ];
27177
27261
  var components = this.getAxisChartComponents(graphFrameComponents);
27178
27262
  components.push(new tooltip_bar_TooltipBar(this.model, this.services));
@@ -27221,8 +27305,8 @@ var bar_stacked_StackedBarChart = /** @class */ (function (_super) {
27221
27305
  new grid_Grid(this.model, this.services),
27222
27306
  new bar_stacked_StackedBar(this.model, this.services),
27223
27307
  new skeleton_Skeleton(this.model, this.services, {
27224
- skeleton: Skeletons.VERT_OR_HORIZ,
27225
- }),
27308
+ skeleton: Skeletons.VERT_OR_HORIZ
27309
+ })
27226
27310
  ];
27227
27311
  var components = this.getAxisChartComponents(graphFrameComponents);
27228
27312
  components.push(new tooltip_bar_TooltipBar(this.model, this.services));
@@ -27272,8 +27356,8 @@ var bubble_BubbleChart = /** @class */ (function (_super) {
27272
27356
  new ruler_Ruler(this.model, this.services),
27273
27357
  new bubble_Bubble(this.model, this.services),
27274
27358
  new skeleton_Skeleton(this.model, this.services, {
27275
- skeleton: Skeletons.GRID,
27276
- }),
27359
+ skeleton: Skeletons.GRID
27360
+ })
27277
27361
  ];
27278
27362
  var components = this.getAxisChartComponents(graphFrameComponents);
27279
27363
  components.push(new tooltip_scatter_TooltipScatter(this.model, this.services));
@@ -27324,8 +27408,8 @@ var line_LineChart = /** @class */ (function (_super) {
27324
27408
  new line_Line(this.model, this.services),
27325
27409
  new scatter_Scatter(this.model, this.services, { handleThresholds: true }),
27326
27410
  new skeleton_Skeleton(this.model, this.services, {
27327
- skeleton: Skeletons.GRID,
27328
- }),
27411
+ skeleton: Skeletons.GRID
27412
+ })
27329
27413
  ];
27330
27414
  var components = this.getAxisChartComponents(graphFrameComponents);
27331
27415
  components.push(new tooltip_scatter_TooltipScatter(this.model, this.services));
@@ -27375,8 +27459,8 @@ var scatter_ScatterChart = /** @class */ (function (_super) {
27375
27459
  new ruler_Ruler(this.model, this.services),
27376
27460
  new scatter_Scatter(this.model, this.services),
27377
27461
  new skeleton_Skeleton(this.model, this.services, {
27378
- skeleton: Skeletons.GRID,
27379
- }),
27462
+ skeleton: Skeletons.GRID
27463
+ })
27380
27464
  ];
27381
27465
  var components = this.getAxisChartComponents(graphFrameComponents);
27382
27466
  components.push(new tooltip_scatter_TooltipScatter(this.model, this.services));
@@ -27477,8 +27561,8 @@ var pie_PieChart = /** @class */ (function (_super) {
27477
27561
  var graphFrameComponents = [
27478
27562
  new pie_Pie(this.model, this.services),
27479
27563
  new skeleton_Skeleton(this.model, this.services, {
27480
- skeleton: Skeletons.PIE,
27481
- }),
27564
+ skeleton: Skeletons.PIE
27565
+ })
27482
27566
  ];
27483
27567
  // get the base chart components and export with tooltip
27484
27568
  var components = this.getChartComponents(graphFrameComponents);
@@ -27526,8 +27610,8 @@ var donut_DonutChart = /** @class */ (function (_super) {
27526
27610
  var graphFrameComponents = [
27527
27611
  new donut_Donut(this.model, this.services),
27528
27612
  new skeleton_Skeleton(this.model, this.services, {
27529
- skeleton: Skeletons.DONUT,
27530
- }),
27613
+ skeleton: Skeletons.DONUT
27614
+ })
27531
27615
  ];
27532
27616
  var components = this.getChartComponents(graphFrameComponents);
27533
27617
  components.push(new tooltip_pie_TooltipPie(this.model, this.services));
@@ -27544,50 +27628,50 @@ function radialLabelPlacement(angleRadians) {
27544
27628
  if (isInRange(angle, [0, 10]) || isInRange(angle, [350, 0])) {
27545
27629
  return {
27546
27630
  textAnchor: TextAnchor.START,
27547
- dominantBaseline: DominantBaseline.MIDDLE,
27631
+ dominantBaseline: DominantBaseline.MIDDLE
27548
27632
  };
27549
27633
  }
27550
27634
  else if (isInRange(angle, [10, 80])) {
27551
27635
  return {
27552
27636
  textAnchor: TextAnchor.START,
27553
- dominantBaseline: DominantBaseline.HANGING,
27637
+ dominantBaseline: DominantBaseline.HANGING
27554
27638
  };
27555
27639
  }
27556
27640
  else if (isInRange(angle, [80, 100])) {
27557
27641
  return {
27558
27642
  textAnchor: TextAnchor.MIDDLE,
27559
- dominantBaseline: DominantBaseline.HANGING,
27643
+ dominantBaseline: DominantBaseline.HANGING
27560
27644
  };
27561
27645
  }
27562
27646
  else if (isInRange(angle, [100, 170])) {
27563
27647
  return {
27564
27648
  textAnchor: TextAnchor.END,
27565
- dominantBaseline: DominantBaseline.HANGING,
27649
+ dominantBaseline: DominantBaseline.HANGING
27566
27650
  };
27567
27651
  }
27568
27652
  else if (isInRange(angle, [170, 190])) {
27569
27653
  return {
27570
27654
  textAnchor: TextAnchor.END,
27571
- dominantBaseline: DominantBaseline.MIDDLE,
27655
+ dominantBaseline: DominantBaseline.MIDDLE
27572
27656
  };
27573
27657
  }
27574
27658
  else if (isInRange(angle, [190, 260])) {
27575
27659
  return {
27576
27660
  textAnchor: TextAnchor.END,
27577
- dominantBaseline: DominantBaseline.BASELINE,
27661
+ dominantBaseline: DominantBaseline.BASELINE
27578
27662
  };
27579
27663
  }
27580
27664
  else if (isInRange(angle, [260, 280])) {
27581
27665
  return {
27582
27666
  textAnchor: TextAnchor.MIDDLE,
27583
- dominantBaseline: DominantBaseline.BASELINE,
27667
+ dominantBaseline: DominantBaseline.BASELINE
27584
27668
  };
27585
27669
  }
27586
27670
  else {
27587
27671
  // 280 - 350
27588
27672
  return {
27589
27673
  textAnchor: TextAnchor.START,
27590
- dominantBaseline: DominantBaseline.BASELINE,
27674
+ dominantBaseline: DominantBaseline.BASELINE
27591
27675
  };
27592
27676
  }
27593
27677
  }
@@ -27788,7 +27872,7 @@ var radar_Radar = /** @class */ (function (_super) {
27788
27872
  if (animate === void 0) { animate = true; }
27789
27873
  this.svg = this.getContainerSVG();
27790
27874
  var _a = dom_utils_DOMUtils.getSVGElementSize(this.parent, {
27791
- useAttrs: true,
27875
+ useAttrs: true
27792
27876
  }), width = _a.width, height = _a.height;
27793
27877
  var data = this.model.getData();
27794
27878
  var displayData = this.model.getDisplayData();
@@ -27817,7 +27901,7 @@ var radar_Radar = /** @class */ (function (_super) {
27817
27901
  var yScale = linear_linear()
27818
27902
  .domain([
27819
27903
  0,
27820
- src_max(this.displayDataNormalized.map(function (d) { return d[value]; })),
27904
+ src_max(this.displayDataNormalized.map(function (d) { return d[value]; }))
27821
27905
  ])
27822
27906
  .range([minRange, radius])
27823
27907
  .nice(yTicksNumber);
@@ -27850,7 +27934,7 @@ var radar_Radar = /** @class */ (function (_super) {
27850
27934
  // center coordinates
27851
27935
  var c = {
27852
27936
  x: leftPadding + xLabelPadding,
27853
- y: height / 2,
27937
+ y: height / 2
27854
27938
  };
27855
27939
  /////////////////////////////
27856
27940
  // Drawing the radar
@@ -28152,7 +28236,7 @@ var radar_Radar = /** @class */ (function (_super) {
28152
28236
  // Dispatch mouse event
28153
28237
  self.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEOVER, {
28154
28238
  element: src_select(this),
28155
- datum: datum,
28239
+ datum: datum
28156
28240
  });
28157
28241
  })
28158
28242
  .on("mousemove", function (datum) {
@@ -28169,7 +28253,7 @@ var radar_Radar = /** @class */ (function (_super) {
28169
28253
  // Dispatch mouse event
28170
28254
  self.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEMOVE, {
28171
28255
  element: hoveredElement,
28172
- datum: datum,
28256
+ datum: datum
28173
28257
  });
28174
28258
  // get the items that should be highlighted
28175
28259
  var itemsToHighlight = self.displayDataNormalized.filter(function (d) { return d[angle] === datum; });
@@ -28177,14 +28261,14 @@ var radar_Radar = /** @class */ (function (_super) {
28177
28261
  self.services.events.dispatchEvent(Events.Tooltip.SHOW, {
28178
28262
  hoveredElement: hoveredElement,
28179
28263
  multidata: itemsToHighlight,
28180
- type: TooltipTypes.GRIDLINE,
28264
+ type: TooltipTypes.GRIDLINE
28181
28265
  });
28182
28266
  })
28183
28267
  .on("click", function (datum) {
28184
28268
  // Dispatch mouse event
28185
28269
  self.services.events.dispatchEvent(Events.Radar.X_AXIS_CLICK, {
28186
28270
  element: src_select(this),
28187
- datum: datum,
28271
+ datum: datum
28188
28272
  });
28189
28273
  })
28190
28274
  .on("mouseout", function (datum) {
@@ -28199,14 +28283,14 @@ var radar_Radar = /** @class */ (function (_super) {
28199
28283
  // Dispatch mouse event
28200
28284
  self.services.events.dispatchEvent(Events.Radar.X_AXIS_MOUSEOUT, {
28201
28285
  element: hoveredElement,
28202
- datum: datum,
28286
+ datum: datum
28203
28287
  });
28204
28288
  // Hide tooltip
28205
28289
  self.services.events.dispatchEvent("hide-tooltip", {
28206
- hoveredElement: hoveredElement,
28290
+ hoveredElement: hoveredElement
28207
28291
  });
28208
28292
  self.services.events.dispatchEvent(Events.Tooltip.HIDE, {
28209
- hoveredElement: hoveredElement,
28293
+ hoveredElement: hoveredElement
28210
28294
  });
28211
28295
  });
28212
28296
  };
@@ -28299,6 +28383,7 @@ var gauge_GaugeChart = /** @class */ (function (_super) {
28299
28383
  // Specify what to render inside the graph-frame
28300
28384
  var graphFrameComponents = [new gauge_Gauge(this.model, this.services)];
28301
28385
  var components = this.getChartComponents(graphFrameComponents);
28386
+ components.push(new tooltip_Tooltip(this.model, this.services));
28302
28387
  return components;
28303
28388
  };
28304
28389
  return GaugeChart;