plottable 3.11.0 → 3.12.0

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 (180) hide show
  1. package/build/src/animators/easingAnimator.d.ts +2 -2
  2. package/build/src/animators/easingAnimator.js +3 -2
  3. package/build/src/animators/index.js +2 -2
  4. package/build/src/animators/nullAnimator.js +2 -1
  5. package/build/src/axes/axis.d.ts +9 -5
  6. package/build/src/axes/axis.js +4 -3
  7. package/build/src/axes/categoryAxis.d.ts +9 -5
  8. package/build/src/axes/categoryAxis.js +13 -11
  9. package/build/src/axes/index.js +3 -3
  10. package/build/src/axes/numericAxis.d.ts +9 -5
  11. package/build/src/axes/numericAxis.js +2 -1
  12. package/build/src/axes/timeAxis.d.ts +18 -14
  13. package/build/src/axes/timeAxis.js +6 -5
  14. package/build/src/components/component.d.ts +2 -2
  15. package/build/src/components/component.js +7 -6
  16. package/build/src/components/componentContainer.js +3 -2
  17. package/build/src/components/dragBoxLayer.d.ts +4 -4
  18. package/build/src/components/dragBoxLayer.js +3 -2
  19. package/build/src/components/dragLineLayer.js +2 -1
  20. package/build/src/components/gridlines.d.ts +2 -2
  21. package/build/src/components/gridlines.js +2 -1
  22. package/build/src/components/group.js +2 -1
  23. package/build/src/components/guideLineLayer.d.ts +1 -1
  24. package/build/src/components/guideLineLayer.js +2 -1
  25. package/build/src/components/index.js +14 -14
  26. package/build/src/components/interpolatedColorLegend.d.ts +7 -3
  27. package/build/src/components/interpolatedColorLegend.js +4 -3
  28. package/build/src/components/label.js +4 -3
  29. package/build/src/components/legend.d.ts +5 -1
  30. package/build/src/components/legend.js +2 -1
  31. package/build/src/components/plotGroup.js +2 -1
  32. package/build/src/components/selectionBoxLayer.d.ts +4 -4
  33. package/build/src/components/selectionBoxLayer.js +2 -1
  34. package/build/src/components/table.d.ts +10 -6
  35. package/build/src/components/table.js +4 -3
  36. package/build/src/components/wrappedLabel.js +2 -1
  37. package/build/src/components/xDragBoxLayer.js +2 -1
  38. package/build/src/components/yDragBoxLayer.js +2 -1
  39. package/build/src/core/config.js +1 -0
  40. package/build/src/core/dataset.d.ts +5 -1
  41. package/build/src/core/dataset.js +1 -0
  42. package/build/src/core/formatters.d.ts +4 -0
  43. package/build/src/core/formatters.js +1 -0
  44. package/build/src/core/renderController.d.ts +1 -1
  45. package/build/src/core/renderController.js +2 -1
  46. package/build/src/core/renderPolicy.d.ts +4 -0
  47. package/build/src/core/renderPolicy.js +1 -0
  48. package/build/src/core/symbolFactories.d.ts +4 -0
  49. package/build/src/core/symbolFactories.js +1 -0
  50. package/build/src/core/version.d.ts +4 -0
  51. package/build/src/core/version.js +2 -1
  52. package/build/src/core/version.js.bak +1 -0
  53. package/build/src/dispatchers/dispatcher.d.ts +7 -3
  54. package/build/src/dispatchers/dispatcher.js +2 -1
  55. package/build/src/dispatchers/index.js +3 -3
  56. package/build/src/dispatchers/keyDispatcher.d.ts +2 -2
  57. package/build/src/dispatchers/keyDispatcher.js +2 -1
  58. package/build/src/dispatchers/mouseDispatcher.d.ts +1 -1
  59. package/build/src/dispatchers/mouseDispatcher.js +2 -1
  60. package/build/src/dispatchers/touchDispatcher.d.ts +1 -1
  61. package/build/src/dispatchers/touchDispatcher.js +2 -1
  62. package/build/src/drawers/arcDrawer.js +2 -1
  63. package/build/src/drawers/arcOutlineDrawer.js +2 -1
  64. package/build/src/drawers/areaDrawer.js +6 -5
  65. package/build/src/drawers/canvasBuffer.js +1 -0
  66. package/build/src/drawers/canvasDrawer.js +1 -0
  67. package/build/src/drawers/drawer.js +1 -0
  68. package/build/src/drawers/index.js +11 -10
  69. package/build/src/drawers/lineDrawer.js +4 -3
  70. package/build/src/drawers/rectangleDrawer.js +7 -5
  71. package/build/src/drawers/segmentDrawer.js +2 -1
  72. package/build/src/drawers/svgDrawer.d.ts +2 -2
  73. package/build/src/drawers/svgDrawer.js +1 -0
  74. package/build/src/drawers/symbolDrawer.js +6 -6
  75. package/build/src/index.d.ts +1 -1
  76. package/build/src/index.js +17 -14
  77. package/build/src/interactions/clickInteraction.d.ts +4 -4
  78. package/build/src/interactions/clickInteraction.js +2 -1
  79. package/build/src/interactions/dragInteraction.d.ts +4 -4
  80. package/build/src/interactions/dragInteraction.js +2 -1
  81. package/build/src/interactions/index.js +7 -6
  82. package/build/src/interactions/interaction.d.ts +2 -2
  83. package/build/src/interactions/interaction.js +1 -0
  84. package/build/src/interactions/keyInteraction.d.ts +2 -2
  85. package/build/src/interactions/keyInteraction.js +2 -1
  86. package/build/src/interactions/panZoomConstraints.js +1 -0
  87. package/build/src/interactions/panZoomInteraction.d.ts +13 -9
  88. package/build/src/interactions/panZoomInteraction.js +4 -3
  89. package/build/src/interactions/pointerInteraction.d.ts +3 -3
  90. package/build/src/interactions/pointerInteraction.js +2 -1
  91. package/build/src/memoize/index.js +5 -4
  92. package/build/src/memoize/memThunk.js +2 -1
  93. package/build/src/memoize/memoize.d.ts +5 -0
  94. package/build/src/memoize/memoize.js +2 -1
  95. package/build/src/memoize/memoizeProjectors.js +3 -2
  96. package/build/src/memoize/signature.d.ts +14 -0
  97. package/build/src/memoize/signature.js +4 -3
  98. package/build/src/plots/areaPlot.d.ts +9 -5
  99. package/build/src/plots/areaPlot.js +4 -3
  100. package/build/src/plots/barPlot.d.ts +16 -22
  101. package/build/src/plots/barPlot.js +6 -5
  102. package/build/src/plots/clusteredBarPlot.d.ts +3 -5
  103. package/build/src/plots/clusteredBarPlot.js +2 -1
  104. package/build/src/plots/commons.js +1 -0
  105. package/build/src/plots/deferredRenderer.d.ts +1 -1
  106. package/build/src/plots/deferredRenderer.js +1 -0
  107. package/build/src/plots/index.js +12 -12
  108. package/build/src/plots/linePlot.d.ts +6 -6
  109. package/build/src/plots/linePlot.js +5 -4
  110. package/build/src/plots/piePlot.d.ts +9 -5
  111. package/build/src/plots/piePlot.js +3 -2
  112. package/build/src/plots/plot.d.ts +5 -5
  113. package/build/src/plots/plot.js +7 -6
  114. package/build/src/plots/rectanglePlot.d.ts +10 -6
  115. package/build/src/plots/rectanglePlot.js +2 -1
  116. package/build/src/plots/scatterPlot.d.ts +8 -9
  117. package/build/src/plots/scatterPlot.js +3 -2
  118. package/build/src/plots/segmentPlot.d.ts +7 -3
  119. package/build/src/plots/segmentPlot.js +3 -2
  120. package/build/src/plots/stackedAreaPlot.d.ts +6 -2
  121. package/build/src/plots/stackedAreaPlot.js +4 -3
  122. package/build/src/plots/stackedBarPlot.d.ts +5 -4
  123. package/build/src/plots/stackedBarPlot.js +5 -4
  124. package/build/src/plots/waterfallPlot.d.ts +4 -6
  125. package/build/src/plots/waterfallPlot.js +2 -1
  126. package/build/src/plots/xyPlot.d.ts +5 -5
  127. package/build/src/plots/xyPlot.js +2 -1
  128. package/build/src/scales/categoryScale.d.ts +7 -3
  129. package/build/src/scales/categoryScale.js +3 -2
  130. package/build/src/scales/colorScale.d.ts +5 -1
  131. package/build/src/scales/colorScale.js +2 -1
  132. package/build/src/scales/index.d.ts +1 -1
  133. package/build/src/scales/index.js +8 -7
  134. package/build/src/scales/interpolatedColorScale.d.ts +7 -3
  135. package/build/src/scales/interpolatedColorScale.js +5 -4
  136. package/build/src/scales/linearScale.d.ts +4 -0
  137. package/build/src/scales/linearScale.js +2 -1
  138. package/build/src/scales/logScale.d.ts +4 -0
  139. package/build/src/scales/logScale.js +2 -1
  140. package/build/src/scales/modifiedLogScale.d.ts +8 -4
  141. package/build/src/scales/modifiedLogScale.js +2 -1
  142. package/build/src/scales/quantitativeScale.d.ts +5 -1
  143. package/build/src/scales/quantitativeScale.js +3 -2
  144. package/build/src/scales/scale.d.ts +4 -0
  145. package/build/src/scales/scale.js +1 -0
  146. package/build/src/scales/tickGenerators.js +1 -0
  147. package/build/src/scales/timeScale.js +2 -1
  148. package/build/src/utils/addD3SelectionMulti.d.ts +8 -0
  149. package/build/src/utils/arrayUtils.d.ts +4 -0
  150. package/build/src/utils/arrayUtils.js +1 -0
  151. package/build/src/utils/bucket.js +1 -0
  152. package/build/src/utils/callbackSet.js +2 -1
  153. package/build/src/utils/coerceD3.js +1 -0
  154. package/build/src/utils/colorUtils.d.ts +4 -0
  155. package/build/src/utils/colorUtils.js +1 -0
  156. package/build/src/utils/domUtils.d.ts +3 -10
  157. package/build/src/utils/domUtils.js +1 -0
  158. package/build/src/utils/entityStore.js +1 -0
  159. package/build/src/utils/index.d.ts +1 -1
  160. package/build/src/utils/index.js +9 -8
  161. package/build/src/utils/makeEnum.js +1 -0
  162. package/build/src/utils/map.d.ts +4 -0
  163. package/build/src/utils/map.js +1 -0
  164. package/build/src/utils/mathUtils.d.ts +4 -0
  165. package/build/src/utils/mathUtils.js +3 -2
  166. package/build/src/utils/objectUtils.js +1 -0
  167. package/build/src/utils/rTree.d.ts +1 -1
  168. package/build/src/utils/rTree.js +1 -0
  169. package/build/src/utils/rTreeSplitStrategies.d.ts +2 -2
  170. package/build/src/utils/rTreeSplitStrategies.js +1 -0
  171. package/build/src/utils/set.js +1 -0
  172. package/build/src/utils/stackingUtils.d.ts +5 -1
  173. package/build/src/utils/stackingUtils.js +6 -5
  174. package/build/src/utils/transformAwareTranslator.d.ts +4 -0
  175. package/build/src/utils/transformAwareTranslator.js +1 -0
  176. package/build/src/utils/windowUtils.d.ts +4 -0
  177. package/build/src/utils/windowUtils.js +1 -0
  178. package/package.json +6 -5
  179. package/plottable.js +40761 -29021
  180. package/plottable.js.map +1 -1
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var lodash_1 = require("lodash");
3
+ exports.memoizeProjectors = exports.memoizeProjector = void 0;
4
+ var lodash_es_1 = require("lodash-es");
4
5
  /**
5
6
  * An index that stores values by numeric key.
6
7
  *
@@ -63,7 +64,7 @@ var DatasetIndexCache = /** @class */ (function () {
63
64
  return DatasetIndexCache;
64
65
  }());
