@d3plus/core 3.0.16 → 3.1.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 (167) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88482 -2998
  3. package/es/index.js +1 -1
  4. package/es/src/charts/AreaPlot.js +1 -3
  5. package/es/src/charts/BarChart.js +1 -3
  6. package/es/src/charts/BoxWhisker.js +2 -4
  7. package/es/src/charts/BumpChart.js +4 -5
  8. package/es/src/charts/Donut.js +1 -3
  9. package/es/src/charts/Geomap.js +47 -88
  10. package/es/src/charts/LinePlot.js +1 -3
  11. package/es/src/charts/Matrix.js +27 -46
  12. package/es/src/charts/Network.js +87 -81
  13. package/es/src/charts/Pack.js +21 -34
  14. package/es/src/charts/Pie.js +12 -24
  15. package/es/src/charts/Plot.js +226 -321
  16. package/es/src/charts/Priestley.js +18 -36
  17. package/es/src/charts/Radar.js +100 -47
  18. package/es/src/charts/RadialMatrix.js +35 -47
  19. package/es/src/charts/Rings.js +99 -90
  20. package/es/src/charts/Sankey.js +85 -75
  21. package/es/src/charts/StackedArea.js +1 -3
  22. package/es/src/charts/Tree.js +27 -28
  23. package/es/src/charts/Treemap.js +117 -71
  24. package/es/src/charts/Viz.js +296 -492
  25. package/es/src/charts/drawSteps/drawAttribution.js +1 -1
  26. package/es/src/charts/drawSteps/drawBack.js +1 -2
  27. package/es/src/charts/drawSteps/drawColorScale.js +1 -2
  28. package/es/src/charts/drawSteps/drawLegend.js +8 -10
  29. package/es/src/charts/drawSteps/drawSubtitle.js +1 -3
  30. package/es/src/charts/drawSteps/drawTimeline.js +12 -9
  31. package/es/src/charts/drawSteps/drawTitle.js +1 -3
  32. package/es/src/charts/drawSteps/drawTotal.js +1 -3
  33. package/es/src/charts/drawSteps/zoomControls.js +19 -21
  34. package/es/src/charts/events/click.legend.js +2 -3
  35. package/es/src/charts/events/click.shape.js +2 -4
  36. package/es/src/charts/events/mouseenter.js +7 -8
  37. package/es/src/charts/events/mouseleave.js +1 -3
  38. package/es/src/charts/events/mousemove.legend.js +3 -4
  39. package/es/src/charts/events/mousemove.shape.js +2 -4
  40. package/es/src/charts/events/touchstart.body.js +1 -1
  41. package/es/src/charts/helpers/matrixData.js +11 -4
  42. package/es/src/charts/helpers/tileAttributions.js +2 -1
  43. package/es/src/charts/plotBuffers/Bar.js +55 -12
  44. package/es/src/charts/plotBuffers/Box.js +55 -12
  45. package/es/src/charts/plotBuffers/Circle.js +9 -11
  46. package/es/src/charts/plotBuffers/Line.js +4 -6
  47. package/es/src/charts/plotBuffers/Rect.js +10 -12
  48. package/es/src/charts/plotBuffers/discreteBuffer.js +4 -2
  49. package/es/src/charts/plotBuffers/numericBuffer.js +7 -6
  50. package/es/src/components/Axis.js +298 -426
  51. package/es/src/components/AxisBottom.js +1 -3
  52. package/es/src/components/AxisLeft.js +1 -3
  53. package/es/src/components/AxisRight.js +1 -3
  54. package/es/src/components/AxisTop.js +1 -3
  55. package/es/src/components/ColorScale.js +80 -197
  56. package/es/src/components/Legend.js +82 -135
  57. package/es/src/components/Message.js +27 -19
  58. package/es/src/components/TextBox.js +106 -262
  59. package/es/src/components/Timeline.js +88 -155
  60. package/es/src/components/Tooltip.js +301 -330
  61. package/es/src/shapes/Area.js +95 -74
  62. package/es/src/shapes/Bar.js +46 -86
  63. package/es/src/shapes/Box.js +104 -118
  64. package/es/src/shapes/Circle.js +29 -30
  65. package/es/src/shapes/Image.js +44 -102
  66. package/es/src/shapes/Line.js +74 -40
  67. package/es/src/shapes/Path.js +23 -25
  68. package/es/src/shapes/Rect.js +29 -41
  69. package/es/src/shapes/Shape.js +146 -363
  70. package/es/src/shapes/Whisker.js +89 -90
  71. package/es/src/utils/AccessorFn.js +4 -0
  72. package/es/src/utils/BaseClass.js +53 -82
  73. package/es/src/utils/D3plusConfig.js +1 -0
  74. package/es/src/utils/RESET.js +2 -4
  75. package/es/src/utils/accessor.js +4 -5
  76. package/es/src/utils/configPrep.js +13 -12
  77. package/es/src/utils/constant.js +2 -3
  78. package/es/src/utils/getProp.js +4 -4
  79. package/es/src/utils/index.js +0 -1
  80. package/package.json +29 -22
  81. package/types/index.d.ts +5 -0
  82. package/types/src/charts/AreaPlot.d.ts +16 -0
  83. package/types/src/charts/BarChart.d.ts +16 -0
  84. package/types/src/charts/BoxWhisker.d.ts +11 -0
  85. package/types/src/charts/BumpChart.d.ts +36 -0
  86. package/types/src/charts/Donut.d.ts +11 -0
  87. package/types/src/charts/Geomap.d.ts +120 -0
  88. package/types/src/charts/LinePlot.d.ts +15 -0
  89. package/types/src/charts/Matrix.d.ts +74 -0
  90. package/types/src/charts/Network.d.ts +78 -0
  91. package/types/src/charts/Pack.d.ts +47 -0
  92. package/types/src/charts/Pie.d.ts +44 -0
  93. package/types/src/charts/Plot.d.ts +199 -0
  94. package/types/src/charts/Priestley.d.ts +37 -0
  95. package/types/src/charts/Radar.d.ts +38 -0
  96. package/types/src/charts/RadialMatrix.d.ts +78 -0
  97. package/types/src/charts/Rings.d.ts +74 -0
  98. package/types/src/charts/Sankey.d.ts +81 -0
  99. package/types/src/charts/StackedArea.d.ts +14 -0
  100. package/types/src/charts/Tree.d.ts +33 -0
  101. package/types/src/charts/Treemap.d.ts +51 -0
  102. package/types/src/charts/Viz.d.ts +402 -0
  103. package/types/src/charts/drawSteps/drawAttribution.d.ts +7 -0
  104. package/types/src/charts/drawSteps/drawBack.d.ts +6 -0
  105. package/types/src/charts/drawSteps/drawColorScale.d.ts +6 -0
  106. package/types/src/charts/drawSteps/drawLegend.d.ts +12 -0
  107. package/types/src/charts/drawSteps/drawSubtitle.d.ts +7 -0
  108. package/types/src/charts/drawSteps/drawTimeline.d.ts +7 -0
  109. package/types/src/charts/drawSteps/drawTitle.d.ts +7 -0
  110. package/types/src/charts/drawSteps/drawTotal.d.ts +7 -0
  111. package/types/src/charts/drawSteps/zoomControls.d.ts +7 -0
  112. package/types/src/charts/events/click.legend.d.ts +8 -0
  113. package/types/src/charts/events/click.shape.d.ts +8 -0
  114. package/types/src/charts/events/mouseenter.d.ts +8 -0
  115. package/types/src/charts/events/mouseleave.d.ts +8 -0
  116. package/types/src/charts/events/mousemove.legend.d.ts +9 -0
  117. package/types/src/charts/events/mousemove.shape.d.ts +9 -0
  118. package/types/src/charts/events/touchstart.body.d.ts +7 -0
  119. package/types/src/charts/helpers/matrixData.d.ts +11 -0
  120. package/types/src/charts/helpers/tileAttributions.d.ts +6 -0
  121. package/types/src/charts/index.d.ts +21 -0
  122. package/types/src/charts/plotBuffers/Bar.d.ts +16 -0
  123. package/types/src/charts/plotBuffers/Box.d.ts +16 -0
  124. package/types/src/charts/plotBuffers/Circle.d.ts +20 -0
  125. package/types/src/charts/plotBuffers/Line.d.ts +16 -0
  126. package/types/src/charts/plotBuffers/Rect.d.ts +19 -0
  127. package/types/src/charts/plotBuffers/discreteBuffer.d.ts +7 -0
  128. package/types/src/charts/plotBuffers/numericBuffer.d.ts +5 -0
  129. package/types/src/components/Axis.d.ts +309 -0
  130. package/types/src/components/AxisBottom.d.ts +11 -0
  131. package/types/src/components/AxisLeft.d.ts +11 -0
  132. package/types/src/components/AxisRight.d.ts +11 -0
  133. package/types/src/components/AxisTop.d.ts +11 -0
  134. package/types/src/components/ColorScale.d.ts +208 -0
  135. package/types/src/components/Legend.d.ts +157 -0
  136. package/types/src/components/Message.d.ts +40 -0
  137. package/types/src/components/TextBox.d.ts +278 -0
  138. package/types/src/components/Timeline.d.ts +157 -0
  139. package/types/src/components/Tooltip.d.ts +297 -0
  140. package/types/src/components/index.d.ts +11 -0
  141. package/types/src/shapes/Area.d.ts +81 -0
  142. package/types/src/shapes/Bar.d.ts +104 -0
  143. package/types/src/shapes/Box.d.ts +121 -0
  144. package/types/src/shapes/Circle.d.ts +44 -0
  145. package/types/src/shapes/Image.d.ts +124 -0
  146. package/types/src/shapes/Line.d.ts +48 -0
  147. package/types/src/shapes/Path.d.ts +38 -0
  148. package/types/src/shapes/Rect.d.ts +54 -0
  149. package/types/src/shapes/Shape.d.ts +378 -0
  150. package/types/src/shapes/Whisker.d.ts +96 -0
  151. package/types/src/shapes/index.d.ts +10 -0
  152. package/types/src/utils/AccessorFn.d.ts +6 -0
  153. package/types/src/utils/BaseClass.d.ts +76 -0
  154. package/types/src/utils/D3plusConfig.d.ts +164 -0
  155. package/types/src/utils/RESET.d.ts +3 -0
  156. package/types/src/utils/accessor.d.ts +13 -0
  157. package/types/src/utils/configPrep.d.ts +28 -0
  158. package/types/src/utils/constant.d.ts +11 -0
  159. package/types/src/utils/getProp.d.ts +9 -0
  160. package/types/src/utils/index.d.ts +8 -0
  161. package/umd/d3plus-core.full.js +20126 -18700
  162. package/umd/d3plus-core.full.js.map +1 -1
  163. package/umd/d3plus-core.full.min.js +2919 -5393
  164. package/umd/d3plus-core.js +1919 -4073
  165. package/umd/d3plus-core.js.map +1 -1
  166. package/umd/d3plus-core.min.js +1604 -3936
  167. package/es/src/utils/uuid.js +0 -13
