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
@@ -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().
@@ -1,8 +1,13 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { Dataset } from "../core/dataset";
2
6
  import { AttributeToProjector, Bounds, IAccessor, Point } from "../core/interfaces";
3
7
  import { SymbolFactory } from "../core/symbolFactories";
4
8
  import { ProxyDrawer } from "../drawers/drawer";
5
9
  import { Scale } from "../scales/scale";
10
+ import { LabelFontSizePx } from "../components/label";
6
11
  import * as Drawers from "../drawers";
7
12
  import * as Plots from "./";
8
13
  import { IAccessorScaleBinding, ILightweightPlotEntity, IPlotEntity, ITransformableAccessorScaleBinding } from "./";
@@ -16,6 +21,7 @@ export declare class Scatter<X, Y> extends XYPlot<X, Y> {
16
21
  protected static _LABEL_AREA_CLASS: string;
17
22
  private _labelConfig;
18
23
  private _labelFormatter;
24
+ private _labelFontSize;
19
25
  protected static _LABEL_MARGIN_FROM_BUBBLE: number;
20
26
  private _labelsEnabled;
21
27
  /**
@@ -62,12 +68,7 @@ export declare class Scatter<X, Y> extends XYPlot<X, Y> {
62
68
  protected _generateDrawSteps(): Drawers.DrawStep[];
63
69
  protected _propertyProjectors(): AttributeToProjector;
64
70
  protected _constructSymbolGenerator(): (datum: any, index: number, dataset: Dataset) => any;
65
- protected _entityBounds(entity: ILightweightScatterPlotEntity): {
66
- x: number;
67
- y: number;
68
- width: number;
69
- height: number;
70
- };
71
+ protected _entityBounds(entity: ILightweightScatterPlotEntity): Pick<DOMRect, "x" | "y" | "width" | "height">;
71
72
  protected _entityVisibleOnPlot(entity: ILightweightScatterPlotEntity, bounds: Bounds): boolean;
72
73
  /**
73
74
  * Gets the Entities at a particular Point.
@@ -89,11 +90,20 @@ export declare class Scatter<X, Y> extends XYPlot<X, Y> {
89
90
  * @returns {Scatter} The calling SCATTER Plot.
90
91
  */
91
92
  labelsEnabled(enabled: boolean): this;
93
+ /**
94
+ * Get the label font size in px.
95
+ */
96
+ labelFontSize(): LabelFontSizePx;
97
+ /**
98
+ * Set the label font size.
99
+ */
100
+ labelFontSize(fontSize: LabelFontSizePx): this;
101
+ invalidateCache(): void;
92
102
  protected _createNodesForDataset(dataset: Dataset): ProxyDrawer;
93
103
  protected _removeDatasetNodes(dataset: Dataset): void;
94
104
  protected _additionalPaint(time: number): void;
95
105
  protected _drawLabels(): void;
96
- private _drawLabel(datum, index, dataset, attrToProjector);
97
- private _calculateLabelProperties(pointCoordinates, diameter, measurement);
98
- private _createLabelContainer(labelArea, labelContainerOrigin, labelOrigin, measurement);
106
+ private _drawLabel;
107
+ private _calculateLabelProperties;
108
+ private _createLabelContainer;
99
109
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Scatter = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var Typesettable = require("typesettable");
9
10
  var Formatters = require("../core/formatters");
@@ -11,6 +12,7 @@ var SymbolFactories = require("../core/symbolFactories");
11
12
  var drawer_1 = require("../drawers/drawer");
12
13
  var symbolDrawer_1 = require("../drawers/symbolDrawer");
13
14
  var Animators = require("../animators");
15
+ var label_1 = require("../components/label");
14
16
  var Drawers = require("../drawers");
15
17
  var Scales = require("../scales");
16
18
  var Utils = require("../utils");
@@ -18,7 +20,7 @@ var Plots = require("./");
18
20
  var plot_1 = require("./plot");
19
21
  var xyPlot_1 = require("./xyPlot");
20
22
  var Scatter = /** @class */ (function (_super) {
21
- tslib_1.__extends(Scatter, _super);
23
+ (0, tslib_1.__extends)(Scatter, _super);
22
24
  /**
23
25
  * A Scatter Plot draws a symbol at each data point.
24
26
  *
@@ -27,6 +29,7 @@ var Scatter = /** @class */ (function (_super) {
27
29
  function Scatter() {
28
30
  var _this = _super.call(this) || this;
29
31
  _this._labelFormatter = Formatters.identity();
32
+ _this._labelFontSize = label_1.Label._DEFAULT_FONT_SIZE_PX;
30
33
  _this._labelsEnabled = false;
31
34
  _this.addClass("scatter-plot");
32
35
  var animator = new Animators.Easing();
@@ -54,7 +57,7 @@ var Scatter = /** @class */ (function (_super) {
54
57
  Scatter.prototype._createDrawer = function (dataset) {
55
58
  var _this = this;
56
59
  return new drawer_1.ProxyDrawer(function () { return new symbolDrawer_1.SymbolSVGDrawer(); }, function (ctx) {
57
- return new Drawers.CanvasDrawer(ctx, symbolDrawer_1.makeSymbolCanvasDrawStep(dataset, function () { return plot_1.Plot._scaledAccessor(_this.symbol()); }, function () { return plot_1.Plot._scaledAccessor(_this.size()); }));
60
+ return new Drawers.CanvasDrawer(ctx, (0, symbolDrawer_1.makeSymbolCanvasDrawStep)(dataset, function () { return plot_1.Plot._scaledAccessor(_this.symbol()); }, function () { return plot_1.Plot._scaledAccessor(_this.size()); }));
58
61
  });
59
62
  };
60
63
  Scatter.prototype.size = function (size, scale) {
@@ -151,9 +154,38 @@ var Scatter = /** @class */ (function (_super) {
151
154
  return this;
152
155
  }
153
156
  };
157
+ Scatter.prototype.labelFontSize = function (fontSize) {
158
+ var _this = this;
159
+ if (fontSize == null) {
160
+ return this._labelFontSize;
161
+ }
162
+ else {
163
+ this.invalidateCache();
164
+ this._labelFontSize = fontSize;
165
+ this._labelConfig.forEach(function (_a) {
166
+ var labelArea = _a.labelArea;
167
+ labelArea.attr("class", null)
168
+ .classed(Scatter._LABEL_AREA_CLASS, true)
169
+ .classed("label-" + _this._labelFontSize, true);
170
+ });
171
+ return this.render();
172
+ }
173
+ };
174
+ Scatter.prototype.invalidateCache = function () {
175
+ var _this = this;
176
+ _super.prototype.invalidateCache.call(this);
177
+ this.datasets().forEach(function (dataset) {
178
+ var labelConfig = _this._labelConfig.get(dataset);
179
+ if (labelConfig != null) {
180
+ labelConfig.measurer.reset();
181
+ }
182
+ });
183
+ };
154
184
  Scatter.prototype._createNodesForDataset = function (dataset) {
155
185
  var drawer = _super.prototype._createNodesForDataset.call(this, dataset);
156
- var labelArea = this._renderArea.append("g").classed(Scatter._LABEL_AREA_CLASS, true);
186
+ var labelArea = this._renderArea.append("g")
187
+ .classed(Scatter._LABEL_AREA_CLASS, true)
188
+ .classed("label-" + this._labelFontSize, true);
157
189
  var context = new Typesettable.SvgContext(labelArea.node());
158
190
  var measurer = new Typesettable.CacheMeasurer(context);
159
191
  var writer = new Typesettable.Writer(measurer, context);
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { AttributeToProjector, Bounds, IAccessor, Point, Range } from "../core/interfaces";
2
6
  import * as Drawers from "../drawers";
3
7
  import { Scale } from "../scales/scale";
@@ -96,7 +100,7 @@ export declare class Segment<X, Y> extends XYPlot<X, Y> {
96
100
  * @returns {PlotEntity[]}
97
101
  */
98
102
  entitiesIn(xRange: Range, yRange: Range): IPlotEntity[];
99
- private _entitiesIntersecting(xRange, yRange);
100
- private _lineIntersectsBox(entity, xRange, yRange, attrToProjector);
101
- private _lineIntersectsSegment(point1, point2, point3, point4);
103
+ private _entitiesIntersecting;
104
+ private _lineIntersectsBox;
105
+ private _lineIntersectsSegment;
102
106
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.Segment = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var Animators = require("../animators");
9
10
  var drawer_1 = require("../drawers/drawer");
@@ -13,7 +14,7 @@ var windowUtils_1 = require("../utils/windowUtils");
13
14
  var plot_1 = require("./plot");
14
15
  var xyPlot_1 = require("./xyPlot");
15
16
  var Segment = /** @class */ (function (_super) {
16
- tslib_1.__extends(Segment, _super);
17
+ (0, tslib_1.__extends)(Segment, _super);
17
18
  /**
18
19
  * A Segment Plot displays line segments based on the data.
19
20
  *
@@ -28,7 +29,7 @@ var Segment = /** @class */ (function (_super) {
28
29
  }
29
30
  Segment.prototype._createDrawer = function () {
30
31
  return new drawer_1.ProxyDrawer(function () { return new segmentDrawer_1.SegmentSVGDrawer(); }, function () {
31
- windowUtils_1.warn("canvas renderer is not supported on Segment Plot!");
32
+ (0, windowUtils_1.warn)("canvas renderer is not supported on Segment Plot!");
32
33
  return null;
33
34
  });
34
35
  };
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
1
5
  import { IAnimator } from "../animators/animator";
2
6
  import { Dataset } from "../core/dataset";
3
7
  import { AttributeToProjector, IAccessor, Point, Projector } from "../core/interfaces";
@@ -66,7 +70,7 @@ export declare class StackedArea<X> extends Area<X> {
66
70
  protected _updateYScale(): void;
67
71
  protected _onDatasetUpdate(): this;
68
72
  protected getExtentsForProperty(attr: string): any[][];
69
- private _checkSameDomain();
73
+ private _checkSameDomain;
70
74
  /**
71
75
  * Given an array of Datasets and the accessor function for the key, computes the
72
76
  * set reunion (no duplicates) of the domain of each Dataset. The keys are stringified
@@ -76,7 +80,7 @@ export declare class StackedArea<X> extends Area<X> {
76
80
  * @param {Accessor<any>} keyAccessor The accessor for the key of the data
77
81
  * @return {string[]} An array of stringified keys
78
82
  */
79
- private static _domainKeys(datasets, keyAccessor);
83
+ private static _domainKeys;
80
84
  protected _coordinateProjectors(): [Projector, Projector, Projector];
81
85
  protected _propertyProjectors(): AttributeToProjector;
82
86
  protected _pixelPoint(datum: any, index: number, dataset: Dataset): Point;
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.StackedArea = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var d3 = require("d3");
9
10
  var Animators = require("../animators");
@@ -12,16 +13,16 @@ var Utils = require("../utils");
12
13
  var areaPlot_1 = require("./areaPlot");
13
14
  var plot_1 = require("./plot");
14
15
  var StackedArea = /** @class */ (function (_super) {
15
- tslib_1.__extends(StackedArea, _super);
16
+ (0, tslib_1.__extends)(StackedArea, _super);
16
17
  /**
17
18
  * @constructor
18
19
  */
19
20
  function StackedArea() {
20
21
  var _this = _super.call(this) || this;
21
- _this._stackingResult = index_1.memThunk(function () { return _this.datasets(); }, function () { return _this.x().accessor; }, function () { return _this.y().accessor; }, function () { return _this._stackingOrder; }, function (datasets, keyAccessor, valueAccessor, stackingOrder) {
22
+ _this._stackingResult = (0, index_1.memThunk)(function () { return _this.datasets(); }, function () { return _this.x().accessor; }, function () { return _this.y().accessor; }, function () { return _this._stackingOrder; }, function (datasets, keyAccessor, valueAccessor, stackingOrder) {
22
23
  return Utils.Stacking.stack(datasets, keyAccessor, valueAccessor, stackingOrder);
23
24
  });
24
- _this._stackedExtent = index_1.memThunk(_this._stackingResult, function () { return _this.x().accessor; }, function () { return _this._filterForProperty("y"); }, function (stackingResult, keyAccessor, filter) {
25
+ _this._stackedExtent = (0, index_1.memThunk)(_this._stackingResult, function () { return _this.x().accessor; }, function () { return _this._filterForProperty("y"); }, function (stackingResult, keyAccessor, filter) {
25
26
  return Utils.Stacking.stackedExtent(stackingResult, keyAccessor, filter);
26
27
  });
27
28
  _this._baselineValue = 0;
@@ -1,6 +1,10 @@
1
- import { Dataset } from "../core/dataset";
1
+ /**
2
+ * Copyright 2014-present Palantir Technologies
3
+ * @license MIT
4
+ */
2
5
  import { Formatter } from "../core/formatters";
3
6
  import * as Utils from "../utils";
7
+ import { LabelFontSizePx } from "../components/label";
4
8
  import { Bar, BarOrientation } from "./barPlot";
5
9
  export declare class StackedBar<X, Y> extends Bar<X, Y> {
6
10
  protected static _EXTREMA_LABEL_MARGIN_FROM_BAR: number;
@@ -51,11 +55,11 @@ export declare class StackedBar<X, Y> extends Bar<X, Y> {
51
55
  * @returns {this}
52
56
  */
53
57
  extremaFormatter(formatter: Formatter): this;
58
+ labelFontSize(): LabelFontSizePx;
59
+ labelFontSize(fontSize: LabelFontSizePx): this;
54
60
  protected _setup(): void;
55
61
  protected _drawLabels(): void;
56
- protected _generateAttrToProjector(): {
57
- [attr: string]: (datum: any, index: number, dataset: Dataset) => any;
58
- };
62
+ protected _generateAttrToProjector(): import("../core/interfaces").AttributeToProjector;
59
63
  protected getExtentsForProperty(attr: string): any[][];
60
64
  invalidateCache(): void;
61
65
  }
@@ -4,6 +4,7 @@
4
4
  * @license MIT
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.StackedBar = void 0;
7
8
  var tslib_1 = require("tslib");
8
9
  var Typesettable = require("typesettable");
9
10
  var formatters_1 = require("../core/formatters");
@@ -12,7 +13,7 @@ var Utils = require("../utils");
12
13
  var barPlot_1 = require("./barPlot");
13
14
  var plot_1 = require("./plot");
14
15
  var StackedBar = /** @class */ (function (_super) {
15
- tslib_1.__extends(StackedBar, _super);
16
+ (0, tslib_1.__extends)(StackedBar, _super);
16
17
  /**
17
18
  * A StackedBar Plot stacks bars across Datasets based on the primary value of the bars.
18
19
  * On a vertical StackedBar Plot, the bars with the same X value are stacked.
@@ -26,11 +27,11 @@ var StackedBar = /** @class */ (function (_super) {
26
27
  function StackedBar(orientation) {
27
28
  if (orientation === void 0) { orientation = "vertical"; }
28
29
  var _this = _super.call(this, orientation) || this;
29
- _this._extremaFormatter = formatters_1.identity();
30
- _this._stackingResult = memoize_1.memThunk(function () { return _this.datasets(); }, function () { return _this.position().accessor; }, function () { return _this.length().accessor; }, function () { return _this._stackingOrder; }, function (datasets, positionAccessor, lengthAccessor, stackingOrder) {
30
+ _this._extremaFormatter = (0, formatters_1.identity)();
31
+ _this._stackingResult = (0, memoize_1.memThunk)(function () { return _this.datasets(); }, function () { return _this.position().accessor; }, function () { return _this.length().accessor; }, function () { return _this._stackingOrder; }, function (datasets, positionAccessor, lengthAccessor, stackingOrder) {
31
32
  return Utils.Stacking.stack(datasets, positionAccessor, lengthAccessor, stackingOrder);
32
33
  });
33
- _this._stackedExtent = memoize_1.memThunk(_this._stackingResult, function () { return _this.position().accessor; }, function () { return _this._filterForProperty(_this._isVertical ? "y" : "x"); }, function (stackingResult, positionAccessor, filter) {
34
+ _this._stackedExtent = (0, memoize_1.memThunk)(_this._stackingResult, function () { return _this.position().accessor; }, function () { return _this._filterForProperty(_this._isVertical ? "y" : "x"); }, function (stackingResult, positionAccessor, filter) {
34
35
  return Utils.Stacking.stackedExtent(stackingResult, positionAccessor, filter);
35
36
  });
36
37
  _this.addClass("stacked-bar-plot");
@@ -55,9 +56,27 @@ var StackedBar = /** @class */ (function (_super) {
55
56
  return this;
56
57
  }
57
58
  };
59
+ StackedBar.prototype.labelFontSize = function (fontSize) {
60
+ if (fontSize == null) {
61
+ return _super.prototype.labelFontSize.call(this);
62
+ }
63
+ else {
64
+ if (this._labelArea != null) {
65
+ // clearing to remove outdated font-size classes
66
+ this._labelArea.attr("class", null)
67
+ .classed(barPlot_1.Bar._LABEL_AREA_CLASS, true)
68
+ .classed("label-" + this._labelFontSize, true);
69
+ }
70
+ _super.prototype.labelFontSize.call(this, fontSize);
71
+ return this;
72
+ }
73
+ };
58
74
  StackedBar.prototype._setup = function () {
59
75
  _super.prototype._setup.call(this);
60
- this._labelArea = this._renderArea.append("g").classed(barPlot_1.Bar._LABEL_AREA_CLASS, true);
76
+ this._labelArea = this._renderArea
77
+ .append("g")
78
+ .classed(barPlot_1.Bar._LABEL_AREA_CLASS, true)
79
+ .classed("label-" + this._labelFontSize, true);
61
80
  var context = new Typesettable.SvgContext(this._labelArea.node());
62
81
  this._measurer = new Typesettable.CacheMeasurer(context);
63
82
  this._writer = new Typesettable.Writer(this._measurer, context);
@@ -210,7 +229,9 @@ var StackedBar = /** @class */ (function (_super) {
210
229
  };
211
230
  StackedBar.prototype.invalidateCache = function () {
212
231
  _super.prototype.invalidateCache.call(this);
213
- this._measurer.reset();
232
+ if (this._measurer != null) {
233
+ this._measurer.reset();
234
+ }
214
235
  };
215
236
  StackedBar._EXTREMA_LABEL_MARGIN_FROM_BAR = 5;
216
237
  return StackedBar;
@@ -46,11 +46,9 @@ export declare class Waterfall<X, Y> extends Bar<X, number> {
46
46
  protected _additionalPaint(time: number): void;
47
47
  protected _createNodesForDataset(dataset: Dataset): ProxyDrawer;
48
48
  protected getExtentsForProperty(attr: string): any[][];
49
- protected _generateAttrToProjector(): {
50
- [attr: string]: (datum: any, index: number, dataset: Dataset) => any;
51
- };
49
+ protected _generateAttrToProjector(): import("../core/interfaces").AttributeToProjector;
52
50
  protected _onDatasetUpdate(): this;
53
- private _calculateSubtotalsAndExtent(dataset);
54
- private _drawConnectors();
55
- private _updateSubtotals();
51
+ private _calculateSubtotalsAndExtent;
52
+ private _drawConnectors;
53
+ private _updateSubtotals;
56
54
  }