plottable 3.9.0-dev-56-geb1f7fd → 3.9.0-dev-60-g2ae4d07

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 (182) 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 +23 -4
  6. package/build/src/axes/axis.js +35 -6
  7. package/build/src/axes/categoryAxis.d.ts +12 -5
  8. package/build/src/axes/categoryAxis.js +22 -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 +21 -14
  13. package/build/src/axes/timeAxis.js +30 -7
  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.d.ts +4 -0
  29. package/build/src/components/label.js +7 -3
  30. package/build/src/components/legend.d.ts +5 -1
  31. package/build/src/components/legend.js +2 -1
  32. package/build/src/components/plotGroup.js +2 -1
  33. package/build/src/components/selectionBoxLayer.d.ts +4 -4
  34. package/build/src/components/selectionBoxLayer.js +2 -1
  35. package/build/src/components/table.d.ts +10 -6
  36. package/build/src/components/table.js +4 -3
  37. package/build/src/components/wrappedLabel.js +2 -1
  38. package/build/src/components/xDragBoxLayer.js +2 -1
  39. package/build/src/components/yDragBoxLayer.js +2 -1
  40. package/build/src/core/config.js +1 -0
  41. package/build/src/core/dataset.d.ts +5 -1
  42. package/build/src/core/dataset.js +1 -0
  43. package/build/src/core/formatters.d.ts +4 -0
  44. package/build/src/core/formatters.js +1 -0
  45. package/build/src/core/renderController.d.ts +1 -1
  46. package/build/src/core/renderController.js +2 -1
  47. package/build/src/core/renderPolicy.d.ts +4 -0
  48. package/build/src/core/renderPolicy.js +1 -0
  49. package/build/src/core/symbolFactories.d.ts +4 -0
  50. package/build/src/core/symbolFactories.js +1 -0
  51. package/build/src/core/version.d.ts +4 -0
  52. package/build/src/core/version.js +2 -1
  53. package/build/src/core/version.js.bak +1 -0
  54. package/build/src/dispatchers/dispatcher.d.ts +7 -3
  55. package/build/src/dispatchers/dispatcher.js +2 -1
  56. package/build/src/dispatchers/index.js +3 -3
  57. package/build/src/dispatchers/keyDispatcher.d.ts +2 -2
  58. package/build/src/dispatchers/keyDispatcher.js +2 -1
  59. package/build/src/dispatchers/mouseDispatcher.d.ts +1 -1
  60. package/build/src/dispatchers/mouseDispatcher.js +2 -1
  61. package/build/src/dispatchers/touchDispatcher.d.ts +1 -1
  62. package/build/src/dispatchers/touchDispatcher.js +2 -1
  63. package/build/src/drawers/arcDrawer.js +2 -1
  64. package/build/src/drawers/arcOutlineDrawer.js +2 -1
  65. package/build/src/drawers/areaDrawer.js +6 -5
  66. package/build/src/drawers/canvasBuffer.js +1 -0
  67. package/build/src/drawers/canvasDrawer.js +1 -0
  68. package/build/src/drawers/drawer.js +1 -0
  69. package/build/src/drawers/index.js +11 -10
  70. package/build/src/drawers/lineDrawer.js +4 -3
  71. package/build/src/drawers/rectangleDrawer.js +7 -5
  72. package/build/src/drawers/segmentDrawer.js +2 -1
  73. package/build/src/drawers/svgDrawer.d.ts +2 -2
  74. package/build/src/drawers/svgDrawer.js +1 -0
  75. package/build/src/drawers/symbolDrawer.js +6 -6
  76. package/build/src/index.d.ts +1 -1
  77. package/build/src/index.js +17 -14
  78. package/build/src/interactions/clickInteraction.d.ts +4 -4
  79. package/build/src/interactions/clickInteraction.js +2 -1
  80. package/build/src/interactions/dragInteraction.d.ts +4 -4
  81. package/build/src/interactions/dragInteraction.js +2 -1
  82. package/build/src/interactions/index.js +7 -6
  83. package/build/src/interactions/interaction.d.ts +2 -2
  84. package/build/src/interactions/interaction.js +1 -0
  85. package/build/src/interactions/keyInteraction.d.ts +2 -2
  86. package/build/src/interactions/keyInteraction.js +2 -1
  87. package/build/src/interactions/panZoomConstraints.js +1 -0
  88. package/build/src/interactions/panZoomInteraction.d.ts +13 -9
  89. package/build/src/interactions/panZoomInteraction.js +4 -3
  90. package/build/src/interactions/pointerInteraction.d.ts +3 -3
  91. package/build/src/interactions/pointerInteraction.js +2 -1
  92. package/build/src/memoize/index.js +5 -4
  93. package/build/src/memoize/memThunk.js +2 -1
  94. package/build/src/memoize/memoize.d.ts +5 -0
  95. package/build/src/memoize/memoize.js +2 -1
  96. package/build/src/memoize/memoizeProjectors.js +3 -2
  97. package/build/src/memoize/signature.d.ts +14 -0
  98. package/build/src/memoize/signature.js +4 -3
  99. package/build/src/plots/areaPlot.d.ts +9 -5
  100. package/build/src/plots/areaPlot.js +4 -3
  101. package/build/src/plots/barPlot.d.ts +26 -22
  102. package/build/src/plots/barPlot.js +35 -7
  103. package/build/src/plots/clusteredBarPlot.d.ts +3 -5
  104. package/build/src/plots/clusteredBarPlot.js +2 -1
  105. package/build/src/plots/commons.js +1 -0
  106. package/build/src/plots/deferredRenderer.d.ts +1 -1
  107. package/build/src/plots/deferredRenderer.js +1 -0
  108. package/build/src/plots/index.js +12 -12
  109. package/build/src/plots/linePlot.d.ts +6 -6
  110. package/build/src/plots/linePlot.js +5 -4
  111. package/build/src/plots/piePlot.d.ts +9 -5
  112. package/build/src/plots/piePlot.js +3 -2
  113. package/build/src/plots/plot.d.ts +5 -5
  114. package/build/src/plots/plot.js +7 -6
  115. package/build/src/plots/rectanglePlot.d.ts +10 -6
  116. package/build/src/plots/rectanglePlot.js +2 -1
  117. package/build/src/plots/scatterPlot.d.ts +19 -9
  118. package/build/src/plots/scatterPlot.js +35 -3
  119. package/build/src/plots/segmentPlot.d.ts +7 -3
  120. package/build/src/plots/segmentPlot.js +3 -2
  121. package/build/src/plots/stackedAreaPlot.d.ts +6 -2
  122. package/build/src/plots/stackedAreaPlot.js +4 -3
  123. package/build/src/plots/stackedBarPlot.d.ts +8 -4
  124. package/build/src/plots/stackedBarPlot.js +27 -6
  125. package/build/src/plots/waterfallPlot.d.ts +4 -6
  126. package/build/src/plots/waterfallPlot.js +2 -1
  127. package/build/src/plots/xyPlot.d.ts +5 -5
  128. package/build/src/plots/xyPlot.js +2 -1
  129. package/build/src/scales/categoryScale.d.ts +7 -3
  130. package/build/src/scales/categoryScale.js +3 -2
  131. package/build/src/scales/colorScale.d.ts +5 -1
  132. package/build/src/scales/colorScale.js +2 -1
  133. package/build/src/scales/index.d.ts +1 -1
  134. package/build/src/scales/index.js +8 -7
  135. package/build/src/scales/interpolatedColorScale.d.ts +7 -3
  136. package/build/src/scales/interpolatedColorScale.js +5 -4
  137. package/build/src/scales/linearScale.d.ts +4 -0
  138. package/build/src/scales/linearScale.js +2 -1
  139. package/build/src/scales/logScale.d.ts +4 -0
  140. package/build/src/scales/logScale.js +2 -1
  141. package/build/src/scales/modifiedLogScale.d.ts +8 -4
  142. package/build/src/scales/modifiedLogScale.js +2 -1
  143. package/build/src/scales/quantitativeScale.d.ts +5 -1
  144. package/build/src/scales/quantitativeScale.js +3 -2
  145. package/build/src/scales/scale.d.ts +4 -0
  146. package/build/src/scales/scale.js +1 -0
  147. package/build/src/scales/tickGenerators.js +1 -0
  148. package/build/src/scales/timeScale.js +2 -1
  149. package/build/src/utils/addD3SelectionMulti.d.ts +8 -0
  150. package/build/src/utils/arrayUtils.d.ts +4 -0
  151. package/build/src/utils/arrayUtils.js +1 -0
  152. package/build/src/utils/bucket.js +1 -0
  153. package/build/src/utils/callbackSet.js +2 -1
  154. package/build/src/utils/coerceD3.js +1 -0
  155. package/build/src/utils/colorUtils.d.ts +4 -0
  156. package/build/src/utils/colorUtils.js +1 -0
  157. package/build/src/utils/domUtils.d.ts +3 -10
  158. package/build/src/utils/domUtils.js +1 -0
  159. package/build/src/utils/entityStore.js +1 -0
  160. package/build/src/utils/index.d.ts +1 -1
  161. package/build/src/utils/index.js +9 -8
  162. package/build/src/utils/makeEnum.js +1 -0
  163. package/build/src/utils/map.d.ts +4 -0
  164. package/build/src/utils/map.js +1 -0
  165. package/build/src/utils/mathUtils.d.ts +4 -0
  166. package/build/src/utils/mathUtils.js +3 -2
  167. package/build/src/utils/objectUtils.js +1 -0
  168. package/build/src/utils/rTree.d.ts +1 -1
  169. package/build/src/utils/rTree.js +1 -0
  170. package/build/src/utils/rTreeSplitStrategies.d.ts +2 -2
  171. package/build/src/utils/rTreeSplitStrategies.js +1 -0
  172. package/build/src/utils/set.js +1 -0
  173. package/build/src/utils/stackingUtils.d.ts +5 -1
  174. package/build/src/utils/stackingUtils.js +6 -5
  175. package/build/src/utils/transformAwareTranslator.d.ts +4 -0
  176. package/build/src/utils/transformAwareTranslator.js +1 -0
  177. package/build/src/utils/windowUtils.d.ts +4 -0
  178. package/build/src/utils/windowUtils.js +1 -0
  179. package/package.json +6 -5
  180. package/plottable.css +75 -2
  181. package/plottable.js +38050 -26170
  182. package/plottable.js.map +1 -1
