highcharts
Version:
JavaScript charting framework
13 lines • 8.14 kB
JavaScript
!/**
* Highcharts JS v12.6.0 (2026-04-13)
* @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
*/function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.Point,t._Highcharts.SeriesRegistry,t._Highcharts.SVGRenderer):"function"==typeof define&&define.amd?define("highcharts/modules/series-on-point",["highcharts/highcharts"],function(t){return e(t,t.Point,t.SeriesRegistry,t.SVGRenderer)}):"object"==typeof exports?exports["highcharts/modules/series-on-point"]=e(t._Highcharts,t._Highcharts.Point,t._Highcharts.SeriesRegistry,t._Highcharts.SVGRenderer):t.Highcharts=e(t.Highcharts,t.Highcharts.Point,t.Highcharts.SeriesRegistry,t.Highcharts.SVGRenderer)}("u"<typeof window?this:window,(t,e,r,s)=>(()=>{"use strict";var o,n={260:t=>{t.exports=e},512:t=>{t.exports=r},540:t=>{t.exports=s},944:e=>{e.exports=t}},i={};function h(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return n[t](r,r.exports,h),r.exports}h.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return h.d(e,{a:e}),e},h.d=(t,e)=>{for(var r in e)h.o(e,r)&&!h.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};h.d(a,{default:()=>G});var l=h(944),c=h.n(l);let{doc:u,win:p}=c();function f(t,e,r,s={}){let o="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let n=o.hcEvents;c().Point&&t instanceof c().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let i=t.addEventListener;i&&i.call(t,e,r,!!c().supportsPassiveEvents&&{passive:void 0===s.passive?-1!==e.indexOf("touch"):s.passive,capture:!1}),n[e]||(n[e]=[]);let h={fn:r,order:"number"==typeof s.order?s.order:1/0};return n[e].push(h),n[e].sort((t,e)=>t.order-e.order),function(){!function(t,e,r){function s(e,r){let s=t.removeEventListener;s&&s.call(t,e,r,!1)}function o(r){let o,n;t.nodeName&&(e?(o={})[e]=!0:o=r,v(o,function(t,e){if(r[e])for(n=r[e].length;n--;)s(e,r[e][n].fn)}))}let n="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(n,"hcEvents")){let t=n.hcEvents;if(e){let n=t[e]||[];r?(t[e]=n.filter(function(t){return r!==t.fn}),s(e,r)):(o(t),t[e]=[])}else o(t),delete n.hcEvents}}(t,e,r)}}function d(t){return null!=t}function y(t,e){let r;for(r in t||(t={}),e)t[r]=e[r];return t}function g(t,e,r,s){if(r=r||{},u?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==c())){let s=u.createEvent("Events");s.initEvent(e,!0,!0),r=y(s,r),t.dispatchEvent?t.dispatchEvent(r):t.fireEvent(e,r)}else if(t.hcEvents){r.target||y(r,{preventDefault:function(){r.defaultPrevented=!0},target:t,type:e});let s=[],o=t,n=!1;for(;o.hcEvents;)Object.hasOwnProperty.call(o,"hcEvents")&&o.hcEvents[e]&&(s.length&&(n=!0),s.unshift.apply(s,o.hcEvents[e])),o=Object.getPrototypeOf(o);n&&s.sort((t,e)=>t.order-e.order),s.forEach(e=>{!1===e.fn.call(t,r,t)&&r.preventDefault()})}s&&!r.defaultPrevented&&s.call(t,r)}let m=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){let r,s=t.length;for(r=0;r<s;r++)if(e(t[r],r))return t[r]};function v(t,e,r){for(let s in t)Object.hasOwnProperty.call(t,s)&&e.call(r||t[s],t[s],s,t)}let{setLength:b,splice:w}={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,r){return Array.isArray(t)?(t.length=e,t):t[r?"subarray":"slice"](0,e)},splice:function(t,e,r,s,o=[]){if(Array.isArray(t))return Array.isArray(o)||(o=Array.from(o)),{removed:t.splice(e,r,...o),array:t};let n=Object.getPrototypeOf(t).constructor,i=t[s?"subarray":"slice"](e,e+r),h=new n(t.length-r+o.length);return h.set(t.subarray(0,e),0),h.set(o,e),h.set(t.subarray(e+r),e+o.length),{removed:i,array:h}}},P=class{constructor(t={}){this.autoId=!t.id,this.columns={},this.id=t.id||(0,l.uniqueKey)(),this.rowCount=0,this.versionTag=(0,l.uniqueKey)();let e=0;v(t.columns||{},(t,r)=>{this.columns[r]=t.slice(),e=Math.max(e,t.length)}),this.applyRowCount(e)}applyRowCount(t){this.rowCount=t,v(this.columns,(e,r)=>{e.length!==t&&(this.columns[r]=b(e,t))})}deleteRows(t,e=1){if(e>0&&t<this.rowCount){let r=0;v(this.columns,(s,o)=>{this.columns[o]=w(s,t,e).array,r=s.length}),this.rowCount=r}g(this,"afterDeleteRows",{rowIndex:t,rowCount:e}),this.versionTag=(0,l.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),{})}getRow(t,e){return(e||Object.keys(this.columns)).map(e=>this.columns[e]?.[t])}setColumn(t,e=[],r=0,s){this.setColumns({[t]:e},r,s)}setColumns(t,e,r){let s=this.rowCount;v(t,(t,e)=>{this.columns[e]=t.slice(),s=t.length}),this.applyRowCount(s),r?.silent||(g(this,"afterSetColumns"),this.versionTag=(0,l.uniqueKey)())}setRow(t,e=this.rowCount,r,s){let{columns:o}=this,n=r?this.rowCount+1:e+1,i=Object.keys(t);if(s?.addColumns!==!1)for(let t=0,e=i.length;t<e;t++){let e=i[t];o[e]||(o[e]=[])}v(o,(i,h)=>{i||s?.addColumns===!1||(i=Array(n)),i&&(r?i=w(i,e,0,!0,[t[h]??null]).array:i[e]=t[h]??null,o[h]=i)}),n>this.rowCount&&this.applyRowCount(n),s?.silent||(g(this,"afterSetRows"),this.versionTag=(0,l.uniqueKey)())}getModified(){return this.modified||this}};var E=h(260),C=h.n(E),x=h(512),R=h.n(x),O=h(540),S=h.n(O);let{composed:j}=c(),{bubble:A}=R().seriesTypes;var H=o||(o={});H.compose=function(t,e){var r;if(r="SeriesOnPoint",0>j.indexOf(r)&&j.push(r)){let{chartGetZData:r,seriesAfterInit:s,seriesAfterRender:o,seriesGetCenter:n,seriesShowOrHide:i,seriesTranslate:h}=T.prototype;t.types.pie.prototype.onPointSupported=!0,f(t,"afterInit",s),f(t,"afterRender",o),f(t,"afterGetCenter",n),f(t,"hide",i),f(t,"show",i),f(t,"translate",h),f(e,"beforeRender",r),f(e,"beforeRedraw",r)}return t};class T{constructor(t){this.getColumn=A.prototype.getColumn,this.getRadii=A.prototype.getRadii,this.getRadius=A.prototype.getRadius,this.getPxExtremes=A.prototype.getPxExtremes,this.getZExtremes=A.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 r=e.connectorOptions||{},s=e.position,o=t.get(e.id);if(!(o instanceof C())||!s||!d(o.plotX)||!d(o.plotY))return;let n=d(s.x)?s.x:o.plotX,i=d(s.y)?s.y:o.plotY,h=n+(s.offsetX||0),a=i+(s.offsetY||0),l=r.width||1,c=r.stroke||this.series.color,u=r.dashstyle,p={d:S().prototype.crispLine([["M",n,i],["L",h,a]],l),"stroke-width":l};return t.styledMode||(p.stroke=c,p.dashstyle=u),p}seriesAfterInit(){this.onPointSupported&&this.options.onPoint&&(this.bubblePadding=!0,this.useMapGeometry=!0,this.onPoint=new T(this))}seriesAfterRender(){delete this.chart.bubbleZExtremes,this.onPoint&&this.onPoint.drawConnector()}seriesGetCenter(t){let e=this.options.onPoint,r=t.positions;if(e){let t=this.chart.get(e.id);t instanceof C()&&d(t.plotX)&&d(t.plotY)&&(r[0]=t.plotX,r[1]=t.plotY);let s=e.position;s&&(d(s.x)&&(r[0]=s.x),d(s.y)&&(r[1]=s.y),s.offsetX&&(r[0]+=s.offsetX),s.offsetY&&(r[1]+=s.offsetY))}let s=this.radii&&this.radii[this.index];"number"==typeof s&&!isNaN(s)&&s<1/0&&s>-1/0&&(r[2]=2*s),t.positions=r}seriesShowOrHide(){let t=this.chart.series;this.points?.forEach(e=>{let r=m(t,t=>{let r=((t.onPoint||{}).options||{}).id;return!!r&&r===e.id});r&&r.setVisible(!r.visible,!1)})}seriesTranslate(){this.onPoint&&(this.onPoint.getRadii(),this.radii=this.onPoint.radii)}chartGetZData(){let t=[];this.series.forEach(e=>{let r=e.options.onPoint;t.push(r?.z??null)});let e=new P({columns:{z:t}});this.series.forEach(t=>{t.onPoint&&(t.onPoint.dataTable=t.dataTable=e)})}}H.Additions=T;let _=o,k=c();_.compose(k.Series,k.Chart);let G=c();return a.default})());