billboard.js 3.3.0 → 3.3.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 (72) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +424 -374
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +2284 -2200
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +137 -92
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +138 -93
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +3 -119
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +3 -119
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1862 -1828
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1998 -1919
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2000 -1921
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1866 -1948
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1866 -1948
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +2 -2
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +2 -2
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +2 -2
  28. package/dist-esm/billboard.js +426 -383
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +129 -77
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
  34. package/package.json +15 -15
  35. package/src/Chart/api/focus.ts +8 -8
  36. package/src/Chart/api/regions.ts +3 -3
  37. package/src/Chart/api/selection.ts +15 -15
  38. package/src/Chart/api/subchart.ts +3 -3
  39. package/src/ChartInternal/Axis/Axis.ts +13 -12
  40. package/src/ChartInternal/ChartInternal.ts +5 -6
  41. package/src/ChartInternal/data/data.ts +3 -3
  42. package/src/ChartInternal/data/load.ts +2 -2
  43. package/src/ChartInternal/interactions/drag.ts +15 -15
  44. package/src/ChartInternal/interactions/eventrect.ts +18 -18
  45. package/src/ChartInternal/interactions/interaction.ts +10 -10
  46. package/src/ChartInternal/interactions/zoom.ts +4 -4
  47. package/src/ChartInternal/internals/color.ts +4 -4
  48. package/src/ChartInternal/internals/domain.ts +1 -1
  49. package/src/ChartInternal/internals/grid.ts +32 -32
  50. package/src/ChartInternal/internals/legend.ts +27 -27
  51. package/src/ChartInternal/internals/redraw.ts +3 -3
  52. package/src/ChartInternal/internals/region.ts +3 -3
  53. package/src/ChartInternal/internals/selection.ts +16 -15
  54. package/src/ChartInternal/internals/size.ts +3 -3
  55. package/src/ChartInternal/internals/text.ts +8 -8
  56. package/src/ChartInternal/internals/title.ts +4 -4
  57. package/src/ChartInternal/internals/tooltip.ts +5 -5
  58. package/src/ChartInternal/internals/transform.ts +5 -5
  59. package/src/ChartInternal/shape/arc.ts +22 -22
  60. package/src/ChartInternal/shape/area.ts +4 -4
  61. package/src/ChartInternal/shape/bar.ts +7 -7
  62. package/src/ChartInternal/shape/candlestick.ts +8 -8
  63. package/src/ChartInternal/shape/gauge.ts +8 -8
  64. package/src/ChartInternal/shape/line.ts +7 -7
  65. package/src/ChartInternal/shape/point.ts +18 -18
  66. package/src/ChartInternal/shape/radar.ts +10 -10
  67. package/src/ChartInternal/shape/shape.ts +4 -2
  68. package/src/Plugin/sparkline/index.ts +2 -2
  69. package/src/Plugin/stanford/index.ts +3 -3
  70. package/src/Plugin/stanford/util.ts +0 -1
  71. package/src/config/classes.ts +154 -66
  72. package/src/module/util.ts +1 -2
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.0
8
+ * @version 3.3.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -183,121 +183,6 @@ win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
183
183
  };
184
184
 
185
185
  var doc = win == null ? void 0 : win.document;
