@vizzly/dashboard 0.15.0-dev-01ea5aa946daad108dcca8cdb39a89202fb70c38 → 0.15.0-dev-1fca222472783bc8d33f75bd255e9ac8ff57ecc3

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.
@@ -56253,9 +56253,7 @@ var getComparisonRepresentationData = function getComparisonRepresentationData(_
56253
56253
  if (leftData.length > 0) {
56254
56254
  var leftTotal = calculateTotal(leftData);
56255
56255
  var leftLabel = (comparison == null ? void 0 : comparison.rules[0].name) || 'Starting Value';
56256
- steps.push(createStep(leftLabel, leftTotal, 0, leftTotal));
56257
- data.push(createDataPoint(xKey, leftLabel, leftLabel, yKey, leftTotal, formattingFunctionY));
56258
- xTicks.push(createXTick(leftLabel, leftLabel));
56256
+ addComparisonBar(data, steps, xTicks, xKey, yKey, leftTotal, leftLabel, formattingFunctionY);
56259
56257
  yValueSum = leftTotal;
56260
56258
  yMaxValue = Math.ceil(Math.max(yMaxValue, leftTotal));
56261
56259
  }
@@ -56264,9 +56262,7 @@ var getComparisonRepresentationData = function getComparisonRepresentationData(_
56264
56262
  updatedYMinValue = _processComparisonIte.yMinValue,
56265
56263
  updatedYMaxValue = _processComparisonIte.yMaxValue;
56266
56264
  var totalLabel = (comparison == null ? void 0 : comparison.rules[1].name) || 'End Value';
56267
- steps.push(createStep(totalLabel, updatedYValueSum, 0, updatedYValueSum));
56268
- data.push(createDataPoint(xKey, totalLabel, totalLabel, yKey, updatedYValueSum, formattingFunctionY));
56269
- xTicks.push(createXTick(totalLabel, totalLabel));
56265
+ addComparisonBar(data, steps, xTicks, xKey, yKey, updatedYValueSum, totalLabel, formattingFunctionY);
56270
56266
  yValueSum = updatedYValueSum;
56271
56267
  yMinValue = updatedYMinValue;
56272
56268
  yMaxValue = updatedYMaxValue;
@@ -56325,6 +56321,11 @@ var addTotalBar = function addTotalBar(data, steps, xTicks, xKey, yKey, yValueSu
56325
56321
  data.push(createDataPoint(xKey, totalLabel, totalLabel, yKey, yValueSum, formatter));
56326
56322
  xTicks.push(createXTick(totalLabel, totalLabel));
56327
56323
  };
56324
+ var addComparisonBar = function addComparisonBar(data, steps, xTicks, xKey, yKey, value, label, formatter) {
56325
+ steps.push(createStep(label, value, 0, value));
56326
+ data.push(createDataPoint(xKey, label, label, yKey, value, formatter));
56327
+ xTicks.push(createXTick(label, label));
56328
+ };
56328
56329
  var calculateTotal = function calculateTotal(data) {
56329
56330
  var total = 0;
56330
56331
  data.forEach(function (dataItem) {
@@ -64541,7 +64542,9 @@ function DateComparisonSection(props) {
64541
64542
  };
64542
64543
  var createNewRules = React.useCallback(function (newCustomField) {
64543
64544
  props.setAttributes({
64544
- comparison: newCustomField
64545
+ comparison: _extends({}, newCustomField, {
64546
+ dataType: 'number'
64547
+ })
64545
64548
  });
64546
64549
  handleOnClose();
64547
64550
  }, [props.setAttributes, handleOnClose]);