@mozaic-ds/chart 0.1.0-beta.22 → 0.1.0-beta.23
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/mozaic-chart.js
CHANGED
|
@@ -11537,7 +11537,11 @@ const Vu = { class: "container" }, ju = { class: "main" }, $u = { class: "chart-
|
|
|
11537
11537
|
});
|
|
11538
11538
|
});
|
|
11539
11539
|
const l = Math.max(...r), c = Math.min(...r), h = t.bubbleMax, d = t.bubbleMin;
|
|
11540
|
-
return a.map((u) => u.map((f) => ({
|
|
11540
|
+
return a.map((u) => l === c ? u.map((f) => ({
|
|
11541
|
+
x: f.x,
|
|
11542
|
+
y: f.y,
|
|
11543
|
+
r: d + (h - d) / 2
|
|
11544
|
+
})) : u.map((f) => ({
|
|
11541
11545
|
x: f.x,
|
|
11542
11546
|
y: f.y,
|
|
11543
11547
|
r: d + (f.r - c) * (h - d) / (l - c)
|
|
@@ -11633,7 +11637,7 @@ const Vu = { class: "container" }, ju = { class: "main" }, $u = { class: "chart-
|
|
|
11633
11637
|
]));
|
|
11634
11638
|
}
|
|
11635
11639
|
});
|
|
11636
|
-
const fo = /* @__PURE__ */ ye(Xu, [["__scopeId", "data-v-
|
|
11640
|
+
const fo = /* @__PURE__ */ ye(Xu, [["__scopeId", "data-v-a786496d"]]);
|
|
11637
11641
|
fo.install = (i) => {
|
|
11638
11642
|
i.component("BubbleChart", fo);
|
|
11639
11643
|
};
|
|
@@ -25,4 +25,4 @@ var Au=Object.defineProperty;var Du=(G,x,rt)=>x in G?Au(G,x,{enumerable:!0,confi
|
|
|
25
25
|
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
26
26
|
* Released under the MIT license
|
|
27
27
|
*/var na=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var i=window.screen;if(i)return(i.deviceXDPI||1)/(i.logicalXDPI||1)}return 1}(),Ie={toTextLines:function(i){var t=[],e;for(i=[].concat(i);i.length;)e=i.pop(),typeof e=="string"?t.unshift.apply(t,e.split(`
|
|
28
|
-
`)):Array.isArray(e)?i.push.apply(i,e):I(i)||t.unshift(""+e);return t},textSize:function(i,t,e){var n=[].concat(t),s=n.length,o=i.font,a=0,r;for(i.font=e.string,r=0;r<s;++r)a=Math.max(i.measureText(n[r]).width,a);return i.font=o,{height:s*e.lineHeight,width:a}},bound:function(i,t,e){return Math.max(i,Math.min(t,e))},arrayDiff:function(i,t){var e=i.slice(),n=[],s,o,a,r;for(s=0,a=t.length;s<a;++s)r=t[s],o=e.indexOf(r),o===-1?n.push([r,1]):e.splice(o,1);for(s=0,a=e.length;s<a;++s)n.push([e[s],-1]);return n},rasterize:function(i){return Math.round(i*na)/na}};function Pn(i,t){var e=t.x,n=t.y;if(e===null)return{x:0,y:-1};if(n===null)return{x:1,y:0};var s=i.x-e,o=i.y-n,a=Math.sqrt(s*s+o*o);return{x:a?s/a:0,y:a?o/a:-1}}function Jd(i,t,e,n,s){switch(s){case"center":e=n=0;break;case"bottom":e=0,n=1;break;case"right":e=1,n=0;break;case"left":e=-1,n=0;break;case"top":e=0,n=-1;break;case"start":e=-e,n=-n;break;case"end":break;default:s*=Math.PI/180,e=Math.cos(s),n=Math.sin(s);break}return{x:i,y:t,vx:e,vy:n}}var Qd=0,sa=1,oa=2,aa=4,ra=8;function Pi(i,t,e){var n=Qd;return i<e.left?n|=sa:i>e.right&&(n|=oa),t<e.top?n|=ra:t>e.bottom&&(n|=aa),n}function tu(i,t){for(var e=i.x0,n=i.y0,s=i.x1,o=i.y1,a=Pi(e,n,t),r=Pi(s,o,t),l,c,h;!(!(a|r)||a&r);)l=a||r,l&ra?(c=e+(s-e)*(t.top-n)/(o-n),h=t.top):l&aa?(c=e+(s-e)*(t.bottom-n)/(o-n),h=t.bottom):l&oa?(h=n+(o-n)*(t.right-e)/(s-e),c=t.right):l&sa&&(h=n+(o-n)*(t.left-e)/(s-e),c=t.left),l===a?(e=c,n=h,a=Pi(e,n,t)):(s=c,o=h,r=Pi(s,o,t));return{x0:e,x1:s,y0:n,y1:o}}function Ai(i,t){var e=t.anchor,n=i,s,o;return t.clamp&&(n=tu(n,t.area)),e==="start"?(s=n.x0,o=n.y0):e==="end"?(s=n.x1,o=n.y1):(s=(n.x0+n.x1)/2,o=(n.y0+n.y1)/2),Jd(s,o,i.vx,i.vy,t.align)}var Di={arc:function(i,t){var e=(i.startAngle+i.endAngle)/2,n=Math.cos(e),s=Math.sin(e),o=i.innerRadius,a=i.outerRadius;return Ai({x0:i.x+n*o,y0:i.y+s*o,x1:i.x+n*a,y1:i.y+s*a,vx:n,vy:s},t)},point:function(i,t){var e=Pn(i,t.origin),n=e.x*i.options.radius,s=e.y*i.options.radius;return Ai({x0:i.x-n,y0:i.y-s,x1:i.x+n,y1:i.y+s,vx:e.x,vy:e.y},t)},bar:function(i,t){var e=Pn(i,t.origin),n=i.x,s=i.y,o=0,a=0;return i.horizontal?(n=Math.min(i.x,i.base),o=Math.abs(i.base-i.x)):(s=Math.min(i.y,i.base),a=Math.abs(i.base-i.y)),Ai({x0:n,y0:s+a,x1:n+o,y1:s,vx:e.x,vy:e.y},t)},fallback:function(i,t){var e=Pn(i,t.origin);return Ai({x0:i.x,y0:i.y,x1:i.x+(i.width||0),y1:i.y+(i.height||0),vx:e.x,vy:e.y},t)}},Ct=Ie.rasterize;function eu(i){var t=i.borderWidth||0,e=i.padding,n=i.size.height,s=i.size.width,o=-s/2,a=-n/2;return{frame:{x:o-e.left-t,y:a-e.top-t,w:s+e.width+t*2,h:n+e.height+t*2},text:{x:o,y:a,w:s,h:n}}}function iu(i,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var n=e.getBasePixel();return i.horizontal?{x:n,y:null}:{x:null,y:n}}function nu(i){return i instanceof Kt?Di.arc:i instanceof Tt?Di.point:i instanceof Zt?Di.bar:Di.fallback}function su(i,t,e,n,s,o){var a=Math.PI/2;if(o){var r=Math.min(o,s/2,n/2),l=t+r,c=e+r,h=t+n-r,d=e+s-r;i.moveTo(t,c),l<h&&c<d?(i.arc(l,c,r,-Math.PI,-a),i.arc(h,c,r,-a,0),i.arc(h,d,r,0,a),i.arc(l,d,r,a,Math.PI)):l<h?(i.moveTo(l,e),i.arc(h,c,r,-a,a),i.arc(l,c,r,a,Math.PI+a)):c<d?(i.arc(l,c,r,-Math.PI,0),i.arc(l,d,r,0,Math.PI)):i.arc(l,c,r,-Math.PI,Math.PI),i.closePath(),i.moveTo(t,e)}else i.rect(t,e,n,s)}function ou(i,t,e){var n=e.backgroundColor,s=e.borderColor,o=e.borderWidth;!n&&(!s||!o)||(i.beginPath(),su(i,Ct(t.x)+o/2,Ct(t.y)+o/2,Ct(t.w)-o,Ct(t.h)-o,e.borderRadius),i.closePath(),n&&(i.fillStyle=n,i.fill()),s&&o&&(i.strokeStyle=s,i.lineWidth=o,i.lineJoin="miter",i.stroke()))}function au(i,t,e){var n=e.lineHeight,s=i.w,o=i.x,a=i.y+n/2;return t==="center"?o+=s/2:(t==="end"||t==="right")&&(o+=s),{h:n,w:s,x:o,y:a}}function ru(i,t,e){var n=i.shadowBlur,s=e.stroked,o=Ct(e.x),a=Ct(e.y),r=Ct(e.w);s&&i.strokeText(t,o,a,r),e.filled&&(n&&s&&(i.shadowBlur=0),i.fillText(t,o,a,r),n&&s&&(i.shadowBlur=n))}function lu(i,t,e,n){var s=n.textAlign,o=n.color,a=!!o,r=n.font,l=t.length,c=n.textStrokeColor,h=n.textStrokeWidth,d=c&&h,u;if(!(!l||!a&&!d))for(e=au(e,s,r),i.font=r.string,i.textAlign=s,i.textBaseline="middle",i.shadowBlur=n.textShadowBlur,i.shadowColor=n.textShadowColor,a&&(i.fillStyle=o),d&&(i.lineJoin="round",i.lineWidth=h,i.strokeStyle=c),u=0,l=t.length;u<l;++u)ru(i,t[u],{stroked:d,filled:a,w:e.w,x:e.x,y:e.y+e.h*u})}var la=function(i,t,e,n){var s=this;s._config=i,s._index=n,s._model=null,s._rects=null,s._ctx=t,s._el=e};dt(la.prototype,{_modelize:function(i,t,e,n){var s=this,o=s._index,a=X(N([e.font,{}],n,o)),r=N([e.color,$.color],n,o);return{align:N([e.align,"center"],n,o),anchor:N([e.anchor,"center"],n,o),area:n.chart.chartArea,backgroundColor:N([e.backgroundColor,null],n,o),borderColor:N([e.borderColor,null],n,o),borderRadius:N([e.borderRadius,0],n,o),borderWidth:N([e.borderWidth,0],n,o),clamp:N([e.clamp,!1],n,o),clip:N([e.clip,!1],n,o),color:r,display:i,font:a,lines:t,offset:N([e.offset,4],n,o),opacity:N([e.opacity,1],n,o),origin:iu(s._el,n),padding:K(N([e.padding,4],n,o)),positioner:nu(s._el),rotation:N([e.rotation,0],n,o)*(Math.PI/180),size:Ie.textSize(s._ctx,t,a),textAlign:N([e.textAlign,"start"],n,o),textShadowBlur:N([e.textShadowBlur,0],n,o),textShadowColor:N([e.textShadowColor,r],n,o),textStrokeColor:N([e.textStrokeColor,r],n,o),textStrokeWidth:N([e.textStrokeWidth,0],n,o)}},update:function(i){var t=this,e=null,n=null,s=t._index,o=t._config,a,r,l,c=N([o.display,!0],i,s);c&&(a=i.dataset.data[s],r=T(E(o.formatter,[a,i]),a),l=I(r)?[]:Ie.toTextLines(r),l.length&&(e=t._modelize(c,l,o,i),n=eu(e))),t._model=e,t._rects=n},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(i,t){var e=this,n=i.ctx,s=e._model,o=e._rects,a;this.visible()&&(n.save(),s.clip&&(a=s.area,n.beginPath(),n.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),n.clip()),n.globalAlpha=Ie.bound(0,s.opacity,1),n.translate(Ct(t.x),Ct(t.y)),n.rotate(s.rotation),ou(n,o.frame,s),lu(n,s.lines,o.text,s),n.restore())}});var cu=Number.MIN_SAFE_INTEGER||-9007199254740991,hu=Number.MAX_SAFE_INTEGER||9007199254740991;function Fe(i,t,e){var n=Math.cos(e),s=Math.sin(e),o=t.x,a=t.y;return{x:o+n*(i.x-o)-s*(i.y-a),y:a+s*(i.x-o)+n*(i.y-a)}}function ca(i,t){var e=hu,n=cu,s=t.origin,o,a,r,l,c;for(o=0;o<i.length;++o)a=i[o],r=a.x-s.x,l=a.y-s.y,c=t.vx*r+t.vy*l,e=Math.min(e,c),n=Math.max(n,c);return{min:e,max:n}}function Li(i,t){var e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);return{vx:(t.x-i.x)/s,vy:(t.y-i.y)/s,origin:i,ln:s}}var ha=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};dt(ha.prototype,{center:function(){var i=this._rect;return{x:i.x+i.w/2,y:i.y+i.h/2}},update:function(i,t,e){this._rotation=e,this._rect={x:t.x+i.x,y:t.y+i.y,w:t.w,h:t.h}},contains:function(i){var t=this,e=1,n=t._rect;return i=Fe(i,t.center(),-t._rotation),!(i.x<n.x-e||i.y<n.y-e||i.x>n.x+n.w+e*2||i.y>n.y+n.h+e*2)},intersects:function(i){var t=this._points(),e=i._points(),n=[Li(t[0],t[1]),Li(t[0],t[3])],s,o,a;for(this._rotation!==i._rotation&&n.push(Li(e[0],e[1]),Li(e[0],e[3])),s=0;s<n.length;++s)if(o=ca(t,n[s]),a=ca(e,n[s]),o.max<a.min||a.max<o.min)return!1;return!0},_points:function(){var i=this,t=i._rect,e=i._rotation,n=i.center();return[Fe({x:t.x,y:t.y},n,e),Fe({x:t.x+t.w,y:t.y},n,e),Fe({x:t.x+t.w,y:t.y+t.h},n,e),Fe({x:t.x,y:t.y+t.h},n,e)]}});function da(i,t,e){var n=t.positioner(i,t),s=n.vx,o=n.vy;if(!s&&!o)return{x:n.x,y:n.y};var a=e.w,r=e.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(r/2*Math.sin(l)),h=Math.abs(a/2*Math.sin(l))+Math.abs(r/2*Math.cos(l)),d=1/Math.max(Math.abs(s),Math.abs(o));return c*=s*d,h*=o*d,c+=t.offset*s,h+=t.offset*o,{x:n.x+c,y:n.y+h}}function du(i,t){var e,n,s,o;for(e=i.length-1;e>=0;--e)for(s=i[e].$layout,n=e-1;n>=0&&s._visible;--n)o=i[n].$layout,o._visible&&s._box.intersects(o._box)&&t(s,o);return i}function uu(i){var t,e,n,s,o,a,r;for(t=0,e=i.length;t<e;++t)n=i[t],s=n.$layout,s._visible&&(r=new Proxy(n._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=n.geometry(),a=da(r,n.model(),o),s._box.update(a,o,n.rotation()));return du(i,function(l,c){var h=l._hidable,d=c._hidable;h&&d||d?c._visible=!1:h&&(l._visible=!1)})}var Re={prepare:function(i){var t=[],e,n,s,o,a;for(e=0,s=i.length;e<s;++e)for(n=0,o=i[e].length;n<o;++n)a=i[e][n],t.push(a),a.$layout={_box:new ha,_hidable:!1,_visible:!0,_set:e,_idx:a._index};return t.sort(function(r,l){var c=r.$layout,h=l.$layout;return c._idx===h._idx?h._set-c._set:h._idx-c._idx}),this.update(t),t},update:function(i){var t=!1,e,n,s,o,a;for(e=0,n=i.length;e<n;++e)s=i[e],o=s.model(),a=s.$layout,a._hidable=o&&o.display==="auto",a._visible=s.visible(),t|=a._hidable;t&&uu(i)},lookup:function(i,t){var e,n;for(e=i.length-1;e>=0;--e)if(n=i[e].$layout,n&&n._visible&&n._box.contains(t))return i[e];return null},draw:function(i,t){var e,n,s,o,a,r;for(e=0,n=t.length;e<n;++e)s=t[e],o=s.$layout,o._visible&&(a=s.geometry(),r=da(s._el,s.model(),a),o._box.update(r,a,s.rotation()),s.draw(i,r))}},fu=function(i){if(I(i))return null;var t=i,e,n,s;if(O(i))if(!I(i.label))t=i.label;else if(!I(i.r))t=i.r;else for(t="",e=Object.keys(i),s=0,n=e.length;s<n;++s)t+=(s!==0?", ":"")+e[s]+": "+i[e[s]];return""+t},gu={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:fu,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},nt="$datalabels",ua="$default";function pu(i,t){var e=i.datalabels,n={},s=[],o,a;return e===!1?null:(e===!0&&(e={}),t=dt({},[t,e]),o=t.labels||{},a=Object.keys(o),delete t.labels,a.length?a.forEach(function(r){o[r]&&s.push(dt({},[t,o[r],{_key:r}]))}):s.push(t),n=s.reduce(function(r,l){return R(l.listeners||{},function(c,h){r[h]=r[h]||{},r[h][l._key||ua]=c}),delete l.listeners,r},{}),{labels:s,listeners:n})}function An(i,t,e,n){if(t){var s=e.$context,o=e.$groups,a;t[o._set]&&(a=t[o._set][o._key],a&&E(a,[s,n])===!0&&(i[nt]._dirty=!0,e.update(s)))}}function mu(i,t,e,n,s){var o,a;!e&&!n||(e?n?e!==n&&(a=o=!0):a=!0:o=!0,a&&An(i,t.leave,e,s),o&&An(i,t.enter,n,s))}function bu(i,t){var e=i[nt],n=e._listeners,s,o;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")o=Re.lookup(e._labels,t);else if(t.type!=="mouseout")return;s=e._hovered,e._hovered=o,mu(i,n,s,o,t)}}function yu(i,t){var e=i[nt],n=e._listeners.click,s=n&&Re.lookup(e._labels,t);s&&An(i,n,s,t)}var xu={id:"datalabels",defaults:gu,beforeInit:function(i){i[nt]={_actives:[]}},beforeUpdate:function(i){var t=i[nt];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(i,t,e){var n=t.index,s=i[nt],o=s._datasets[n]=[],a=i.isDatasetVisible(n),r=i.data.datasets[n],l=pu(r,e),c=t.meta.data||[],h=i.ctx,d,u,f,p,g,m,b,y;for(h.save(),d=0,f=c.length;d<f;++d)if(b=c[d],b[nt]=[],a&&b&&i.getDataVisibility(d)&&!b.skip)for(u=0,p=l.labels.length;u<p;++u)g=l.labels[u],m=g._key,y=new la(g,h,b,d),y.$groups={_set:n,_key:m||ua},y.$context={active:!1,chart:i,dataIndex:d,dataset:r,datasetIndex:n},y.update(y.$context),b[nt].push(y),o.push(y);h.restore(),dt(s._listeners,l.listeners,{merger:function(_,S,v){S[_]=S[_]||{},S[_][t.index]=v[_],s._listened=!0}})},afterUpdate:function(i){i[nt]._labels=Re.prepare(i[nt]._datasets)},afterDatasetsDraw:function(i){Re.draw(i,i[nt]._labels)},beforeEvent:function(i,t){if(i[nt]._listened){var e=t.event;switch(e.type){case"mousemove":case"mouseout":bu(i,e);break;case"click":yu(i,e);break}}},afterEvent:function(i){var t=i[nt],e=t._actives,n=t._actives=i.getActiveElements(),s=Ie.arrayDiff(e,n),o,a,r,l,c,h,d;for(o=0,a=s.length;o<a;++o)if(c=s[o],c[1])for(d=c[0].element[nt]||[],r=0,l=d.length;r<l;++r)h=d[r],h.$context.active=c[1]===1,h.update(h.$context);(t._dirty||s.length)&&(Re.update(t._labels),i.render()),delete t._dirty}};const fa="background: white; border-bottom: 1px solid #CCCCCC; border-radius: 5px; padding: 10px 20px";class _u extends oe{constructor(){super(...arguments);C(this,"fontProperties","font-family: Arial; font-size: 16px")}createBubbleTooltip(e,n,s){if(!s||s==="")return;let o=document.querySelector("#chartjs-tooltip");o||(o=this.createNewTooltipElement());const a=e.tooltip;if(a.opacity===0){o.style.opacity="0";return}if(a.body){this.titleLines=a.title||[];const l=a.body.map(this.getBody)[0];this.addBubbleLegendToDom(n,l,o,s)}this.handleTooltipPosition(e,a,o)}addBubbleLegendToDom(e,n,s,o){n[0].split(":")[0];const a=`<span style="${this.fontProperties}">${o}</span>`;let r=`<div style="${fa}; font-weight: bold" class="tooltipTitle">${a}</div>`;const l=this.getBubbleInnerHtml(e);r+=l;const c=s==null?void 0:s.querySelector(".tooltipCtn");c.innerHTML=r}getBubbleInnerHtml(e){let n="";return e.forEach(s=>{n+=`<div style="${this.fontProperties}; ${fa}; display:flex; justify-content: space-between;">`,n+=`<div>${s.label}</div>`,n+=`<div>${s.value}${s.unit}</div>`,n+="</div>"}),`<div>${n}</div>`}}const vu={class:"container"},Su={class:"main"},wu={class:"chart-legend"},ku=["alt"],Cu={class:"size-legend-label"},Mu=x.defineComponent({__name:"BubbleChart",props:{chartId:{type:String,default:"bubble-chart"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},colours:{type:Array,default:()=>[]},shapes:{type:Array,default:()=>[]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},bubbleMin:{type:Number,default:10},bubbleMax:{type:Number,default:40},plugins:{type:Array,default:()=>[]},displayBubbleLabel:{type:Boolean,default:!1},xAxis:{type:Object,default:null,required:!0},yAxis:{type:Object,default:null,required:!0},rAxis:{type:Object,default:null,required:!0},displayAxisLabels:{type:Boolean,default:!0}},setup(i){const t=i;wt.register(Qt,te,Jt,Tt,ee,ie,xu);const{colourSets:e}=re(),n=function(a){const r=[];a.forEach(u=>{u.forEach(f=>{r.push(f.r)})});const l=Math.max(...r),c=Math.min(...r),h=t.bubbleMax,d=t.bubbleMin;return a.map(u=>u.map(f=>({x:f.x,y:f.y,r:d+(f.r-c)*(h-d)/(l-c)})))},s=x.computed(()=>{const a=e[t.colourSet];return{datasets:n(t.datasets).map((r,l)=>({data:r,pointStyle:t.shapes[l],backgroundColor:se(a[t.colours[l]],.2),borderColor:a[t.colours[l]],label:t.labels[l]}))}}),o=x.computed(()=>({responsive:!1,scales:{x:{offset:!0,title:{display:t.displayAxisLabels,text:t.xAxis.title}},y:{offset:!0,title:{display:t.displayAxisLabels,text:t.yAxis.title}}},plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},datalabels:{display:t.displayBubbleLabel,anchor:"end",align:"end",color:"black",formatter:function(a,r){return r.dataset.label},padding:0},tooltip:{enabled:!1,position:"nearest",external:function(a){var h,d,u,f,p,g;const r=((d=(h=a.tooltip)==null?void 0:h.dataPoints)==null?void 0:d[0].datasetIndex)||0,l=((u=a.tooltip.dataPoints)==null?void 0:u[0].dataIndex)||0,c=t.datasets[r][l];new _u().createBubbleTooltip(a,[{label:t.xAxis.title,value:`${tt(c.x)}`,unit:(f=t.xAxis)==null?void 0:f.unit},{label:t.yAxis.title,value:`${tt(c.y)}`,unit:(p=t.yAxis)==null?void 0:p.unit},{label:t.rAxis.title,value:`${tt(c.r)}`,unit:(g=t.rAxis)==null?void 0:g.unit}],t.labels[r])}}}}));return(a,r)=>(x.openBlock(),x.createElementBlock("div",vu,[x.createElementVNode("div",Su,[s.value?(x.openBlock(),x.createBlock(x.unref(dd),{key:0,ref:"bubbleChartRef",id:i.chartId,data:s.value,options:o.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",wu,[x.createElementVNode("img",{src:Zd,alt:i.rAxis.title,class:"bubble-icon mu-mr-025"},null,8,ku),x.createElementVNode("div",Cu,x.toDisplayString(i.rAxis.title),1)])]))}}),Bu="",zu="",Dn=le(Mu,[["__scopeId","data-v-cecd05d5"]]);Dn.install=i=>{i.component("BubbleChart",Dn)};const Pu={install:(i,t)=>{Object.keys(ea).forEach(e=>{i.component(e,ea[e])})}};G.BarChart=wi,G.BubbleChart=Dn,G.DoughnutChart=ki,G.LineChart=Ci,G.MixedBarLineChart=Mn,G.RadarChart=Mi,G.default=Pu,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
28
|
+
`)):Array.isArray(e)?i.push.apply(i,e):I(i)||t.unshift(""+e);return t},textSize:function(i,t,e){var n=[].concat(t),s=n.length,o=i.font,a=0,r;for(i.font=e.string,r=0;r<s;++r)a=Math.max(i.measureText(n[r]).width,a);return i.font=o,{height:s*e.lineHeight,width:a}},bound:function(i,t,e){return Math.max(i,Math.min(t,e))},arrayDiff:function(i,t){var e=i.slice(),n=[],s,o,a,r;for(s=0,a=t.length;s<a;++s)r=t[s],o=e.indexOf(r),o===-1?n.push([r,1]):e.splice(o,1);for(s=0,a=e.length;s<a;++s)n.push([e[s],-1]);return n},rasterize:function(i){return Math.round(i*na)/na}};function Pn(i,t){var e=t.x,n=t.y;if(e===null)return{x:0,y:-1};if(n===null)return{x:1,y:0};var s=i.x-e,o=i.y-n,a=Math.sqrt(s*s+o*o);return{x:a?s/a:0,y:a?o/a:-1}}function Jd(i,t,e,n,s){switch(s){case"center":e=n=0;break;case"bottom":e=0,n=1;break;case"right":e=1,n=0;break;case"left":e=-1,n=0;break;case"top":e=0,n=-1;break;case"start":e=-e,n=-n;break;case"end":break;default:s*=Math.PI/180,e=Math.cos(s),n=Math.sin(s);break}return{x:i,y:t,vx:e,vy:n}}var Qd=0,sa=1,oa=2,aa=4,ra=8;function Pi(i,t,e){var n=Qd;return i<e.left?n|=sa:i>e.right&&(n|=oa),t<e.top?n|=ra:t>e.bottom&&(n|=aa),n}function tu(i,t){for(var e=i.x0,n=i.y0,s=i.x1,o=i.y1,a=Pi(e,n,t),r=Pi(s,o,t),l,c,h;!(!(a|r)||a&r);)l=a||r,l&ra?(c=e+(s-e)*(t.top-n)/(o-n),h=t.top):l&aa?(c=e+(s-e)*(t.bottom-n)/(o-n),h=t.bottom):l&oa?(h=n+(o-n)*(t.right-e)/(s-e),c=t.right):l&sa&&(h=n+(o-n)*(t.left-e)/(s-e),c=t.left),l===a?(e=c,n=h,a=Pi(e,n,t)):(s=c,o=h,r=Pi(s,o,t));return{x0:e,x1:s,y0:n,y1:o}}function Ai(i,t){var e=t.anchor,n=i,s,o;return t.clamp&&(n=tu(n,t.area)),e==="start"?(s=n.x0,o=n.y0):e==="end"?(s=n.x1,o=n.y1):(s=(n.x0+n.x1)/2,o=(n.y0+n.y1)/2),Jd(s,o,i.vx,i.vy,t.align)}var Di={arc:function(i,t){var e=(i.startAngle+i.endAngle)/2,n=Math.cos(e),s=Math.sin(e),o=i.innerRadius,a=i.outerRadius;return Ai({x0:i.x+n*o,y0:i.y+s*o,x1:i.x+n*a,y1:i.y+s*a,vx:n,vy:s},t)},point:function(i,t){var e=Pn(i,t.origin),n=e.x*i.options.radius,s=e.y*i.options.radius;return Ai({x0:i.x-n,y0:i.y-s,x1:i.x+n,y1:i.y+s,vx:e.x,vy:e.y},t)},bar:function(i,t){var e=Pn(i,t.origin),n=i.x,s=i.y,o=0,a=0;return i.horizontal?(n=Math.min(i.x,i.base),o=Math.abs(i.base-i.x)):(s=Math.min(i.y,i.base),a=Math.abs(i.base-i.y)),Ai({x0:n,y0:s+a,x1:n+o,y1:s,vx:e.x,vy:e.y},t)},fallback:function(i,t){var e=Pn(i,t.origin);return Ai({x0:i.x,y0:i.y,x1:i.x+(i.width||0),y1:i.y+(i.height||0),vx:e.x,vy:e.y},t)}},Ct=Ie.rasterize;function eu(i){var t=i.borderWidth||0,e=i.padding,n=i.size.height,s=i.size.width,o=-s/2,a=-n/2;return{frame:{x:o-e.left-t,y:a-e.top-t,w:s+e.width+t*2,h:n+e.height+t*2},text:{x:o,y:a,w:s,h:n}}}function iu(i,t){var e=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!e)return null;if(e.xCenter!==void 0&&e.yCenter!==void 0)return{x:e.xCenter,y:e.yCenter};var n=e.getBasePixel();return i.horizontal?{x:n,y:null}:{x:null,y:n}}function nu(i){return i instanceof Kt?Di.arc:i instanceof Tt?Di.point:i instanceof Zt?Di.bar:Di.fallback}function su(i,t,e,n,s,o){var a=Math.PI/2;if(o){var r=Math.min(o,s/2,n/2),l=t+r,c=e+r,h=t+n-r,d=e+s-r;i.moveTo(t,c),l<h&&c<d?(i.arc(l,c,r,-Math.PI,-a),i.arc(h,c,r,-a,0),i.arc(h,d,r,0,a),i.arc(l,d,r,a,Math.PI)):l<h?(i.moveTo(l,e),i.arc(h,c,r,-a,a),i.arc(l,c,r,a,Math.PI+a)):c<d?(i.arc(l,c,r,-Math.PI,0),i.arc(l,d,r,0,Math.PI)):i.arc(l,c,r,-Math.PI,Math.PI),i.closePath(),i.moveTo(t,e)}else i.rect(t,e,n,s)}function ou(i,t,e){var n=e.backgroundColor,s=e.borderColor,o=e.borderWidth;!n&&(!s||!o)||(i.beginPath(),su(i,Ct(t.x)+o/2,Ct(t.y)+o/2,Ct(t.w)-o,Ct(t.h)-o,e.borderRadius),i.closePath(),n&&(i.fillStyle=n,i.fill()),s&&o&&(i.strokeStyle=s,i.lineWidth=o,i.lineJoin="miter",i.stroke()))}function au(i,t,e){var n=e.lineHeight,s=i.w,o=i.x,a=i.y+n/2;return t==="center"?o+=s/2:(t==="end"||t==="right")&&(o+=s),{h:n,w:s,x:o,y:a}}function ru(i,t,e){var n=i.shadowBlur,s=e.stroked,o=Ct(e.x),a=Ct(e.y),r=Ct(e.w);s&&i.strokeText(t,o,a,r),e.filled&&(n&&s&&(i.shadowBlur=0),i.fillText(t,o,a,r),n&&s&&(i.shadowBlur=n))}function lu(i,t,e,n){var s=n.textAlign,o=n.color,a=!!o,r=n.font,l=t.length,c=n.textStrokeColor,h=n.textStrokeWidth,d=c&&h,u;if(!(!l||!a&&!d))for(e=au(e,s,r),i.font=r.string,i.textAlign=s,i.textBaseline="middle",i.shadowBlur=n.textShadowBlur,i.shadowColor=n.textShadowColor,a&&(i.fillStyle=o),d&&(i.lineJoin="round",i.lineWidth=h,i.strokeStyle=c),u=0,l=t.length;u<l;++u)ru(i,t[u],{stroked:d,filled:a,w:e.w,x:e.x,y:e.y+e.h*u})}var la=function(i,t,e,n){var s=this;s._config=i,s._index=n,s._model=null,s._rects=null,s._ctx=t,s._el=e};dt(la.prototype,{_modelize:function(i,t,e,n){var s=this,o=s._index,a=X(N([e.font,{}],n,o)),r=N([e.color,$.color],n,o);return{align:N([e.align,"center"],n,o),anchor:N([e.anchor,"center"],n,o),area:n.chart.chartArea,backgroundColor:N([e.backgroundColor,null],n,o),borderColor:N([e.borderColor,null],n,o),borderRadius:N([e.borderRadius,0],n,o),borderWidth:N([e.borderWidth,0],n,o),clamp:N([e.clamp,!1],n,o),clip:N([e.clip,!1],n,o),color:r,display:i,font:a,lines:t,offset:N([e.offset,4],n,o),opacity:N([e.opacity,1],n,o),origin:iu(s._el,n),padding:K(N([e.padding,4],n,o)),positioner:nu(s._el),rotation:N([e.rotation,0],n,o)*(Math.PI/180),size:Ie.textSize(s._ctx,t,a),textAlign:N([e.textAlign,"start"],n,o),textShadowBlur:N([e.textShadowBlur,0],n,o),textShadowColor:N([e.textShadowColor,r],n,o),textStrokeColor:N([e.textStrokeColor,r],n,o),textStrokeWidth:N([e.textStrokeWidth,0],n,o)}},update:function(i){var t=this,e=null,n=null,s=t._index,o=t._config,a,r,l,c=N([o.display,!0],i,s);c&&(a=i.dataset.data[s],r=T(E(o.formatter,[a,i]),a),l=I(r)?[]:Ie.toTextLines(r),l.length&&(e=t._modelize(c,l,o,i),n=eu(e))),t._model=e,t._rects=n},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(i,t){var e=this,n=i.ctx,s=e._model,o=e._rects,a;this.visible()&&(n.save(),s.clip&&(a=s.area,n.beginPath(),n.rect(a.left,a.top,a.right-a.left,a.bottom-a.top),n.clip()),n.globalAlpha=Ie.bound(0,s.opacity,1),n.translate(Ct(t.x),Ct(t.y)),n.rotate(s.rotation),ou(n,o.frame,s),lu(n,s.lines,o.text,s),n.restore())}});var cu=Number.MIN_SAFE_INTEGER||-9007199254740991,hu=Number.MAX_SAFE_INTEGER||9007199254740991;function Fe(i,t,e){var n=Math.cos(e),s=Math.sin(e),o=t.x,a=t.y;return{x:o+n*(i.x-o)-s*(i.y-a),y:a+s*(i.x-o)+n*(i.y-a)}}function ca(i,t){var e=hu,n=cu,s=t.origin,o,a,r,l,c;for(o=0;o<i.length;++o)a=i[o],r=a.x-s.x,l=a.y-s.y,c=t.vx*r+t.vy*l,e=Math.min(e,c),n=Math.max(n,c);return{min:e,max:n}}function Li(i,t){var e=t.x-i.x,n=t.y-i.y,s=Math.sqrt(e*e+n*n);return{vx:(t.x-i.x)/s,vy:(t.y-i.y)/s,origin:i,ln:s}}var ha=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};dt(ha.prototype,{center:function(){var i=this._rect;return{x:i.x+i.w/2,y:i.y+i.h/2}},update:function(i,t,e){this._rotation=e,this._rect={x:t.x+i.x,y:t.y+i.y,w:t.w,h:t.h}},contains:function(i){var t=this,e=1,n=t._rect;return i=Fe(i,t.center(),-t._rotation),!(i.x<n.x-e||i.y<n.y-e||i.x>n.x+n.w+e*2||i.y>n.y+n.h+e*2)},intersects:function(i){var t=this._points(),e=i._points(),n=[Li(t[0],t[1]),Li(t[0],t[3])],s,o,a;for(this._rotation!==i._rotation&&n.push(Li(e[0],e[1]),Li(e[0],e[3])),s=0;s<n.length;++s)if(o=ca(t,n[s]),a=ca(e,n[s]),o.max<a.min||a.max<o.min)return!1;return!0},_points:function(){var i=this,t=i._rect,e=i._rotation,n=i.center();return[Fe({x:t.x,y:t.y},n,e),Fe({x:t.x+t.w,y:t.y},n,e),Fe({x:t.x+t.w,y:t.y+t.h},n,e),Fe({x:t.x,y:t.y+t.h},n,e)]}});function da(i,t,e){var n=t.positioner(i,t),s=n.vx,o=n.vy;if(!s&&!o)return{x:n.x,y:n.y};var a=e.w,r=e.h,l=t.rotation,c=Math.abs(a/2*Math.cos(l))+Math.abs(r/2*Math.sin(l)),h=Math.abs(a/2*Math.sin(l))+Math.abs(r/2*Math.cos(l)),d=1/Math.max(Math.abs(s),Math.abs(o));return c*=s*d,h*=o*d,c+=t.offset*s,h+=t.offset*o,{x:n.x+c,y:n.y+h}}function du(i,t){var e,n,s,o;for(e=i.length-1;e>=0;--e)for(s=i[e].$layout,n=e-1;n>=0&&s._visible;--n)o=i[n].$layout,o._visible&&s._box.intersects(o._box)&&t(s,o);return i}function uu(i){var t,e,n,s,o,a,r;for(t=0,e=i.length;t<e;++t)n=i[t],s=n.$layout,s._visible&&(r=new Proxy(n._el,{get:(l,c)=>l.getProps([c],!0)[c]}),o=n.geometry(),a=da(r,n.model(),o),s._box.update(a,o,n.rotation()));return du(i,function(l,c){var h=l._hidable,d=c._hidable;h&&d||d?c._visible=!1:h&&(l._visible=!1)})}var Re={prepare:function(i){var t=[],e,n,s,o,a;for(e=0,s=i.length;e<s;++e)for(n=0,o=i[e].length;n<o;++n)a=i[e][n],t.push(a),a.$layout={_box:new ha,_hidable:!1,_visible:!0,_set:e,_idx:a._index};return t.sort(function(r,l){var c=r.$layout,h=l.$layout;return c._idx===h._idx?h._set-c._set:h._idx-c._idx}),this.update(t),t},update:function(i){var t=!1,e,n,s,o,a;for(e=0,n=i.length;e<n;++e)s=i[e],o=s.model(),a=s.$layout,a._hidable=o&&o.display==="auto",a._visible=s.visible(),t|=a._hidable;t&&uu(i)},lookup:function(i,t){var e,n;for(e=i.length-1;e>=0;--e)if(n=i[e].$layout,n&&n._visible&&n._box.contains(t))return i[e];return null},draw:function(i,t){var e,n,s,o,a,r;for(e=0,n=t.length;e<n;++e)s=t[e],o=s.$layout,o._visible&&(a=s.geometry(),r=da(s._el,s.model(),a),o._box.update(r,a,s.rotation()),s.draw(i,r))}},fu=function(i){if(I(i))return null;var t=i,e,n,s;if(O(i))if(!I(i.label))t=i.label;else if(!I(i.r))t=i.r;else for(t="",e=Object.keys(i),s=0,n=e.length;s<n;++s)t+=(s!==0?", ":"")+e[s]+": "+i[e[s]];return""+t},gu={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:fu,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},nt="$datalabels",ua="$default";function pu(i,t){var e=i.datalabels,n={},s=[],o,a;return e===!1?null:(e===!0&&(e={}),t=dt({},[t,e]),o=t.labels||{},a=Object.keys(o),delete t.labels,a.length?a.forEach(function(r){o[r]&&s.push(dt({},[t,o[r],{_key:r}]))}):s.push(t),n=s.reduce(function(r,l){return R(l.listeners||{},function(c,h){r[h]=r[h]||{},r[h][l._key||ua]=c}),delete l.listeners,r},{}),{labels:s,listeners:n})}function An(i,t,e,n){if(t){var s=e.$context,o=e.$groups,a;t[o._set]&&(a=t[o._set][o._key],a&&E(a,[s,n])===!0&&(i[nt]._dirty=!0,e.update(s)))}}function mu(i,t,e,n,s){var o,a;!e&&!n||(e?n?e!==n&&(a=o=!0):a=!0:o=!0,a&&An(i,t.leave,e,s),o&&An(i,t.enter,n,s))}function bu(i,t){var e=i[nt],n=e._listeners,s,o;if(!(!n.enter&&!n.leave)){if(t.type==="mousemove")o=Re.lookup(e._labels,t);else if(t.type!=="mouseout")return;s=e._hovered,e._hovered=o,mu(i,n,s,o,t)}}function yu(i,t){var e=i[nt],n=e._listeners.click,s=n&&Re.lookup(e._labels,t);s&&An(i,n,s,t)}var xu={id:"datalabels",defaults:gu,beforeInit:function(i){i[nt]={_actives:[]}},beforeUpdate:function(i){var t=i[nt];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(i,t,e){var n=t.index,s=i[nt],o=s._datasets[n]=[],a=i.isDatasetVisible(n),r=i.data.datasets[n],l=pu(r,e),c=t.meta.data||[],h=i.ctx,d,u,f,p,g,m,b,y;for(h.save(),d=0,f=c.length;d<f;++d)if(b=c[d],b[nt]=[],a&&b&&i.getDataVisibility(d)&&!b.skip)for(u=0,p=l.labels.length;u<p;++u)g=l.labels[u],m=g._key,y=new la(g,h,b,d),y.$groups={_set:n,_key:m||ua},y.$context={active:!1,chart:i,dataIndex:d,dataset:r,datasetIndex:n},y.update(y.$context),b[nt].push(y),o.push(y);h.restore(),dt(s._listeners,l.listeners,{merger:function(_,S,v){S[_]=S[_]||{},S[_][t.index]=v[_],s._listened=!0}})},afterUpdate:function(i){i[nt]._labels=Re.prepare(i[nt]._datasets)},afterDatasetsDraw:function(i){Re.draw(i,i[nt]._labels)},beforeEvent:function(i,t){if(i[nt]._listened){var e=t.event;switch(e.type){case"mousemove":case"mouseout":bu(i,e);break;case"click":yu(i,e);break}}},afterEvent:function(i){var t=i[nt],e=t._actives,n=t._actives=i.getActiveElements(),s=Ie.arrayDiff(e,n),o,a,r,l,c,h,d;for(o=0,a=s.length;o<a;++o)if(c=s[o],c[1])for(d=c[0].element[nt]||[],r=0,l=d.length;r<l;++r)h=d[r],h.$context.active=c[1]===1,h.update(h.$context);(t._dirty||s.length)&&(Re.update(t._labels),i.render()),delete t._dirty}};const fa="background: white; border-bottom: 1px solid #CCCCCC; border-radius: 5px; padding: 10px 20px";class _u extends oe{constructor(){super(...arguments);C(this,"fontProperties","font-family: Arial; font-size: 16px")}createBubbleTooltip(e,n,s){if(!s||s==="")return;let o=document.querySelector("#chartjs-tooltip");o||(o=this.createNewTooltipElement());const a=e.tooltip;if(a.opacity===0){o.style.opacity="0";return}if(a.body){this.titleLines=a.title||[];const l=a.body.map(this.getBody)[0];this.addBubbleLegendToDom(n,l,o,s)}this.handleTooltipPosition(e,a,o)}addBubbleLegendToDom(e,n,s,o){n[0].split(":")[0];const a=`<span style="${this.fontProperties}">${o}</span>`;let r=`<div style="${fa}; font-weight: bold" class="tooltipTitle">${a}</div>`;const l=this.getBubbleInnerHtml(e);r+=l;const c=s==null?void 0:s.querySelector(".tooltipCtn");c.innerHTML=r}getBubbleInnerHtml(e){let n="";return e.forEach(s=>{n+=`<div style="${this.fontProperties}; ${fa}; display:flex; justify-content: space-between;">`,n+=`<div>${s.label}</div>`,n+=`<div>${s.value}${s.unit}</div>`,n+="</div>"}),`<div>${n}</div>`}}const vu={class:"container"},Su={class:"main"},wu={class:"chart-legend"},ku=["alt"],Cu={class:"size-legend-label"},Mu=x.defineComponent({__name:"BubbleChart",props:{chartId:{type:String,default:"bubble-chart"},labels:{type:Array,default:()=>[]},colourSet:{type:Number,default:0},colours:{type:Array,default:()=>[]},shapes:{type:Array,default:()=>[]},datasets:{type:Array,default:()=>[]},width:{type:String,default:"400px"},height:{type:String,default:"300px"},cssClasses:{type:String,default:void 0},styles:{type:Object,default:()=>{}},bubbleMin:{type:Number,default:10},bubbleMax:{type:Number,default:40},plugins:{type:Array,default:()=>[]},displayBubbleLabel:{type:Boolean,default:!1},xAxis:{type:Object,default:null,required:!0},yAxis:{type:Object,default:null,required:!0},rAxis:{type:Object,default:null,required:!0},displayAxisLabels:{type:Boolean,default:!0}},setup(i){const t=i;wt.register(Qt,te,Jt,Tt,ee,ie,xu);const{colourSets:e}=re(),n=function(a){const r=[];a.forEach(u=>{u.forEach(f=>{r.push(f.r)})});const l=Math.max(...r),c=Math.min(...r),h=t.bubbleMax,d=t.bubbleMin;return a.map(u=>l===c?u.map(f=>({x:f.x,y:f.y,r:d+(h-d)/2})):u.map(f=>({x:f.x,y:f.y,r:d+(f.r-c)*(h-d)/(l-c)})))},s=x.computed(()=>{const a=e[t.colourSet];return{datasets:n(t.datasets).map((r,l)=>({data:r,pointStyle:t.shapes[l],backgroundColor:se(a[t.colours[l]],.2),borderColor:a[t.colours[l]],label:t.labels[l]}))}}),o=x.computed(()=>({responsive:!1,scales:{x:{offset:!0,title:{display:t.displayAxisLabels,text:t.xAxis.title}},y:{offset:!0,title:{display:t.displayAxisLabels,text:t.yAxis.title}}},plugins:{responsive:!0,maintainAspectRatio:!1,legend:{display:!1},title:{display:!1},datalabels:{display:t.displayBubbleLabel,anchor:"end",align:"end",color:"black",formatter:function(a,r){return r.dataset.label},padding:0},tooltip:{enabled:!1,position:"nearest",external:function(a){var h,d,u,f,p,g;const r=((d=(h=a.tooltip)==null?void 0:h.dataPoints)==null?void 0:d[0].datasetIndex)||0,l=((u=a.tooltip.dataPoints)==null?void 0:u[0].dataIndex)||0,c=t.datasets[r][l];new _u().createBubbleTooltip(a,[{label:t.xAxis.title,value:`${tt(c.x)}`,unit:(f=t.xAxis)==null?void 0:f.unit},{label:t.yAxis.title,value:`${tt(c.y)}`,unit:(p=t.yAxis)==null?void 0:p.unit},{label:t.rAxis.title,value:`${tt(c.r)}`,unit:(g=t.rAxis)==null?void 0:g.unit}],t.labels[r])}}}}));return(a,r)=>(x.openBlock(),x.createElementBlock("div",vu,[x.createElementVNode("div",Su,[s.value?(x.openBlock(),x.createBlock(x.unref(dd),{key:0,ref:"bubbleChartRef",id:i.chartId,data:s.value,options:o.value,class:x.normalizeClass(i.cssClasses),style:x.normalizeStyle([{width:i.width,height:i.height,cursor:"pointer"},i.styles])},null,8,["id","data","options","class","style"])):x.createCommentVNode("",!0)]),x.createElementVNode("div",wu,[x.createElementVNode("img",{src:Zd,alt:i.rAxis.title,class:"bubble-icon mu-mr-025"},null,8,ku),x.createElementVNode("div",Cu,x.toDisplayString(i.rAxis.title),1)])]))}}),Bu="",zu="",Dn=le(Mu,[["__scopeId","data-v-a786496d"]]);Dn.install=i=>{i.component("BubbleChart",Dn)};const Pu={install:(i,t)=>{Object.keys(ea).forEach(e=>{i.component(e,ea[e])})}};G.BarChart=wi,G.BubbleChart=Dn,G.DoughnutChart=ki,G.LineChart=Ci,G.MixedBarLineChart=Mn,G.RadarChart=Mi,G.default=Pu,Object.defineProperties(G,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mc-checkbox__input:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");background-position:center center}.mc-checkbox__input:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.container[data-v-98d7a612]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-98d7a612]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.container[data-v-b0907849]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-b0907849]{display:flex;flex-direction:column;justify-content:center;align-items:center}.container[data-v-a49082e5]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-a49082e5]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.container[data-v-e38e3f99]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-e38e3f99]{display:flex;flex-direction:column;justify-content:center;align-items:center}.mc-checkbox__input:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");background-position:center center}.mc-checkbox__input:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.container[data-v-2dbee7d5]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-2dbee7d5]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.mc-checkbox{align-items:center;display:flex}.mc-checkbox__label{font-size:1rem;line-height:1.125;cursor:pointer;margin-left:.5rem;color:#000}.mc-checkbox__input{font-family:LeroyMerlin,sans-serif;font-weight:400;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;box-shadow:none;border:none;min-width:20px;min-height:20px;width:1.25rem;height:1.25rem;border-radius:4px;border:2px solid #666666;background-color:#fff;position:relative;transition:all .2s ease;cursor:pointer}.mc-checkbox__input[type=number]::-webkit-inner-spin-button,.mc-checkbox__input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.mc-checkbox__input[type=number]{-moz-appearance:textfield}.mc-checkbox__input[type=search]::-webkit-search-decoration:hover,.mc-checkbox__input[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-checkbox__input::-ms-check{background-color:#fff;border:2px solid #666666;border-radius:4px;color:#fff}.mc-checkbox__input:hover{border-color:#191919}.mc-checkbox__input:hover::-ms-check{border-color:#191919}.mc-checkbox__input:focus{box-shadow:0 0 0 .125rem #fff,0 0 0 .25rem #0b96cc}.mc-checkbox__input:focus::-ms-check{box-shadow:0 0 0 .125rem #fff,0 0 0 .25rem #0b96cc}.mc-checkbox__input:checked,.mc-checkbox__input:indeterminate{background-color:#46a610;border-color:#46a610;background-size:1rem 1rem}.mc-checkbox__input:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");background-position:center center}.mc-checkbox__input:checked::-ms-check{background-color:#46a610;border-color:#46a610}.mc-checkbox__input:checked:hover:not(:disabled){border-color:#035010}.mc-checkbox__input:checked:hover:not(:disabled)::-ms-check{border-color:#035010}.mc-checkbox__input:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled{background-color:#e6e6e6;border-color:#e6e6e6;cursor:not-allowed}.mc-checkbox__input:disabled::-ms-check{background-color:#e6e6e6;border-color:#e6e6e6}.mc-checkbox__input:disabled:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled+.mc-checkbox__label{color:gray}.mc-checkbox__input.is-invalid{border-color:#c61112}.mc-checkbox__input.is-invalid::-ms-check{border-color:#c61112}.mc-checkbox__input.is-invalid:hover{border-color:#530000}.mc-checkbox__input.is-invalid:hover::-ms-check{border-color:#530000}.container[data-v-
|
|
1
|
+
.mc-checkbox__input:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");background-position:center center}.mc-checkbox__input:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.container[data-v-98d7a612]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-98d7a612]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.container[data-v-b0907849]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-b0907849]{display:flex;flex-direction:column;justify-content:center;align-items:center}.container[data-v-a49082e5]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-a49082e5]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.container[data-v-e38e3f99]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-e38e3f99]{display:flex;flex-direction:column;justify-content:center;align-items:center}.mc-checkbox__input:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");background-position:center center}.mc-checkbox__input:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.container[data-v-2dbee7d5]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-2dbee7d5]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.mc-checkbox{align-items:center;display:flex}.mc-checkbox__label{font-size:1rem;line-height:1.125;cursor:pointer;margin-left:.5rem;color:#000}.mc-checkbox__input{font-family:LeroyMerlin,sans-serif;font-weight:400;box-sizing:border-box;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;margin:0;box-shadow:none;border:none;min-width:20px;min-height:20px;width:1.25rem;height:1.25rem;border-radius:4px;border:2px solid #666666;background-color:#fff;position:relative;transition:all .2s ease;cursor:pointer}.mc-checkbox__input[type=number]::-webkit-inner-spin-button,.mc-checkbox__input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.mc-checkbox__input[type=number]{-moz-appearance:textfield}.mc-checkbox__input[type=search]::-webkit-search-decoration:hover,.mc-checkbox__input[type=search]::-webkit-search-cancel-button:hover{cursor:pointer}.mc-checkbox__input::-ms-check{background-color:#fff;border:2px solid #666666;border-radius:4px;color:#fff}.mc-checkbox__input:hover{border-color:#191919}.mc-checkbox__input:hover::-ms-check{border-color:#191919}.mc-checkbox__input:focus{box-shadow:0 0 0 .125rem #fff,0 0 0 .25rem #0b96cc}.mc-checkbox__input:focus::-ms-check{box-shadow:0 0 0 .125rem #fff,0 0 0 .25rem #0b96cc}.mc-checkbox__input:checked,.mc-checkbox__input:indeterminate{background-color:#46a610;border-color:#46a610;background-size:1rem 1rem}.mc-checkbox__input:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E");background-position:center center}.mc-checkbox__input:checked::-ms-check{background-color:#46a610;border-color:#46a610}.mc-checkbox__input:checked:hover:not(:disabled){border-color:#035010}.mc-checkbox__input:checked:hover:not(:disabled)::-ms-check{border-color:#035010}.mc-checkbox__input:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled{background-color:#e6e6e6;border-color:#e6e6e6;cursor:not-allowed}.mc-checkbox__input:disabled::-ms-check{background-color:#e6e6e6;border-color:#e6e6e6}.mc-checkbox__input:disabled:checked{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M7.63 11.21a1 1 0 0 1-1.38 0l-2.92-2.6a1 1 0 1 1 1.34-1.48l2.22 2 4.41-4.34a1 1 0 1 1 1.4 1.42z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled:indeterminate{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1rem' width='1rem' fill='%23999999' viewBox='0 0 16 16'%3E%3Cpath d='M12 9H4a1 1 0 010-2h8a1 1 0 010 2z'/%3E%3C/svg%3E")}.mc-checkbox__input:disabled+.mc-checkbox__label{color:gray}.mc-checkbox__input.is-invalid{border-color:#c61112}.mc-checkbox__input.is-invalid::-ms-check{border-color:#c61112}.mc-checkbox__input.is-invalid:hover{border-color:#530000}.mc-checkbox__input.is-invalid:hover::-ms-check{border-color:#530000}.container[data-v-a786496d]{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:400;font-family:Roboto,sans-serif}.main[data-v-a786496d]{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-bottom:20px}.chart-legend[data-v-a786496d]{display:flex;gap:4px;font-size:14px;align-items:center;margin:1.375rem 1.0625rem;color:#666}.bubble-icon[data-v-a786496d]{width:16px;height:16px}
|
package/package.json
CHANGED
|
@@ -203,13 +203,23 @@ const normalizeDatasets = function (dataSets: Array<Array<any>>) {
|
|
|
203
203
|
const rMin = bubbleDataProps.bubbleMin
|
|
204
204
|
|
|
205
205
|
return dataSets.map((dataSerie: Array<any>) => {
|
|
206
|
-
|
|
207
|
-
return {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
if (max === min) {
|
|
207
|
+
return dataSerie.map((item) => {
|
|
208
|
+
return {
|
|
209
|
+
x: item.x,
|
|
210
|
+
y: item.y,
|
|
211
|
+
r: rMin + (rMax - rMin) / 2
|
|
212
|
+
}
|
|
213
|
+
})
|
|
214
|
+
} else {
|
|
215
|
+
return dataSerie.map((item) => {
|
|
216
|
+
return {
|
|
217
|
+
x: item.x,
|
|
218
|
+
y: item.y,
|
|
219
|
+
r: rMin + (item.r - min) * (rMax - rMin) / (max - min)
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
}
|
|
213
223
|
})
|
|
214
224
|
}
|
|
215
225
|
|