186
- ;// CONCATENATED MODULE: ./src/config/classes.ts
187
- /**
188
- * Copyright (c) 2017 ~ present NAVER Corp.
189
- * billboard.js project is licensed under the MIT license
190
- */
191
-
192
- /**
193
- * CSS class names definition
194
- * @private
195
- */
196
- /* harmony default export */ var classes = ({
197
- arc: "bb-arc",
198
- arcLabelLine: "bb-arc-label-line",
199
- arcs: "bb-arcs",
200
- area: "bb-area",
201
- areas: "bb-areas",
202
- axis: "bb-axis",
203
- axisX: "bb-axis-x",
204
- axisXLabel: "bb-axis-x-label",
205
- axisY: "bb-axis-y",
206
- axisY2: "bb-axis-y2",
207
- axisY2Label: "bb-axis-y2-label",
208
- axisYLabel: "bb-axis-y-label",
209
- bar: "bb-bar",
210
- bars: "bb-bars",
211
- brush: "bb-brush",
212
- button: "bb-button",
213
- buttonZoomReset: "bb-zoom-reset",
214
- candlestick: "bb-candlestick",
215
- candlesticks: "bb-candlesticks",
216
- chart: "bb-chart",
217
- chartArc: "bb-chart-arc",
218
- chartArcs: "bb-chart-arcs",
219
- chartArcsBackground: "bb-chart-arcs-background",
220
- chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
221
- chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
222
- chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
223
- chartArcsTitle: "bb-chart-arcs-title",
224
- chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
225
- chartBar: "bb-chart-bar",
226
- chartBars: "bb-chart-bars",
227
- chartCandlestick: "bb-chart-candlestick",
228
- chartCandlesticks: "bb-chart-candlesticks",
229
- chartCircles: "bb-chart-circles",
230
- chartLine: "bb-chart-line",
231
- chartLines: "bb-chart-lines",
232
- chartRadar: "bb-chart-radar",
233
- chartRadars: "bb-chart-radars",
234
- chartText: "bb-chart-text",
235
- chartTexts: "bb-chart-texts",
236
- circle: "bb-circle",
237
- circles: "bb-circles",
238
- colorPattern: "bb-color-pattern",
239
- colorScale: "bb-colorscale",
240
- defocused: "bb-defocused",
241
- dragarea: "bb-dragarea",
242
- empty: "bb-empty",
243
- eventRect: "bb-event-rect",
244
- eventRects: "bb-event-rects",
245
- eventRectsMultiple: "bb-event-rects-multiple",
246
- eventRectsSingle: "bb-event-rects-single",
247
- focused: "bb-focused",
248
- gaugeValue: "bb-gauge-value",
249
- grid: "bb-grid",
250
- gridLines: "bb-grid-lines",
251
- legend: "bb-legend",
252
- legendBackground: "bb-legend-background",
253
- legendItem: "bb-legend-item",
254
- legendItemEvent: "bb-legend-item-event",
255
- legendItemFocused: "bb-legend-item-focused",
256
- legendItemHidden: "bb-legend-item-hidden",
257
- legendItemPoint: "bb-legend-item-point",
258
- legendItemTile: "bb-legend-item-tile",
259
- level: "bb-level",
260
- levels: "bb-levels",
261
- line: "bb-line",
262
- lines: "bb-lines",
263
- main: "bb-main",
264
- region: "bb-region",
265
- regions: "bb-regions",
266
- selectedCircle: "bb-selected-circle",
267
- selectedCircles: "bb-selected-circles",
268
- shape: "bb-shape",
269
- shapes: "bb-shapes",
270
- stanfordElements: "bb-stanford-elements",
271
- stanfordLine: "bb-stanford-line",
272
- stanfordLines: "bb-stanford-lines",
273
- stanfordRegion: "bb-stanford-region",
274
- stanfordRegions: "bb-stanford-regions",
275
- subchart: "bb-subchart",
276
- target: "bb-target",
277
- text: "bb-text",
278
- texts: "bb-texts",
279
- title: "bb-title",
280
- tooltip: "bb-tooltip",
281
- tooltipContainer: "bb-tooltip-container",
282
- tooltipName: "bb-tooltip-name",
283
- valueDown: "bb-value-down",
284
- valueUp: "bb-value-up",
285
- xgrid: "bb-xgrid",
286
- xgridFocus: "bb-xgrid-focus",
287
- xgridLine: "bb-xgrid-line",
288
- xgridLines: "bb-xgrid-lines",
289
- xgrids: "bb-xgrids",
290
- ygrid: "bb-ygrid",
291
- ygridFocus: "bb-ygrid-focus",
292
- ygridLine: "bb-ygrid-line",
293
- ygridLines: "bb-ygrid-lines",
294
- ygrids: "bb-ygrids",
295
- zoomBrush: "bb-zoom-brush",
296
- EXPANDED: "_expanded_",
297
- SELECTED: "_selected_",
298
- INCLUDED: "_included_",
299
- TextOverlapping: "text-overlapping"
300
- });
301
186
  ;// CONCATENATED MODULE: ./src/module/util.ts
302
187
 
303
188
 
@@ -315,7 +200,6 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
315
200
 
316
201
 
317
202
 
318
-
319
203
  var isValue = function (v) {
320
204
  return v || v === 0;
321
205
  },
