highcharts
Version:
JavaScript charting framework
13 lines • 3.58 kB
JavaScript
!/**
* Highcharts JS v12.6.0 (2026-04-13)
* @module highcharts/modules/dotplot
* @requires highcharts
*
* Dot plot series type for Highcharts
*
* (c) 2010-2026 Highsoft AS
* Author: Torstein Hønsi
*
* 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.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/modules/dotplot",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/dotplot"]=e(t._Highcharts,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,(t,e)=>(()=>{"use strict";var r={512:t=>{t.exports=e},944:e=>{e.exports=t}},o={};function i(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={exports:{}};return r[t](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var s={};i.d(s,{default:()=>b});var n=i(944),a=i.n(n),c=i(512),l=i.n(c);let{doc:h,win:p}=a();function d(t,e){let r;for(r in t||(t={}),e)t[r]=e[r];return t}function f(t){return u(t)&&"number"==typeof t.nodeType}function u(t,e){let r;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(r=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==r)}Array.prototype.find;let{column:y}=l().seriesTypes;class g extends y{drawPoints(){var t;let e=this.options,r=this.chart.renderer,o=e.marker,i=this.points.reduce((t,e)=>t+Math.abs(e.y||0),0),s=this.points.reduce((t,e)=>t+(e.shapeArgs?.height||0),0),n=e.itemPadding||0,a=this.points[0]?.shapeArgs?.width||0,c=e.slotsPerBar,l=a;if(!("number"==typeof(t=c)&&!isNaN(t)&&t<1/0&&t>-1/0))for(c=1;c<i&&!(i/c<s/l*1.2);)l=a/++c;let h=s*c/i;for(let t of this.points){let e=t.marker||{},i=e.symbol||o.symbol,s=function(){let t=arguments,e=t.length;for(let r=0;r<e;r++){let e=t[r];if(null!=e)return e}}(e.radius,o.radius),a="rect"!==i?h:l,p=t.shapeArgs||{},f=(p.x||0)+((p.width||0)-c*a)/2,u=Math.abs(t.y??0),y=p.y||0,g=p.height||0,b,m=f,v=t.negative?y:y+g-h,A=0;t.graphics=b=t.graphics||[];let x=t.pointAttr?t.pointAttr[t.selected?"selected":""]||this.pointAttr[""]:this.pointAttribs(t,t.selected&&"select");if(delete x.r,this.chart.styledMode&&(delete x.stroke,delete x["stroke-width"]),"number"==typeof t.y){t.graphic||(t.graphic=r.g("point").add(this.group));for(let e=0;e<u;e++){let o={x:m+a*n,y:v+h*n,width:a*(1-2*n),height:h*(1-2*n),r:s},l=b[e];l?l.animate(o):l=r.symbol(i).attr(d(o,x)).add(t.graphic),l.isActive=!0,b[e]=l,m+=a,++A>=c&&(A=0,m=f,v=t.negative?v+h:v-h)}}let j=-1;for(let t of b)++j,t&&(t.isActive?t.isActive=!1:(t.destroy(),b.splice(j,1)))}}}g.defaultOptions=function(t,...e){let r,o=[t,...e],i={},s=function(t,e){return"object"!=typeof t&&(t={}),function(t,e,r){for(let r in t)Object.hasOwnProperty.call(t,r)&&e.call((0,t[r]),t[r],r,t)}(e,function(r,o){if("__proto__"!==o&&"constructor"!==o){let i;!u(r,!0)||(i=r?.constructor,u(r,!0)&&!f(r)&&i?.name&&"Object"!==i.name)||f(r)?t[o]=e[o]:t[o]=s(t[o]||{},r)}}),t};!0===t&&(i=o[1],o=Array.prototype.slice.call(o,2));let n=o.length;for(r=0;r<n;r++)i=s(i,o[r]);return i}(y.defaultOptions,{itemPadding:.1,marker:{symbol:"circle",states:{hover:{},select:{}}},slotsPerBar:void 0}),d(g.prototype,{markerAttribs:void 0}),l().registerSeriesType("dotplot",g);let b=a();return s.default})());