@@ -1,3 +1,14 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_with_holes(arr) {
7
+ if (Array.isArray(arr)) return arr;
8
+ }
9
+ function _array_without_holes(arr) {
10
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
11
+ }
1
12
  function _assert_this_initialized(self) {
2
13
  if (self === void 0) {
3
14
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
@@ -62,6 +73,39 @@ function _inherits(subClass, superClass) {
62
73
  });
63
74
  if (superClass) _set_prototype_of(subClass, superClass);
64
75
  }
76
+ function _iterable_to_array(iter) {
77
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
78
+ }
79
+ function _iterable_to_array_limit(arr, i) {
80
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
81
+ if (_i == null) return;
82
+ var _arr = [];
83
+ var _n = true;
84
+ var _d = false;
85
+ var _s, _e;
86
+ try {
87
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
88
+ _arr.push(_s.value);
89
+ if (i && _arr.length === i) break;
90
+ }
91
+ } catch (err) {
92
+ _d = true;
93
+ _e = err;
94
+ } finally{
95
+ try {
96
+ if (!_n && _i["return"] != null) _i["return"]();
97
+ } finally{
98
+ if (_d) throw _e;
99
+ }
100
+ }
101
+ return _arr;
102
+ }
103
+ function _non_iterable_rest() {
104
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
105
+ }
106
+ function _non_iterable_spread() {
107
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
108
+ }
65
109
  function _possible_constructor_return(self, call) {
66
110
  if (call && (_type_of(call) === "object" || typeof call === "function")) {
67
111
  return call;
@@ -75,6 +119,9 @@ function _set_prototype_of(o, p) {
75
119
  };
76
120
  return _set_prototype_of(o, p);
77
121
  }
122
+ function _sliced_to_array(arr, i) {
123
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
124
+ }
78
125
  function _super_prop_base(object, property) {
79
126
  while(!Object.prototype.hasOwnProperty.call(object, property)){
80
127
  object = _get_prototype_of(object);
@@ -82,10 +129,21 @@ function _super_prop_base(object, property) {
82
129
  }
83
130
  return object;
84
131
  }
132
+ function _to_consumable_array(arr) {
133
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
134
+ }
85
135
  function _type_of(obj) {
86
136
  "@swc/helpers - typeof";
87
137
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
88
138
  }
139
+ function _unsupported_iterable_to_array(o, minLen) {
140
+ if (!o) return;
141
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
142
+ var n = Object.prototype.toString.call(o).slice(8, -1);
143
+ if (n === "Object" && o.constructor) n = o.constructor.name;
144
+ if (n === "Map" || n === "Set") return Array.from(n);
145
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
146
+ }
89
147
  function _is_native_reflect_construct() {
90
148
  try {
91
149
  var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
@@ -94,8 +152,7 @@ function _is_native_reflect_construct() {
94
152
  return !!result;
95
153
  })();
96
154
  }
97
- import { sum } from "d3-array";
98
- import { nest } from "d3-collection";
155
+ import { group, sum } from "d3-array";
99
156
  import { hierarchy, treemap } from "d3-hierarchy";
100
157
  import { treemapBinary, treemapDice, treemapSlice, treemapSliceDice, treemapSquarify, treemapResquarify } from "d3-hierarchy";
101
158
  var tileMethods = {
@@ -106,7 +163,7 @@ var tileMethods = {
106
163
  treemapSquarify: treemapSquarify,
107
164
  treemapResquarify: treemapResquarify
108
165
  };
109
- import { merge } from "@d3plus/data";
166
+ import { merge, nestGroups } from "@d3plus/data";
110
167
  import { assign, elem } from "@d3plus/dom";
111
168
  import { formatAbbreviate } from "@d3plus/format";
112
169
  import { Rect } from "../shapes/index.js";
@@ -132,7 +189,7 @@ var Treemap = /*#__PURE__*/ function(Viz) {
132
189
  tbody: []
133
190
  });
134
191
  _this._shapeConfig = assign({}, _this._shapeConfig, {
135
- ariaLabel: function(d, i) {
192
+ ariaLabel: function ariaLabel(d, i) {
136
193
  var rank = _this._rankData ? "".concat(_this._rankData.indexOf(d) + 1, ". ") : "";
137
194
  return "".concat(rank).concat(_this._drawLabel(d, i), ", ").concat(_this._sum(d, i), ".");
138
195
  },
@@ -164,24 +221,21 @@ var Treemap = /*#__PURE__*/ function(Viz) {
164
221
  ]
165
222
  });
166
223
  _this._treemap = treemap().round(true);
167
- var isAggregated = function(leaf) {
224
+ var isAggregated = function isAggregated(leaf) {
168
225
  return leaf.children && leaf.children.length === 1 && leaf.children[0].data._isAggregation;
169
226
  };
170
227
  return _this;
171
228
  }
172
229
  _create_class(Treemap, [
173
230
  {
174
- /**
175
- @memberof Treemap
176
- @desc Extends the draw behavior of the abstract Viz class.
177
- @private
178
- */ key: "_draw",
231
+ /**
232
+ Extends the draw behavior of the abstract Viz class.
233
+ @private
234
+ */ key: "_draw",
179
235
  value: function _draw(callback) {
180
236
  var _this = this;
181
237
  _get(_get_prototype_of(Treemap.prototype), "_draw", this).call(this, callback);
182
- var nestedData = nest();
183
- for(var i = 0; i <= this._drawDepth; i++)nestedData.key(this._groupBy[i]);
184
- nestedData = nestedData.entries(this._filteredData);
238
+ var nestedData = nestGroups(this._filteredData, this._groupBy.slice(0, this._drawDepth + 1));
185
239
  var tmapData = this._treemap.padding(this._layoutPadding).size([
186
240
  this._width - this._margin.left - this._margin.right,
187
241
  this._height - this._margin.top - this._margin.bottom
@@ -191,11 +245,10 @@ var Treemap = /*#__PURE__*/ function(Viz) {
191
245
  return d.values;
192
246
  }).sum(this._sum).sort(this._sort));
193
247
  var shapeData = [], that = this;
194
- /**
195
- @memberof Treemap
196
- @desc Flattens and merges treemap data.
197
- @private
198
- */ function extractLayout(children) {
248
+ /**
249
+ Flattens and merges treemap data.
250
+ @private
251
+ */ function extractLayout(children) {
199
252
  for(var i = 0; i < children.length; i++){
200
253
  var node = children[i];
201
254
  if (node.depth <= that._drawDepth) extractLayout(node.children);
@@ -238,10 +291,10 @@ var Treemap = /*#__PURE__*/ function(Viz) {
238
291
  transform: transform
239
292
  }
240
293
  }).node()).config({
241
- height: function(d) {
294
+ height: function height(d) {
242
295
  return d.y1 - d.y0;
243
296
  },
244
- labelBounds: function(d, i, s) {
297
+ labelBounds: function labelBounds(d, i, s) {
245
298
  var h = s.height;
246
299
  var sh = Math.min(fontMax, (h - padding * 2) * 0.5);
247
300
  if (sh < fontMin) sh = 0;
@@ -261,7 +314,7 @@ var Treemap = /*#__PURE__*/ function(Viz) {
261
314
  ];
262
315
  },
263
316
  labelConfig: {
264
- textAnchor: function(d, i, x) {
317
+ textAnchor: function textAnchor(d, i, x) {
265
318
  var line, parent = x;
266
319
  while(typeof line === "undefined" && parent){
267
320
  if (typeof parent.l !== "undefined") line = parent.l;
@@ -269,7 +322,7 @@ var Treemap = /*#__PURE__*/ function(Viz) {
269
322
  }
270
323
  return line ? "middle" : "start";
271
324
  },
272
- verticalAlign: function(d, i, x) {
325
+ verticalAlign: function verticalAlign(d, i, x) {
273
326
  var line, parent = x;
274
327
  while(typeof line === "undefined" && parent){
275
328
  if (typeof parent.l !== "undefined") line = parent.l;
@@ -278,7 +331,7 @@ var Treemap = /*#__PURE__*/ function(Viz) {
278
331
  return line ? "bottom" : "top";
279
332
  }
280
333
  },
281
- width: function(d) {
334
+ width: function width(d) {
282
335
  return d.x1 - d.x0;
283
336
  }
284
337
  }).config(rectConfig).render());
@@ -286,11 +339,11 @@ var Treemap = /*#__PURE__*/ function(Viz) {
286
339
  }
287
340
  },
288
341
  {
289
- /**
290
- * Applies the threshold algorithm for Treemaps.
291
- * @param {Array} data The data to process.
292
- * @private
293
- */ key: "_thresholdFunction",
342
+ /**
343
+ * Applies the threshold algorithm for Treemaps.
344
+ * @param {Array} data The data to process.
345
+ * @private
346
+ */ key: "_thresholdFunction",
294
347
  value: function _thresholdFunction(data) {
295
348
  var aggs = this._aggs;
296
349
  var drawDepth = this._drawDepth;
@@ -301,16 +354,17 @@ var Treemap = /*#__PURE__*/ function(Viz) {
301
354
  if (threshold && thresholdKey) {
302
355
  return thresholdByDepth(data, 0);
303
356
  }
304
- /**
305
- * @memberof Treemap
306
- * @desc Explores the data tree recursively and merges elements under the indicated threshold.
307
- * @param {object[]} branchData The current subset of the dataset to work on.
308
- * @param {number} depth The depth of the current branch.
309
- * @private
310
- */ function thresholdByDepth(branchData, depth) {
357
+ /**
358
+ Explores the data tree recursively and merges elements under the indicated threshold.
359
+ @param branchData The current subset of the dataset to work on.
360
+ @param depth The depth of the current branch.
361
+ @private
362
+ */ function thresholdByDepth(branchData, depth) {
311
363
  if (depth < drawDepth) {
312
- return nest().key(groupBy[depth]).entries(branchData).reduce(function(bulk, leaf) {
313
- var subBranchData = thresholdByDepth(leaf.values, depth + 1);
364
+ return _to_consumable_array(group(branchData, groupBy[depth])).reduce(function(bulk, param) {
365
+ var _param = _sliced_to_array(param, 2), values = _param[1];
366
+ var _thresholdByDepth;
367
+ var subBranchData = (_thresholdByDepth = thresholdByDepth(values, depth + 1)) !== null && _thresholdByDepth !== void 0 ? _thresholdByDepth : [];
314
368
  return bulk.concat(subBranchData);
315
369
  }, []);
316
370
  }
@@ -343,39 +397,35 @@ var Treemap = /*#__PURE__*/ function(Viz) {
343
397
  }
344
398
  },
345
399
  {
346
- /**
347
- @memberof Treemap
348
- @desc If *value* is specified, sets the inner and outer padding accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current padding accessor.
349
- @param {Function|Number} [*value*]
350
- */ key: "layoutPadding",
400
+ /**
401
+ The inner and outer padding.
402
+ */ key: "layoutPadding",
351
403
  value: function layoutPadding(_) {
352
404
  return arguments.length ? (this._layoutPadding = typeof _ === "function" ? _ : constant(_), this) : this._layoutPadding;
353
405
  }
354
406
  },
355
407
  {
356
- /**
357
- @memberof Treemap
358
- @desc If *comparator* is specified, sets the sort order for the treemap using the specified comparator function. If *comparator* is not specified, returns the current group sort order, which defaults to descending order by the associated input data's numeric value attribute.
359
- @param {Array} [*comparator*]
360
- @example
361
- function comparator(a, b) {
362
- return b.value - a.value;
363
- }
364
- */ key: "sort",
408
+ /**
409
+ Sort comparator function for the treemap layout. Defaults to descending order by the associated input data's numeric value attribute.
410
+
411
+ @example
412
+ function comparator(a, b) {
413
+ return b.value - a.value;
414
+ }
415
+ */ key: "sort",
365
416
  value: function sort(_) {
366
417
  return arguments.length ? (this._sort = _, this) : this._sort;
367
418
  }
368
419
  },
369
420
  {
370
- /**
371
- @memberof Treemap
372
- @desc If *value* is specified, sets the sum accessor to the specified function or number and returns the current class instance. If *value* is not specified, returns the current sum accessor.
373
- @param {Function|Number} [*value*]
374
- @example
375
- function sum(d) {
376
- return d.sum;
377
- }
378
- */ key: "sum",
421
+ /**
422
+ The sum accessor used for sizing each rectangle in the treemap.
423
+
424
+ @example
425
+ function sum(d) {
426
+ return d.sum;
427
+ }
428
+ */ key: "sum",
379
429
  value: function sum(_) {
380
430
  if (arguments.length) {
381
431
  this._sum = typeof _ === "function" ? _ : accessor(_);
@@ -385,13 +435,11 @@ function sum(d) {
385
435
  }
386
436
  },
387
437
  {
388
- /**
389
- @memberof Treemap
390
- @desc Sets the tiling method used when calcuating the size and position of the rectangles.
391
-
392
- Can either be a string referring to a d3-hierarchy [tiling method](https://github.com/d3/d3-hierarchy#treemap-tiling), or a custom function in the same format.
393
- @param {String|Function} [*value* = "squarify"]
394
- */ key: "tile",
438
+ /**
439
+ The tiling method used when calculating the size and position of the rectangles.
440
+
441
+ Can either be a string referring to a d3-hierarchy [tiling method](https://github.com/d3/d3-hierarchy#treemap-tiling), or a custom function in the same format.
442
+ */ key: "tile",
395
443
  value: function tile(_) {
396
444
  return arguments.length ? (this._tile = typeof _ === "string" ? tileMethods["treemap".concat(_.charAt(0).toUpperCase()).concat(_.slice(1))] || treemapSquarify : _, this) : this._tile;
397
445
  }
@@ -399,8 +447,6 @@ Can either be a string referring to a d3-hierarchy [tiling method](https://githu
399
447
  ]);
400
448
  return Treemap;
401
449
  }(Viz);
402
- /**
403
- @class Treemap
404
- @extends Viz
405
- @desc Uses the [d3 treemap layout](https://github.com/mbostock/d3/wiki/Treemap-Layout) to creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-hierarchy/getting-started/) for help getting started using the treemap generator.
450
+ /**
451
+ Uses the [d3 treemap layout](https://github.com/mbostock/d3/wiki/Treemap-Layout) to creates SVG rectangles based on an array of data. See [this example](https://d3plus.org/examples/d3plus-hierarchy/getting-started/) for help getting started using the treemap generator.
406
452
  */ export { Treemap as default };