@@ -586,7 +470,7 @@ function getBrushSelection(ctx) {
586
470
  // check from event
587
471
  if (event && event.type === "brush") {
588
472
  selection = event.selection; // check from brush area selection
589
- } else if (main && (selection = main.select("." + classes.brush).node())) {
473
+ } else if (main && (selection = main.select(".bb-brush").node())) {
590
474
  selection = (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushSelection)(selection);
591
475
  }
592
476
 
@@ -1229,7 +1113,7 @@ var Plugin = /*#__PURE__*/function () {
1229
1113
  return Plugin;
1230
1114
  }();
1231
1115
 
1232
- Plugin.version = "3.2.2";
1116
+ Plugin.version = "3.3.0";
1233
1117
 
1234
1118
  ;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
1235
1119
  /**
@@ -5,8 +5,8 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.3.0
8
+ * @version 3.3.1
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
12
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var r="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.2.2";var b=function(){return{selector:void 0,extent:1,area:0}},d=function(r){var i,c;function u(t){var n=r.call(this,t)||this;return n.config=void 0,n.config=new b,e(n)||e(n)}c=r,(i=u).prototype=Object.create(c.prototype),i.prototype.constructor=i,t(i,c);var a=u.prototype;return a.$init=function(){s.call(this,this.options)},a.$redraw=function(){var e=this.$$.$el,t=this.config.selector,n=t?e.main.selectAll(t):e.text;n.empty()||this.preventLabelOverlap(n)},a.generateVoronoi=function(e){var t=this.$$.scale,o=["x","y"].map((function(e){return t[e].domain()})),r=o[0],i=o[1],c=[i[0],r[1]];return r[1]=c[0],i[0]=c[1],n.Delaunay.from(e).voronoi([].concat(r,i))},a.preventLabelOverlap=function(e){var t=this.config,n=t.extent,r=t.area,i=e.data().map((function(e){return[e.index,e.value]})),c=this.generateVoronoi(i),u=0;e.each((function(){var e=c.cellPolygon(u);if(e&&this){var t=i[u],a=t[0],l=t[1],s=(0,o.polygonCentroid)(e),f=s[0],b=s[1],d=Math.abs((0,o.polygonArea)(e)),p=Math.round(Math.atan2(b-l,f-a)/Math.PI*2),v=n*(0===p?1:-1),h=-1===p?-n:n+5,y=1===Math.abs(p)?"middle":0===p?"start":"end";this.style.display=d<r?"none":"",this.setAttribute("text-anchor",y),this.setAttribute("dy","0."+(1===p?71:35)+"em"),this.setAttribute("transform","translate("+v+", "+h+")")}u++}))},u}(f)}(),u=u.default}()}));
12
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var r="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.3.0";var b=function(){return{selector:void 0,extent:1,area:0}},d=function(r){var i,c;function u(t){var n=r.call(this,t)||this;return n.config=void 0,n.config=new b,e(n)||e(n)}c=r,(i=u).prototype=Object.create(c.prototype),i.prototype.constructor=i,t(i,c);var a=u.prototype;return a.$init=function(){s.call(this,this.options)},a.$redraw=function(){var e=this.$$.$el,t=this.config.selector,n=t?e.main.selectAll(t):e.text;n.empty()||this.preventLabelOverlap(n)},a.generateVoronoi=function(e){var t=this.$$.scale,o=["x","y"].map((function(e){return t[e].domain()})),r=o[0],i=o[1],c=[i[0],r[1]];return r[1]=c[0],i[0]=c[1],n.Delaunay.from(e).voronoi([].concat(r,i))},a.preventLabelOverlap=function(e){var t=this.config,n=t.extent,r=t.area,i=e.data().map((function(e){return[e.index,e.value]})),c=this.generateVoronoi(i),u=0;e.each((function(){var e=c.cellPolygon(u);if(e&&this){var t=i[u],a=t[0],l=t[1],s=(0,o.polygonCentroid)(e),f=s[0],b=s[1],d=Math.abs((0,o.polygonArea)(e)),p=Math.round(Math.atan2(b-l,f-a)/Math.PI*2),v=n*(0===p?1:-1),h=-1===p?-n:n+5,y=1===Math.abs(p)?"middle":0===p?"start":"end";this.style.display=d<r?"none":"",this.setAttribute("text-anchor",y),this.setAttribute("dy","0."+(1===p?71:35)+"em"),this.setAttribute("transform","translate("+v+", "+h+")")}u++}))},u}(f)}(),u=u.default}()}));