@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.
@@ -56317,9 +56317,7 @@ var getComparisonRepresentationData = function getComparisonRepresentationData(_
56317
56317
  if (leftData.length > 0) {
56318
56318
  var leftTotal = calculateTotal(leftData);
56319
56319
  var leftLabel = (comparison == null ? void 0 : comparison.rules[0].name) || 'Starting Value';
56320
- steps.push(createStep(leftLabel, leftTotal, 0, leftTotal));
56321
- data.push(createDataPoint(xKey, leftLabel, leftLabel, yKey, leftTotal, formattingFunctionY));
56322
- xTicks.push(createXTick(leftLabel, leftLabel));
56320
+ addComparisonBar(data, steps, xTicks, xKey, yKey, leftTotal, leftLabel, formattingFunctionY);
56323
56321
  yValueSum = leftTotal;
56324
56322
  yMaxValue = Math.ceil(Math.max(yMaxValue, leftTotal));
56325
56323
  }
@@ -56328,9 +56326,7 @@ var getComparisonRepresentationData = function getComparisonRepresentationData(_
56328
56326
  updatedYMinValue = _processComparisonIte.yMinValue,
56329
56327
  updatedYMaxValue = _processComparisonIte.yMaxValue;
56330
56328
  var totalLabel = (comparison == null ? void 0 : comparison.rules[1].name) || 'End Value';
56331
- steps.push(createStep(totalLabel, updatedYValueSum, 0, updatedYValueSum));
56332
- data.push(createDataPoint(xKey, totalLabel, totalLabel, yKey, updatedYValueSum, formattingFunctionY));
56333
- xTicks.push(createXTick(totalLabel, totalLabel));
56329
+ addComparisonBar(data, steps, xTicks, xKey, yKey, updatedYValueSum, totalLabel, formattingFunctionY);
56334
56330
  yValueSum = updatedYValueSum;
56335
56331
  yMinValue = updatedYMinValue;
56336
56332
  yMaxValue = updatedYMaxValue;
@@ -56389,6 +56385,11 @@ var addTotalBar = function addTotalBar(data, steps, xTicks, xKey, yKey, yValueSu
56389
56385
  data.push(createDataPoint(xKey, totalLabel, totalLabel, yKey, yValueSum, formatter));
56390
56386
  xTicks.push(createXTick(totalLabel, totalLabel));
56391
56387
  };
56388
+ var addComparisonBar = function addComparisonBar(data, steps, xTicks, xKey, yKey, value, label, formatter) {
56389
+ steps.push(createStep(label, value, 0, value));
56390
+ data.push(createDataPoint(xKey, label, label, yKey, value, formatter));
56391
+ xTicks.push(createXTick(label, label));
56392
+ };
56392
56393
  var calculateTotal = function calculateTotal(data) {
56393
56394
  var total = 0;
56394
56395
  data.forEach(function (dataItem) {
@@ -64605,7 +64606,9 @@ function DateComparisonSection(props) {
64605
64606
  };
64606
64607
  var createNewRules = useCallback(function (newCustomField) {
64607
64608
  props.setAttributes({
64608
- comparison: newCustomField
64609
+ comparison: _extends({}, newCustomField, {
64610
+ dataType: 'number'
64611
+ })
64609
64612
  });
64610
64613
  handleOnClose();
64611
64614
  }, [props.setAttributes, handleOnClose]);
@@ -71,7 +71,7 @@ export declare type SimpleMathField = BaseCustomField & SimpleMath & {
71
71
  };
72
72
  export declare type RulesField = BaseField & {
73
73
  rules: Rules[];
74
- dataType: 'string';
74
+ dataType: 'string' | 'number';
75
75
  };
76
76
  export declare type CustomBuildMetricField = BaseField & {
77
77
  metricAttributes: Metric;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vizzly/dashboard",
3
3
  "author": "james@vizzly.co",
4
- "version": "0.15.0-dev-01ea5aa946daad108dcca8cdb39a89202fb70c38",
4
+ "version": "0.15.0-dev-1fca222472783bc8d33f75bd255e9ac8ff57ecc3",
5
5
  "source": "src/index.tsx",
6
6
  "types": "./dist/dashboard/src/index.d.ts",
7
7
  "module": "./dist/dashboard.esm.js",
@@ -55,7 +55,7 @@
55
55
  "@visx/visx": "^3.10.2",
56
56
  "@vizzly/api-client": "0.0.57",
57
57
  "@vizzly/joi": "^17.7.0",
58
- "@vizzly/semantic-layer-public": "0.0.241",
58
+ "@vizzly/semantic-layer-public": "0.0.243",
59
59
  "@vizzly/sqlbuilder-public": "0.1.71",
60
60
  "chroma-js": "2.4.2",
61
61
  "copy-to-clipboard": "^3.3.3",