@axdspub/axiom-charts 0.0.16 → 0.0.17

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.
@@ -124,6 +124,7 @@ var PlotRoot = /** @class */ (function (_super) {
124
124
  _this.dimensions = props.dimensions;
125
125
  _this.style = props.style;
126
126
  _this.scrubbing = props.scrubbing;
127
+ _this.onDataLoad = props.onDataLoad;
127
128
  _this.axisSettings = props.axisSettings;
128
129
  _this.runtime = {};
129
130
  return _this;
@@ -267,6 +268,7 @@ var ChartRoot = /** @class */ (function () {
267
268
  this.plots = props.plots.map(function (p) { return (__assign({}, p)); });
268
269
  this.settings = props.settings;
269
270
  this.element = props.element;
271
+ this.onPlotDataLoad = props.onPlotDataLoad;
270
272
  this.onScrub = props.onScrub;
271
273
  this.onScrubEnd = props.onScrubEnd;
272
274
  this.runtime = {
@@ -542,7 +544,7 @@ var ChartRoot = /** @class */ (function () {
542
544
  });
543
545
  };
544
546
  ChartRoot.prototype.getPlotImplementationProps = function (plot) {
545
- return __assign(__assign({}, plot), { chart: this });
547
+ return __assign(__assign({}, plot), { chart: this, onDataLoad: this.onPlotDataLoad });
546
548
  };
547
549
  ChartRoot.prototype.createPlot = function (plot) {
548
550
  return new PlotRoot(this.getPlotImplementationProps(plot));
@@ -588,6 +590,7 @@ var AxiomLine = /** @class */ (function (_super) {
588
590
  return [4 /*yield*/, this.getData()];
589
591
  case 1:
590
592
  data = _m.sent();
593
+ this.emitDataLoad(data);
591
594
  this.parsedData = (_a = data === null || data === void 0 ? void 0 : data.parsed) === null || _a === void 0 ? void 0 : _a.data;
592
595
  _m.label = 2;
593
596
  case 2:
@@ -723,6 +726,14 @@ var AxiomLine = /** @class */ (function (_super) {
723
726
  var style = this.style !== undefined ? this.style : {};
724
727
  return style.strokeWidth !== undefined ? style.strokeWidth : 1;
725
728
  };
729
+ AxiomLine.prototype.emitDataLoad = function (data) {
730
+ if (this.onDataLoad !== undefined) {
731
+ this.onDataLoad({
732
+ plotId: this.id,
733
+ data: data
734
+ });
735
+ }
736
+ };
726
737
  return AxiomLine;
727
738
  }(AxiomPlotRoot));
728
739
 
@@ -1204,7 +1215,6 @@ var AxiomChart = /** @class */ (function (_super) {
1204
1215
  this.element.append(canvasNode);
1205
1216
  }
1206
1217
  }
1207
- // TODO: conditional
1208
1218
  this.addScrubbing();
1209
1219
  };
1210
1220
  AxiomChart.prototype.createPlot = function (plot) {