billboard.js 3.10.3 → 3.11.0-next.2
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.
- package/README.md +0 -1
- package/dist/billboard.css +5 -4
- package/dist/billboard.js +598 -220
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2828 -2456
- package/dist/billboard.pkgd.min.js +2 -4
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +31 -15
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +31 -15
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +30 -15
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +30 -15
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2222 -2214
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2252 -2228
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2253 -2229
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2253 -2230
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2259 -2238
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +7 -7
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +7 -7
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +7 -7
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +7 -7
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +7 -7
- package/dist/theme/modern.min.css +2 -2
- package/dist-esm/billboard.js +517 -180
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -4
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +7 -9
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +3 -4
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -4
- package/package.json +42 -46
- package/src/Chart/api/zoom.ts +5 -20
- package/src/ChartInternal/Axis/Axis.ts +5 -3
- package/src/ChartInternal/Axis/AxisRenderer.ts +14 -0
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/data.ts +12 -5
- package/src/ChartInternal/data/load.ts +37 -1
- package/src/ChartInternal/interactions/eventrect.ts +11 -4
- package/src/ChartInternal/interactions/interaction.ts +2 -1
- package/src/ChartInternal/interactions/zoom.ts +28 -0
- package/src/ChartInternal/internals/domain.ts +24 -1
- package/src/ChartInternal/internals/legend.ts +28 -2
- package/src/ChartInternal/internals/scale.ts +3 -3
- package/src/ChartInternal/internals/size.axis.ts +8 -3
- package/src/ChartInternal/internals/size.ts +14 -1
- package/src/ChartInternal/internals/tooltip.ts +12 -6
- package/src/ChartInternal/internals/transform.ts +6 -2
- package/src/ChartInternal/internals/type.ts +1 -1
- package/src/ChartInternal/shape/arc.ts +110 -34
- package/src/ChartInternal/shape/gauge.ts +8 -4
- package/src/ChartInternal/shape/radar.ts +58 -45
- package/src/config/Options/axis/x.ts +27 -1
- package/src/config/Options/axis/y2.ts +13 -0
- package/src/config/Options/common/legend.ts +17 -0
- package/src/config/Options/common/tooltip.ts +1 -0
- package/src/config/Options/shape/arc.ts +40 -3
- package/src/config/Options/shape/gauge.ts +23 -2
- package/src/config/Options/shape/pie.ts +2 -2
- package/src/config/classes.ts +1 -0
- package/src/module/Cache.ts +1 -0
- package/src/module/util.ts +16 -2
- package/src/scss/billboard.scss +2 -1
- package/src/scss/theme/dark.scss +2 -1
- package/src/scss/theme/datalab.scss +2 -1
- package/src/scss/theme/graph.scss +2 -1
- package/src/scss/theme/insight.scss +2 -1
- package/src/scss/theme/modern.scss +2 -1
- package/types/options.d.ts +28 -4
- package/types/options.shape.d.ts +44 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.11.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -149,27 +149,27 @@ function _typeof(o) {
|
|
|
149
149
|
}
|
|
150
150
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
151
151
|
|
|
152
|
-
function
|
|
153
|
-
if (
|
|
154
|
-
var
|
|
155
|
-
if (
|
|
156
|
-
var
|
|
157
|
-
if (
|
|
152
|
+
function toPrimitive(t, r) {
|
|
153
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
154
|
+
var e = t[Symbol.toPrimitive];
|
|
155
|
+
if (void 0 !== e) {
|
|
156
|
+
var i = e.call(t, r || "default");
|
|
157
|
+
if ("object" != _typeof(i)) return i;
|
|
158
158
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
159
159
|
}
|
|
160
|
-
return (
|
|
160
|
+
return ("string" === r ? String : Number)(t);
|
|
161
161
|
}
|
|
162
162
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
function
|
|
166
|
-
var
|
|
167
|
-
return _typeof(
|
|
165
|
+
function toPropertyKey(t) {
|
|
166
|
+
var i = toPrimitive(t, "string");
|
|
167
|
+
return "symbol" == _typeof(i) ? i : String(i);
|
|
168
168
|
}
|
|
169
169
|
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
170
170
|
|
|
171
171
|
function _defineProperty(obj, key, value) {
|
|
172
|
-
key =
|
|
172
|
+
key = toPropertyKey(key);
|
|
173
173
|
if (key in obj) {
|
|
174
174
|
Object.defineProperty(obj, key, {
|
|
175
175
|
value: value,
|
|
@@ -742,13 +742,14 @@ const toArray = function (v) {
|
|
|
742
742
|
*/
|
|
743
743
|
function addCssRules(style, selector, prop) {
|
|
744
744
|
var _this9 = this;
|
|
745
|
-
const
|
|
745
|
+
const _style$rootSelector = style.rootSelector,
|
|
746
|
+
rootSelector = _style$rootSelector === void 0 ? "" : _style$rootSelector,
|
|
746
747
|
sheet = style.sheet,
|
|
747
748
|
getSelector = function (s) {
|
|
748
749
|
_newArrowCheck(this, _this9);
|
|
749
750
|
return s.replace(/\s?(bb-)/g, ".$1").replace(/\.+/g, ".");
|
|
750
751
|
}.bind(this),
|
|
751
|
-
rule =
|
|
752
|
+
rule = rootSelector + " " + getSelector(selector) + " {" + prop.join(";") + "}";
|
|
752
753
|
return sheet[sheet.insertRule ? "insertRule" : "addRule"](rule, sheet.cssRules.length);
|
|
753
754
|
}
|
|
754
755
|
|
|
@@ -775,6 +776,20 @@ function getCssRules(styleSheets) {
|
|
|
775
776
|
return rules;
|
|
776
777
|
}
|
|
777
778
|
|
|
779
|
+
/**
|
|
780
|
+
* Get current window and container scroll position
|
|
781
|
+
* @param {HTMLElement} node Target element
|
|
782
|
+
* @returns {object} window scroll position
|
|
783
|
+
* @private
|
|
784
|
+
*/
|
|
785
|
+
function getScrollPosition(node) {
|
|
786
|
+
var _ref2, _ref3, _window$pageXOffset, _ref4, _ref5, _window$pageYOffset;
|
|
787
|
+
return {
|
|
788
|
+
x: (_ref2 = ((_ref3 = (_window$pageXOffset = win.pageXOffset) != null ? _window$pageXOffset : win.scrollX) != null ? _ref3 : 0) + node.scrollLeft) != null ? _ref2 : 0,
|
|
789
|
+
y: (_ref4 = ((_ref5 = (_window$pageYOffset = win.pageYOffset) != null ? _window$pageYOffset : win.scrollY) != null ? _ref5 : 0) + node.scrollTop) != null ? _ref4 : 0
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
778
793
|
/**
|
|
779
794
|
* Gets the SVGMatrix of an SVGGElement
|
|
780
795
|
* @param {SVGElement} node Node element
|
|
@@ -1231,7 +1246,7 @@ let Plugin = /*#__PURE__*/function () {
|
|
|
1231
1246
|
};
|
|
1232
1247
|
return Plugin;
|
|
1233
1248
|
}();
|
|
1234
|
-
Plugin.version = "3.
|
|
1249
|
+
Plugin.version = "3.11.0-next.2";
|
|
1235
1250
|
|
|
1236
1251
|
;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
|
|
1237
1252
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.11.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(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"],n):"object"==typeof exports?exports.bb=n(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.textoverlap=n(t.d3,t.d3,t.d3,t.d3))}(this,(function(t,n,e,i){return function(){"use strict";var o={
|
|
12
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(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"],n):"object"==typeof exports?exports.bb=n(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.textoverlap=n(t.d3,t.d3,t.d3,t.d3))}(this,(function(t,n,e,i){return function(){"use strict";var o={624:function(t){t.exports=i},248:function(n){n.exports=t},344:function(t){t.exports=n},364:function(t){t.exports=e}},r={};function c(t){var n=r[t];if(void 0!==n)return n.exports;var e=r[t]={exports:{}};return o[t](e,e.exports,c),e.exports}c.d=function(t,n){for(var e in n)c.o(n,e)&&!c.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},c.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)};var s={};return function(){function t(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function e(t,n){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},e(t,n)}c.d(s,{default:function(){return w}});var i=c(248),o=c(344);c(364),c(624);const 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")(),u=null==r?void 0:r.document,a=function(n){var e=this;const i="function"==typeof(null==n?void 0:n.requestAnimationFrame)&&"function"==typeof(null==n?void 0:n.cancelAnimationFrame),o="function"==typeof(null==n?void 0:n.requestIdleCallback)&&"function"==typeof(null==n?void 0:n.cancelIdleCallback),r=function(n){return t(this,e),setTimeout(n,1)}.bind(this),c=function(n){return t(this,e),clearTimeout(n)}.bind(this);return[i?n.requestAnimationFrame:r,i?n.cancelAnimationFrame:c,o?n.requestIdleCallback:r,o?n.cancelIdleCallback:c]}(r);a[0],a[1],a[2],a[3];var l=void 0;(function(n){return t(this,l),n||0===n}).bind(void 0),function(n){return t(this,l),"function"==typeof n}.bind(void 0);const d=function(n){return t(this,l),"string"==typeof n}.bind(void 0),f=function(n){return t(this,l),"number"==typeof n}.bind(void 0),h=function(n){return t(this,l),void 0===n}.bind(void 0),b=function(n){return t(this,l),void 0!==n}.bind(void 0),p=(function(n){return t(this,l),"boolean"==typeof n}.bind(void 0),function(n){return t(this,l),10*Math.ceil(n/10)}.bind(void 0),function(n){return t(this,l),Math.ceil(n)+.5}.bind(void 0),function(n){return t(this,l),n[1]-n[0]}.bind(void 0),function(n){return t(this,l),"object"==typeof n}.bind(void 0)),v=function(n){return t(this,l),h(n)||null===n||d(n)&&0===n.length||p(n)&&!(n instanceof Date)&&0===Object.keys(n).length||f(n)&&isNaN(n)}.bind(void 0),y=(function(n){return t(this,l),!v(n)}.bind(void 0),function(n){return t(this,l),Array.isArray(n)}.bind(void 0)),g=function(n){return t(this,l),n&&!(null!=n&&n.nodeType)&&p(n)&&!y(n)}.bind(void 0);(function(n){return t(this,l),n.charAt(0).toUpperCase()+n.slice(1)}).bind(void 0);(function(n){return t(this,l),[].slice.call(n)}).bind(void 0);function m(n){for(var e=this,i=arguments.length,o=Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];if(!o.length||1===o.length&&!o[0])return n;const c=o.shift();return g(n)&&g(c)&&Object.keys(c).forEach(function(i){t(this,e);const o=c[i];g(o)?(n[i]||(n[i]={}),n[i]=m(n[i],o)):n[i]=y(o)?o.concat():o}.bind(this)),m.apply(void 0,[n].concat(o))}(function(n,e,i){void 0===i&&(i=1),t(this,l);const o=[],r=0|Math.max(0,Math.ceil((e-n)/i));for(let t=n;t<r;t++)o.push(n+t*i);return o}).bind(void 0),function(){var n=this;t(this,l);const e=function(){return t(this,n),{bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0}}.bind(this);try{return new MouseEvent("t"),function(i,o,r){void 0===r&&(r=e()),t(this,n),i.dispatchEvent(new MouseEvent(o,r))}.bind(this)}catch(i){return function(i,o,c){void 0===c&&(c=e()),t(this,n);const s=u.createEvent("MouseEvent");s.initMouseEvent(o,c.bubbles,c.cancelable,r,0,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),i.dispatchEvent(s)}.bind(this)}}.bind(void 0)(),function(n,e,i){t(this,l);const o=new Touch(m({identifier:Date.now(),target:n,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},i));n.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}.bind(void 0);function j(n){var e=this;const i=this.config;let o,r,c;const s=function(){t(this,e);const n=r.shift();return n&&o&&p(o)&&n in o?(o=o[n],s()):n?void 0:o}.bind(this);Object.keys(i).forEach(function(u){t(this,e),o=n,r=u.split("_"),c=s(),b(c)&&(i[u]=c)}.bind(this)),this.api&&(this.state.orgConfig=n)}let x=function(){function n(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=n.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var n=this;Object.keys(this).forEach(function(e){t(this,n),this[e]=null,delete this[e]}.bind(this))},n}();x.version="3.11.0-next.2";let O=function(){return{selector:void 0,extent:1,area:0}},w=function(r){var c,s;function u(t){var e=r.call(this,t)||this;return e.config=void 0,e.config=new O,n(e)||n(e)}s=r,(c=u).prototype=Object.create(s.prototype),c.prototype.constructor=c,e(c,s);var a=u.prototype;return a.$init=function(){j.call(this,this.options)},a.$redraw=function(){const t=this.$$.$el,n=this.config.selector,e=n?t.main.selectAll(n):t.text;e.empty()||this.preventLabelOverlap(e)},a.generateVoronoi=function(n){var e=this;const o=this.$$.scale,r=["x","y"].map(function(n){return t(this,e),o[n].domain()}.bind(this)),c=r[0],s=r[1];var u=[s[0],c[1]];return c[1]=u[0],s[0]=u[1],i.Delaunay.from(n).voronoi([].concat(c,s))},a.preventLabelOverlap=function(n){var e=this;const i=this.config,r=i.extent,c=i.area,s=n.data().map(function(n){return t(this,e),[n.index,n.value]}.bind(this)),u=this.generateVoronoi(s);let a=0;n.each((function(){const t=u.cellPolygon(a);if(t&&this){const n=s[a],e=n[0],i=n[1],u=(0,o.polygonCentroid)(t),l=u[0],d=u[1],f=Math.abs((0,o.polygonArea)(t)),h=Math.round(Math.atan2(d-i,l-e)/Math.PI*2),b=r*(0===h?1:-1),p=-1===h?-r:r+5,v=1===Math.abs(h)?"middle":0===h?"start":"end";this.style.display=f<c?"none":"",this.setAttribute("text-anchor",v),this.setAttribute("dy","0."+(1===h?71:35)+"em"),this.setAttribute("transform","translate("+b+", "+p+")")}a++}))},u}(x)}(),s=s.default}()}));
|