From 0ec73adc7b17a6257e917eadc895d0dc2ec5c176 Mon Sep 17 00:00:00 2001 From: slu Date: Sat, 26 Jan 2019 12:16:26 -0800 Subject: [PATCH] fix events after drag bug --- bundle.js | 2 +- src/components/Annotation.js | 38 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/bundle.js b/bundle.js index 651b020..cf596ce 100644 --- a/bundle.js +++ b/bundle.js @@ -1 +1 @@ -window.ReactAnnotation=function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=27)}([function(t,e){t.exports=window.React},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arcBuilder=e.pathBuilder=e.lineBuilder=void 0;var o=n(26);e.lineBuilder=function(t){var e=t.data,n=t.curve,r=void 0===n?o.curveLinear:n,i=t.canvasContext,u=t.className,a=t.classID,s=(0,o.line)().curve(r),l={type:"path",className:u,classID:a,data:e};return i?(s.context(i),l.pathMethods=s):l.attrs={d:s(e)},l},e.pathBuilder=function(t){var e=t.d,n=t.curve,r=void 0===n?o.curveLinear:n,i=t.canvasContext,u=t.className,a=t.classID,s=(0,o.line)().curve(r),l={type:"path",className:u,classID:a};return i?s.context(i):l.attrs={d:e},l},e.arcBuilder=function(t){var e=t.data,n=t.canvasContext,r={type:"path",className:t.className,classID:t.classID,data:e},i=(0,o.arc)().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return n?i.context(n):r.attrs={d:i()},r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(){for(var t=arguments.length,e=new Array(t),n=0;n2&&void 0!==arguments[2]?arguments[2]:{},p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f.default,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:h.default,m=t.disable,g=void 0===m?[]:m,O=t.connector,j=t.note,w=t.subject,P=t.x,S=t.y,M=t.dx,x=t.dy,E=t.nx,T=t.ny,k=t.color,N=t.className,C=t.onDrag,D=t.onDragStart,R=t.onDragEnd,A=t.editMode,B=t.events,q={type:{curve:s.default,line:u.default,elbow:a.default},end:{dot:l.default,arrow:c.default}};-1===g.indexOf("connector")&&(n=O&&q.type[O.type]||e,r=O&&q.end[O.end]);var X=_(t.editMode);return o.default.createElement(X,y({x:P,y:S,dx:M,dy:x,nx:E,ny:T,color:k,className:N,onDrag:C,onDragStart:D,onDragEnd:R,editMode:A},b,w,{events:B}),n&&o.default.createElement(n,O,r&&o.default.createElement(r,null)),p&&-1===g.indexOf("subject")&&o.default.createElement(p,null),j&&-1===g.indexOf("note")&&(o.default.isValidElement(j)||"function"==typeof j)?o.default.createElement(d.default,{noteDefaultProps:i,note:j}):o.default.createElement(v,y({},i,j)))};var o=p(n(0)),r=p(n(13)),i=p(n(25)),u=p(n(8)),a=p(n(6)),s=p(n(10)),l=p(n(15)),c=p(n(17)),f=p(n(5)),h=p(n(11)),d=p(n(42));function p(t){return t&&t.__esModule?t:{default:t}}function y(){return(y=Object.assign||function(t){for(var e=1;er&&l.length>1&&(l.pop(),c.push(o.default.createElement("tspan",f({key:c.length+n},a),l.join(" "))),l=[u])}return 0!==l.length&&c.push(o.default.createElement("tspan",f({key:c.length+n},a),l.join(" "))),o.default.createElement("tspan",f({},a,{key:e+n}),c)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.orientation,o=e.padding,i=e.align,u=e.dx,a=e.dy,s=e.lineType;if(!this.state.bbox.width||t.dx===this.props.dx&&t.dy===this.props.dy||!this.title&&!this.label){if(this.state.align!==t.align||this.props.orientation!==t.orientation||this.props.padding!==t.padding){var l={padding:o,bbox:this.state.bbox,offset:{x:u,y:a},orientation:n,align:i};"vertical"===s?l.orientation="leftRight":"horizontal"===s&&(l.orientation="topBottom");var c=(0,r.default)(l),f=c.x,h=c.y,d={};this.state.translateX!==f&&(d.translateX=f),this.state.translateY!==h&&(d.translateY=h),void 0===d.translateX&&void 0===d.translateY||this.setState(d)}}else{var p=_(this.title,this.label),y={padding:o,bbox:p,offset:{x:u,y:a},orientation:n,align:i};"vertical"===s?y.orientation="leftRight":"horizontal"===s&&(y.orientation="topBottom");var b=(0,r.default)(y),v=b.x,m=b.y,g={bbox:p};this.state.translateX!==v&&(g.translateX=v),this.state.translateY!==m&&(g.translateY=m),void 0===g.translateX&&void 0===g.translateY||this.setState(g)}}},{key:"render",value:function(){var t,e,n,r,s=this,l=this.props,h=l.dx,d=l.dy,p=l.title,y=l.label,_=l.align,b=l.editMode,v=l.lineType,m=l.color,g=l.titleColor,O=l.labelColor,j=l.bgPadding,w={top:0,bottom:0,left:0,right:0};if("number"==typeof j?w={top:j,bottom:j,left:j,right:j}:j&&"object"===c(j)&&(w=Object.assign(w,j)),p&&(t=o.default.createElement("text",{ref:function(t){return s.title=t},className:"annotation-note-title",fontWeight:"bold",key:"title",fill:g||m},this.state.titleWrapped||o.default.createElement("tspan",{x:0,dy:".8em"},p))),y&&(e=o.default.createElement("text",{ref:function(t){return s.label=t},className:"annotation-note-label",y:1.1*this.state.labelOffset,key:"label",fill:O||m},this.state.labelWrapped||o.default.createElement("tspan",{x:0,dy:".8em"},y))),v&&this.state.bbox.width){var P={bbox:this.state.bbox,align:_,offset:{x:h,y:d}},S=("vertical"===v&&(0,u.default)(P)||"horizontal"===v&&(0,a.default)(P)).components[0];n=o.default.createElement(S.type,f({className:S.className},S.attrs,{stroke:m}))}return b&&(r=o.default.createElement(i.default,{handleStart:this.props.dragStart,handleStop:this.props.dragEnd,handleDrag:this.props.dragNote})),o.default.createElement("g",f({transform:"translate(".concat(h,", ").concat(d,")"),className:"annotation-note"},this.props.gProps),o.default.createElement("g",{className:"annotation-note-content",transform:"translate(".concat(this.state.translateX,",\n ").concat(this.state.translateY,")"),ref:function(t){return s.note=t}},o.default.createElement("rect",{className:"annotation-note-bg",width:this.state.bbox.width+w.left+w.right,x:-w.left,y:-w.top,height:this.state.bbox.height+w.top+w.bottom,stroke:"none",fill:"white",fillOpacity:"0"}),t,e),n,r)}}])&&h(n.prototype,s),l&&h(n,l),e}();e.default=b,b.defaultProps={wrap:120,align:"dynamic",orientation:"topBottom",padding:3},b.propTypes={dx:s.default.number,dy:s.default.number,title:s.default.string,label:s.default.string,orientation:s.default.oneOf(["leftRight","topBottom"]),padding:s.default.number,bgPadding:s.default.oneOfType([s.default.number,s.default.object]),align:s.default.oneOf(["left","right","middle","top","bottom","dynamic"]),editMode:s.default.bool,lineType:s.default.oneOf(["vertical","horizontal"]),color:s.default.string,titleColor:s.default.string,labelColor:s.default.string}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=e.leftRightDynamic=function(t,e){return t&&"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},r=e.topBottomDynamic=function(t,e){return t&&"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},i=["topBottom","top","bottom"],u=["leftRight","left","right"];e.default=function(t){var e=t.padding,n=void 0===e?0:e,a=t.bbox,s=void 0===a?{x:0,y:0,width:0,height:0}:a,l=t.align,c=t.orientation,f=t.offset,h=void 0===f?{x:0,y:0}:f,d=-s.x,p=-s.y;return-1!==i.indexOf(c)?(l=r(l,h.x),h.y<0&&"topBottom"===c||"top"===c?p-=s.height+n:p+=n,"middle"===l?d-=s.width/2:"right"===l&&(d-=s.width)):-1!==u.indexOf(c)&&(l=o(l,h.y),h.x<0&&"leftRight"===c||"left"===c?d-=s.width+n:d+=n,"middle"===l?p-=s.height/2:"top"===l&&(p-=s.height)),{x:d,y:p}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=u(n(0)),r=u(n(2)),i=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(){return(s=Object.assign||function(t){for(var e=1;e0&&e>0||u<0&&e<0)&&(s=Math.abs(u)>Math.abs(e)?u/2:u),(a>0&&n>0||a<0&&n<0)&&(c=Math.abs(a)>Math.abs(n)?a/2:a),s===u/2&&c===a/2&&(s=l,c=f)),[[s,c],[l,f]]};e.default=function(t){var e=r(t);return{components:[(0,o.lineBuilder)({data:e,className:"connector"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;u(n(0));var o=u(n(30)),r=u(n(16)),i=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n2*a?"right":void 0,topBottom:e.oDeltaY<2*-a?"top":e.oDeltaY>2*a?"bottom":void 0}},s}}])&&s(n.prototype,i),u&&s(n,u),e}();e.default=h,h.propTypes={leftRight:i.default.oneOf(["left","right"]),topBottom:i.default.oneOf(["top","bottom"]),text:i.default.oneOfType([i.default.string,i.default.number]),color:i.default.string,editMode:i.default.bool}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;u(n(0));var o=u(n(35)),r=u(n(5)),i=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,["width","height","depth"]),l=s.dx,c=s.dy;i?(c||(c=i/2),l||(l=a),e="leftRight"):n&&(l||(l=n/2),c||(c=a),e="topBottom");return o.default.createElement(r.default,u({align:"middle",orientation:e,padding:10},s,{editMode:!1,dx:l,dy:c}))};var o=i(n(0)),r=i(n(11));function i(t){return t&&t.__esModule?t:{default:t}}function u(){return(u=Object.assign||function(t){for(var e=1;e1e-6)if(Math.abs(f*s-l*c)>1e-6&&i){var d=n-u,p=r-a,y=s*s+l*l,_=d*d+p*p,b=Math.sqrt(y),v=Math.sqrt(h),m=i*Math.tan((o-Math.acos((y+h-_)/(2*b*v)))/2),g=m/v,O=m/b;Math.abs(g-1)>1e-6&&(this._+="L"+(t+g*c)+","+(e+g*f)),this._+="A"+i+","+i+",0,0,"+ +(f*d>c*p)+","+(this._x1=t+O*s)+","+(this._y1=e+O*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,u,a,s){t=+t,e=+e;var l=(n=+n)*Math.cos(u),c=n*Math.sin(u),f=t+l,h=e+c,d=1^s,p=s?u-a:a-u;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+f+","+h:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+f+","+h),n&&(p<0&&(p=p%r+r),p>i?this._+="A"+n+","+n+",0,1,"+d+","+(t-l)+","+(e-c)+"A"+n+","+n+",0,1,"+d+","+(this._x1=f)+","+(this._y1=h):p>1e-6&&(this._+="A"+n+","+n+",0,"+ +(p>=o)+","+d+","+(this._x1=t+n*Math.cos(a))+","+(this._y1=e+n*Math.sin(a))))},rect:function(t,e,n,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +o+"h"+-n+"Z"},toString:function(){return this._}};var s=a,l=function(t){return function(){return t}},c=Math.abs,f=Math.atan2,h=Math.cos,d=Math.max,p=Math.min,y=Math.sin,_=Math.sqrt,b=1e-12,v=Math.PI,m=v/2,g=2*v;function O(t){return t>=1?m:t<=-1?-m:Math.asin(t)}function j(t){return t.innerRadius}function w(t){return t.outerRadius}function P(t){return t.startAngle}function S(t){return t.endAngle}function M(t){return t&&t.padAngle}function x(t,e,n,o,r,i,u){var a=t-n,s=e-o,l=(u?i:-i)/_(a*a+s*s),c=l*s,f=-l*a,h=t+c,p=e+f,y=n+c,b=o+f,v=(h+y)/2,m=(p+b)/2,g=y-h,O=b-p,j=g*g+O*O,w=r-i,P=h*b-y*p,S=(O<0?-1:1)*_(d(0,w*w*j-P*P)),M=(P*O-g*S)/j,x=(-P*g-O*S)/j,E=(P*O+g*S)/j,T=(-P*g+O*S)/j,k=M-v,N=x-m,C=E-v,D=T-m;return k*k+N*N>C*C+D*D&&(M=E,x=T),{cx:M,cy:x,x01:-c,y01:-f,x11:M*(r/w-1),y11:x*(r/w-1)}}var E=function(){var t=j,e=w,n=l(0),o=null,r=P,i=S,u=M,a=null;function d(){var l,d,j,w=+t.apply(this,arguments),P=+e.apply(this,arguments),S=r.apply(this,arguments)-m,M=i.apply(this,arguments)-m,E=c(M-S),T=M>S;if(a||(a=l=s()),Pb)if(E>g-b)a.moveTo(P*h(S),P*y(S)),a.arc(0,0,P,S,M,!T),w>b&&(a.moveTo(w*h(M),w*y(M)),a.arc(0,0,w,M,S,T));else{var k,N,C=S,D=M,R=S,A=M,B=E,q=E,X=u.apply(this,arguments)/2,Y=X>b&&(o?+o.apply(this,arguments):_(w*w+P*P)),z=p(c(P-w)/2,+n.apply(this,arguments)),I=z,L=z;if(Y>b){var W=O(Y/w*y(X)),F=O(Y/P*y(X));(B-=2*W)>b?(R+=W*=T?1:-1,A-=W):(B=0,R=A=(S+M)/2),(q-=2*F)>b?(C+=F*=T?1:-1,D-=F):(q=0,C=D=(S+M)/2)}var U=P*h(C),K=P*y(C),H=w*h(A),Q=w*y(A);if(z>b){var V=P*h(D),Z=P*y(D),G=w*h(R),J=w*y(R);if(Eb?function(t,e,n,o,r,i,u,a){var s=n-t,l=o-e,c=u-r,f=a-i,h=(c*(e-i)-f*(t-r))/(f*s-c*l);return[t+h*s,e+h*l]}(U,K,G,J,V,Z,H,Q):[H,Q],tt=U-$[0],et=K-$[1],nt=V-$[0],ot=Z-$[1],rt=1/y(((j=(tt*nt+et*ot)/(_(tt*tt+et*et)*_(nt*nt+ot*ot)))>1?0:j<-1?v:Math.acos(j))/2),it=_($[0]*$[0]+$[1]*$[1]);I=p(z,(w-it)/(rt-1)),L=p(z,(P-it)/(rt+1))}}q>b?L>b?(k=x(G,J,U,K,P,L,T),N=x(V,Z,H,Q,P,L,T),a.moveTo(k.cx+k.x01,k.cy+k.y01),Lb&&B>b?I>b?(k=x(H,Q,V,Z,w,-I,T),N=x(U,K,G,J,w,-I,T),a.lineTo(k.cx+k.x01,k.cy+k.y01),I=f;--h)a.point(b[h],v[h]);a.lineEnd(),a.areaEnd()}_&&(b[c]=+t(d,c,l),v[c]=+n(d,c,l),a.point(e?+e(d,c,l):b[c],o?+o(d,c,l):v[c]))}if(p)return a=null,p+""||null}function f(){return D().defined(r).curve(u).context(i)}return c.x=function(n){return arguments.length?(t="function"==typeof n?n:l(+n),e=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:l(+e),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:l(+t),c):e},c.y=function(t){return arguments.length?(n="function"==typeof t?t:l(+t),o=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:l(+t),c):n},c.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:l(+t),c):o},c.lineX0=c.lineY0=function(){return f().x(t).y(n)},c.lineY1=function(){return f().x(t).y(o)},c.lineX1=function(){return f().x(e).y(n)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:l(!!t),c):r},c.curve=function(t){return arguments.length?(u=t,null!=i&&(a=u(i)),c):u},c.context=function(t){return arguments.length?(null==t?i=a=null:a=u(i=t),c):i},c},A=function(t,e){return et?1:e>=t?0:NaN},B=function(t){return t},q=function(){var t=B,e=A,n=null,o=l(0),r=l(g),i=l(0);function u(u){var a,s,l,c,f,h=u.length,d=0,p=new Array(h),y=new Array(h),_=+o.apply(this,arguments),b=Math.min(g,Math.max(-g,r.apply(this,arguments)-_)),v=Math.min(Math.abs(b)/h,i.apply(this,arguments)),m=v*(b<0?-1:1);for(a=0;a0&&(d+=f);for(null!=e?p.sort(function(t,n){return e(y[t],y[n])}):null!=n&&p.sort(function(t,e){return n(u[t],u[e])}),a=0,l=d?(b-h*m)/d:0;a0?f*l:0)+m,y[s]={data:u[s],index:a,value:f,startAngle:_,endAngle:c,padAngle:v};return y}return u.value=function(e){return arguments.length?(t="function"==typeof e?e:l(+e),u):t},u.sortValues=function(t){return arguments.length?(e=t,n=null,u):e},u.sort=function(t){return arguments.length?(n=t,e=null,u):n},u.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:l(+t),u):o},u.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:l(+t),u):r},u.padAngle=function(t){return arguments.length?(i="function"==typeof t?t:l(+t),u):i},u},X=z(k);function Y(t){this._curve=t}function z(t){function e(e){return new Y(t(e))}return e._curve=t,e}function I(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(z(t)):e()._curve},t}Y.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var L=function(){return I(D().curve(X))},W=function(){var t=R().curve(X),e=t.curve,n=t.lineX0,o=t.lineX1,r=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return I(n())},delete t.lineX0,t.lineEndAngle=function(){return I(o())},delete t.lineX1,t.lineInnerRadius=function(){return I(r())},delete t.lineY0,t.lineOuterRadius=function(){return I(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(z(t)):e()._curve},t},F={draw:function(t,e){var n=Math.sqrt(e/v);t.moveTo(n,0),t.arc(0,0,n,0,g)}},U={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},K=Math.sqrt(1/3),H=2*K,Q={draw:function(t,e){var n=Math.sqrt(e/H),o=n*K;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},V=Math.sin(v/10)/Math.sin(7*v/10),Z=Math.sin(g/10)*V,G=-Math.cos(g/10)*V,J={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),o=Z*n,r=G*n;t.moveTo(0,-n),t.lineTo(o,r);for(var i=1;i<5;++i){var u=g*i/5,a=Math.cos(u),s=Math.sin(u);t.lineTo(s*n,-a*n),t.lineTo(a*o-s*r,s*o+a*r)}t.closePath()}},$={draw:function(t,e){var n=Math.sqrt(e),o=-n/2;t.rect(o,o,n,n)}},tt=Math.sqrt(3),et={draw:function(t,e){var n=-Math.sqrt(e/(3*tt));t.moveTo(0,2*n),t.lineTo(-tt*n,-n),t.lineTo(tt*n,-n),t.closePath()}},nt=Math.sqrt(3)/2,ot=1/Math.sqrt(12),rt=3*(ot/2+1),it={draw:function(t,e){var n=Math.sqrt(e/rt),o=n/2,r=n*ot,i=o,u=n*ot+n,a=-i,s=u;t.moveTo(o,r),t.lineTo(i,u),t.lineTo(a,s),t.lineTo(-.5*o-nt*r,nt*o+-.5*r),t.lineTo(-.5*i-nt*u,nt*i+-.5*u),t.lineTo(-.5*a-nt*s,nt*a+-.5*s),t.lineTo(-.5*o+nt*r,-.5*r-nt*o),t.lineTo(-.5*i+nt*u,-.5*u-nt*i),t.lineTo(-.5*a+nt*s,-.5*s-nt*a),t.closePath()}},ut=[F,U,Q,$,J,et,it],at=function(){var t=l(F),e=l(64),n=null;function o(){var o;if(n||(n=o=s()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:l(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:l(+t),o):e},o.context=function(t){return arguments.length?(n=null==t?null:t,o):n},o},st=function(){};function lt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ct(t){this._context=t}ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var ft=function(t){return new ct(t)};function ht(t){this._context=t}ht.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var dt=function(t){return new ht(t)};function pt(t){this._context=t}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,o=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var yt=function(t){return new pt(t)};function _t(t,e){this._basis=new ct(t),this._beta=e}_t.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var o,r=t[0],i=e[0],u=t[n]-r,a=e[n]-i,s=-1;++s<=n;)o=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+o*u),this._beta*e[s]+(1-this._beta)*(i+o*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var bt=function t(e){function n(t){return 1===e?new ct(t):new _t(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function vt(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:vt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function n(t){return new mt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ot(t,e){this._context=t,this._k=(1-e)/6}Ot.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var jt=function t(e){function n(t){return new Ot(t,e)}return n.tension=function(e){return t(+e)},n}(0);function wt(t,e){this._context=t,this._k=(1-e)/6}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Pt=function t(e){function n(t){return new wt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function St(t,e,n){var o=t._x1,r=t._y1,i=t._x2,u=t._y2;if(t._l01_a>b){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>b){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*l+t._x1*t._l23_2a-e*t._l12_2a)/c,u=(u*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(o,r,i,u,t._x2,t._y2)}function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:St(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function n(t){return e?new Mt(t,e):new mt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Et(t,e){this._context=t,this._alpha=e}Et.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:St(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function n(t){return e?new Et(t,e):new Ot(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:St(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Nt=function t(e){function n(t){return e?new kt(t,e):new wt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ct(t){this._context=t}Ct.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var Dt=function(t){return new Ct(t)};function Rt(t){return t<0?-1:1}function At(t,e,n){var o=t._x1-t._x0,r=e-t._x1,i=(t._y1-t._y0)/(o||r<0&&-0),u=(n-t._y1)/(r||o<0&&-0),a=(i*r+u*o)/(o+r);return(Rt(i)+Rt(u))*Math.min(Math.abs(i),Math.abs(u),.5*Math.abs(a))||0}function Bt(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qt(t,e,n){var o=t._x0,r=t._y0,i=t._x1,u=t._y1,a=(i-o)/3;t._context.bezierCurveTo(o+a,r+a*e,i-a,u-a*n,i,u)}function Xt(t){this._context=t}function Yt(t){this._context=new zt(t)}function zt(t){this._context=t}function It(t){return new Xt(t)}function Lt(t){return new Yt(t)}function Wt(t){this._context=t}function Ft(t){var e,n,o=t.length-1,r=new Array(o),i=new Array(o),u=new Array(o);for(r[0]=0,i[0]=2,u[0]=t[0]+2*t[1],e=1;e=0;--e)r[e]=(u[e]-r[e+1])/i[e];for(i[o-1]=(t[o]+r[o-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Ht=function(t){return new Kt(t,.5)};function Qt(t){return new Kt(t,0)}function Vt(t){return new Kt(t,1)}var Zt=Array.prototype.slice,Gt=function(t,e){if((o=t.length)>1)for(var n,o,r=1,i=t[e[0]],u=i.length;r=0;)n[e]=e;return n};function $t(t,e){return t[e]}var te=function(){var t=l([]),e=Jt,n=Gt,o=$t;function r(r){var i,u,a=t.apply(this,arguments),s=r.length,l=a.length,c=new Array(l);for(i=0;i0){for(var n,o,r,i=0,u=t[0].length;i0){for(var n,o=0,r=t[e[0]],i=r.length;o0&&(o=(n=t[e[0]]).length)>0){for(var n,o,r,i=0,u=1;u1&&void 0!==arguments[1]?arguments[1]:2,n=t.x/(e+1),o=t.y/(e+1),r=[],i=1;i<=e;i++)r.push([n*i+i%2*20,o*i-i%2*20]);return r}({x:s,y:l},n)),e||(e=i.curveCatmullRom);var p=(0,r.lineSetup)({x:u,y:a,dx:s,dy:l,radius:c,outerRadius:f,width:h,height:d});return p=[p[0]].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&e>0||a<0&&e<0)&&(l=Math.abs(a)>Math.abs(e)?a/2:a),(s>0&&n>0||s<0&&n<0)&&(f=Math.abs(s)>Math.abs(n)?s/2:s),l===a/2&&f===s/2&&(l=c,f=h));var d=[[l,f],[c,h]],p=h-f,y=c-l,_=c,b=h,v=hl||cf?-1:1;if(Math.abs(y)g&&Math.abs(p)>g)d=[[l=g*(c<0?-1:1),f=g*(h<0?-1:1)],[_,b],[c,h]];else if(Math.abs(y)>Math.abs(p)){var O=Math.asin(-h/m);d=[[l=Math.abs(Math.cos(O)*m)*(c<0?-1:1),h],[c,h]]}else{var j=Math.acos(c/m);d=[[c,f=Math.abs(Math.sin(j)*m)*(h<0?-1:1)],[c,h]]}}else d=[[l,f],[_,b],[c,h]];return{components:[(0,o.lineBuilder)({data:d,className:"connector"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.lineData,n=t.scale,r=void 0===n?1:n,i=(0,o.arcBuilder)({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(r)}});return i.attrs.transform="translate("+e[0][0]+", "+e[0][1]+")",{components:[i]}}},function(t,e,n){"use strict";var o=n(32);function r(){}t.exports=function(){function t(t,e,n,r,i,u){if(u!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.dx,n=t.dy,r=t.start,i=t.end,u=t.scale,a=void 0===u?1:u;r=r?[-i[0]+r[0],-i[1]+r[1]]:[e,n],i||(i=[0,0]);var s=i[0],l=i[1],c=10*a,f=16/180*Math.PI,h=Math.atan(r[1]/r[0]);r[0]<0&&(h+=Math.PI);var d=[[s,l],[Math.cos(h+f)*c+s,Math.sin(h+f)*c+l],[Math.cos(h-f)*c+s,Math.sin(h-f)*c+l],[s,l]];return{components:[(0,o.lineBuilder)({data:d,className:"connector-end connector-arrow",classID:"connector-end"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.radius,n=void 0===e?14:e,r=t.leftRight,i=t.topBottom,u=t.text,a=t.color,s=t.editMode,l=[],c=[],f=.7*n,h=0,d=0,p=Math.sqrt(2)*n,y={xleftcorner:-n,xrightcorner:n,ytopcorner:-n,ybottomcorner:n,xleft:-p,xright:p,ytop:-p,ybottom:p};r&&!i?h=y["x"+r]:i&&!r?d=y["y"+i]:r&&i&&(h=y["x"+r+"corner"],d=y["y"+i+"corner"]);var _="translate("+h+", "+d+")",b=(0,o.arcBuilder)({className:"subject",data:{radius:n}});b.attrs.transform=_,b.attrs.fill=a,b.attrs["stroke-linecap"]="round",b.attrs["stroke-width"]="3px";var v=(0,o.arcBuilder)({className:"subject-ring",data:{outerRadius:n,innerRadius:f}});v.attrs.transform=_,v.attrs["stroke-width"]="3px",v.attrs.fill="white";var m=void 0;if(h&&d||!h&&!d)m=(0,o.lineBuilder)({className:"subject-pointer",data:[[0,0],[h||0,0],[0,d||0],[0,0]]});else if(h||d){var g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*n/Math.sqrt(2)};m=(0,o.lineBuilder)({className:"subject-pointer",data:[[0,0],[g(h),g(d)],[g(h,-1),g(d,-1)],[0,0]]})}if(m&&(m.attrs.fill=a,m.attrs["stroke-linecap"]="round",m.attrs["stroke-width"]="3px",c.push(m)),s){var O={x:2*h,y:2*d,offsetParent:!0};O.x||O.y||(O.y=-n),l=[O]}var j=void 0;return u&&(j={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:u,"text-anchor":"middle",dy:".25em",x:h,y:d}}),c.push(b),c.push(v),c.push(j),{components:c,handles:l}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circleHandles=void 0;var o=n(1),r=e.circleHandles=function(t){var e=t.cx,n=void 0===e?0:e,o=t.cy,r=void 0===o?0:o,i=t.r1,u=t.r2,a=t.padding,s={move:{x:n,y:r}};return void 0!==i&&(s.r1={x:n+i/Math.sqrt(2),y:r+i/Math.sqrt(2)}),void 0!==u&&(s.r2={x:n+u/Math.sqrt(2),y:r+u/Math.sqrt(2)}),void 0!==a&&(s.padding={x:n+i+a,y:r}),s};e.default=function(t){var e=t.radius,n=t.radiusPadding,i=t.outerRadius,u=t.innerRadius,a=t.editMode,s=[],l=(0,o.arcBuilder)({data:{radius:e,outerRadius:i,innerRadius:u},className:"subject"});if(a){var c=r({r1:l.data.outerRadius||l.data.radius,r2:l.data.innerRadius,padding:n}),f=[{x:c.r1.x,y:c.r1.y,key:l.data.outerRadius?"outerRadius":"radius"}];u&&f.push({x:c.r2.x,y:c.r2.y,key:"innerRadius"}),s=f}return l.attrs["fill-opacity"]=0,{components:[l],handles:s}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.width,n=void 0===e?100:e,r=t.height,i=void 0===r?100:r,u=t.editMode,a=[],s=[[0,0],[n,0],[n,i],[0,i],[0,0]],l=(0,o.lineBuilder)({data:s,className:"subject"});return u&&(a=[{x:n,y:i/2,key:"width"},{x:n/2,y:i,key:"height"}]),l.attrs["fill-opacity"]=.1,{components:[l],handles:a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.x1,n=t.x2,r=t.y1,i=t.y2,u=t.x,a=t.y,s=[[e=(void 0!==e?e:u)-u,r=(void 0!==r?r:a)-a],[n=(void 0!==n?n:u)-u,i=(void 0!==i?i:a)-a]];return{components:[(0,o.lineBuilder)({data:s,className:"subject"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e,n,r,i,u,a,s,l,c,f,h,d=t.height,p=t.width,y=t.depth,_=t.type,b=t.editMode,v=[],m=void 0,g=void 0;return"square"===_?(d?m=[[0,0],[y,0],[y,d],[0,d]]:p&&(m=[[0,0],[0,y],[p,y],[p,0]]),g=(0,o.lineBuilder)({data:m,className:"subject"})):"curly"===_&&(g=(0,o.pathBuilder)({d:(e=0,n=0,r=p||0,i=d||0,u=d&&d>0||p&&p<0?-y:y,a=.55,s=e-r,l=n-i,c=Math.sqrt(s*s+l*l),f=e-.5*c*(s/=c)+u*(l/=c),h=n-.5*c*l-u*s,"M "+e+" "+n+" Q "+(e+a*u*l)+" "+(n-a*u*s)+" "+(e-.25*c*s+(1-a)*u*l)+" "+(n-.25*c*l-(1-a)*u*s)+" T "+f+" "+h+" M "+r+" "+i+" Q "+(r+a*u*l)+" "+(i-a*u*s)+" "+(e-.75*c*s+(1-a)*u*l)+" "+(n-.75*c*l-(1-a)*u*s)+" T "+f+" "+h),className:"subject"})),b&&(v=[{x:d?y:p/2,y:d?d/2:y,key:"depth",type:d?"X":"Y"},{x:p||0,y:d||0,key:d?"height":"width"}]),g.attrs["fill-opacity"]=.1,{components:[g],handles:v}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(12);e.default=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,u=t.y,a=void 0===u?0:u,s=t.bbox,l=t.offset;"top"===(e=(0,r.leftRightDynamic)(e,l.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var c=[[i,a],[i,a+s.height]];return{components:[(0,o.lineBuilder)({data:c,className:"note-line"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(12);e.default=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,u=t.y,a=void 0===u?0:u,s=t.offset,l=t.bbox;"right"===(e=(0,r.topBottomDynamic)(e,s.x))?i-=l.width:"middle"===e&&(i-=l.width/2);var c=[[i,a],[i+l.width,a]];return{components:[(0,o.lineBuilder)({data:c,className:"note-line"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=(0,o.default)("label",t.className);return(0,r.default)(function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f.default,b=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},v=arguments.length>5&&void 0!==arguments[5]?arguments[5]:h.default,m=t.disable,g=void 0===m?[]:m,O=t.connector,j=t.note,w=t.subject,P=t.x,S=t.y,M=t.dx,x=t.dy,E=t.nx,T=t.ny,k=t.color,N=t.className,C=t.onDrag,D=t.onDragStart,R=t.onDragEnd,A=t.editMode,B=t.events,q={type:{curve:s.default,line:u.default,elbow:a.default},end:{dot:l.default,arrow:c.default}};-1===g.indexOf("connector")&&(n=O&&q.type[O.type]||e,r=O&&q.end[O.end]);var X=_(t.editMode);return o.default.createElement(X,y({x:P,y:S,dx:M,dy:x,nx:E,ny:T,color:k,className:N,onDrag:C,onDragStart:D,onDragEnd:R,editMode:A},b,w,{events:B}),n&&o.default.createElement(n,O,r&&o.default.createElement(r,null)),p&&-1===g.indexOf("subject")&&o.default.createElement(p,null),j&&-1===g.indexOf("note")&&(o.default.isValidElement(j)||"function"==typeof j)?o.default.createElement(d.default,{noteDefaultProps:i,note:j}):o.default.createElement(v,y({},i,j)))};var o=p(n(0)),r=p(n(13)),i=p(n(25)),u=p(n(8)),a=p(n(6)),s=p(n(10)),l=p(n(15)),c=p(n(17)),f=p(n(5)),h=p(n(11)),d=p(n(42));function p(t){return t&&t.__esModule?t:{default:t}}function y(){return(y=Object.assign||function(t){for(var e=1;er&&l.length>1&&(l.pop(),c.push(o.default.createElement("tspan",f({key:c.length+n},a),l.join(" "))),l=[u])}return 0!==l.length&&c.push(o.default.createElement("tspan",f({key:c.length+n},a),l.join(" "))),o.default.createElement("tspan",f({},a,{key:e+n}),c)}},{key:"componentDidUpdate",value:function(t){var e=this.props,n=e.orientation,o=e.padding,i=e.align,u=e.dx,a=e.dy,s=e.lineType;if(!this.state.bbox.width||t.dx===this.props.dx&&t.dy===this.props.dy||!this.title&&!this.label){if(this.state.align!==t.align||this.props.orientation!==t.orientation||this.props.padding!==t.padding){var l={padding:o,bbox:this.state.bbox,offset:{x:u,y:a},orientation:n,align:i};"vertical"===s?l.orientation="leftRight":"horizontal"===s&&(l.orientation="topBottom");var c=(0,r.default)(l),f=c.x,h=c.y,d={};this.state.translateX!==f&&(d.translateX=f),this.state.translateY!==h&&(d.translateY=h),void 0===d.translateX&&void 0===d.translateY||this.setState(d)}}else{var p=_(this.title,this.label),y={padding:o,bbox:p,offset:{x:u,y:a},orientation:n,align:i};"vertical"===s?y.orientation="leftRight":"horizontal"===s&&(y.orientation="topBottom");var b=(0,r.default)(y),v=b.x,m=b.y,g={bbox:p};this.state.translateX!==v&&(g.translateX=v),this.state.translateY!==m&&(g.translateY=m),void 0===g.translateX&&void 0===g.translateY||this.setState(g)}}},{key:"render",value:function(){var t,e,n,r,s=this,l=this.props,h=l.dx,d=l.dy,p=l.title,y=l.label,_=l.align,b=l.editMode,v=l.lineType,m=l.color,g=l.titleColor,O=l.labelColor,j=l.bgPadding,w={top:0,bottom:0,left:0,right:0};if("number"==typeof j?w={top:j,bottom:j,left:j,right:j}:j&&"object"===c(j)&&(w=Object.assign(w,j)),p&&(t=o.default.createElement("text",{ref:function(t){return s.title=t},className:"annotation-note-title",fontWeight:"bold",key:"title",fill:g||m},this.state.titleWrapped||o.default.createElement("tspan",{x:0,dy:".8em"},p))),y&&(e=o.default.createElement("text",{ref:function(t){return s.label=t},className:"annotation-note-label",y:1.1*this.state.labelOffset,key:"label",fill:O||m},this.state.labelWrapped||o.default.createElement("tspan",{x:0,dy:".8em"},y))),v&&this.state.bbox.width){var P={bbox:this.state.bbox,align:_,offset:{x:h,y:d}},S=("vertical"===v&&(0,u.default)(P)||"horizontal"===v&&(0,a.default)(P)).components[0];n=o.default.createElement(S.type,f({className:S.className},S.attrs,{stroke:m}))}return b&&(r=o.default.createElement(i.default,{handleStart:this.props.dragStart,handleStop:this.props.dragEnd,handleDrag:this.props.dragNote})),o.default.createElement("g",f({transform:"translate(".concat(h,", ").concat(d,")"),className:"annotation-note"},this.props.gProps),o.default.createElement("g",{className:"annotation-note-content",transform:"translate(".concat(this.state.translateX,",\n ").concat(this.state.translateY,")"),ref:function(t){return s.note=t}},o.default.createElement("rect",{className:"annotation-note-bg",width:this.state.bbox.width+w.left+w.right,x:-w.left,y:-w.top,height:this.state.bbox.height+w.top+w.bottom,stroke:"none",fill:"white",fillOpacity:"0"}),t,e),n,r)}}])&&h(n.prototype,s),l&&h(n,l),e}();e.default=b,b.defaultProps={wrap:120,align:"dynamic",orientation:"topBottom",padding:3},b.propTypes={dx:s.default.number,dy:s.default.number,title:s.default.string,label:s.default.string,orientation:s.default.oneOf(["leftRight","topBottom"]),padding:s.default.number,bgPadding:s.default.oneOfType([s.default.number,s.default.object]),align:s.default.oneOf(["left","right","middle","top","bottom","dynamic"]),editMode:s.default.bool,lineType:s.default.oneOf(["vertical","horizontal"]),color:s.default.string,titleColor:s.default.string,labelColor:s.default.string}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=e.leftRightDynamic=function(t,e){return t&&"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},r=e.topBottomDynamic=function(t,e){return t&&"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},i=["topBottom","top","bottom"],u=["leftRight","left","right"];e.default=function(t){var e=t.padding,n=void 0===e?0:e,a=t.bbox,s=void 0===a?{x:0,y:0,width:0,height:0}:a,l=t.align,c=t.orientation,f=t.offset,h=void 0===f?{x:0,y:0}:f,d=-s.x,p=-s.y;return-1!==i.indexOf(c)?(l=r(l,h.x),h.y<0&&"topBottom"===c||"top"===c?p-=s.height+n:p+=n,"middle"===l?d-=s.width/2:"right"===l&&(d-=s.width)):-1!==u.indexOf(c)&&(l=o(l,h.y),h.x<0&&"leftRight"===c||"left"===c?d-=s.width+n:d+=n,"middle"===l?p-=s.height/2:"top"===l&&(p-=s.height)),{x:d,y:p}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=u(n(0)),r=u(n(2)),i=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(){return(s=Object.assign||function(t){for(var e=1;e0&&e>0||u<0&&e<0)&&(s=Math.abs(u)>Math.abs(e)?u/2:u),(a>0&&n>0||a<0&&n<0)&&(c=Math.abs(a)>Math.abs(n)?a/2:a),s===u/2&&c===a/2&&(s=l,c=f)),[[s,c],[l,f]]};e.default=function(t){var e=r(t);return{components:[(0,o.lineBuilder)({data:e,className:"connector"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;u(n(0));var o=u(n(30)),r=u(n(16)),i=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n2*a?"right":void 0,topBottom:e.oDeltaY<2*-a?"top":e.oDeltaY>2*a?"bottom":void 0}},s}}])&&s(n.prototype,i),u&&s(n,u),e}();e.default=h,h.propTypes={leftRight:i.default.oneOf(["left","right"]),topBottom:i.default.oneOf(["top","bottom"]),text:i.default.oneOfType([i.default.string,i.default.number]),color:i.default.string,editMode:i.default.bool}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;u(n(0));var o=u(n(35)),r=u(n(5)),i=u(n(3));function u(t){return t&&t.__esModule?t:{default:t}}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){for(var n=0;n=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(t,["width","height","depth"]),l=s.dx,c=s.dy;i?(c||(c=i/2),l||(l=a),e="leftRight"):n&&(l||(l=n/2),c||(c=a),e="topBottom");return o.default.createElement(r.default,u({align:"middle",orientation:e,padding:10},s,{editMode:!1,dx:l,dy:c}))};var o=i(n(0)),r=i(n(11));function i(t){return t&&t.__esModule?t:{default:t}}function u(){return(u=Object.assign||function(t){for(var e=1;e1e-6)if(Math.abs(f*s-l*c)>1e-6&&i){var d=n-u,p=r-a,y=s*s+l*l,_=d*d+p*p,b=Math.sqrt(y),v=Math.sqrt(h),m=i*Math.tan((o-Math.acos((y+h-_)/(2*b*v)))/2),g=m/v,O=m/b;Math.abs(g-1)>1e-6&&(this._+="L"+(t+g*c)+","+(e+g*f)),this._+="A"+i+","+i+",0,0,"+ +(f*d>c*p)+","+(this._x1=t+O*s)+","+(this._y1=e+O*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,u,a,s){t=+t,e=+e;var l=(n=+n)*Math.cos(u),c=n*Math.sin(u),f=t+l,h=e+c,d=1^s,p=s?u-a:a-u;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+f+","+h:(Math.abs(this._x1-f)>1e-6||Math.abs(this._y1-h)>1e-6)&&(this._+="L"+f+","+h),n&&(p<0&&(p=p%r+r),p>i?this._+="A"+n+","+n+",0,1,"+d+","+(t-l)+","+(e-c)+"A"+n+","+n+",0,1,"+d+","+(this._x1=f)+","+(this._y1=h):p>1e-6&&(this._+="A"+n+","+n+",0,"+ +(p>=o)+","+d+","+(this._x1=t+n*Math.cos(a))+","+(this._y1=e+n*Math.sin(a))))},rect:function(t,e,n,o){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +o+"h"+-n+"Z"},toString:function(){return this._}};var s=a,l=function(t){return function(){return t}},c=Math.abs,f=Math.atan2,h=Math.cos,d=Math.max,p=Math.min,y=Math.sin,_=Math.sqrt,b=1e-12,v=Math.PI,m=v/2,g=2*v;function O(t){return t>=1?m:t<=-1?-m:Math.asin(t)}function j(t){return t.innerRadius}function w(t){return t.outerRadius}function P(t){return t.startAngle}function S(t){return t.endAngle}function M(t){return t&&t.padAngle}function x(t,e,n,o,r,i,u){var a=t-n,s=e-o,l=(u?i:-i)/_(a*a+s*s),c=l*s,f=-l*a,h=t+c,p=e+f,y=n+c,b=o+f,v=(h+y)/2,m=(p+b)/2,g=y-h,O=b-p,j=g*g+O*O,w=r-i,P=h*b-y*p,S=(O<0?-1:1)*_(d(0,w*w*j-P*P)),M=(P*O-g*S)/j,x=(-P*g-O*S)/j,E=(P*O+g*S)/j,T=(-P*g+O*S)/j,k=M-v,N=x-m,C=E-v,D=T-m;return k*k+N*N>C*C+D*D&&(M=E,x=T),{cx:M,cy:x,x01:-c,y01:-f,x11:M*(r/w-1),y11:x*(r/w-1)}}var E=function(){var t=j,e=w,n=l(0),o=null,r=P,i=S,u=M,a=null;function d(){var l,d,j,w=+t.apply(this,arguments),P=+e.apply(this,arguments),S=r.apply(this,arguments)-m,M=i.apply(this,arguments)-m,E=c(M-S),T=M>S;if(a||(a=l=s()),Pb)if(E>g-b)a.moveTo(P*h(S),P*y(S)),a.arc(0,0,P,S,M,!T),w>b&&(a.moveTo(w*h(M),w*y(M)),a.arc(0,0,w,M,S,T));else{var k,N,C=S,D=M,R=S,A=M,B=E,q=E,X=u.apply(this,arguments)/2,Y=X>b&&(o?+o.apply(this,arguments):_(w*w+P*P)),z=p(c(P-w)/2,+n.apply(this,arguments)),I=z,L=z;if(Y>b){var W=O(Y/w*y(X)),F=O(Y/P*y(X));(B-=2*W)>b?(R+=W*=T?1:-1,A-=W):(B=0,R=A=(S+M)/2),(q-=2*F)>b?(C+=F*=T?1:-1,D-=F):(q=0,C=D=(S+M)/2)}var U=P*h(C),K=P*y(C),H=w*h(A),Q=w*y(A);if(z>b){var V=P*h(D),Z=P*y(D),G=w*h(R),J=w*y(R);if(Eb?function(t,e,n,o,r,i,u,a){var s=n-t,l=o-e,c=u-r,f=a-i,h=(c*(e-i)-f*(t-r))/(f*s-c*l);return[t+h*s,e+h*l]}(U,K,G,J,V,Z,H,Q):[H,Q],tt=U-$[0],et=K-$[1],nt=V-$[0],ot=Z-$[1],rt=1/y(((j=(tt*nt+et*ot)/(_(tt*tt+et*et)*_(nt*nt+ot*ot)))>1?0:j<-1?v:Math.acos(j))/2),it=_($[0]*$[0]+$[1]*$[1]);I=p(z,(w-it)/(rt-1)),L=p(z,(P-it)/(rt+1))}}q>b?L>b?(k=x(G,J,U,K,P,L,T),N=x(V,Z,H,Q,P,L,T),a.moveTo(k.cx+k.x01,k.cy+k.y01),Lb&&B>b?I>b?(k=x(H,Q,V,Z,w,-I,T),N=x(U,K,G,J,w,-I,T),a.lineTo(k.cx+k.x01,k.cy+k.y01),I=f;--h)a.point(b[h],v[h]);a.lineEnd(),a.areaEnd()}_&&(b[c]=+t(d,c,l),v[c]=+n(d,c,l),a.point(e?+e(d,c,l):b[c],o?+o(d,c,l):v[c]))}if(p)return a=null,p+""||null}function f(){return D().defined(r).curve(u).context(i)}return c.x=function(n){return arguments.length?(t="function"==typeof n?n:l(+n),e=null,c):t},c.x0=function(e){return arguments.length?(t="function"==typeof e?e:l(+e),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:l(+t),c):e},c.y=function(t){return arguments.length?(n="function"==typeof t?t:l(+t),o=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:l(+t),c):n},c.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:l(+t),c):o},c.lineX0=c.lineY0=function(){return f().x(t).y(n)},c.lineY1=function(){return f().x(t).y(o)},c.lineX1=function(){return f().x(e).y(n)},c.defined=function(t){return arguments.length?(r="function"==typeof t?t:l(!!t),c):r},c.curve=function(t){return arguments.length?(u=t,null!=i&&(a=u(i)),c):u},c.context=function(t){return arguments.length?(null==t?i=a=null:a=u(i=t),c):i},c},A=function(t,e){return et?1:e>=t?0:NaN},B=function(t){return t},q=function(){var t=B,e=A,n=null,o=l(0),r=l(g),i=l(0);function u(u){var a,s,l,c,f,h=u.length,d=0,p=new Array(h),y=new Array(h),_=+o.apply(this,arguments),b=Math.min(g,Math.max(-g,r.apply(this,arguments)-_)),v=Math.min(Math.abs(b)/h,i.apply(this,arguments)),m=v*(b<0?-1:1);for(a=0;a0&&(d+=f);for(null!=e?p.sort(function(t,n){return e(y[t],y[n])}):null!=n&&p.sort(function(t,e){return n(u[t],u[e])}),a=0,l=d?(b-h*m)/d:0;a0?f*l:0)+m,y[s]={data:u[s],index:a,value:f,startAngle:_,endAngle:c,padAngle:v};return y}return u.value=function(e){return arguments.length?(t="function"==typeof e?e:l(+e),u):t},u.sortValues=function(t){return arguments.length?(e=t,n=null,u):e},u.sort=function(t){return arguments.length?(n=t,e=null,u):n},u.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:l(+t),u):o},u.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:l(+t),u):r},u.padAngle=function(t){return arguments.length?(i="function"==typeof t?t:l(+t),u):i},u},X=z(k);function Y(t){this._curve=t}function z(t){function e(e){return new Y(t(e))}return e._curve=t,e}function I(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(z(t)):e()._curve},t}Y.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var L=function(){return I(D().curve(X))},W=function(){var t=R().curve(X),e=t.curve,n=t.lineX0,o=t.lineX1,r=t.lineY0,i=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return I(n())},delete t.lineX0,t.lineEndAngle=function(){return I(o())},delete t.lineX1,t.lineInnerRadius=function(){return I(r())},delete t.lineY0,t.lineOuterRadius=function(){return I(i())},delete t.lineY1,t.curve=function(t){return arguments.length?e(z(t)):e()._curve},t},F={draw:function(t,e){var n=Math.sqrt(e/v);t.moveTo(n,0),t.arc(0,0,n,0,g)}},U={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},K=Math.sqrt(1/3),H=2*K,Q={draw:function(t,e){var n=Math.sqrt(e/H),o=n*K;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},V=Math.sin(v/10)/Math.sin(7*v/10),Z=Math.sin(g/10)*V,G=-Math.cos(g/10)*V,J={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),o=Z*n,r=G*n;t.moveTo(0,-n),t.lineTo(o,r);for(var i=1;i<5;++i){var u=g*i/5,a=Math.cos(u),s=Math.sin(u);t.lineTo(s*n,-a*n),t.lineTo(a*o-s*r,s*o+a*r)}t.closePath()}},$={draw:function(t,e){var n=Math.sqrt(e),o=-n/2;t.rect(o,o,n,n)}},tt=Math.sqrt(3),et={draw:function(t,e){var n=-Math.sqrt(e/(3*tt));t.moveTo(0,2*n),t.lineTo(-tt*n,-n),t.lineTo(tt*n,-n),t.closePath()}},nt=Math.sqrt(3)/2,ot=1/Math.sqrt(12),rt=3*(ot/2+1),it={draw:function(t,e){var n=Math.sqrt(e/rt),o=n/2,r=n*ot,i=o,u=n*ot+n,a=-i,s=u;t.moveTo(o,r),t.lineTo(i,u),t.lineTo(a,s),t.lineTo(-.5*o-nt*r,nt*o+-.5*r),t.lineTo(-.5*i-nt*u,nt*i+-.5*u),t.lineTo(-.5*a-nt*s,nt*a+-.5*s),t.lineTo(-.5*o+nt*r,-.5*r-nt*o),t.lineTo(-.5*i+nt*u,-.5*u-nt*i),t.lineTo(-.5*a+nt*s,-.5*s-nt*a),t.closePath()}},ut=[F,U,Q,$,J,et,it],at=function(){var t=l(F),e=l(64),n=null;function o(){var o;if(n||(n=o=s()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),o)return n=null,o+""||null}return o.type=function(e){return arguments.length?(t="function"==typeof e?e:l(e),o):t},o.size=function(t){return arguments.length?(e="function"==typeof t?t:l(+t),o):e},o.context=function(t){return arguments.length?(n=null==t?null:t,o):n},o},st=function(){};function lt(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function ct(t){this._context=t}ct.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:lt(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var ft=function(t){return new ct(t)};function ht(t){this._context=t}ht.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var dt=function(t){return new ht(t)};function pt(t){this._context=t}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,o=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,o):this._context.moveTo(n,o);break;case 3:this._point=4;default:lt(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var yt=function(t){return new pt(t)};function _t(t,e){this._basis=new ct(t),this._beta=e}_t.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var o,r=t[0],i=e[0],u=t[n]-r,a=e[n]-i,s=-1;++s<=n;)o=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(r+o*u),this._beta*e[s]+(1-this._beta)*(i+o*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var bt=function t(e){function n(t){return 1===e?new ct(t):new _t(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function vt(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function mt(t,e){this._context=t,this._k=(1-e)/6}mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:vt(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:vt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gt=function t(e){function n(t){return new mt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Ot(t,e){this._context=t,this._k=(1-e)/6}Ot.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var jt=function t(e){function n(t){return new Ot(t,e)}return n.tension=function(e){return t(+e)},n}(0);function wt(t,e){this._context=t,this._k=(1-e)/6}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vt(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Pt=function t(e){function n(t){return new wt(t,e)}return n.tension=function(e){return t(+e)},n}(0);function St(t,e,n){var o=t._x1,r=t._y1,i=t._x2,u=t._y2;if(t._l01_a>b){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>b){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*l+t._x1*t._l23_2a-e*t._l12_2a)/c,u=(u*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(o,r,i,u,t._x2,t._y2)}function Mt(t,e){this._context=t,this._alpha=e}Mt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:St(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xt=function t(e){function n(t){return e?new Mt(t,e):new mt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Et(t,e){this._context=t,this._alpha=e}Et.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:St(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Tt=function t(e){function n(t){return e?new Et(t,e):new Ot(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function kt(t,e){this._context=t,this._alpha=e}kt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:St(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Nt=function t(e){function n(t){return e?new kt(t,e):new wt(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ct(t){this._context=t}Ct.prototype={areaStart:st,areaEnd:st,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var Dt=function(t){return new Ct(t)};function Rt(t){return t<0?-1:1}function At(t,e,n){var o=t._x1-t._x0,r=e-t._x1,i=(t._y1-t._y0)/(o||r<0&&-0),u=(n-t._y1)/(r||o<0&&-0),a=(i*r+u*o)/(o+r);return(Rt(i)+Rt(u))*Math.min(Math.abs(i),Math.abs(u),.5*Math.abs(a))||0}function Bt(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qt(t,e,n){var o=t._x0,r=t._y0,i=t._x1,u=t._y1,a=(i-o)/3;t._context.bezierCurveTo(o+a,r+a*e,i-a,u-a*n,i,u)}function Xt(t){this._context=t}function Yt(t){this._context=new zt(t)}function zt(t){this._context=t}function It(t){return new Xt(t)}function Lt(t){return new Yt(t)}function Wt(t){this._context=t}function Ft(t){var e,n,o=t.length-1,r=new Array(o),i=new Array(o),u=new Array(o);for(r[0]=0,i[0]=2,u[0]=t[0]+2*t[1],e=1;e=0;--e)r[e]=(u[e]-r[e+1])/i[e];for(i[o-1]=(t[o]+r[o-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Ht=function(t){return new Kt(t,.5)};function Qt(t){return new Kt(t,0)}function Vt(t){return new Kt(t,1)}var Zt=Array.prototype.slice,Gt=function(t,e){if((o=t.length)>1)for(var n,o,r=1,i=t[e[0]],u=i.length;r=0;)n[e]=e;return n};function $t(t,e){return t[e]}var te=function(){var t=l([]),e=Jt,n=Gt,o=$t;function r(r){var i,u,a=t.apply(this,arguments),s=r.length,l=a.length,c=new Array(l);for(i=0;i0){for(var n,o,r,i=0,u=t[0].length;i0){for(var n,o=0,r=t[e[0]],i=r.length;o0&&(o=(n=t[e[0]]).length)>0){for(var n,o,r,i=0,u=1;u1&&void 0!==arguments[1]?arguments[1]:2,n=t.x/(e+1),o=t.y/(e+1),r=[],i=1;i<=e;i++)r.push([n*i+i%2*20,o*i-i%2*20]);return r}({x:s,y:l},n)),e||(e=i.curveCatmullRom);var p=(0,r.lineSetup)({x:u,y:a,dx:s,dy:l,radius:c,outerRadius:f,width:h,height:d});return p=[p[0]].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e0&&e>0||a<0&&e<0)&&(l=Math.abs(a)>Math.abs(e)?a/2:a),(s>0&&n>0||s<0&&n<0)&&(f=Math.abs(s)>Math.abs(n)?s/2:s),l===a/2&&f===s/2&&(l=c,f=h));var d=[[l,f],[c,h]],p=h-f,y=c-l,_=c,b=h,v=hl||cf?-1:1;if(Math.abs(y)g&&Math.abs(p)>g)d=[[l=g*(c<0?-1:1),f=g*(h<0?-1:1)],[_,b],[c,h]];else if(Math.abs(y)>Math.abs(p)){var O=Math.asin(-h/m);d=[[l=Math.abs(Math.cos(O)*m)*(c<0?-1:1),h],[c,h]]}else{var j=Math.acos(c/m);d=[[c,f=Math.abs(Math.sin(j)*m)*(h<0?-1:1)],[c,h]]}}else d=[[l,f],[_,b],[c,h]];return{components:[(0,o.lineBuilder)({data:d,className:"connector"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.lineData,n=t.scale,r=void 0===n?1:n,i=(0,o.arcBuilder)({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(r)}});return i.attrs.transform="translate("+e[0][0]+", "+e[0][1]+")",{components:[i]}}},function(t,e,n){"use strict";var o=n(32);function r(){}t.exports=function(){function t(t,e,n,r,i,u){if(u!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=r,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.dx,n=t.dy,r=t.start,i=t.end,u=t.scale,a=void 0===u?1:u;r=r?[-i[0]+r[0],-i[1]+r[1]]:[e,n],i||(i=[0,0]);var s=i[0],l=i[1],c=10*a,f=16/180*Math.PI,h=Math.atan(r[1]/r[0]);r[0]<0&&(h+=Math.PI);var d=[[s,l],[Math.cos(h+f)*c+s,Math.sin(h+f)*c+l],[Math.cos(h-f)*c+s,Math.sin(h-f)*c+l],[s,l]];return{components:[(0,o.lineBuilder)({data:d,className:"connector-end connector-arrow",classID:"connector-end"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.radius,n=void 0===e?14:e,r=t.leftRight,i=t.topBottom,u=t.text,a=t.color,s=t.editMode,l=[],c=[],f=.7*n,h=0,d=0,p=Math.sqrt(2)*n,y={xleftcorner:-n,xrightcorner:n,ytopcorner:-n,ybottomcorner:n,xleft:-p,xright:p,ytop:-p,ybottom:p};r&&!i?h=y["x"+r]:i&&!r?d=y["y"+i]:r&&i&&(h=y["x"+r+"corner"],d=y["y"+i+"corner"]);var _="translate("+h+", "+d+")",b=(0,o.arcBuilder)({className:"subject",data:{radius:n}});b.attrs.transform=_,b.attrs.fill=a,b.attrs["stroke-linecap"]="round",b.attrs["stroke-width"]="3px";var v=(0,o.arcBuilder)({className:"subject-ring",data:{outerRadius:n,innerRadius:f}});v.attrs.transform=_,v.attrs["stroke-width"]="3px",v.attrs.fill="white";var m=void 0;if(h&&d||!h&&!d)m=(0,o.lineBuilder)({className:"subject-pointer",data:[[0,0],[h||0,0],[0,d||0],[0,0]]});else if(h||d){var g=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*n/Math.sqrt(2)};m=(0,o.lineBuilder)({className:"subject-pointer",data:[[0,0],[g(h),g(d)],[g(h,-1),g(d,-1)],[0,0]]})}if(m&&(m.attrs.fill=a,m.attrs["stroke-linecap"]="round",m.attrs["stroke-width"]="3px",c.push(m)),s){var O={x:2*h,y:2*d,offsetParent:!0};O.x||O.y||(O.y=-n),l=[O]}var j=void 0;return u&&(j={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:u,"text-anchor":"middle",dy:".25em",x:h,y:d}}),c.push(b),c.push(v),c.push(j),{components:c,handles:l}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.circleHandles=void 0;var o=n(1),r=e.circleHandles=function(t){var e=t.cx,n=void 0===e?0:e,o=t.cy,r=void 0===o?0:o,i=t.r1,u=t.r2,a=t.padding,s={move:{x:n,y:r}};return void 0!==i&&(s.r1={x:n+i/Math.sqrt(2),y:r+i/Math.sqrt(2)}),void 0!==u&&(s.r2={x:n+u/Math.sqrt(2),y:r+u/Math.sqrt(2)}),void 0!==a&&(s.padding={x:n+i+a,y:r}),s};e.default=function(t){var e=t.radius,n=t.radiusPadding,i=t.outerRadius,u=t.innerRadius,a=t.editMode,s=[],l=(0,o.arcBuilder)({data:{radius:e,outerRadius:i,innerRadius:u},className:"subject"});if(a){var c=r({r1:l.data.outerRadius||l.data.radius,r2:l.data.innerRadius,padding:n}),f=[{x:c.r1.x,y:c.r1.y,key:l.data.outerRadius?"outerRadius":"radius"}];u&&f.push({x:c.r2.x,y:c.r2.y,key:"innerRadius"}),s=f}return l.attrs["fill-opacity"]=0,{components:[l],handles:s}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.width,n=void 0===e?100:e,r=t.height,i=void 0===r?100:r,u=t.editMode,a=[],s=[[0,0],[n,0],[n,i],[0,i],[0,0]],l=(0,o.lineBuilder)({data:s,className:"subject"});return u&&(a=[{x:n,y:i/2,key:"width"},{x:n/2,y:i,key:"height"}]),l.attrs["fill-opacity"]=.1,{components:[l],handles:a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e=t.x1,n=t.x2,r=t.y1,i=t.y2,u=t.x,a=t.y,s=[[e=(void 0!==e?e:u)-u,r=(void 0!==r?r:a)-a],[n=(void 0!==n?n:u)-u,i=(void 0!==i?i:a)-a]];return{components:[(0,o.lineBuilder)({data:s,className:"subject"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.default=function(t){var e,n,r,i,u,a,s,l,c,f,h,d=t.height,p=t.width,y=t.depth,_=t.type,b=t.editMode,v=[],m=void 0,g=void 0;return"square"===_?(d?m=[[0,0],[y,0],[y,d],[0,d]]:p&&(m=[[0,0],[0,y],[p,y],[p,0]]),g=(0,o.lineBuilder)({data:m,className:"subject"})):"curly"===_&&(g=(0,o.pathBuilder)({d:(e=0,n=0,r=p||0,i=d||0,u=d&&d>0||p&&p<0?-y:y,a=.55,s=e-r,l=n-i,c=Math.sqrt(s*s+l*l),f=e-.5*c*(s/=c)+u*(l/=c),h=n-.5*c*l-u*s,"M "+e+" "+n+" Q "+(e+a*u*l)+" "+(n-a*u*s)+" "+(e-.25*c*s+(1-a)*u*l)+" "+(n-.25*c*l-(1-a)*u*s)+" T "+f+" "+h+" M "+r+" "+i+" Q "+(r+a*u*l)+" "+(i-a*u*s)+" "+(e-.75*c*s+(1-a)*u*l)+" "+(n-.75*c*l-(1-a)*u*s)+" T "+f+" "+h),className:"subject"})),b&&(v=[{x:d?y:p/2,y:d?d/2:y,key:"depth",type:d?"X":"Y"},{x:p||0,y:d||0,key:d?"height":"width"}]),g.attrs["fill-opacity"]=.1,{components:[g],handles:v}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(12);e.default=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,u=t.y,a=void 0===u?0:u,s=t.bbox,l=t.offset;"top"===(e=(0,r.leftRightDynamic)(e,l.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var c=[[i,a],[i,a+s.height]];return{components:[(0,o.lineBuilder)({data:c,className:"note-line"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(12);e.default=function(t){var e=t.align,n=t.x,i=void 0===n?0:n,u=t.y,a=void 0===u?0:u,s=t.offset,l=t.bbox;"right"===(e=(0,r.topBottomDynamic)(e,s.x))?i-=l.width:"middle"===e&&(i-=l.width/2);var c=[[i,a],[i+l.width,a]];return{components:[(0,o.lineBuilder)({data:c,className:"note-line"})]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=(0,o.default)("label",t.className);return(0,r.default)(function(t){for(var e=1;e @@ -24,21 +24,23 @@ export default class Annotation extends React.Component { ...child.props }) - ); - + ) + const wrappedEvents = {} Object.keys(events).forEach(k => { - events[k] = events[k].bind(this, this.props, this.state); - }); + wrappedEvents[k] = e => { + events[k](this.props, this.state, e) + } + }) return ( {childrenWithProps} - ); + ) } } @@ -49,7 +51,7 @@ Annotation.defaultProps = { dy: 0, color: "grey", events: {} -}; +} Annotation.propTypes = { x: PropTypes.number, @@ -59,4 +61,4 @@ Annotation.propTypes = { color: PropTypes.string, editMode: PropTypes.bool, events: PropTypes.object -}; +}