highcharts
Version:
JavaScript charting framework
13 lines • 3.88 kB
JavaScript
!/**
* Highcharts JS v12.6.0 (2026-04-13)
* @module highcharts/modules/vector
* @requires highcharts
*
* Vector plot series module
*
* (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/vector",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/modules/vector"]=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 n=o[t]={exports:{}};return r[t](n,n.exports,i),n.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 n={};i.d(n,{default:()=>m});var s=i(944),a=i.n(s),h=i(512),l=i.n(h);let{doc:c,win:p}=a();function d(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{animObject:g}=a(),{series:f,seriesTypes:{scatter:y}}=l();class b extends y{animate(t){t?this.markerGroup.attr({opacity:.01}):this.markerGroup.animate({opacity:1},g(this.options.animation))}arrow(t){let e=t.length/this.lengthMax*this.options.vectorLength/20,r={start:10*e,center:0,end:-10*e}[this.options.rotationOrigin]||0;return[["M",0,7*e+r],["L",-1.5*e,7*e+r],["L",0,10*e+r],["L",1.5*e,7*e+r],["L",0,7*e+r],["L",0,-10*e+r]]}drawPoints(){let t=this.chart;for(let e of this.points){let r=e.plotX,o=e.plotY;!1===this.options.clip||t.isInsidePlot(r,o,{inverted:t.inverted})?(e.graphic||(e.graphic=this.chart.renderer.path().add(this.markerGroup).addClass("highcharts-point highcharts-color-"+function(){let t=arguments,e=t.length;for(let r=0;r<e;r++){let e=t[r];if(null!=e)return e}}(e.colorIndex,e.series.colorIndex))),e.graphic.attr({d:this.arrow(e),translateX:r,translateY:o,rotation:e.direction}),this.chart.styledMode||e.graphic.attr(this.pointAttribs(e))):e.graphic&&(e.graphic=e.graphic.destroy())}}pointAttribs(t,e){let r=this.options,o=t?.color||this.color,i=this.options.lineWidth;return e&&(o=r.states[e].color||o,i=(r.states[e].lineWidth||i)+(r.states[e].lineWidthPlus||0)),{stroke:o,"stroke-width":i}}translate(){f.prototype.translate.call(this),this.lengthMax=function(t){let e=t.length,r=t[0];for(;e--;)t[e]>r&&(r=t[e]);return r}(this.getColumn("length"))}}b.defaultOptions=function(t,...e){let r,o=[t,...e],i={},n=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)&&!d(r)&&i?.name&&"Object"!==i.name)||d(r)?t[o]=e[o]:t[o]=n(t[o]||{},r)}}),t};!0===t&&(i=o[1],o=Array.prototype.slice.call(o,2));let s=o.length;for(r=0;r<s;r++)i=n(i,o[r]);return i}(y.defaultOptions,{lineWidth:2,marker:void 0,rotationOrigin:"center",states:{hover:{lineWidthPlus:1}},tooltip:{pointFormat:"<b>[{point.x}, {point.y}]</b><br/>Length: <b>{point.length}</b><br/>Direction: <b>{point.direction}\xb0</b><br/>"},vectorLength:20}),function(t,e){let r;for(r in t||(t={}),e)t[r]=e[r]}(b.prototype,{drawGraph:a().noop,getSymbol:a().noop,markerAttribs:a().noop,parallelArrays:["x","y","length","direction"],pointArrayMap:["y","length","direction"]}),l().registerSeriesType("vector",b);let m=a();return n.default})());