highcharts
Version:
JavaScript charting framework
11 lines • 19.2 kB
JavaScript
/**
* Highcharts JS v12.6.0 (2026-04-13)
* @module highcharts/modules/draggable-points
* @requires highcharts
*
* (c) 2009-2026 Highsoft AS
* Author: Torstein Hønsi
*
* A commercial license may be required depending on use.
* See www.highcharts.com/license
*/import*as e from"../highcharts.js";var t={};t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);let r=e.default;var o=t.n(r);let{doc:a,win:i}=o();function n(e,t,r,a={}){let i="function"==typeof e&&e.prototype||e;Object.hasOwnProperty.call(i,"hcEvents")||(i.hcEvents={});let s=i.hcEvents;o().Point&&e instanceof o().Point&&e.series&&e.series.chart&&(e.series.chart.runTrackerClick=!0);let d=e.addEventListener;d&&d.call(e,t,r,!!o().supportsPassiveEvents&&{passive:void 0===a.passive?-1!==t.indexOf("touch"):a.passive,capture:!1}),s[t]||(s[t]=[]);let l={fn:r,order:"number"==typeof a.order?a.order:1/0};return s[t].push(l),s[t].sort((e,t)=>e.order-t.order),function(){!function(e,t,r){function o(t,r){let o=e.removeEventListener;o&&o.call(e,t,r,!1)}function a(r){let a,i;e.nodeName&&(t?(a={})[t]=!0:a=r,h(a,function(e,t){if(r[t])for(i=r[t].length;i--;)o(t,r[t][i].fn)}))}let i="function"==typeof e&&e.prototype||e;if(Object.hasOwnProperty.call(i,"hcEvents")){let e=i.hcEvents;if(t){let i=e[t]||[];r?(e[t]=i.filter(function(e){return r!==e.fn}),o(t,r)):(a(e),e[t]=[])}else a(e),delete i.hcEvents}}(e,t,r)}}function s(e){return p(e)&&"number"==typeof e.nodeType}function d(e){return"number"==typeof e&&!isNaN(e)&&e<1/0&&e>-1/0}function l(e){let t=Object.prototype.toString.call(e);return"[object Array]"===t||"[object Array Iterator]"===t}function p(e,t){return!!e&&"object"==typeof e&&(!t||!l(e))}function g(e,...t){let r,o=[e,...t],a={},i=function(e,t){return"object"!=typeof e&&(e={}),h(t,function(r,o){if("__proto__"!==o&&"constructor"!==o){let a;!p(r,!0)||(a=r?.constructor,p(r,!0)&&!s(r)&&a?.name&&"Object"!==a.name)||s(r)?e[o]=t[o]:e[o]=i(e[o]||{},r)}}),e};!0===e&&(a=o[1],o=Array.prototype.slice.call(o,2));let n=o.length;for(r=0;r<n;r++)a=i(a,o[r]);return a}function h(e,t,r){for(let o in e)Object.hasOwnProperty.call(e,o)&&t.call(r||e[o],e[o],o,e)}Array.prototype.find;let c={addEvents:function(e,t,r,o){let a=t.map(t=>n(e,t,r,o));return function(){for(let e of a)e()}},countProps:function(e){return Object.keys(e).length},getFirstProp:function(e){for(let t in e)if(Object.hasOwnProperty.call(e,t))return e[t]},getNormalizedEvent:function(e,t){return(void 0===e.chartX||void 0===e.chartY)&&t.pointer?.normalize(e)||e}},u={className:"highcharts-drag-handle",color:"#fff",lineColor:"rgba(0, 0, 0, 0.6)",lineWidth:1,zIndex:901},x={default:{className:"highcharts-drag-box-default",lineWidth:1,lineColor:"#888",color:"rgba(0, 0, 0, 0.1)",cursor:"move",zIndex:900}},{animObject:m}=o(),{addEvents:f,countProps:y,getFirstProp:v,getNormalizedEvent:D}=c,{doc:P}=o();function b(){let e=this.dragHandles||{};if(e){for(let t of Object.keys(e))e[t].destroy&&e[t].destroy();delete this.dragHandles}}function w(e,t){let r=this.dragGuideBox,o=g(x,t),a=g(o.default,o[e]);return r.attr({class:a.className,stroke:a.lineColor,strokeWidth:a.lineWidth,fill:a.color,cursor:a.cursor,zIndex:a.zIndex}).css({pointerEvents:"none"})}function z(e){let t=this.options.chart||{},r=t.panKey&&t.panKey+"Key";return e[this.zooming.key&&this.zooming.key+"Key"]||e[r]}function A(e){return({left:"right",right:"left",top:"bottom",bottom:"top"})[e]}function N(e,t){let r,o=function(e){let t=e.series,r=t.options.data||[],o=t.options.dragDrop.groupBy,a=[];if(t.boosted&&l(r))for(let e=0,o=r.length;e<o;++e)a.push(new t.pointClass(t,r[e])),a[a.length-1].index=e;else a=t.points;return e.options[o]?a.filter(t=>t.options[o]===e.options[o]):[e]}(t),a=t.series,i=a.chart;(a.options.dragDrop?.liveRedraw??!0)||(i.dragGuideBox=r=a.getGuideBox(o),i.setGuideBoxState("default",a.options.dragDrop?.guideBox).add(a.group)),i.dragDropData={origin:function(e,t,r){let o={chartX:e.chartX,chartY:e.chartY,guideBox:r&&{x:r.attr("x"),y:r.attr("y"),width:r.attr("width"),height:r.attr("height")},points:{}};for(let r of t){let t=r.series.dragDropProps||{},a={};for(let o of Object.keys(t)){let i=t[o],n=r.series[i.axis+"Axis"];a[o]=r[o],r.series.chart.mapView&&r.plotX&&r.plotY?a[o+"Offset"]="x"===o?r.plotX:r.plotY:a[o+"Offset"]=n.toPixels(r[o])-(n.horiz?e.chartX:e.chartY)}a.point=r,o.points[r.id]=a}return o}(e,o,r),point:t,groupedPoints:o,isDragging:!0}}function S(e,t){let r=t.dragDropData;if(r&&r.isDragging&&r.draggedPastSensitivity&&r.point.series){let o=r.point,a=r.newPoints,i=y(a),n=1===i?v(a):null;t.dragHandles&&t.hideDragHandles(),e.preventDefault(),t.cancelClick=!0,o.firePointEvent("drop",{origin:r.origin,chartX:e.chartX,chartY:e.chartY,newPoints:a,numNewPoints:i,newPoint:n&&n.newValues,newPointId:n&&n.point.id},function(){H(t)})}delete t.dragDropData,t.dragGuideBox&&(t.dragGuideBox.destroy(),delete t.dragGuideBox)}function B(){var e;let t;!this.hasAddedDragDropEvents&&(e=this,t=e.container,function(e){let t=e.series?e.series.length:0;if(e.hasCartesianSeries&&!e.polar||e.mapView){for(;t--;)if(e.series[t].options.dragDrop&&function(e){let t,r=["draggableX","draggableY"],o=e.dragDropProps||{};for(let e of Object.keys(o))(t=o[e]).optionName&&r.push(t.optionName);let a=r.length;for(;a--;)if(e.options.dragDrop[r[a]])return!0}(e.series[t]))return!0}return!1}(e)&&(f(t,["mousedown","touchstart"],t=>{!function(e,t){let r=t.hoverPoint,o=g(r&&r.series.options.dragDrop,r&&r.options.dragDrop),a=o.draggableX||!1,i=o.draggableY||!1;if(t.cancelClick=!1,!(!(a||i)||t.zoomOrPanKeyPressed(e))&&!t.hasDraggedAnnotation){if(t.dragDropData&&t.dragDropData.isDragging)return S(e,t);r&&function(e){let t,r,o,a=e.series,i=a.chart,n=a.options.dragDrop||{},s=e.options&&e.options.dragDrop,d=a.dragDropProps;for(let e in d)"x"===(t=d[e]).axis&&t.move?r=!0:"y"===t.axis&&t.move&&(o=!0);return(n.draggableX&&r||n.draggableY&&o)&&!(s&&!1===s.draggableX&&!1===s.draggableY)&&(!!(a.yAxis&&a.xAxis)||i.mapView)}(r)&&(t.mouseIsDown=!1,N(e,r),r.firePointEvent("dragStart",e))}}(D(t,e),e)}),f(t,["mousemove","touchmove"],t=>{!function(e,t){if(t.zoomOrPanKeyPressed(e))return;let r=t.dragDropData,o,a,i,n=0,s;if(r&&r.isDragging&&r.point.series){var d;let l,p,h,c,u;a=(o=r.point).series.options.dragDrop,e.preventDefault(),r.draggedPastSensitivity||(d=o.options.dragDrop?.dragSensitivity??a?.dragSensitivity??2??2,p=(l=t.dragDropData.origin).chartX,h=l.chartY,c=e.chartX,r.draggedPastSensitivity=Math.sqrt((c-p)*(c-p)+((u=e.chartY)-h)*(u-h))>d),r.draggedPastSensitivity&&(r.newPoints=function(e,t){let r=e.point,o=r.series,a=o.chart,i=g(o.options.dragDrop,r.options.dragDrop),n={},s=e.updateProp,d={},l=r.series.dragDropProps;for(let e in l){let t=l[e];(!s||s===e&&t.resize&&(!t.optionName||!1!==i[t.optionName]))&&(s||t.move&&("x"===t.axis&&i.draggableX||"y"===t.axis&&i.draggableY))&&(a.mapView?n["x"===e?"lon":"lat"]=t:n[e]=t)}for(let o of s?[r]:e.groupedPoints)d[o.id]={point:o,newValues:o.getDropValues(e.origin,t,n)};return d}(r,e),s=1===(n=y(i=r.newPoints))?v(i):null,o.firePointEvent("drag",{origin:r.origin,newPoints:r.newPoints,newPoint:s&&s.newValues,newPointId:s&&s.point.id,numNewPoints:n,chartX:e.chartX,chartY:e.chartY},function(){var t,r,a;let i,n,s,d,l,p,h,c,u,x,m,f,y,v,D,P,b;s=(n=(i=o.series).chart).dragDropData,l=(d=g(i.options.dragDrop,o.options.dragDrop)).draggableX,p=d.draggableY,h=s.origin,c=s.updateProp,u=e.chartX-h.chartX,x=e.chartY-h.chartY,m=u,n.inverted&&(u=-x,x=-m),d.liveRedraw??!0?(H(n,!1),o.showDragHandles()):c?(t=o,r=u,a=x,v=(y=(f=t.series).chart).dragDropData,D=f.dragDropProps[v.updateProp],P=v.newPoints[t.id].newValues,b="function"==typeof D.resizeSide?D.resizeSide(P,t):D.resizeSide,D.beforeResize&&D.beforeResize(y.dragGuideBox,P,t),function(e,t,r){let o;switch(t){case"left":o={x:e.attr("x")+r.x,width:Math.max(1,e.attr("width")-r.x)};break;case"right":o={width:Math.max(1,e.attr("width")+r.x)};break;case"top":o={y:e.attr("y")+r.y,height:Math.max(1,e.attr("height")-r.y)};break;case"bottom":o={height:Math.max(1,e.attr("height")+r.y)}}e.attr(o)}(y.dragGuideBox,"x"===D.axis&&f.xAxis.reversed||"y"===D.axis&&f.yAxis.reversed?A(b):b,{x:"x"===D.axis?r-(v.origin.prevdX||0):0,y:"y"===D.axis?a-(v.origin.prevdY||0):0})):n.dragGuideBox.translate(l?u:0,p?x:0),h.prevdX=u,h.prevdY=x}))}}(D(t,e),e)},{passive:!1}),n(t,"mouseleave",t=>{S(D(t,e),e)}),e.unbindDragDropMouseUp=f(P,["mouseup","touchend"],t=>{S(D(t,e),e)},{passive:!1}),e.hasAddedDragDropEvents=!0,n(e,"destroy",()=>{e.unbindDragDropMouseUp&&e.unbindDragDropMouseUp()})))}function H(e,t){let r,o=e.dragDropData.newPoints,a=m(t);for(let t of(e.isDragDropAnimating=!0,Object.keys(o)))(r=o[t]).point.update(r.newValues,!1);e.redraw(a),setTimeout(()=>{delete e.isDragDropAnimating,e.hoverPoint&&!e.dragHandles&&e.hoverPoint.showDragHandles()},a.duration)}let O={compose:function(e){let t=e.prototype;t.hideDragHandles||(t.hideDragHandles=b,t.setGuideBoxState=w,t.zoomOrPanKeyPressed=z,n(e,"render",B))},flipResizeSide:A,initDragDrop:N},{flipResizeSide:F}=O,V={x:{axis:"x",move:!0},y:{axis:"y",move:!0}},M={x:{axis:"x",move:!0},y:{axis:"y",move:!1,resize:!0,beforeResize:(e,t,r)=>{let o,a=function(){let e=arguments,t=e.length;for(let r=0;r<t;r++){let t=e[r];if(null!=t)return t}}(r.yBottom,r.series.translatedThreshold),i=e.attr("y"),n=d(r.stackY)?r.stackY-(r.y||0):r.series.options.threshold||0,s=n+t.y;(r.series.yAxis.reversed?s<n:s>=n)?(o=e.attr("height"),e.attr({height:Math.max(0,Math.round(o+(a?a-i-o:0)))})):e.attr({y:Math.round(i+(a?a-i:0))})},resizeSide:(e,t)=>{let r=t.series.chart.dragHandles,o=e.y>=(t.series.options.threshold||0)?"top":"bottom",a=F(o);return r&&r[a]&&(r[a].destroy(),delete r[a]),o},handlePositioner:e=>{let t=e.shapeArgs||e.graphic&&e.graphic.getBBox()||{},r=e.series.yAxis.reversed,o=e.series.options.threshold||0,a=e.y||0;return{x:t.x||0,y:!r&&a>=o||r&&a<o?t.y||0:(t.y||0)+(t.height||0)}},handleFormatter:e=>{let t=e.shapeArgs||{},r=t.r||0,o=t.width||0,a=o/2;return[["M",r,0],["L",a-5,0],["A",1,1,0,0,0,a+5,0],["A",1,1,0,0,0,a-5,0],["M",a+5,0],["L",o-r,0]]}}},X={x:M.x,low:{optionName:"draggableLow",axis:"y",move:!0,resize:!0,resizeSide:"bottom",handlePositioner:e=>({x:e.shapeArgs.x||0,y:e.lowPlot}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.q1},q1:{optionName:"draggableQ1",axis:"y",move:!0,resize:!0,resizeSide:"bottom",handlePositioner:e=>({x:e.shapeArgs.x||0,y:e.q1Plot}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.median&&e>=t.low},median:{axis:"y",move:!0},q3:{optionName:"draggableQ3",axis:"y",move:!0,resize:!0,resizeSide:"top",handlePositioner:e=>({x:e.shapeArgs.x||0,y:e.q3Plot}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.high&&e>=t.median},high:{optionName:"draggableHigh",axis:"y",move:!0,resize:!0,resizeSide:"top",handlePositioner:e=>({x:e.shapeArgs.x||0,y:e.highPlot}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e>=t.q3}},Y={x:M.x,low:{...X.low,propValidate:(e,t)=>e<=t.high},high:{...X.high,propValidate:(e,t)=>e>=t.low}},j={x:M.x,y:M.y,target:{optionName:"draggableTarget",axis:"y",move:!0,resize:!0,resizeSide:"top",handlePositioner:e=>{let t=e.targetGraphic.getBBox();return{x:e.barX,y:t.y+t.height/2}},handleFormatter:M.y.handleFormatter}},k={x:M.x,low:{optionName:"draggableLow",axis:"y",move:!0,resize:!0,resizeSide:"bottom",handlePositioner:e=>({x:e.shapeArgs.x,y:e.plotLow}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.open&&e<=t.close},high:{optionName:"draggableHigh",axis:"y",move:!0,resize:!0,resizeSide:"top",handlePositioner:e=>({x:e.shapeArgs.x,y:e.plotHigh}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e>=t.open&&e>=t.close},open:{optionName:"draggableOpen",axis:"y",move:!0,resize:!0,resizeSide:e=>e.open>=e.close?"top":"bottom",handlePositioner:e=>({x:e.shapeArgs.x,y:e.plotOpen}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.high&&e>=t.low},close:{optionName:"draggableClose",axis:"y",move:!0,resize:!0,resizeSide:e=>e.open>=e.close?"bottom":"top",handlePositioner:e=>({x:e.shapeArgs.x,y:e.plotClose}),handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.high&&e>=t.low}},E={x:M.x,y:g(M.y,{handleFormatter:e=>e.isSum||e.isIntermediateSum?null:M?.y?.handleFormatter?.(e)||null})},L={x:{axis:"x",move:!0},low:{optionName:"draggableLow",axis:"y",move:!0,resize:!0,resizeSide:"bottom",handlePositioner:e=>{let t=e.shapeArgs||e.graphic.getBBox();return{x:t.x||0,y:(t.y||0)+(t.height||0)}},handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e<=t.high},high:{optionName:"draggableHigh",axis:"y",move:!0,resize:!0,resizeSide:"top",handlePositioner:e=>{let t=e.shapeArgs||e.graphic.getBBox();return{x:t.x||0,y:t.y||0}},handleFormatter:M.y.handleFormatter,propValidate:(e,t)=>e>=t.low}},C={x:L.x,low:{optionName:"draggableLow",axis:"y",move:!0,resize:!0,resizeSide:"bottom",handlePositioner:e=>{let t=e.graphics&&e.graphics[0]&&e.graphics[0].getBBox();return t?{x:t.x+t.width/2,y:t.y+t.height/2}:{x:-999,y:-999}},handleFormatter:I,propValidate:L.low.propValidate},high:{optionName:"draggableHigh",axis:"y",move:!0,resize:!0,resizeSide:"top",handlePositioner:e=>{let t=e.graphics&&e.graphics[1]&&e.graphics[1].getBBox();return t?{x:t.x+t.width/2,y:t.y+t.height/2}:{x:-999,y:-999}},handleFormatter:I,propValidate:L.high.propValidate}},G={y:{axis:"y",move:!0},x:{optionName:"draggableX1",axis:"x",move:!0,resize:!0,resizeSide:"left",handlePositioner:e=>K(e,"x"),handleFormatter:T,propValidate:(e,t)=>e<=t.x2},x2:{optionName:"draggableX2",axis:"x",move:!0,resize:!0,resizeSide:"right",handlePositioner:e=>K(e,"x2"),handleFormatter:T,propValidate:(e,t)=>e>=t.x}};function I(e){let t=e.graphic?e.graphic.getBBox().width/2+1:4;return[["M",0-t,0],["a",t,t,0,1,0,2*t,0],["a",t,t,0,1,0,-2*t,0]]}function T(e){let t=e.shapeArgs||e.graphic.getBBox(),r=t.r||0,o=t.height-r,a=t.height/2;return[["M",0,r],["L",0,a-5],["A",1,1,0,0,0,0,a+5],["A",1,1,0,0,0,0,a-5],["M",0,a+5],["L",0,o]]}function K(e,t){let r=e.series,o=r.xAxis,a=r.yAxis,i=r.chart.inverted,n=r.columnMetrics?r.columnMetrics.offset:-e.shapeArgs.height/2,s=o.toPixels(e[t],!0),d=a.toPixels(e.y,!0);return i&&(s=o.len-s,d=a.len-d),{x:Math.round(s),y:Math.round(d+=n)}}let _={arearange:C,boxplot:X,bullet:j,column:M,columnrange:L,errorbar:Y,flags:V,gantt:{y:G.y,start:g(G.x,{optionName:"draggableStart",validateIndividualDrag:e=>!e.milestone}),end:g(G.x2,{optionName:"draggableEnd",validateIndividualDrag:e=>!e.milestone})},line:V,ohlc:k,waterfall:E,xrange:G},{addEvents:q,getNormalizedEvent:$}=c,{initDragDrop:R}=O;function U(e){let t=e.series&&e.series.chart,r=t&&t.dragDropData;t&&t.dragHandles&&!(r&&(r.isDragging&&r.draggedPastSensitivity||r.isHoveringHandle===e.id))&&t.hideDragHandles()}function W(){let e=this;setTimeout(()=>{e.series&&U(e)},10)}function Q(){let e=this;setTimeout(()=>{let t,r,o,a;return o=(r=(t=e.series)&&t.chart)&&r.dragDropData,a=r&&r.is3d&&r.is3d(),void(r&&!(o&&o.isDragging&&o.draggedPastSensitivity)&&!r.isDragDropAnimating&&t.options.dragDrop&&!a&&(r.dragHandles&&r.hideDragHandles(),e.showDragHandles()))},12)}function J(){let e=this.series.chart,t=e.dragHandles;t&&t.point===this.id&&e.hideDragHandles()}function Z(e,t,r){let o=this.series,a=o.chart,i=a.mapView,n=g(o.options.dragDrop,this.options.dragDrop),s={},l=e.points[this.id],p=1===Object.keys(r).length,h=(e,t)=>{var r;let a=t.toUpperCase(),i=o.chart.time,s=+!!o[`${t}Axis`].categories,d=n[`dragPrecision${a}`]??s,l=i.parse(n[`dragMin${a}`])??-1/0,p=i.parse(n[`dragMax${a}`])??1/0,g=e;return d&&(g=Math.round(g/d)*d),(r=g)>l?r<p?r:p:l},c=(e,t,r)=>{if(i){var o,s,d;let l=t.toUpperCase(),p=n[`dragPrecision${l}`]??0,g=i.pixelsToLonLat({x:0,y:0}),h=i.pixelsToLonLat({x:a.plotBox.width,y:a.plotBox.height}),c=n[`dragMin${l}`]??g?.[r]??-1/0,u=n[`dragMax${l}`]??h?.[r]??1/0,x=e[r];if("Orthographic"===i.projection.options.name)return x;if("lat"===r){(isNaN(c)||c>i.projection.maxLatitude)&&(c=i.projection.maxLatitude),(isNaN(u)||u<-1*i.projection.maxLatitude)&&(u=-1*i.projection.maxLatitude);let e=u;u=c,c=e}if(!i.projection.hasCoordinates){let t=i.pixelsToLonLat({x:e.chartX-a.plotLeft,y:a.plotHeight-e.chartY+a.plotTop});t&&(x=t[r])}return p&&(x=Math.round(x/p)*p),o=x,s=c,d=u,o>s?o<d?o:d:s}};for(let e of Object.keys(r)){let a=r[e],n=l.point[e],g=o[a.axis+"Axis"],u=i?c(t,a.axis,e):h(g.toValue((g.horiz?t.chartX:t.chartY)+l[e+"Offset"]),a.axis);d(u)&&!(p&&a.propValidate&&!a.propValidate(u,this))&&void 0!==n&&(s[e]=u)}return s}function ee(){let e=this,t=e.series,r=t.chart,{inverted:o,renderer:a}=r,i=g(t.options.dragDrop,e.options.dragDrop),s=t.dragDropProps||{},d=r.dragHandles;for(let l of Object.keys(s)){let p,h,c,x=s[l],m=g(u,x.handleOptions,i.dragHandle),f={class:m.className,"stroke-width":m.lineWidth,fill:m.color,stroke:m.lineColor},y=m.pathFormatter||x.handleFormatter,v=x.handlePositioner,D=!x.validateIndividualDrag||x.validateIndividualDrag(e);if(x.resize&&D&&x.resizeSide&&y&&(i["draggable"+x.axis.toUpperCase()]||i[x.optionName])&&!1!==i[x.optionName]){d?d.point=e.id:d=r.dragHandles={group:a.g("drag-drop-handles").add(t.markerGroup||t.group),point:e.id},p=v(e),f.d=c=y(e);let i=e.series.xAxis.categories?-.5:0;if(!c||p.x<i||p.y<0)continue;f.cursor=m.cursor||("x"===x.axis!=!!o?"ew-resize":"ns-resize"),(h=d[x.optionName])||(h=d[x.optionName]=a.path().add(d.group)),f.translateX=o?t.yAxis.len-p.y:p.x,f.translateY=o?t.xAxis.len-p.x:p.y,o&&(f.rotation=-90),h.attr(f),q(h.element,["touchstart","mousedown"],t=>{!function(e,t,r){let o=t.series.chart;o.zoomOrPanKeyPressed(e)||(o.mouseIsDown=!1,R(e,t),o.dragDropData.updateProp=e.updateProp=r,t.firePointEvent("dragStart",e),e.stopPropagation(),e.preventDefault())}($(t,r),e,l)},{passive:!1}),n(d.group.element,"mouseover",()=>{r.dragDropData=r.dragDropData||{},r.dragDropData.isHoveringHandle=e.id}),q(d.group.element,["touchend","mouseout"],()=>{!function(e){let t=e.series.chart;t.dragDropData&&e.id===t.dragDropData.isHoveringHandle&&delete t.dragDropData.isHoveringHandle,t.hoverPoint||U(e)}(e)})}}}function et(e){let t=this.chart,r=1/0,o=-1/0,a=1/0,i=-1/0,n;for(let t of e){let e=t.graphic&&t.graphic.getBBox()||t.shapeArgs;if(e){let s,l=t.x2;d(l)&&(s=t.series.xAxis.translate(l,!1,!1,!1,!0));let p=!(e.width||e.height||e.x||e.y);n=!0,r=Math.min(t.plotX||0,s||0,p?1/0:e.x||0,r),o=Math.max(t.plotX||0,s||0,(e.x||0)+(e.width||0),o),a=Math.min(t.plotY||0,p?1/0:e.y||0,a),i=Math.max((e.y||0)+(e.height||0),i)}}return n?t.renderer.rect(r,a,o-r,i-a):t.renderer.g()}let er=o();({compose:function(e,t){O.compose(e);let r=t.prototype;if(!r.dragDropProps){let e=t.prototype.pointClass,o=t.types,a=e.prototype;for(let t of(a.getDropValues=Z,a.showDragHandles=ee,n(e,"mouseOut",W),n(e,"mouseOver",Q),n(e,"remove",J),r.dragDropProps=_.line,r.getGuideBox=et,["arearange","boxplot","bullet","column","columnrange","errorbar","flags","gantt","ohlc","waterfall","xrange"]))o[t]&&(o[t].prototype.dragDropProps=_[t]);for(let e of["bellcurve","gauge","histogram","map","mapline","pareto","pie","sankey","sma","sunburst","treemap","vector","windbarb","wordcloud"])o[e]&&(o[e].prototype.dragDropProps=null)}}}).compose(er.Chart,er.Series);let eo=o();export{eo as default};