UNPKG

highcharts

Version:
13 lines 5.99 kB
/** * Highcharts JS v13.0.1 (2026-08-17) * @module highcharts/modules/series-on-point * @requires highcharts * * Series on point module * * (c) 2010-2026 Highsoft AS * Author: Rafał Sebestjański and Piotr Madej * * A commercial license may be required depending on use, * see www.highcharts.com/license */import*as t from"../highcharts.js";let e={};e.n=t=>{let s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},e.d=(t,s)=>{if(Array.isArray(s))for(var i=0;i<s.length;){var o=s[i++],r=s[i++];e.o(t,o)?0===r&&i++:0===r?Object.defineProperty(t,o,{enumerable:!0,value:s[i++]}):Object.defineProperty(t,o,{enumerable:!0,get:r})}else for(var o in s)e.o(s,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:s[o]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let s=t.default;var i,o=e.n(s);let{setLength:r,splice:n}={convertToNumber:function(t,e){switch(typeof t){case"boolean":return+!!t;case"number":return isNaN(t)&&!e?null:t;default:return isNaN(t=parseFloat(`${t??""}`))&&!e?null:t}},setLength:function(t,e,s){return Array.isArray(t)?(t.length=e,t):t[s?"subarray":"slice"](0,e)},splice:function(t,e,s,i,o=[]){if(Array.isArray(t))return Array.isArray(o)||(o=Array.from(o)),{removed:t.splice(e,s,...o),array:t};let r=Object.getPrototypeOf(t).constructor,n=t[i?"subarray":"slice"](e,e+s),a=new r(t.length-s+o.length);return a.set(t.subarray(0,e),0),a.set(o,e),a.set(t.subarray(e+s),e+o.length),{removed:n,array:a}}},a=class{constructor(t={}){this.isDataTable=!0,this.autoId=!t.id,this.columns={},this.id=t.id||(0,s.uniqueKey)(),this.rowCount=0,this.versionTag=(0,s.uniqueKey)();let e=0;(0,s.objectEach)(t.columns||{},(t,s)=>{this.columns[s]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,(0,s.objectEach)(this.columns,(e,s)=>{e.length!==t&&(this.columns[s]=r(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let i=0;(0,s.objectEach)(this.columns,(s,o)=>{this.columns[o]=n(s,t,e).array,i=s.length}),this.rowCount=i}(0,s.fireEvent)(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=(0,s.uniqueKey)()}getColumn(t,e){return this.columns[t]}getColumns(t,e){return(t||Object.keys(this.columns)).reduce((t,e)=>(t[e]=this.columns[e],t),{})}getRowObject(t,e){let s={},i=this.columns;for(let o of(e??(e=Object.keys(this.columns)),e))s[o]=i[o]?.[t];return s}setColumn(t,e=[],s=0,i){this.setColumns({[t]:e},s,i)}setColumns(t,e,i){let o=this.rowCount;(0,s.objectEach)(t,(t,e)=>{this.columns[e]=t.slice(),o=t.length}),this.applyRowCount(o),i?.silent||((0,s.fireEvent)(this,"afterSetColumns"),this.versionTag=(0,s.uniqueKey)())}setRow(t,e=this.rowCount,i,o){var r;let{columns:a}=this,l=i?this.rowCount+1:e+1,h=Object.keys(t);if(o?.addColumns!==!1)for(let t=0,e=h.length;t<e;t++)a[r=h[t]]||(a[r]=Array(this.rowCount));(0,s.objectEach)(a,(s,o)=>{s&&(i?s=n(s,e,0,!0,[t[o]]).array:s[e]=o in t?t[o]:s[e],a[o]=s)}),this.applyRowCount(Math.max(l,this.rowCount)),o?.silent||((0,s.fireEvent)(this,"afterSetRows",{rowIndex:e}),this.versionTag=(0,s.uniqueKey)())}getModified(){return this.modified||this}},l=t.default.Point;var h=e.n(l);let u=t.default.SeriesRegistry;var d=e.n(u);let c=t.default.SVGRenderer;var p=e.n(c);let{composed:f}=o(),{bubble:y}=d().seriesTypes;var m=i||(i={});m.compose=function(t,e){if((0,s.pushUnique)(f,"SeriesOnPoint")){let{chartGetZData:i,seriesAfterInit:o,seriesAfterRender:r,seriesGetCenter:n,seriesShowOrHide:a,seriesTranslate:l}=g.prototype;t.types.pie.prototype.onPointSupported=!0,(0,s.addEvent)(t,"afterInit",o),(0,s.addEvent)(t,"afterRender",r),(0,s.addEvent)(t,"afterGetCenter",n),(0,s.addEvent)(t,"hide",a),(0,s.addEvent)(t,"show",a),(0,s.addEvent)(t,"translate",l),(0,s.addEvent)(e,"beforeRender",i),(0,s.addEvent)(e,"beforeRedraw",i)}return t};class g{constructor(t){this.getColumn=y.prototype.getColumn,this.getRadii=y.prototype.getRadii,this.getRadius=y.prototype.getRadius,this.getPxExtremes=y.prototype.getPxExtremes,this.getZExtremes=y.prototype.getZExtremes,this.chart=t.chart,this.series=t,this.options=t.options.onPoint}drawConnector(){this.connector||(this.connector=this.series.chart.renderer.path().addClass("highcharts-connector-seriesonpoint").attr({zIndex:-1}).add(this.series.markerGroup));let t=this.getConnectorAttributes();t&&this.connector.animate(t)}getConnectorAttributes(){let t=this.series.chart,e=this.options;if(!e)return;let i=e.connectorOptions||{},o=e.position,r=t.get(e.id);if(!(r instanceof h())||!o||!(0,s.defined)(r.plotX)||!(0,s.defined)(r.plotY))return;let n=(0,s.defined)(o.x)?o.x:r.plotX,a=(0,s.defined)(o.y)?o.y:r.plotY,l=n+(o.offsetX||0),u=a+(o.offsetY||0),d=i.width||1,c=i.stroke||this.series.color,f=i.dashstyle,y={d:p().prototype.crispLine([["M",n,a],["L",l,u]],d),"stroke-width":d};return t.styledMode||(y.stroke=c,y.dashstyle=f),y}seriesAfterInit(){this.onPointSupported&&this.options.onPoint&&(this.bubblePadding=!0,this.useMapGeometry=!0,this.onPoint=new g(this))}seriesAfterRender(){delete this.chart.bubbleZExtremes,this.onPoint&&this.onPoint.drawConnector()}seriesGetCenter(t){let e=this.options.onPoint,i=t.positions;if(e){let t=this.chart.get(e.id);t instanceof h()&&(0,s.defined)(t.plotX)&&(0,s.defined)(t.plotY)&&(i[0]=t.plotX,i[1]=t.plotY);let o=e.position;o&&((0,s.defined)(o.x)&&(i[0]=o.x),(0,s.defined)(o.y)&&(i[1]=o.y),o.offsetX&&(i[0]+=o.offsetX),o.offsetY&&(i[1]+=o.offsetY))}let o=this.radii&&this.radii[this.index];(0,s.isNumber)(o)&&(i[2]=2*o),t.positions=i}seriesShowOrHide(){let t=this.chart.series;this.points?.forEach(e=>{let i=(0,s.find)(t,t=>{let s=((t.onPoint||{}).options||{}).id;return!!s&&s===e.id});i&&i.setVisible(!i.visible,!1)})}seriesTranslate(){this.onPoint&&(this.onPoint.getRadii(),this.radii=this.onPoint.radii)}chartGetZData(){let t=[];this.series.forEach(e=>{let s=e.options.onPoint;t.push(s?.z??null)});let e=new a({columns:{z:t}});this.series.forEach(t=>{t.onPoint&&(t.onPoint.dataTable=t.dataTable=e)})}}m.Additions=g;let b=i,w=o();b.compose(w.Series,w.Chart);let C=o();export{C as default};