billboard.js 3.6.0-next.2 → 3.6.1

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 (43) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +4808 -7179
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +8271 -11777
  6. package/dist/billboard.pkgd.min.js +2 -3
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +27 -62
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +303 -528
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +368 -648
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +305 -513
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +306 -500
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2169 -2362
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2940 -3599
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +3194 -4110
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2943 -3585
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3084 -3931
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +369 -192
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -8
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +3 -12
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +3 -12
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +3 -12
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -8
  34. package/package.json +23 -23
  35. package/src/ChartInternal/data/IData.ts +8 -2
  36. package/src/ChartInternal/interactions/interaction.ts +39 -26
  37. package/src/ChartInternal/internals/color.ts +50 -0
  38. package/src/ChartInternal/internals/legend.ts +246 -145
  39. package/src/ChartInternal/shape/area.ts +9 -38
  40. package/src/ChartInternal/shape/bar.ts +20 -3
  41. package/src/config/Options/common/legend.ts +18 -3
  42. package/src/config/Options/shape/bar.ts +32 -0
  43. package/types/options.d.ts +30 -4
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.6.0-next.2
8
+ * @version 3.6.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -94,7 +94,6 @@ function _assertThisInitialized(self) {
94
94
  if (self === void 0) {
95
95
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
96
96
  }
97
-
98
97
  return self;
99
98
  }
100
99
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
@@ -116,17 +115,14 @@ function _inheritsLoose(subClass, superClass) {
116
115
  var external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_ = __webpack_require__(1);
117
116
  ;// CONCATENATED MODULE: ./src/Plugin/Plugin.ts
118
117
 
119
-
120
118
  /**
121
119
  * Copyright (c) 2017 ~ present NAVER Corp.
122
120
  * billboard.js project is licensed under the MIT license
123
121
  */
124
-
125
122
  /**
126
123
  * Base class to generate billboard.js plugin
127
124
  * @class Plugin
128
125
  */
129
-
130
126
  /**
131
127
  * Version info string for plugin
132
128
  * @name version
@@ -146,62 +142,51 @@ var Plugin = /*#__PURE__*/function () {
146
142
  if (options === void 0) {
147
143
  options = {};
148
144
  }
149
-
150
145
  this.$$ = void 0;
151
146
  this.options = void 0;
152
147
  this.options = options;
153
148
  }
149
+
154
150
  /**
155
151
  * Lifecycle hook for 'beforeInit' phase.
156
152
  * @private
157
153
  */
158
-
159
-
160
154
  var _proto = Plugin.prototype;
161
-
162
155
  _proto.$beforeInit = function $beforeInit() {}
156
+
163
157
  /**
164
158
  * Lifecycle hook for 'init' phase.
165
159
  * @private
166
- */
167
- ;
168
-
160
+ */;
169
161
  _proto.$init = function $init() {}
162
+
170
163
  /**
171
164
  * Lifecycle hook for 'afterInit' phase.
172
165
  * @private
173
- */
174
- ;
175
-
166
+ */;
176
167
  _proto.$afterInit = function $afterInit() {}
168
+
177
169
  /**
178
170
  * Lifecycle hook for 'redraw' phase.
179
171
  * @private
180
- */
181
- ;
182
-
172
+ */;
183
173
  _proto.$redraw = function $redraw() {}
174
+
184
175
  /**
185
176
  * Lifecycle hook for 'willDestroy' phase.
186
177
  * @private
187
- */
188
- ;
189
-
178
+ */;
190
179
  _proto.$willDestroy = function $willDestroy() {
191
180
  var _this = this;
192
-
193
181
  Object.keys(this).forEach(function (key) {
194
182
  _newArrowCheck(this, _this);
195
-
196
183
  this[key] = null;
197
184
  delete this[key];
198
185
  }.bind(this));
199
186
  };
200
-
201
187
  return Plugin;
202
188
  }();
203
-
204
- Plugin.version = "3.6.0-next.2";
189
+ Plugin.version = "3.6.1";
205
190
 
206
191
  ;// CONCATENATED MODULE: ./src/Plugin/bubblecompare/index.ts
207
192
 
@@ -209,6 +194,7 @@ Plugin.version = "3.6.0-next.2";
209
194
 
210
195
 
211
196
 
197
+
212
198
  /**
213
199
  * Bubble compare diagram plugin.<br>
214
200
  * Compare data 3-dimensional ways: x-axis, y-axis & bubble-size.
@@ -250,91 +236,70 @@ Plugin.version = "3.6.0-next.2";
250
236
  * ]
251
237
  * })
252
238
  */
