billboard.js 3.15.1 → 3.16.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/dist/billboard.css +2 -1
- package/dist/billboard.js +333 -102
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +9 -9
- package/dist/billboard.pkgd.js +3023 -1556
- package/dist/billboard.pkgd.min.js +19 -19
- 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 +25 -10
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +25 -10
- package/dist/plugin/billboardjs-plugin-stanford.min.js +5 -5
- package/dist/plugin/billboardjs-plugin-tableview.js +18 -7
- package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-textoverlap.js +18 -7
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2692 -1456
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2716 -1465
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -7
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2717 -1466
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +14 -14
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2711 -1464
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +7 -7
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2712 -1465
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -7
- package/dist/theme/dark.css +2 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +2 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +2 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +2 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +2 -1
- package/dist/theme/modern.min.css +2 -2
- package/dist-esm/billboard.js +376 -129
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +9 -5
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +9 -5
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +23 -23
- package/src/Chart/api/category.ts +1 -1
- package/src/Chart/api/chart.ts +12 -0
- package/src/Chart/api/export.ts +11 -4
- package/src/ChartInternal/Axis/Axis.ts +20 -6
- package/src/ChartInternal/Axis/AxisRenderer.ts +17 -4
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/convert.ts +17 -4
- package/src/ChartInternal/data/data.ts +27 -38
- package/src/ChartInternal/interactions/eventrect.ts +8 -3
- package/src/ChartInternal/interactions/interaction.ts +3 -2
- package/src/ChartInternal/internals/color.ts +2 -2
- package/src/ChartInternal/internals/domain.ts +6 -2
- package/src/ChartInternal/internals/grid.ts +1 -1
- package/src/ChartInternal/internals/size.ts +16 -5
- package/src/ChartInternal/internals/style.ts +1 -1
- package/src/ChartInternal/internals/text.ts +31 -18
- package/src/ChartInternal/internals/tooltip.ts +2 -1
- package/src/ChartInternal/shape/arc.ts +2 -4
- package/src/ChartInternal/shape/bar.ts +113 -14
- package/src/ChartInternal/shape/candlestick.ts +1 -1
- package/src/ChartInternal/shape/funnel.ts +1 -1
- package/src/ChartInternal/shape/line.ts +6 -2
- package/src/ChartInternal/shape/point.ts +13 -9
- package/src/ChartInternal/shape/radar.ts +3 -2
- package/src/ChartInternal/shape/shape.ts +3 -2
- package/src/ChartInternal/shape/treemap.ts +1 -1
- package/src/config/Options/axis/axis.ts +19 -5
- package/src/config/Options/axis/x.ts +22 -1
- package/src/config/Options/axis/y.ts +20 -0
- package/src/config/Options/axis/y2.ts +33 -0
- package/src/config/Options/shape/bar.ts +1 -0
- package/src/config/Store/State.ts +2 -1
- package/src/config/classes.ts +7 -3
- package/src/module/util.ts +45 -20
- package/src/scss/billboard.scss +1 -0
- package/src/scss/theme/dark.scss +1 -0
- package/src/scss/theme/datalab.scss +1 -0
- package/src/scss/theme/graph.scss +1 -0
- package/src/scss/theme/insight.scss +1 -0
- package/src/scss/theme/modern.scss +1 -0
- package/types/axis.d.ts +12 -0
- package/types/chart.d.ts +10 -0
- package/types/options.shape.d.ts +6 -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.16.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -235,7 +235,7 @@ function getRectSegList(path) {
|
|
|
235
235
|
];
|
|
236
236
|
}
|
|
237
237
|
function getPathBox(path) {
|
|
238
|
-
const { width, height } = path
|
|
238
|
+
const { width, height } = getBoundingRect(path);
|
|
239
239
|
const items = getRectSegList(path);
|
|
240
240
|
const x = items[0].x;
|
|
241
241
|
const y = Math.min(items[0].y, items[1].y);
|
|
@@ -267,9 +267,20 @@ function getBrushSelection(ctx) {
|
|
|
267
267
|
}
|
|
268
268
|
return selection;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
const
|
|
272
|
-
|
|
270
|
+
function getRect(relativeViewport, node, forceEval = false) {
|
|
271
|
+
const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
|
|
272
|
+
if (forceEval) {
|
|
273
|
+
return _(node);
|
|
274
|
+
} else {
|
|
275
|
+
const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
|
|
276
|
+
return needEvaluate ? node.rect = _(node) : node.rect;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
function getBoundingRect(node, forceEval = false) {
|
|
280
|
+
return getRect(true, node, forceEval);
|
|
281
|
+
}
|
|
282
|
+
function getBBox(node, forceEval = false) {
|
|
283
|
+
return getRect(false, node, forceEval);
|
|
273
284
|
}
|
|
274
285
|
function getRandom(asStr = true, min = 0, max = 1e4) {
|
|
275
286
|
const crpt = win.crypto || win.msCrypto;
|
|
@@ -365,7 +376,7 @@ function getTransformCTM(node, x = 0, y = 0, inverse = true) {
|
|
|
365
376
|
inverse ? screen == null ? void 0 : screen.inverse() : screen
|
|
366
377
|
);
|
|
367
378
|
if (inverse === false) {
|
|
368
|
-
const rect = node
|
|
379
|
+
const rect = getBoundingRect(node);
|
|
369
380
|
res.x -= rect.x;
|
|
370
381
|
res.y -= rect.y;
|
|
371
382
|
}
|
|
@@ -648,7 +659,7 @@ class Plugin {
|
|
|
648
659
|
});
|
|
649
660
|
}
|
|
650
661
|
}
|
|
651
|
-
__publicField(Plugin, "version", "3.
|
|
662
|
+
__publicField(Plugin, "version", "3.16.0-next.2");
|
|
652
663
|
|
|
653
664
|
;// ./src/Plugin/textoverlap/Options.ts
|
|
654
665
|
class Options {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.16.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=u(l.d3,l.d3,l.d3,l.d3))})(this,function(w,l,u,
|
|
12
|
-
`)===-1)e.text(
|
|
13
|
-
`),s=o?i.length-1:1;e.html(""),i.forEach((c,f)=>{e.append("tspan").attr("x",0).attr("dy",`${f===0?
|
|
11
|
+
*/(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=u(l.d3,l.d3,l.d3,l.d3))})(this,function(w,l,u,q){return function(){"use strict";var R={263:function(e){e.exports=l},348:function(e){e.exports=w},747:function(e){e.exports=q},853:function(e){e.exports=u}},O={};function a(e){var t=O[e];if(t!==void 0)return t.exports;var n=O[e]={exports:{}};return R[e](n,n.exports,a),n.exports}(function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();var p={};a.d(p,{default:function(){return ie}});var B=a(348),P=a(263),pe=a(853),he=a(747);function F(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function S(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=i=>setTimeout(i,1),r=i=>clearTimeout(i);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const h=F(),I=h==null?void 0:h.document,[be,me,_e,ge]=S(h);var N=Object.defineProperty,E=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))V.call(t,n)&&M(e,n,t[n]);if(E)for(var n of E(t))U.call(t,n)&&M(e,n,t[n]);return e};const ye=e=>e||e===0,X=e=>typeof e=="function",b=e=>typeof e=="string",_=e=>typeof e=="number",Y=e=>typeof e=="undefined",$=e=>typeof e!="undefined",xe=e=>typeof e=="boolean",ve=e=>Math.ceil(e/10)*10,we=e=>Math.ceil(e)+.5,Oe=e=>e[1]-e[0],g=e=>typeof e=="object",L=e=>Y(e)||e===null||b(e)&&e.length===0||g(e)&&!(e instanceof Date)&&Object.keys(e).length===0||_(e)&&isNaN(e),z=e=>!L(e),y=e=>Array.isArray(e),m=e=>e&&!(e!=null&&e.nodeType)&&g(e)&&!y(e);function Pe(e,t,n){return $(e[t])?e[t]:n}function Ee(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function Me(e,t,...n){const o=X(e);return o&&e.call(t,...n),o}function Te(e,t){let n=0;const o=function(...r){!--n&&t.apply(this,...r)};"duration"in e?e.each(()=>++n).on("end",o):(++n,e.call(o))}function $e(e){return b(e)?e.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):e}function je(e,t,n=[-1,1],o=!1){if(!(!e||!b(t)))if(t.indexOf(`
|
|
12
|
+
`)===-1)e.text(t);else{const r=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const i=t.split(`
|
|
13
|
+
`),s=o?i.length-1:1;e.html(""),i.forEach((c,f)=>{e.append("tspan").attr("x",0).attr("dy",`${f===0?n[0]*s:n[1]}em`).text(c)})}}}function k(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function Ae(e){const{width:t,height:n}=A(e),o=k(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Ce(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(i){}return r.map(i=>isNaN(i)?0:i)}function G(e){const{event:t,$el:n}=e,o=n.subchart.main||n.main;let r;return t&&t.type==="brush"?r=t.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function j(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function A(e,t=!1){return j(!0,e,t)}function De(e,t=!1){return j(!1,e,t)}function qe(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function C(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:c=0}=e[i];return r&&(s=e[i].y,c=e[i].h),t>=s&&t<=s+c?i:t<s?C(e,t,n,i-1,r):C(e,t,i+1,o,r)}function Re(e){const t=G(e);return t?t[0]===t[1]:!0}function Be(...e){const t=n=>{if(m(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>T(T({},n),o))}function H(e={},t){y(t)&&t.forEach(n=>H(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Fe=e=>e.charAt(0).toUpperCase()+e.slice(1);function Se(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const K=e=>[].slice.call(e);function Ie(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Ne(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(K(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Ve(e){var t,n,o,r,i,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((i=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?i:0)+((s=e.scrollTop)!=null?s:0)}}function Ue(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const c=A(e);s.x-=c.x,s.y-=c.y}return s}function Xe(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ye(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,i)=>i.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function Le(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function x(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return m(e)&&m(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];m(r)?(!e[o]&&(e[o]={}),e[o]=x(e[o],r)):e[o]=y(r)?r.concat():r}}),x(e,...t)}function W(e,t=!0){let n;return e[0]instanceof Date?n=t?(o,r)=>o-r:(o,r)=>r-o:t&&!e.every(isNaN)?n=(o,r)=>o-r:t||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),e.concat().sort(n)}function ze(e,t){let n=t.filter(o=>z(o));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=W(n,e==="min")[0]):n=void 0,n}const ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<r;i++)o.push(e+i*n);return o},Ge={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const i=I.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,h,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch(x({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function He(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function Ke(e){var t;let n;if(e instanceof Date)n=e;else if(b(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else _(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function We(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Je(e,t,n=!1){const o=!!e.node;let r=!1;for(const[i,s]of Object.entries(t))if(r=o?e.style(i)===s:e.style[i]===s,n===!1&&r)break;return r}function Qe(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function Ze(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,i=o==null?void 0:o("(pointer:coarse)").matches;let s=!1;if(t)if(r&&"maxTouchPoints"in r)s=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(i)s=!0;else{const f=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(f)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(f)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function J(e,t){t()===!1?requestAnimationFrame(()=>J(e,t)):e()}function Q(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&g(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),$(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var Z=Object.defineProperty,ee=(e,t,n)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ee(e,typeof t!="symbol"?t+"":t,n);class D{constructor(t={}){v(this,"$$"),v(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}v(D,"version","3.16.0-next.2");class te{constructor(){return{selector:void 0,extent:1,area:0}}}var ne=Object.defineProperty,oe=(e,t,n)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t,n)=>oe(e,typeof t!="symbol"?t+"":t,n);class ie extends D{constructor(t){return super(t),re(this,"config"),this.config=new te,this}$init(){Q.call(this,this.options)}$redraw(){const{$$:{$el:t},config:{selector:n}}=this,o=n?t.main.selectAll(n):t.text;!o.empty()&&this.preventLabelOverlap(o)}generateVoronoi(t){const{$$:n}=this,{scale:o}=n,[r,i]=["x","y"].map(s=>o[s].domain());return[r[1],i[0]]=[i[0],r[1]],B.Delaunay.from(t).voronoi([...r,...i])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),i=this.generateVoronoi(r);let s=0;t.each(function(){const c=i.cellPolygon(s);if(c&&this){const[f,se]=r[s],[ce,le]=(0,P.polygonCentroid)(c),ae=Math.abs((0,P.polygonArea)(c)),d=Math.round(Math.atan2(le-se,ce-f)/Math.PI*2),ue=n*(d===0?1:-1),fe=d===-1?-n:n+5,de=Math.abs(d)===1?"middle":d===0?"start":"end";this.style.display=ae<o?"none":"",this.setAttribute("text-anchor",de),this.setAttribute("dy",`0.${d===1?71:35}em`),this.setAttribute("transform",`translate(${ue}, ${fe})`)}s++})}}return p=p.default,p}()});
|