65
66
  function memoizeProjector(projector) {
66
- var memo = lodash_1.memoize(projector, DatasetIndexCache.resolver);
67
+ var memo = (0, lodash_es_1.memoize)(projector, DatasetIndexCache.resolver);
67
68
  memo.cache = new DatasetIndexCache();
68
69
  return memo;
69
70
  }
@@ -1,3 +1,17 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ * @fileoverview Implements the Signature API to help in comparing when two
5
+ * Plottable objects have "changed".
6
+ *
7
+ * Memoization in Plottable is complicated by mutable scales and datasets. We cannot simply
8
+ * reference compare two e.g. scales since it may have internally mutated. To resolve this,
9
+ * we write a recursive Signature interface that holds an immutable snapshot of whatever
10
+ * state the scale/data was in at the time. Then on memoized function invocation we sign the
11
+ * new inputs and compare the signatures to decide if we should recompute.
12
+ *
13
+ * We must hand-write a signature for each custom class we wish to support.
14
+ */
1
15
  import { Dataset } from "../core/dataset";
2
16
  import { Scale } from "../scales/scale";
3
17
  /**
@@ -14,6 +14,7 @@
14
14
  * We must hand-write a signature for each custom class we wish to support.
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ObjectSignature = exports.ReferenceSignature = exports.ArraySignature = exports.Signature = exports.signObj = exports.signArray = exports.signRef = exports.signDataset = exports.signScale = exports.sign = void 0;
17
18
  var tslib_1 = require("tslib");
18
19
  var isPlainObject = require("is-plain-object");
19
20
  var dataset_1 = require("../core/dataset");
@@ -119,7 +120,7 @@ exports.Signature = Signature;
119
120
  * A signature for an array.
120
121
  */