253
-
254
239
  var BubbleCompare = /*#__PURE__*/function (_Plugin) {
255
240
  _inheritsLoose(BubbleCompare, _Plugin);
256
-
257
241
  function BubbleCompare(options) {
258
242
  var _this = _Plugin.call(this, options) || this;
259
-
260
243
  _this.$$ = void 0;
261
244
  return _assertThisInitialized(_this) || _assertThisInitialized(_this);
262
245
  }
263
-
264
246
  var _proto = BubbleCompare.prototype;
265
-
266
247
  _proto.$init = function $init() {
267
248
  var $$ = this.$$;
268
249
  $$.findClosest = this.findClosest.bind(this);
269
250
  $$.getBubbleR = this.getBubbleR.bind(this);
270
251
  $$.pointExpandedR = this.pointExpandedR.bind(this);
271
252
  };
272
-
273
253
  _proto.pointExpandedR = function pointExpandedR(d) {
274
254
  var baseR = this.getBubbleR(d),
275
- _this$options$expandS = this.options.expandScale,
276
- expandScale = _this$options$expandS === void 0 ? 1 : _this$options$expandS;
255
+ _this$options$expandS = this.options.expandScale,
256
+ expandScale = _this$options$expandS === void 0 ? 1 : _this$options$expandS;
277
257
  BubbleCompare.raiseFocusedBubbleLayer(d);
278
258
  this.changeCursorPoint();
279
259
  return baseR * expandScale;
280
260
  };
281
-
282
261
  BubbleCompare.raiseFocusedBubbleLayer = function raiseFocusedBubbleLayer(d) {
283
262
  d.raise && (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(d.node().parentNode.parentNode).raise();
284
263
  };
285
-
286
264
  _proto.changeCursorPoint = function changeCursorPoint() {
287
265
  this.$$.$el.svg.select(".bb-event-rect").style("cursor", "pointer");
288
266
  };
289
-
290
267
  _proto.findClosest = function findClosest(values, pos) {
291
268
  var _this2 = this,
292
- $$ = this.$$;
293
-
269
+ $$ = this.$$;
294
270
  return values.filter(function (v) {
295
271
  _newArrowCheck(this, _this2);
296
-
297
272
  return v && !$$.isBarType(v.id);
298
273
  }.bind(this)).reduce(function (acc, cur) {
299
274
  _newArrowCheck(this, _this2);
300
-
301
275
  var d = $$.dist(cur, pos);
302
276
  return d < this.getBubbleR(cur) ? cur : acc;
303
277
  }.bind(this), 0);
304
278
  };
305
-
306
279
  _proto.getBubbleR = function getBubbleR(d) {
307
280
  var _this3 = this,
308
- _this$options = this.options,
309
- minR = _this$options.minR,
310
- maxR = _this$options.maxR,
311
- curVal = this.getZData(d);
312
-
281
+ _this$options = this.options,
282
+ minR = _this$options.minR,
283
+ maxR = _this$options.maxR,
284
+ curVal = this.getZData(d);
313
285
  if (!curVal) return minR;
314
-
315
286
  var _this$$$$data$targets = this.$$.data.targets.reduce(function (_ref, cur) {
316
- var accMin = _ref[0],
287
+ var accMin = _ref[0],
317
288
  accMax = _ref[1];
318
-
319
- _newArrowCheck(this, _this3);
320
-
321
- var val = this.getZData(cur.values[0]);
322
- return [Math.min(accMin, val), Math.max(accMax, val)];
323
- }.bind(this), [1e4, 0]),
324
- min = _this$$$$data$targets[0],
325
- max = _this$$$$data$targets[1],
326
- size = min > 0 && max === min ? 0 : curVal / max;
327
-
289
+ _newArrowCheck(this, _this3);
290
+ var val = this.getZData(cur.values[0]);
291
+ return [Math.min(accMin, val), Math.max(accMax, val)];
292
+ }.bind(this), [1e4, 0]),
293
+ min = _this$$$$data$targets[0],
294
+ max = _this$$$$data$targets[1],
295
+ size = min > 0 && max === min ? 0 : curVal / max;
328
296
  return Math.abs(size) * (maxR - minR) + minR;
329
297
  };
330
-
331
298
  _proto.getZData = function getZData(d) {
332
299
  return this.$$.isBubbleZType(d) ? this.$$.getBubbleZData(d.value, "z") : d.value;
333
300
  };
334
-
335
301
  return BubbleCompare;
336
302
  }(Plugin);