@@ -20,8 +20,8 @@ export declare class Key extends Interaction {
20
20
  private _keyUpCallback;
21
21
  protected _anchor(component: Component): void;
22
22
  protected _unanchor(): void;
23
- private _handleKeyDownEvent(keyCode, event);
24
- private _handleKeyUpEvent(keyCode);
23
+ private _handleKeyDownEvent;
24
+ private _handleKeyUpEvent;
25
25
  /**
26
26
  * Adds a callback to be called when the key with the given keyCode is
27
27
  * pressed and the user is moused over the Component.
@@ -4,12 +4,13 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Key = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var Dispatchers = require("../dispatchers");
9
10
  var Utils = require("../utils");
10
11
  var interaction_1 = require("./interaction");
11
12
  var Key = /** @class */ (function (_super) {
12
- tslib_1.__extends(Key, _super);
13
+ (0, tslib_1.__extends)(Key, _super);
13
14
  function Key() {
14
15
  var _this = _super !== null && _super.apply(this, arguments) || this;
15
16
  _this._keyPressCallbacks = {};
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.constrainedTranslation = exports.constrainZoomValues = exports.constrainZoomExtents = exports.constrainedZoom = exports.zoomOut = void 0;
7
8
  /**
8
9
  * Return `value` if its distance to `center` was scaled by `zoom`.
9
10
  *
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { Component } from "../components/component";
2
6
  import { Point } from "../core/interfaces";
3
7
  import { TransformableScale } from "../scales/scale";
@@ -81,19 +85,19 @@ export declare class PanZoom extends Interaction {
81
85
  };
82
86
  protected _anchor(component: Component): void;
83
87
  protected _unanchor(): void;
84
- private _handleTouchStart(ids, idToPoint, e);
85
- private _handlePinch(ids, idToPoint, e);
88
+ private _handleTouchStart;
89
+ private _handlePinch;
86
90
  static centerPoint(point1: Point, point2: Point): {
87
91
  x: number;
88
92
  y: number;
89
93
  };
90
- private static _pointDistance(point1, point2);
91
- private _handleTouchEnd(ids, idToPoint, e);
92
- private _handleWheelEvent(p, e);
93
- private _constrainedZoom(scale, zoomAmount, centerPoint);
94
- private _constrainedTranslation(scale, translation);
95
- private _setupDragInteraction();
96
- private _nonLinearScaleWithExtents(scale);
94
+ private static _pointDistance;
95
+ private _handleTouchEnd;
96
+ private _handleWheelEvent;
97
+ private _constrainedZoom;
98
+ private _constrainedTranslation;
99
+ private _setupDragInteraction;
100
+ private _nonLinearScaleWithExtents;
97
101
  /**
98
102
  * Gets the x scales for this PanZoom Interaction.
99
103
  */
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.PanZoom = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Dispatchers = require("../dispatchers");
@@ -13,7 +14,7 @@ var Interactions = require("./");
13
14
  var interaction_1 = require("./interaction");
14
15
  var panZoomConstraints_1 = require("./panZoomConstraints");
15
16
  var PanZoom = /** @class */ (function (_super) {
16
- tslib_1.__extends(PanZoom, _super);
17
+ (0, tslib_1.__extends)(PanZoom, _super);
17
18
  /**
18
19
  * A PanZoom Interaction updates the domains of an x-scale and/or a y-scale
19
20
  * in response to the user panning or zooming.
@@ -240,10 +241,10 @@ var PanZoom = /** @class */ (function (_super) {
240
241
  }
241
242
  };
242
243
  PanZoom.prototype._constrainedZoom = function (scale, zoomAmount, centerPoint) {
243
- return panZoomConstraints_1.constrainedZoom(scale, zoomAmount, centerPoint, this.minDomainExtent(scale), this.maxDomainExtent(scale), this.minDomainValue(scale), this.maxDomainValue(scale));
244
+ return (0, panZoomConstraints_1.constrainedZoom)(scale, zoomAmount, centerPoint, this.minDomainExtent(scale), this.maxDomainExtent(scale), this.minDomainValue(scale), this.maxDomainValue(scale));
244
245
  };
245
246
  PanZoom.prototype._constrainedTranslation = function (scale, translation) {
246
- return panZoomConstraints_1.constrainedTranslation(scale, translation, this.minDomainValue(scale), this.maxDomainValue(scale));
247
+ return (0, panZoomConstraints_1.constrainedTranslation)(scale, translation, this.minDomainValue(scale), this.maxDomainValue(scale));
247
248
  };
248
249
  PanZoom.prototype._setupDragInteraction = function () {
249
250
  var _this = this;
@@ -17,9 +17,9 @@ export declare class Pointer extends Interaction {
17
17
  private _touchStartCallback;
18
18
  protected _anchor(component: Component): void;
19
19
  protected _unanchor(): void;
20
- private _handleMouseEvent(p, e);
21
- private _handleTouchEvent(p, e);
22
- private _handlePointerEvent(p, insideSVG);
20
+ private _handleMouseEvent;
21
+ private _handleTouchEvent;
22
+ private _handlePointerEvent;
23
23
  /**
24
24
  * Adds a callback to be called when the pointer enters the Component.
25
25
  *
@@ -4,12 +4,13 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Pointer = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var Dispatchers = require("../dispatchers");
9
10
  var Utils = require("../utils");
10
11
  var interaction_1 = require("./interaction");
11
12
  var Pointer = /** @class */ (function (_super) {
12
- tslib_1.__extends(Pointer, _super);
13
+ (0, tslib_1.__extends)(Pointer, _super);
13
14
  function Pointer() {
14
15
  var _this = _super !== null && _super.apply(this, arguments) || this;
15
16
  _this._overComponent = false;
@@ -4,9 +4,10 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.sign = void 0;
7
8
  var tslib_1 = require("tslib");
8
- tslib_1.__exportStar(require("./memoize"), exports);
9
- tslib_1.__exportStar(require("./memoizeProjectors"), exports);
10
- tslib_1.__exportStar(require("./memThunk"), exports);
9
+ (0, tslib_1.__exportStar)(require("./memoize"), exports);
10
+ (0, tslib_1.__exportStar)(require("./memoizeProjectors"), exports);
11
+ (0, tslib_1.__exportStar)(require("./memThunk"), exports);
11
12
  var signature_1 = require("./signature");
12
- exports.sign = signature_1.sign;
13
+ Object.defineProperty(exports, "sign", { enumerable: true, get: function () { return signature_1.sign; } });
@@ -6,6 +6,7 @@
6
6
  * of creating a memoized function that takes its inputs from mutable class properties.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.memThunk = void 0;
9
10
  var index_1 = require("./index");
10
11
  /**
11
12
  * First pass argument thunks that will be evaluated whenever the memThunk
@@ -26,7 +27,7 @@ function memThunk() {
26
27
  }
27
28
  var inputs = argsAndCompute.slice(0, -1);
28
29
  var compute = argsAndCompute[argsAndCompute.length - 1];
29
- var memoizedCompute = index_1.memoize(compute);
30
+ var memoizedCompute = (0, index_1.memoize)(compute);
30
31
  var memoizedThunk = function () {
31
32
  var _this = this;
32
33
  var inputEval = inputs.map(function (inputFn) { return inputFn.apply(_this); });
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ * @fileoverview Implements a function memoizer using the Signature API.
5
+ */
1
6
  export interface IMemoizedFunctionMethods {
2
7
  /**
3
8
  * Lock the memoization to always return the cached
@@ -5,6 +5,7 @@
5
5
  * @fileoverview Implements a function memoizer using the Signature API.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.memoize = void 0;
8
9
  var signature_1 = require("./signature");
9
10
  /**
10
11
  * Return a memoized version of the input function. The memoized function
@@ -43,7 +44,7 @@ function memoize(compute) {
43
44
  if (locked) {
44
45
  return lastValue;
45
46
  }
46
- var inputSignature = signature_1.signArray(args);
47
+ var inputSignature = (0, signature_1.signArray)(args);
47
48
  if (lastSignature === undefined
48
49
  || lastSignature.isDifferent(inputSignature)) {
49
50
  if (logPerformance) {
@@ -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,8 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
5
+ import { LabelFontSizePx } from "../components/label";
1
6
  import { Dataset } from "../core/dataset";
2
7
  import { DatumFormatter } from "../core/formatters";
3
8
  import { AttributeToProjector, IAccessor, IEntityBounds, Point } from "../core/interfaces";
@@ -14,15 +19,15 @@ export declare const BarOrientation: {
14
19
  };
15
20
  export declare type BarOrientation = keyof typeof BarOrientation;
16
21
  export declare const LabelsPosition: {
17
- start: "start";
18
22
  end: "end";
23
+ start: "start";
19
24
  middle: "middle";
20
25
  outside: "outside";
21
26
  };
22
27
  export declare type LabelsPosition = keyof typeof LabelsPosition;
23
28
  export declare const BarAlignment: {
24
- start: "start";
25
29
  end: "end";
30
+ start: "start";
26
31
  middle: "middle";
27
32
  };
28
33
  export declare type BarAlignment = keyof typeof BarAlignment;
@@ -45,6 +50,7 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
45
50
  private _labelFormatter;
46
51
  private _labelsEnabled;
47
52
  private _labelsPosition;
53
+ protected _labelFontSize: LabelFontSizePx;
48
54
  private _hideBarsIfAnyAreTooWide;
49
55
  private _labelConfig;
50
56
  private _baselineValueProvider;
@@ -178,6 +184,14 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
178
184
  * @returns {Bar} The calling Bar Plot.
179
185
  */
180
186
  labelFormatter(formatter: DatumFormatter): this;
187
+ /**
188
+ * Get the label font size in px.
189
+ */
190
+ labelFontSize(): LabelFontSizePx;
191
+ /**
192
+ * Set the label font size.
193
+ */
194
+ labelFontSize(fontSize: LabelFontSizePx): this;
181
195
  protected _createNodesForDataset(dataset: Dataset): ProxyDrawer;
182
196
  protected _removeDatasetNodes(dataset: Dataset): void;
183
197
  /**
@@ -201,8 +215,8 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
201
215
  entitiesInBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[];
202
216
  entitiesInXBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[];
203
217
  entitiesInYBounds(queryBounds: IEntityBounds): Plots.IPlotEntity[];
204
- private _entitiesIntersecting(xValOrRange, yValOrRange);
205
- private _updateLengthScale();
218
+ private _entitiesIntersecting;
219
+ private _updateLengthScale;
206
220
  renderImmediately(): this;
207
221
  protected _additionalPaint(time: number): void;
208
222
  /**
@@ -215,37 +229,27 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
215
229
  */
216
230
  protected _getPositionAttr(position: number, thickness: number): number;
217
231
  protected _drawLabels(): void;
218
- private _drawLabel(datum, index, dataset, attrToProjector);
232
+ private _drawLabel;
219
233
  /**
220
234
  * Labels are "on-bar" by default, but if the bar is not long enough to fit the text,
221
235
  * we can try putting the label "off-bar", if there's enough space outside of the bar
222
236
  * to fit it.
223
237
  */
224
- private _shouldShowLabelOnBar(barCoordinates, barDimensions, labelDimensions);
225
- private _calculateLabelProperties(barCoordinates, barDimensions, measurement, showLabelOnBar, aboveOrLeftOfBaseline);
226
- private _createLabelContainer(labelArea, labelContainerOrigin, labelOrigin, measurement, showLabelOnBar, color);
238
+ private _shouldShowLabelOnBar;
239
+ private _calculateLabelProperties;
240
+ private _createLabelContainer;
227
241
  protected _generateDrawSteps(): Drawers.DrawStep[];
228
242
  protected _generateAttrToProjector(): AttributeToProjector;
229
243
  protected _updateThicknessAttr(): void;
230
- private _barPixelThickness();
244
+ private _barPixelThickness;
231
245
  entities(datasets?: Dataset[]): IPlotEntity[];
232
- protected _entityBounds(entity: Plots.IPlotEntity | Plots.ILightweightPlotEntity): {
233
- x: any;
234
- y: any;
235
- width: any;
236
- height: any;
237
- };
246
+ protected _entityBounds(entity: Plots.IPlotEntity | Plots.ILightweightPlotEntity): Pick<DOMRect, "height" | "width" | "x" | "y">;
238
247
  /**
239
248
  * The rectangular bounds of a bar. Note that the x/y coordinates are not the
240
249
  * same as the "pixel point" because they are always at the top/left of the
241
250
  * bar.
242
251
  */
243
- protected _pixelBounds(datum: any, index: number, dataset: Dataset): {
244
- x: any;
245
- y: any;
246
- width: any;
247
- height: any;
248
- };
252
+ protected _pixelBounds(datum: any, index: number, dataset: Dataset): Pick<DOMRect, "x" | "y" | "width" | "height">;
249
253
  /**
250
254
  * The "pixel point" of a bar is the farthest point from the baseline.
251
255
  *
@@ -254,7 +258,7 @@ export declare class Bar<X, Y> extends XYPlot<X, Y> {
254
258
  * point will be at the bottom of the bar.
255
259
  */
256
260
  protected _pixelPoint(datum: any, index: number, dataset: Dataset): Point;
257
- private _pixelPointBar(originalPosition, scaledBaseline, rect);
261
+ private _pixelPointBar;
258
262
  protected _uninstallScaleForKey(scale: Scale<any, number>, key: string): void;
259
263
  protected _getDataToDraw(): Utils.Map<Dataset, any[]>;
260
264
  protected _isDatumOnScreen(attrToProjector: AttributeToProjector, plotWidth: number, plotHeight: number, d: any, i: number, dataset: Dataset): boolean;
@@ -4,10 +4,12 @@
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");
10
11
  var Animators = require("../animators");
12
+ var label_1 = require("../components/label");
11
13
  var Formatters = require("../core/formatters");
12
14
  var Drawers = require("../drawers");
13
15
  var drawer_1 = require("../drawers/drawer");
@@ -20,11 +22,11 @@ var makeEnum_1 = require("../utils/makeEnum");
20
22
  var Plots = require("./");
21
23
  var plot_1 = require("./plot");
22
24
  var xyPlot_1 = require("./xyPlot");
23
- exports.BarOrientation = makeEnum_1.makeEnum(["vertical", "horizontal"]);
24
- exports.LabelsPosition = makeEnum_1.makeEnum(["start", "middle", "end", "outside"]);
25
- 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"]);
26
28
  var Bar = /** @class */ (function (_super) {
27
- tslib_1.__extends(Bar, _super);
29
+ (0, tslib_1.__extends)(Bar, _super);
28
30
  /**
29
31
  * A Bar Plot draws bars growing out from a baseline to some value
30
32
  *
@@ -37,9 +39,10 @@ var Bar = /** @class */ (function (_super) {
37
39
  _this._labelFormatter = Formatters.identity();
38
40
  _this._labelsEnabled = false;
39
41
  _this._labelsPosition = exports.LabelsPosition.end;
42
+ _this._labelFontSize = label_1.Label._DEFAULT_FONT_SIZE_PX;
40
43
  _this._hideBarsIfAnyAreTooWide = true;
41
44
  _this._barAlignment = "middle";
42
- _this._computeBarPixelThickness = memoize_1.memoize(computeBarPixelThickness);
45
+ _this._computeBarPixelThickness = (0, memoize_1.memoize)(computeBarPixelThickness);
43
46
  /**
44
47
  * Whether all the bars in this barPlot have the same pixel thickness.
45
48
  * If so, use the _barPixelThickness property to access the thickness.
@@ -210,9 +213,29 @@ var Bar = /** @class */ (function (_super) {
210
213
  return this;
211
214
  }
212
215
  };
216
+ Bar.prototype.labelFontSize = function (fontSize) {
217
+ var _this = this;
218
+ if (fontSize == null) {
219
+ return this._labelFontSize;
220
+ }
221
+ else {
222
+ this.invalidateCache();
223
+ this._labelFontSize = fontSize;
224
+ this._labelConfig.forEach(function (_a) {
225
+ var labelArea = _a.labelArea;
226
+ // clearing to remove outdated font-size classes
227
+ labelArea.attr("class", null)
228
+ .classed(Bar._LABEL_AREA_CLASS, true)
229
+ .classed("label-" + _this._labelFontSize, true);
230
+ });
231
+ return this.render();
232
+ }
233
+ };
213
234
  Bar.prototype._createNodesForDataset = function (dataset) {
214
235
  var drawer = _super.prototype._createNodesForDataset.call(this, dataset);
215
- var labelArea = this._renderArea.append("g").classed(Bar._LABEL_AREA_CLASS, true);
236
+ var labelArea = this._renderArea.append("g")
237
+ .classed(Bar._LABEL_AREA_CLASS, true)
238
+ .classed("label-" + this._labelFontSize, true);
216
239
  var context = new Typesettable.SvgContext(labelArea.node());
217
240
  var measurer = new Typesettable.CacheMeasurer(context);
218
241
  var writer = new Typesettable.Writer(measurer, context);
@@ -686,7 +709,12 @@ var Bar = /** @class */ (function (_super) {
686
709
  Bar.prototype.invalidateCache = function () {
687
710
  var _this = this;
688
711
  _super.prototype.invalidateCache.call(this);
689
- this.datasets().forEach(function (dataset) { return _this._labelConfig.get(dataset).measurer.reset(); });
712
+ this.datasets().forEach(function (dataset) {
713
+ var labelConfig = _this._labelConfig.get(dataset);
714
+ if (labelConfig != null) {
715
+ labelConfig.measurer.reset();
716
+ }
717
+ });
690
718
  };
691
719
  Bar._BAR_THICKNESS_RATIO = 0.95;
692
720
  Bar._BAR_GAPLESS_THRESHOLD_PX = 3;
@@ -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);