121
122
  var ArraySignature = /** @class */ (function (_super) {
122
- tslib_1.__extends(ArraySignature, _super);
123
+ (0, tslib_1.__extends)(ArraySignature, _super);
123
124
  function ArraySignature(array) {
124
125
  var _this = _super.call(this) || this;
125
126
  _this.array = array;
@@ -145,7 +146,7 @@ var ArraySignature = /** @class */ (function (_super) {
145
146
  }(Signature));
146
147
  exports.ArraySignature = ArraySignature;
147
148
  var ReferenceSignature = /** @class */ (function (_super) {
148
- tslib_1.__extends(ReferenceSignature, _super);
149
+ (0, tslib_1.__extends)(ReferenceSignature, _super);
149
150
  function ReferenceSignature(ref) {
150
151
  var _this = _super.call(this) || this;
151
152
  _this.ref = ref;
@@ -161,7 +162,7 @@ exports.ReferenceSignature = ReferenceSignature;
161
162
  * A signature for a plain js object.
162
163
  */
163
164
  var ObjectSignature = /** @class */ (function (_super) {
164
- tslib_1.__extends(ObjectSignature, _super);
165
+ (0, tslib_1.__extends)(ObjectSignature, _super);
165
166
  function ObjectSignature(obj) {
166
167
  var _this = _super.call(this) || this;
167
168
  _this.obj = obj;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { Dataset } from "../core/dataset";
2
6
  import { AttributeToProjector, IAccessor, Projector, SimpleSelection } from "../core/interfaces";
3
7
  import { QuantitativeScale } from "../scales/quantitativeScale";
@@ -34,8 +38,8 @@ export declare class Area<X> extends Line<X> {
34
38
  protected _createNodesForDataset(dataset: Dataset): Drawers.ProxyDrawer;
35
39
  protected _removeDatasetNodes(dataset: Dataset): void;
36
40
  protected _additionalPaint(): void;
37
- private _generateLineDrawSteps();
38
- private _generateLineAttrToProjector();
41
+ private _generateLineDrawSteps;
42
+ private _generateLineAttrToProjector;
39
43
  protected _createDrawer(dataset: Dataset): Drawers.ProxyDrawer;
40
44
  protected _generateDrawSteps(): Drawers.DrawStep[];
41
45
  protected _updateYScale(): void;
@@ -44,7 +48,7 @@ export declare class Area<X> extends Line<X> {
44
48
  protected _propertyProjectors(): AttributeToProjector;
45
49
  selections(datasets?: Dataset[]): SimpleSelection<any>;
46
50
  protected _constructAreaProjector(xProjector: Projector, yProjector: Projector, y0Projector: Projector): (datum: any[], index: number, dataset: Dataset) => string;
47
- private _createDefinedProjector(xProjector, yProjector);
48
- private _createAreaGenerator(xProjector, yProjector, y0Projector, definedProjector, dataset);
49
- private _createTopLineGenerator(xProjector, yProjector, definedProjector, dataset);
51
+ private _createDefinedProjector;
52
+ private _createAreaGenerator;
53
+ private _createTopLineGenerator;
50
54
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Area = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Scales = require("../scales");
@@ -16,7 +17,7 @@ var Plots = require("./");
16
17
  var linePlot_1 = require("./linePlot");
17
18
  var plot_1 = require("./plot");
18
19
  var Area = /** @class */ (function (_super) {
19
- tslib_1.__extends(Area, _super);
20
+ (0, tslib_1.__extends)(Area, _super);
20
21
  /**
21
22
  * An Area Plot draws a filled region (area) between Y and Y0.
22
23
  *
@@ -67,7 +68,7 @@ var Area = /** @class */ (function (_super) {
67
68
  };
68
69
  Area.prototype._addDataset = function (dataset) {
69
70
  var _this = this;
70
- this._lineDrawers.set(dataset, new Drawers.ProxyDrawer(function () { return new lineDrawer_1.LineSVGDrawer(); }, function (ctx) { return new Drawers.CanvasDrawer(ctx, lineDrawer_1.makeLineCanvasDrawStep(function () {
71
+ this._lineDrawers.set(dataset, new Drawers.ProxyDrawer(function () { return new lineDrawer_1.LineSVGDrawer(); }, function (ctx) { return new Drawers.CanvasDrawer(ctx, (0, lineDrawer_1.makeLineCanvasDrawStep)(function () {
71
72
  var xProjector = plot_1.Plot._scaledAccessor(_this.x());
72
73
  var yProjector = plot_1.Plot._scaledAccessor(_this.y());
73
74
  return _this._d3LineFactory(dataset, xProjector, yProjector);
@@ -120,7 +121,7 @@ var Area = /** @class */ (function (_super) {
120
121
  Area.prototype._createDrawer = function (dataset) {
121
122
  var _this = this;
122
123
  return new drawer_1.ProxyDrawer(function () { return new areaDrawer_1.AreaSVGDrawer(); }, function (ctx) {
123
- return new Drawers.CanvasDrawer(ctx, areaDrawer_1.makeAreaCanvasDrawStep(function () {
124
+ return new Drawers.CanvasDrawer(ctx, (0, areaDrawer_1.makeAreaCanvasDrawStep)(function () {
124
125
  var _a = _this._coordinateProjectors(), xProjector = _a[0], yProjector = _a[1], y0Projector = _a[2];
125
126
  var definedProjector = _this._createDefinedProjector(xProjector, yProjector);
126
127
  return _this._createAreaGenerator(xProjector, yProjector, y0Projector, definedProjector, dataset);
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { LabelFontSizePx } from "../components/label";
2
6
  import { Dataset } from "../core/dataset";
3
7
  import { DatumFormatter } from "../core/formatters";
@@ -15,15 +19,15 @@ export declare const BarOrientation: {
15
19
  };
16
20
  export declare type BarOrientation = keyof typeof BarOrientation;
17
21
  export declare const LabelsPosition: {
18
- start: "start";
19
22
  end: "end";
23
+ start: "start";
20
24
  middle: "middle";
21
25
  outside: "outside";
22
26
  };
23
27
  export declare type LabelsPosition = keyof typeof LabelsPosition;
24
28
  export declare const BarAlignment: {
25
- start: "start";
26
29
  end: "end";
30
+ start: "start";
27
31
  middle: "middle";
28
32
  };
29
33
  export declare type BarAlignment = keyof typeof BarAlignment;
@@ -211,8 +215,8 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
211
215
  entitiesInBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[];
212
216
  entitiesInXBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[];
213
217
  entitiesInYBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[];
214
- private _entitiesIntersecting(xValOrRange, yValOrRange);
215
- private _updateLengthScale();
218
+ private _entitiesIntersecting;
219
+ private _updateLengthScale;
216
220
  renderImmediately(): this;
217
221
  protected _additionalPaint(time: number): void;
218
222
  /**
@@ -225,37 +229,27 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
225
229
  */
226
230
  protected _getPositionAttr(position: number, thickness: number): number;
227
231
  protected _drawLabels(): void;
228
- private _drawLabel(datum, index, dataset, attrToProjector);
232
+ private _drawLabel;
229
233
  /**
230
234
  * Labels are "on-bar" by default, but if the bar is not long enough to fit the text,
231
235
  * we can try putting the label "off-bar", if there's enough space outside of the bar
232
236
  * to fit it.
233
237
  */
234
- private _shouldShowLabelOnBar(barCoordinates, barDimensions, labelDimensions);
235
- private _calculateLabelProperties(barCoordinates, barDimensions, measurement, showLabelOnBar, aboveOrLeftOfBaseline);
236
- private _createLabelContainer(labelArea, labelContainerOrigin, labelOrigin, measurement, showLabelOnBar, color);
238
+ private _shouldShowLabelOnBar;
239
+ private _calculateLabelProperties;
240
+ private _createLabelContainer;
237
241
  protected _generateDrawSteps(): Drawers.DrawStep[];
238
242
  protected _generateAttrToProjector(): AttributeToProjector;
239
243
  protected _updateThicknessAttr(): void;
240
- private _barPixelThickness();
244
+ private _barPixelThickness;
241
245
  entities(datasets?: Dataset[]): IPlotEntity[];
242
- protected _entityBounds(entity: Plots.IPlotEntity | Plots.ILightweightPlotEntity): {
243
- x: any;
244
- y: any;
245
- width: any;
246
- height: any;
247
- };
246
+ protected _entityBounds(entity: Plots.IPlotEntity | Plots.ILightweightPlotEntity): Pick<DOMRect, "height" | "width" | "x" | "y">;
248
247
  /**
249
248
  * The rectangular bounds of a bar. Note that the x/y coordinates are not the
250
249
  * same as the "pixel point" because they are always at the top/left of the
251
250
  * bar.
252
251
  */
253
- protected _pixelBounds(datum: any, index: number, dataset: Dataset): {
254
- x: any;
255
- y: any;
256
- width: any;
257
- height: any;
258
- };
252
+ protected _pixelBounds(datum: any, index: number, dataset: Dataset): Pick<DOMRect, "x" | "y" | "width" | "height">;
259
253
  /**
260
254
  * The "pixel point" of a bar is the farthest point from the baseline.
261
255
  *
@@ -264,7 +258,7 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
264
258
  * point will be at the bottom of the bar.
265
259
  */
266
260
  protected _pixelPoint(datum: any, index: number, dataset: Dataset): Point;
267
- private _pixelPointBar(originalPosition, scaledBaseline, rect);
261
+ private _pixelPointBar;
268
262
  protected _uninstallScaleForKey(scale: Scale<any, number>, key: string): void;
269
263
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
270
264
  protected _isDatumOnScreen(attrToProjector: AttributeToProjector, plotWidth: number, plotHeight: number, d: any, i: number, dataset: Dataset): boolean;
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Bar = exports.BarAlignment = exports.LabelsPosition = exports.BarOrientation = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Typesettable = require("typesettable");
@@ -21,11 +22,11 @@ var makeEnum_1 = require("../utils/makeEnum");
21
22
  var Plots = require("./");
22
23
  var plot_1 = require("./plot");
23
24
  var xyPlot_1 = require("./xyPlot");
24
- exports.BarOrientation = makeEnum_1.makeEnum(["vertical", "horizontal"]);
25
- exports.LabelsPosition = makeEnum_1.makeEnum(["start", "middle", "end", "outside"]);
26
- exports.BarAlignment = makeEnum_1.makeEnum(["start", "middle", "end"]);
25
+ exports.BarOrientation = (0, makeEnum_1.makeEnum)(["vertical", "horizontal"]);
26
+ exports.LabelsPosition = (0, makeEnum_1.makeEnum)(["start", "middle", "end", "outside"]);
27
+ exports.BarAlignment = (0, makeEnum_1.makeEnum)(["start", "middle", "end"]);
27
28
  var Bar = /** @class */ (function (_super) {
28
- tslib_1.__extends(Bar, _super);
29
+ (0, tslib_1.__extends)(Bar, _super);
29
30
  /**
30
31
  * A Bar Plot draws bars growing out from a baseline to some value
31
32
  *
@@ -41,7 +42,7 @@ var Bar = /** @class */ (function (_super) {
41
42
  _this._labelFontSize = label_1.Label._DEFAULT_FONT_SIZE_PX;
42
43
  _this._hideBarsIfAnyAreTooWide = true;
43
44
  _this._barAlignment = "middle";
44
- _this._computeBarPixelThickness = memoize_1.memoize(computeBarPixelThickness);
45
+ _this._computeBarPixelThickness = (0, memoize_1.memoize)(computeBarPixelThickness);
45
46
  /**
46
47
  * Whether all the bars in this barPlot have the same pixel thickness.
47
48
  * If so, use the _barPixelThickness property to access the thickness.
@@ -16,10 +16,8 @@ export declare class ClusteredBar<X, Y> extends Bar<X, Y> {
16
16
  * @param {string} [orientation="vertical"] One of "vertical"/"horizontal".
17
17
  */
18
18
  constructor(orientation?: BarOrientation);
19
- protected _generateAttrToProjector(): {
20
- [attr: string]: (datum: any, index: number, dataset: Dataset) => any;
21
- };
22
- private _updateClusterPosition();
23
- private _makeInnerScale();
19
+ protected _generateAttrToProjector(): import("..").AttributeToProjector;
20
+ private _updateClusterPosition;
21
+ private _makeInnerScale;
24
22
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
25
23
  }
@@ -4,13 +4,14 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ClusteredBar = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var Scales = require("../scales");
9
10
  var Utils = require("../utils");
10
11
  var barPlot_1 = require("./barPlot");
11
12
  var plot_1 = require("./plot");
12
13
  var ClusteredBar = /** @class */ (function (_super) {
13
- tslib_1.__extends(ClusteredBar, _super);
14
+ (0, tslib_1.__extends)(ClusteredBar, _super);
14
15
  /**
15
16
  * A ClusteredBar Plot groups bars across Datasets based on the primary value of the bars.
16
17
  * On a vertical ClusteredBar Plot, the bars with the same X value are grouped.
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Animator = void 0;
7
8
  var Animator;
8
9
  (function (Animator) {
9
10
  Animator.MAIN = "main";
@@ -30,5 +30,5 @@ export declare class DeferredRenderer<X, Y> {
30
30
  updateDomains(scaleX?: ITransformableScale, scaleY?: ITransformableScale): void;
31
31
  resetTransforms(): void;
32
32
  private renderDeferred;
33
- private applyTransform();
33
+ private applyTransform;
34
34
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DeferredRenderer = void 0;
7
8
  /**
8
9
  * Stores the deferred transformation state for a single scale.
9
10
  */
@@ -5,15 +5,15 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var tslib_1 = require("tslib");
8
- tslib_1.__exportStar(require("./areaPlot"), exports);
9
- tslib_1.__exportStar(require("./barPlot"), exports);
10
- tslib_1.__exportStar(require("./commons"), exports);
11
- tslib_1.__exportStar(require("./clusteredBarPlot"), exports);
12
- tslib_1.__exportStar(require("./linePlot"), exports);
13
- tslib_1.__exportStar(require("./piePlot"), exports);
14
- tslib_1.__exportStar(require("./rectanglePlot"), exports);
15
- tslib_1.__exportStar(require("./scatterPlot"), exports);
16
- tslib_1.__exportStar(require("./segmentPlot"), exports);
17
- tslib_1.__exportStar(require("./stackedAreaPlot"), exports);
18
- tslib_1.__exportStar(require("./stackedBarPlot"), exports);
19
- tslib_1.__exportStar(require("./waterfallPlot"), exports);
8
+ (0, tslib_1.__exportStar)(require("./areaPlot"), exports);
9
+ (0, tslib_1.__exportStar)(require("./barPlot"), exports);
10
+ (0, tslib_1.__exportStar)(require("./commons"), exports);
11
+ (0, tslib_1.__exportStar)(require("./clusteredBarPlot"), exports);
12
+ (0, tslib_1.__exportStar)(require("./linePlot"), exports);
13
+ (0, tslib_1.__exportStar)(require("./piePlot"), exports);
14
+ (0, tslib_1.__exportStar)(require("./rectanglePlot"), exports);
15
+ (0, tslib_1.__exportStar)(require("./scatterPlot"), exports);
16
+ (0, tslib_1.__exportStar)(require("./segmentPlot"), exports);
17
+ (0, tslib_1.__exportStar)(require("./stackedAreaPlot"), exports);
18
+ (0, tslib_1.__exportStar)(require("./stackedBarPlot"), exports);
19
+ (0, tslib_1.__exportStar)(require("./waterfallPlot"), exports);
@@ -62,7 +62,7 @@ export declare class Line<X> extends XYPlot<X, number> {
62
62
  * and deactivating the nice domain feature on the scales
63
63
  */
64
64
  autorangeSmooth(autorangeSmooth: boolean): this;
65
- private _setScaleSnapping();
65
+ private _setScaleSnapping;
66
66
  /**
67
67
  * Gets the curve function associated with the plot.
68
68
  *
@@ -118,7 +118,7 @@ export declare class Line<X> extends XYPlot<X, number> {
118
118
  collapseDenseLinesEnabled(collapseDenseLines: boolean): this;
119
119
  protected _createDrawer(dataset: Dataset): Drawers.ProxyDrawer;
120
120
  protected getExtentsForProperty(property: string): any[][];
121
- private _getEdgeIntersectionPoints();
121
+ private _getEdgeIntersectionPoints;
122
122
  protected _getResetYFunction(): (d: any, i: number, dataset: Dataset) => number;
123
123
  protected _generateDrawSteps(): Drawers.DrawStep[];
124
124
  protected _generateAttrToProjector(): AttributeToProjector;
@@ -149,8 +149,8 @@ export declare class Line<X> extends XYPlot<X, number> {
149
149
  * @private
150
150
  */
151
151
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
152
- private _filterCroppedRendering(dataset, indices);
153
- private _filterDownsampling(dataset, indices);
152
+ private _filterCroppedRendering;
153
+ private _filterDownsampling;
154
154
  /**
155
155
  * Collapse line geometry
156
156
  *
@@ -158,7 +158,7 @@ export declare class Line<X> extends XYPlot<X, number> {
158
158
  * we can save a lot of render time by just drawing one line from the min to
159
159
  * max y-coordinate of all those points.
160
160
  */
161
- private _filterDenseLines(dataset, indices);
161
+ private _filterDenseLines;
162
162
  /**
163
163
  * Iterates over the line points collapsing points that fall on the same
164
164
  * floored x coordinate.
@@ -170,5 +170,5 @@ export declare class Line<X> extends XYPlot<X, number> {
170
170
  * also drawn. This allows lines with no collapsed segments to render
171
171
  * correctly.
172
172
  */
173
- private _bucketByX(dataset, indices, xFn, yFn);
173
+ private _bucketByX;
174
174
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Line = exports.CurveName = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Animators = require("../animators");
@@ -35,7 +36,7 @@ var CURVE_NAME_MAPPING = {
35
36
  /**
36
37
  * Known curve types that line and area plot's .curve() methods understand
37
38
  */
38
- exports.CurveName = makeEnum_1.makeEnum([
39
+ exports.CurveName = (0, makeEnum_1.makeEnum)([
39
40
  "linear",
40
41
  "linearClosed",
41
42
  "step",
@@ -51,7 +52,7 @@ exports.CurveName = makeEnum_1.makeEnum([
51
52
  "monotone",
52
53
  ]);
53
54
  var Line = /** @class */ (function (_super) {
54
- tslib_1.__extends(Line, _super);
55
+ (0, tslib_1.__extends)(Line, _super);
55
56
  /**
56
57
  * A Line Plot draws line segments starting from the first data point to the next.
57
58
  *
@@ -151,7 +152,7 @@ var Line = /** @class */ (function (_super) {
151
152
  };
152
153
  Line.prototype._createDrawer = function (dataset) {
153
154
  var _this = this;
154
- return new drawer_1.ProxyDrawer(function () { return new lineDrawer_1.LineSVGDrawer(); }, function (ctx) { return new Drawers.CanvasDrawer(ctx, lineDrawer_1.makeLineCanvasDrawStep(function () { return _this._d3LineFactory(dataset); })); });
155
+ return new drawer_1.ProxyDrawer(function () { return new lineDrawer_1.LineSVGDrawer(); }, function (ctx) { return new Drawers.CanvasDrawer(ctx, (0, lineDrawer_1.makeLineCanvasDrawStep)(function () { return _this._d3LineFactory(dataset); })); });
155
156
  };
156
157
  Line.prototype.getExtentsForProperty = function (property) {
157
158
  var extents = _super.prototype.getExtentsForProperty.call(this, property);
@@ -169,7 +170,7 @@ var Line = /** @class */ (function (_super) {
169
170
  if (this.autorangeMode() === "y") {
170
171
  includedValues = edgeIntersectionPoints.left.concat(edgeIntersectionPoints.right).map(function (point) { return point.y; });
171
172
  }
172
- else {
173
+ else { // === "x"
173
174
  includedValues = edgeIntersectionPoints.top.concat(edgeIntersectionPoints.bottom).map(function (point) { return point.x; });
174
175
  }
175
176
  return extents.map(function (extent) { return d3.extent(d3.merge([extent, includedValues])); });
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { Dataset } from "../core/dataset";
2
6
  import { DatumFormatter } from "../core/formatters";
3
7
  import { AttributeToProjector, IAccessor, Point, SimpleSelection } from "../core/interfaces";
@@ -149,8 +153,8 @@ export declare class Pie extends Plot {
149
153
  labelFormatter(formatter: DatumFormatter): this;
150
154
  entitiesAt(queryPoint: Point): IPiePlotEntity[];
151
155
  protected _propertyProjectors(): AttributeToProjector;
152
- private _updatePieAngles();
153
- private _pieCenter();
156
+ private _updatePieAngles;
157
+ private _pieCenter;
154
158
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
155
159
  protected static _isValidData(value: any): boolean;
156
160
  protected _pixelPoint(datum: any, index: number, dataset: Dataset): {
@@ -158,7 +162,7 @@ export declare class Pie extends Plot {
158
162
  y: number;
159
163
  };
160
164
  protected _additionalPaint(time: number): void;
161
- private _generateStrokeDrawSteps();
162
- private _sliceIndexForPoint(p);
163
- private _drawLabels();
165
+ private _generateStrokeDrawSteps;
166
+ private _sliceIndexForPoint;
167
+ private _drawLabels;
164
168
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Pie = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Typesettable = require("typesettable");
@@ -17,7 +18,7 @@ var drawer_1 = require("../drawers/drawer");
17
18
  var windowUtils_1 = require("../utils/windowUtils");
18
19
  var plot_1 = require("./plot");
19
20
  var Pie = /** @class */ (function (_super) {
20
- tslib_1.__extends(Pie, _super);
21
+ (0, tslib_1.__extends)(Pie, _super);
21
22
  /**
22
23
  * @constructor
23
24
  */
@@ -108,7 +109,7 @@ var Pie = /** @class */ (function (_super) {
108
109
  };
109
110
  Pie.prototype._createDrawer = function () {
110
111
  return new drawer_1.ProxyDrawer(function () { return new arcDrawer_1.ArcSVGDrawer(); }, function () {
111
- windowUtils_1.warn("canvas renderer is not supported on Pie Plot!");
112
+ (0, windowUtils_1.warn)("canvas renderer is not supported on Pie Plot!");
112
113
  return null;
113
114
  });
114
115
  };
@@ -14,8 +14,8 @@ import { Component } from "../components/component";
14
14
  import { ProxyDrawer } from "../drawers/drawer";
15
15
  import { Scale } from "../scales/scale";
16
16
  export declare const Renderer: {
17
- svg: "svg";
18
17
  canvas: "canvas";
18
+ svg: "svg";
19
19
  };
20
20
  export declare type Renderer = keyof typeof Renderer;
21
21
  export declare class Plot extends Component {
@@ -116,7 +116,7 @@ export declare class Plot extends Component {
116
116
  constructor();
117
117
  anchor(selection: d3.Selection<HTMLElement, any, any, any>): this;
118
118
  protected _setup(): void;
119
- private _appendCanvasNode();
119
+ private _appendCanvasNode;
120
120
  setBounds(width: number, height: number, originX?: number, originY?: number): this;
121
121
  destroy(): void;
122
122
  /**
@@ -178,7 +178,7 @@ export declare class Plot extends Component {
178
178
  /**
179
179
  * @returns {Scale[]} A unique array of all scales currently used by the Plot.
180
180
  */
181
- private _scales();
181
+ private _scales;
182
182
  /**
183
183
  * Updates the extents associated with each attribute, then autodomains all scales the Plot uses.
184
184
  */
@@ -189,7 +189,7 @@ export declare class Plot extends Component {
189
189
  * Override in subclass to add special extents, such as included values
190
190
  */
191
191
  protected getExtentsForProperty(property: string): any[][];
192
- private _includedValuesForScale<D>(scale, ignoreAttachState?);
192
+ private _includedValuesForScale;
193
193
  /**
194
194
  * Get the Animator associated with the specified Animator key.
195
195
  *
@@ -241,7 +241,7 @@ export declare class Plot extends Component {
241
241
  */
242
242
  protected _buildLightweightPlotEntities(datasets: Dataset[]): Plots.ILightweightPlotEntity[];
243
243
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
244
- private _paint();
244
+ private _paint;
245
245
  /**
246
246
  * Retrieves the drawn visual elements for the specified Datasets as a d3 Selection.
247
247
  * Not supported on canvas renderer.
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Plot = exports.Renderer = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Animators = require("../animators");
@@ -17,9 +18,9 @@ var svgDrawer_1 = require("../drawers/svgDrawer");
17
18
  var coerceD3_1 = require("../utils/coerceD3");
18
19
  var makeEnum_1 = require("../utils/makeEnum");
19
20
  var deferredRenderer_1 = require("./deferredRenderer");
20
- exports.Renderer = makeEnum_1.makeEnum(["svg", "canvas"]);
21
+ exports.Renderer = (0, makeEnum_1.makeEnum)(["svg", "canvas"]);
21
22
  var Plot = /** @class */ (function (_super) {
22
- tslib_1.__extends(Plot, _super);
23
+ (0, tslib_1.__extends)(Plot, _super);
23
24
  /**
24
25
  * A Plot draws some visualization of the inputted Datasets.
25
26
  *
@@ -91,7 +92,7 @@ var Plot = /** @class */ (function (_super) {
91
92
  return appliedDrawSteps;
92
93
  };
93
94
  Plot.prototype.anchor = function (selection) {
94
- selection = coerceD3_1.coerceExternalD3(selection);
95
+ selection = (0, coerceD3_1.coerceExternalD3)(selection);
95
96
  _super.prototype.anchor.call(this, selection);
96
97
  this._dataChanged = true;
97
98
  this._resetEntityStore();
@@ -264,7 +265,7 @@ var Plot = /** @class */ (function (_super) {
264
265
  if (this._cachedAttrToProjector == null) {
265
266
  var projectors = this._generateAttrToProjector();
266
267
  if (Plot.OPTIMIZE_MEMOIZE_PROJECTORS) {
267
- projectors = memoize_1.memoizeProjectors(projectors);
268
+ projectors = (0, memoize_1.memoizeProjectors)(projectors);
268
269
  }
269
270
  this._cachedAttrToProjector = projectors;
270
271
  }
@@ -342,7 +343,7 @@ var Plot = /** @class */ (function (_super) {
342
343
  Plot.prototype.getExtentsForAttr = function (attr) {
343
344
  var _this = this;
344
345
  if (this._attrExtents[attr] == null) {
345
- var thunk = memoize_1.memThunk(function () { return _this.datasets(); }, function () { return _this._attrBindings.get(attr); }, function (datasets, accScaleBinding) {
346
+ var thunk = (0, memoize_1.memThunk)(function () { return _this.datasets(); }, function () { return _this._attrBindings.get(attr); }, function (datasets, accScaleBinding) {
346
347
  if (accScaleBinding == null || accScaleBinding.accessor == null) {
347
348
  return null;
348
349
  }
@@ -358,7 +359,7 @@ var Plot = /** @class */ (function (_super) {
358
359
  Plot.prototype.getExtentsForProperty = function (property) {
359
360
  var _this = this;
360
361
  if (this._propertyExtents[property] == null) {
361
- var thunk = memoize_1.memThunk(function () { return _this.datasets(); }, function () { return _this._propertyBindings.get(property); }, function () { return _this._filterForProperty(property); }, function (datasets, accScaleBinding, filter) {
362
+ var thunk = (0, memoize_1.memThunk)(function () { return _this.datasets(); }, function () { return _this._propertyBindings.get(property); }, function () { return _this._filterForProperty(property); }, function (datasets, accScaleBinding, filter) {
362
363
  if (accScaleBinding == null || accScaleBinding.accessor == null) {
363
364
  return null;
364
365
  }
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { Dataset } from "../core/dataset";
2
6
  import { AttributeToProjector, IAccessor, IRangeProjector, Point } from "../core/interfaces";
3
7
  import * as Drawers from "../drawers";
@@ -97,8 +101,8 @@ export declare class Rectangle<X, Y> extends XYPlot<X, Y> {
97
101
  * @returns {PlotEntity[]} The PlotEntities at the particular point
98
102
  */
99
103
  entitiesAt(point: Point): Plots.IPlotEntity[];
100
- protected _entityBounds(entity: Plots.IPlotEntity | Plots.ILightweightPlotEntity): SVGRect;
101
- private _entityBBox(datum, index, dataset, attrToProjector);
104
+ protected _entityBounds(entity: Plots.IPlotEntity | Plots.ILightweightPlotEntity): Pick<DOMRect, "height" | "width" | "x" | "y">;
105
+ private _entityBBox;
102
106
  /**
103
107
  * Gets the accessor for labels.
104
108
  *
@@ -131,10 +135,10 @@ export declare class Rectangle<X, Y> extends XYPlot<X, Y> {
131
135
  x: any;
132
136
  y: any;
133
137
  };
134
- private _rectangleWidth(scale);
138
+ private _rectangleWidth;
135
139
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
136
140
  protected _additionalPaint(time: number): void;
137
- private _drawLabels();
138
- private _drawLabel(dataToDraw, dataset, datasetIndex);
139
- private _overlayLabel(labelXRange, labelYRange, datumIndex, datasetIndex, dataToDraw);
141
+ private _drawLabels;
142
+ private _drawLabel;
143
+ private _overlayLabel;
140
144
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Rectangle = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Typesettable = require("typesettable");
@@ -16,7 +17,7 @@ var Utils = require("../utils");
16
17
  var plot_1 = require("./plot");
17
18
  var xyPlot_1 = require("./xyPlot");
18
19
  var Rectangle = /** @class */ (function (_super) {
19
- tslib_1.__extends(Rectangle, _super);
20
+ (0, tslib_1.__extends)(Rectangle, _super);
20
21
  /**
21
22
  * A Rectangle Plot displays rectangles based on the data.
22
23
  * The left and right edges of each rectangle can be set with x() and x2().