@nova-ui/dashboards 12.0.7-3547 → 12.0.8-3554

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/bundles/nova-ui-dashboards.umd.js +10 -8
  2. package/bundles/nova-ui-dashboards.umd.js.map +1 -1
  3. package/esm2015/lib/common/pipes/dashboard-unit-conversion-pipe.js +4 -4
  4. package/esm2015/lib/components/proportional-widget/proportional-widget.component.js +3 -3
  5. package/esm2015/lib/components/timeseries-widget/chart-presets/timeseries-chart.component.js +2 -2
  6. package/esm2015/lib/components/timeseries-widget/timeseries-scales.service.js +3 -3
  7. package/esm2015/lib/components/timeseries-widget/types.js +1 -1
  8. package/fesm2015/nova-ui-dashboards.js +8 -8
  9. package/fesm2015/nova-ui-dashboards.js.map +1 -1
  10. package/lib/common/pipes/dashboard-unit-conversion-pipe.d.ts +2 -2
  11. package/lib/components/timeseries-widget/timeseries-scales.service.d.ts +2 -2
  12. package/lib/components/timeseries-widget/types.d.ts +2 -1
  13. package/package.json +3 -3
  14. package/sdk/atoms/src/lib/common/pipes/dashboard-unit-conversion-pipe.d.ts +2 -2
  15. package/sdk/atoms/src/lib/common/pipes/dashboard-unit-conversion-pipe.js +3 -3
  16. package/sdk/atoms/src/lib/common/pipes/dashboard-unit-conversion-pipe.js.map +1 -1
  17. package/sdk/atoms/src/lib/components/proportional-widget/proportional-widget.component.js +2 -2
  18. package/sdk/atoms/src/lib/components/proportional-widget/proportional-widget.component.js.map +1 -1
  19. package/sdk/atoms/src/lib/components/timeseries-widget/chart-presets/timeseries-chart.component.js +1 -1
  20. package/sdk/atoms/src/lib/components/timeseries-widget/chart-presets/timeseries-chart.component.js.map +1 -1
  21. package/sdk/atoms/src/lib/components/timeseries-widget/timeseries-scales.service.d.ts +2 -2
  22. package/sdk/atoms/src/lib/components/timeseries-widget/timeseries-scales.service.js +2 -2
  23. package/sdk/atoms/src/lib/components/timeseries-widget/timeseries-scales.service.js.map +1 -1
  24. package/sdk/atoms/src/lib/components/timeseries-widget/types.d.ts +2 -1
  25. package/sdk/atoms/src/lib/components/timeseries-widget/types.js.map +1 -1
@@ -457,13 +457,14 @@
457
457
  *
458
458
  * @returns The string representation of the converted value
459
459
  */
460
- this.transform = function (value) {
460
+ this.transform = function (value, units) {
461
+ if (units === void 0) { units = "generic"; }
461
462
  var valueAsNumber = typeof value === "string" ? parseFloat(value) : value;
462
463
  if (valueAsNumber === undefined || isNaN(valueAsNumber) || valueAsNumber < DEFAULT_UNIT_CONVERSION_THRESHOLD) {
463
464
  return (value === null || value === void 0 ? void 0 : value.toString()) || "";
464
465
  }
465
- var conversion = _this.unitConversionService.convert(valueAsNumber, i2.UnitBase.Standard, 1);
466
- return _this.unitConversionService.getFullDisplay(conversion, "generic");
466
+ var conversion = _this.unitConversionService.convert(valueAsNumber, (units === "bytes") ? i2.UnitBase.Bytes : i2.UnitBase.Standard, 1);
467
+ return _this.unitConversionService.getFullDisplay(conversion, units);
467
468
  };
468
469
  }
469
470
  return DashboardUnitConversionPipe;
@@ -5562,11 +5563,11 @@
5562
5563
  this.chartAssist.chart.addPlugin(this.donutContentPlugin);
5563
5564
  }
5564
5565
  if (this.configuration.chartOptions.type === exports.ProportionalWidgetChartTypes.HorizontalBarChart) {
5565
- this.scales.x.formatters.tick = this.unitConversionPipe.transform;
5566
+ this.scales.x.formatters.tick = function (value) { return _this.unitConversionPipe.transform(value); };
5566
5567
  this.applyTickLabelMaxWidths();
5567
5568
  }
5568
5569
  else if (this.configuration.chartOptions.type === exports.ProportionalWidgetChartTypes.VerticalBarChart) {
5569
- this.scales.y.formatters.tick = this.unitConversionPipe.transform;
5570
+ this.scales.y.formatters.tick = function (value) { return _this.unitConversionPipe.transform(value); };
5570
5571
  }
5571
5572
  (_b = this.chartTypeSubscription$) === null || _b === void 0 ? void 0 : _b.unsubscribe();
5572
5573
  this.chartTypeSubscription$ = this.chartAssist.chart.getEventBus().getStream(i2$1.SELECT_DATA_POINT_EVENT).subscribe(function (event) {
@@ -6563,7 +6564,8 @@
6563
6564
  *
6564
6565
  * @param scaleConfig
6565
6566
  */
6566
- TimeseriesScalesService.prototype.getScale = function (scaleConfig) {
6567
+ TimeseriesScalesService.prototype.getScale = function (scaleConfig, units) {
6568
+ var _this = this;
6567
6569
  var scale;
6568
6570
  switch (scaleConfig.type) {
6569
6571
  case exports.TimeseriesScaleType.Time: {
@@ -6572,7 +6574,7 @@
6572
6574
  }
6573
6575
  case exports.TimeseriesScaleType.Linear: {
6574
6576
  scale = new i2$1.LinearScale();
6575
- scale.formatters.tick = this.unitConversionPipe.transform;
6577
+ scale.formatters.tick = function (value) { return _this.unitConversionPipe.transform(value, units); };
6576
6578
  break;
6577
6579
  }
6578
6580
  case exports.TimeseriesScaleType.TimeInterval: {
@@ -6653,7 +6655,7 @@
6653
6655
  var scaleConfigCurrent = (_a = configurationCurrent === null || configurationCurrent === void 0 ? void 0 : configurationCurrent.scales) === null || _a === void 0 ? void 0 : _a[scaleKey];
6654
6656
  var scaleConfigPrevious = (_b = configurationPrevious === null || configurationPrevious === void 0 ? void 0 : configurationPrevious.scales) === null || _b === void 0 ? void 0 : _b[scaleKey];
6655
6657
  if ((scaleConfigCurrent === null || scaleConfigCurrent === void 0 ? void 0 : scaleConfigCurrent.type) !== (scaleConfigPrevious === null || scaleConfigPrevious === void 0 ? void 0 : scaleConfigPrevious.type) || !this.scales[scaleKey]) {
6656
- this.scales[scaleKey] = this.timeseriesScalesService.getScale(scaleConfigCurrent);
6658
+ this.scales[scaleKey] = this.timeseriesScalesService.getScale(scaleConfigCurrent, configurationCurrent.units);
6657
6659
  shouldUpdateChart = true;
6658
6660
  }
6659
6661
  else if ((scaleConfigCurrent === null || scaleConfigCurrent === void 0 ? void 0 : scaleConfigCurrent.properties) !== (scaleConfigPrevious === null || scaleConfigPrevious === void 0 ? void 0 : scaleConfigPrevious.properties)) {