You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
28 KiB
2 lines
28 KiB
5 years ago
|
// https://d3js.org/d3-shape/ Version 1.2.0. Copyright 2017 Mike Bostock.
|
||
|
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-path")):"function"==typeof define&&define.amd?define(["exports","d3-path"],n):n(t.d3=t.d3||{},t.d3)}(this,function(t,n){"use strict";function i(t){return t>1?0:t<-1?lt:Math.acos(t)}function e(t){return t>=1?ut:t<=-1?-ut:Math.asin(t)}function s(t){return t.innerRadius}function h(t){return t.outerRadius}function o(t){return t.startAngle}function _(t){return t.endAngle}function r(t){return t&&t.padAngle}function a(t,n,i,e,s,h,o,_){var r=i-t,a=e-n,c=o-s,l=_-h,u=(c*(n-h)-l*(t-s))/(l*r-c*a);return[t+u*r,n+u*a]}function c(t,n,i,e,s,h,o){var _=t-i,r=n-e,a=(o?h:-h)/at(_*_+r*r),c=a*r,l=-a*_,u=t+c,f=n+l,x=i+c,y=e+l,p=(u+x)/2,v=(f+y)/2,d=x-u,T=y-f,g=d*d+T*T,b=s-h,w=u*y-x*f,k=(T<0?-1:1)*at(ot(0,b*b*g-w*w)),m=(w*T-d*k)/g,N=(-w*d-T*k)/g,M=(w*T+d*k)/g,S=(-w*d+T*k)/g,E=m-p,A=N-v,P=M-p,C=S-v;return E*E+A*A>P*P+C*C&&(m=M,N=S),{cx:m,cy:N,x01:-c,y01:-l,x11:m*(s/b-1),y11:N*(s/b-1)}}function l(t){this._context=t}function u(t){return t[0]}function f(t){return t[1]}function x(t){this._curve=t}function y(t){function n(n){return new x(t(n))}return n._curve=t,n}function p(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(y(t)):n()._curve},t}function v(t){return t.source}function d(t){return t.target}function T(t){function i(){var i,r=Nt.call(arguments),a=e.apply(this,r),c=s.apply(this,r);if(_||(_=i=n.path()),t(_,+h.apply(this,(r[0]=a,r)),+o.apply(this,r),+h.apply(this,(r[0]=c,r)),+o.apply(this,r)),i)return _=null,i+""||null}var e=v,s=d,h=u,o=f,_=null;return i.source=function(t){return arguments.length?(e=t,i):e},i.target=function(t){return arguments.length?(s=t,i):s},i.x=function(t){return arguments.length?(h="function"==typeof t?t:it(+t),i):h},i.y=function(t){return arguments.length?(o="function"==typeof t?t:it(+t),i):o},i.context=function(t){return arguments.length?(_=null==t?null:t,i):_},i}function g(t,n,i,e,s){t.moveTo(n,i),t.bezierCurveTo(n=(n+e)/2,i,n,s,e,s)}function b(t,n,i,e,s){t.moveTo(n,i),t.bezierCurveTo(n,i=(i+s)/2,e,i,e,s)}function w(t,n,i,e,s){var h=mt(n,i),o=mt(n,i=(i+s)/2),_=mt(e,i),r=mt(e,s);t.moveTo(h[0],h[1]),t.bezierCurveTo(o[0],o[1],_[0],_[1],r[0],r[1])}function k(){return T(g)}function m(){return T(b)}function N(){var t=T(w);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}function M(t,n,i){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+n)/6,(t._y0+4*t._y1+i)/6)}function S(t){this._context=t}function E(t){this._context=t}function A(t){this._context=t}function P(t,n){this._basis=new S(t),this._beta=n}function C(t,n,i){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-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function R(t,n){this._context=t,this._k=(1-n)/6}function q(t,n){this._context=t,this._k=(1-n)/6}function O(t,n){this._context=t,this._k=(1-n)/6}function z(t,n,i){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>ct){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,r=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/r,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/r}if(t._l23_a>ct){var a=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);h=(h*a+t._x1*t._l23_2a-n*t._l12_2a)/c,o=(o*a+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function X(t,n){this._context=t,this._alpha=n}function Y(t,n){this._context=t,this._alpha=n}function B(t,n){this._context=t,this._alpha=n}function I(t){this._context=t}function j(t){return t<0?-1:1}function D(t,n,i){var e=t._x1-t._x0,s=n-t._x1,h=(t._y1-t._y0)/(e||s<0&&-0),o=(i-t._y1)/(s||e<0&&-0),_=(h*s+o*e)/(e+s);return(j(h)+j(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function L(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function V(t,n,i){var e=t._x0,s=t._y0,h=t._x1,o=t._y1,_=(h-e)/3;t._context.bezierCurveTo(e+_,s+_*n,h-_,o-_*i,h,o)}function W(t){this._context=t}function H(t){this._context=new F(t)}function F(t){this._context=t}function G(t){ret
|