337
-
338
303
  BubbleCompare.version = "0.0.1";
339
304
 
340
305
  }();
@@ -5,8 +5,8 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.6.0-next.2
8
+ * @version 3.6.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection")):"function"==typeof define&&define.amd?define("bb",["d3-selection"],e):"object"==typeof exports?exports.bb=e(require("d3-selection")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.bubblecompare=e(t.d3))}(this,(function(t){return function(){"use strict";var e=[,function(e){e.exports=t}],n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}i.d(r,{default:function(){return u}});var o=i(1),s=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();s.version="3.6.0-next.2";var u=function(i){var r,s;function u(t){var n=i.call(this,t)||this;return n.$$=void 0,e(n)||e(n)}s=i,(r=u).prototype=Object.create(s.prototype),r.prototype.constructor=r,n(r,s);var a=u.prototype;return a.$init=function(){var t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)},a.pointExpandedR=function(t){var e=this.getBubbleR(t),n=this.options.expandScale,i=void 0===n?1:n;return u.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),e*i},u.raiseFocusedBubbleLayer=function(t){t.raise&&(0,o.select)(t.node().parentNode.parentNode).raise()},a.changeCursorPoint=function(){this.$$.$el.svg.select(".bb-event-rect").style("cursor","pointer")},a.findClosest=function(e,n){var i=this,r=this.$$;return e.filter(function(e){return t(this,i),e&&!r.isBarType(e.id)}.bind(this)).reduce(function(e,o){return t(this,i),r.dist(o,n)<this.getBubbleR(o)?o:e}.bind(this),0)},a.getBubbleR=function(e){var n=this,i=this.options,r=i.minR,o=i.maxR,s=this.getZData(e);if(!s)return r;var u=this.$$.data.targets.reduce(function(e,i){var r=e[0],o=e[1];t(this,n);var s=this.getZData(i.values[0]);return[Math.min(r,s),Math.max(o,s)]}.bind(this),[1e4,0]),a=u[0],c=u[1],f=a>0&&c===a?0:s/c;return Math.abs(f)*(o-r)+r},a.getZData=function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value},u}(s);u.version="0.0.1"}(),r=r.default}()}));
12
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection")):"function"==typeof define&&define.amd?define("bb",["d3-selection"],e):"object"==typeof exports?exports.bb=e(require("d3-selection")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.bubblecompare=e(t.d3))}(this,(function(t){return function(){"use strict";var e=[,function(e){e.exports=t}],n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var r={};return function(){function t(t,e){if(t!==e)throw new TypeError("Cannot instantiate an arrow function")}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}i.d(r,{default:function(){return u}});var o=i(1),s=function(){function e(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var n=e.prototype;return n.$beforeInit=function(){},n.$init=function(){},n.$afterInit=function(){},n.$redraw=function(){},n.$willDestroy=function(){var e=this;Object.keys(this).forEach(function(n){t(this,e),this[n]=null,delete this[n]}.bind(this))},e}();s.version="3.6.1";var u=function(i){var r,s;function u(t){var n=i.call(this,t)||this;return n.$$=void 0,e(n)||e(n)}s=i,(r=u).prototype=Object.create(s.prototype),r.prototype.constructor=r,n(r,s);var a=u.prototype;return a.$init=function(){var t=this.$$;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)},a.pointExpandedR=function(t){var e=this.getBubbleR(t),n=this.options.expandScale,i=void 0===n?1:n;return u.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),e*i},u.raiseFocusedBubbleLayer=function(t){t.raise&&(0,o.select)(t.node().parentNode.parentNode).raise()},a.changeCursorPoint=function(){this.$$.$el.svg.select(".bb-event-rect").style("cursor","pointer")},a.findClosest=function(e,n){var i=this,r=this.$$;return e.filter(function(e){return t(this,i),e&&!r.isBarType(e.id)}.bind(this)).reduce(function(e,o){return t(this,i),r.dist(o,n)<this.getBubbleR(o)?o:e}.bind(this),0)},a.getBubbleR=function(e){var n=this,i=this.options,r=i.minR,o=i.maxR,s=this.getZData(e);if(!s)return r;var u=this.$$.data.targets.reduce(function(e,i){var r=e[0],o=e[1];t(this,n);var s=this.getZData(i.values[0]);return[Math.min(r,s),Math.max(o,s)]}.bind(this),[1e4,0]),a=u[0],c=u[1],f=a>0&&c===a?0:s/c;return Math.abs(f)*(o-r)+r},a.getZData=function(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value},u}(s);u.version="0.0.1"}(),r=r.default}()}));