victory-brush-container 37.0.0 → 37.0.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/victory-brush-container.js +2 -2
- package/dist/victory-brush-container.min.js +1 -1
- package/es/brush-helpers.d.ts +70 -70
- package/es/index.d.ts +2 -2
- package/es/victory-brush-container.d.ts +205 -205
- package/es/victory-brush-container.js +2 -2
- package/lib/brush-helpers.d.ts +70 -70
- package/lib/index.d.ts +2 -2
- package/lib/victory-brush-container.d.ts +205 -205
- package/lib/victory-brush-container.js +2 -2
- package/package.json +2 -5
- package/src/victory-brush-container.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -584,7 +584,7 @@ function brushContainerMixin(Base) {
|
|
|
584
584
|
handleWidth: 8,
|
|
585
585
|
mouseMoveThreshold: 0
|
|
586
586
|
};
|
|
587
|
-
static defaultEvents
|
|
587
|
+
static defaultEvents(props) {
|
|
588
588
|
return [{
|
|
589
589
|
target: "parent",
|
|
590
590
|
eventHandlers: {
|
|
@@ -611,7 +611,7 @@ function brushContainerMixin(Base) {
|
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
613
|
}];
|
|
614
|
-
}
|
|
614
|
+
}
|
|
615
615
|
getSelectBox(props, coordinates) {
|
|
616
616
|
const {
|
|
617
617
|
x,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.VictoryBrushContainer=e(require("react")):t.VictoryBrushContainer=e(t.React)}(self,(function(t){return function(){var e={2596:function(t,e,n){var r=n(2373).Symbol;t.exports=r},6082:function(t){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},8644:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},9559:function(t){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},4132:function(t,e,n){var r=n(8347),o=n(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8347:function(t,e,n){var r=n(5525);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},6457:function(t,e,n){var r=n(9559),o=n(3608);t.exports=function t(e,n,i,a,s){var u=-1,c=e.length;for(i||(i=o),s||(s=[]);++u<c;){var l=e[u];n>0&&i(l)?n>1?t(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},4432:function(t,e,n){var r=n(9026),o=n(3110);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},6776:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},5436:function(t,e,n){var r=n(6371),o=n(5066);t.exports=function(t,e){return r(t,e,(function(e,n){return o(t,n)}))}},6371:function(t,e,n){var r=n(4432),o=n(6539),i=n(9026);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],l=r(t,c);n(l,c)&&o(u,i(c,t),l)}return u}},1600:function(t){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},3301:function(t,e,n){var r=n(4432);t.exports=function(t){return function(e){return r(e,t)}}},6317:function(t,e,n){var r=n(5346),o=n(4280),i=n(201);t.exports=function(t,e){return i(o(t,e,r),t+"")}},6539:function(t,e,n){var r=n(4132),o=n(9026),i=n(9099),a=n(7709),s=n(3110);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,l=(e=o(e,t)).length,f=l-1,h=t;null!=h&&++c<l;){var p=s(e[c]),x=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return t;if(c!=f){var d=h[p];void 0===(x=u?u(d,p,h):void 0)&&(x=a(d)?d:i(e[c+1])?[]:{})}r(h,p,x),h=h[p]}return t}},6316:function(t,e,n){var r=n(2596),o=n(8644),i=n(163),a=n(1995),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},9026:function(t,e,n){var r=n(163),o=n(726),i=n(7801),a=n(7010);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},5525:function(t,e,n){var r=n(3743),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:function(t,e,n){var r=n(2645),o=n(4280),i=n(201);t.exports=function(t){return i(o(t,void 0,r),t+"")}},2117:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},3743:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},3096:function(t,e,n){var r=n(9026),o=n(5075),i=n(163),a=n(9099),s=n(8454),u=n(3110);t.exports=function(t,e,n){for(var c=-1,l=(e=r(e,t)).length,f=!1;++c<l;){var h=u(e[c]);if(!(f=null!=t&&n(t,h)))break;t=t[h]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&s(l)&&a(h,l)&&(i(t)||o(t))}},3608:function(t,e,n){var r=n(2596),o=n(5075),i=n(163),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8286:function(t){t.exports=function(){return!1}},726:function(t,e,n){var r=n(163),o=n(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},2453:function(t){t.exports=function(t){return t}},4280:function(t,e,n){var r=n(6082),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),u=Array(s);++a<s;)u[a]=i[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=i[a];return c[e]=n(u),r(t,this,c)}}},2373:function(t,e,n){var r=n(2117),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},201:function(t){t.exports=function(t){return t}},7801:function(t,e,n){var r=n(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=a},3110:function(t,e,n){var r=n(1995);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},5034:function(t,e,n){var r=n(7709),o=n(6987),i=n(5812),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,c,l,f,h,p,x=0,d=!1,y=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var n=u,r=c;return u=c=void 0,x=e,f=t.apply(r,n)}function g(t){return x=t,h=setTimeout(M,e),d?v(t):f}function b(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-x>=l}function M(){var t=o();if(b(t))return w(t);h=setTimeout(M,function(t){var n=e-(t-p);return y?s(n,l-(t-x)):n}(t))}function w(t){return h=void 0,m&&u?v(t):(u=c=void 0,f)}function D(){var t=o(),n=b(t);if(u=arguments,c=this,p=t,n){if(void 0===h)return g(p);if(y)return clearTimeout(h),h=setTimeout(M,e),v(p)}return void 0===h&&(h=setTimeout(M,e)),f}return e=i(e)||0,r(n)&&(d=!!n.leading,l=(y="maxWait"in n)?a(i(n.maxWait)||0,e):l,m="trailing"in n?!!n.trailing:m),D.cancel=function(){void 0!==h&&clearTimeout(h),x=0,u=p=c=h=void 0},D.flush=function(){return void 0===h?f:w(o())},D}},1893:function(t,e,n){var r=n(6317),o=n(788),i=n(8286),a=n(8855),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&i(e[0],e[1],c)&&(r=1);++n<r;)for(var l=e[n],f=a(l),h=-1,p=f.length;++h<p;){var x=f[h],d=t[x];(void 0===d||o(d,s[x])&&!u.call(t,x))&&(t[x]=l[x])}return t}));t.exports=c},788:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},2645:function(t,e,n){var r=n(6457);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},5066:function(t,e,n){var r=n(6776),o=n(3096);t.exports=function(t,e){return null!=t&&o(t,e,r)}},5346:function(t){t.exports=function(t){return t}},5075:function(t){t.exports=function(){return!1}},163:function(t){var e=Array.isArray;t.exports=e},8454:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7709:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1995:function(t){t.exports=function(){return!1}},8855:function(t){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},6987:function(t,e,n){var r=n(2373);t.exports=function(){return r.Date.now()}},9082:function(t,e,n){var r=n(5436),o=n(5557)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},8532:function(t,e,n){var r=n(1600),o=n(3301),i=n(726),a=n(3110);t.exports=function(t){return i(t)?r(a(t)):o(t)}},8163:function(t,e,n){var r=n(5034),o=n(7709);t.exports=function(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}},5812:function(t){t.exports=function(t){return t}},7010:function(t,e,n){var r=n(6316);t.exports=function(t){return null==t?"":r(t)}},660:function(t,e,n){var r=n(7010),o=0;t.exports=function(t){var e=++o;return r(t)+e}},7491:function(t){var e="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var s,u,c,l;if(Array.isArray(t)){if((s=t.length)!=a.length)return!1;for(u=s;0!=u--;)if(!i(t[u],a[u]))return!1;return!0}if(n&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;for(l=t.entries();!(u=l.next()).done;)if(!i(u.value[1],a.get(u.value[0])))return!1;return!0}if(r&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((s=t.length)!=a.length)return!1;for(u=s;0!=u--;)if(t[u]!==a[u])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((s=(c=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(u=s;0!=u--;)if(!Object.prototype.hasOwnProperty.call(a,c[u]))return!1;if(e&&t instanceof Element)return!1;for(u=s;0!=u--;)if(("_owner"!==c[u]&&"__v"!==c[u]&&"__o"!==c[u]||!t.$$typeof)&&!i(t[c[u]],a[c[u]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,e){try{return i(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:function(e){"use strict";e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){"use strict";r.r(o),r.d(o,{BrushHelpers:function(){return nt},VictoryBrushContainer:function(){return ot},brushContainerMixin:function(){return rt}});var t=r(1893),e=r.n(t),n=r(9787),i=r.n(n),a=r(7709),s=r.n(a),u=r(660),c=r.n(u);class l extends i().Component{static displayName="Portal";constructor(t){super(t),this.map={},this.index=1}portalRegister=()=>++this.index;portalUpdate=(t,e)=>{this.map[t]=e,this.forceUpdate()};portalDeregister=t=>{delete this.map[t],this.forceUpdate()};getChildren(){return Object.keys(this.map).map((t=>{const e=this.map[t];return e?i().cloneElement(e,{key:t}):e}))}render(){return i().createElement("svg",this.props,this.getChildren())}}const f=i().createContext({});f.displayName="PortalContext";var h,p,x=0,d=0,y=0,m=0,v=0,g=0,b="object"==typeof performance&&performance.now?performance:Date,M="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function w(){return v||(M(D),v=b.now()+g)}function D(){v=0}function B(){this._call=this._time=this._next=null}function O(t,e,n){var r=new B;return r.restart(t,e,n),r}function j(){v=(m=b.now())+g,x=d=0;try{!function(){w(),++x;for(var t,e=h;e;)(t=v-e._time)>=0&&e._call.call(void 0,t),e=e._next;--x}()}finally{x=0,function(){for(var t,e,n=h,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:h=e);p=t,S(r)}(),v=0}}function E(){var t=b.now(),e=t-m;e>1e3&&(g-=e,m=t)}function S(t){x||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(j,t-b.now()-g)),y&&(y=clearInterval(y))):(y||(m=b.now(),y=setInterval(E,1e3)),x=1,M(j)))}B.prototype=O.prototype={constructor:B,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?w():+n)+(null==e?0:+e),this._next||p===this||(p?p._next=this:h=this,p=this),this._call=t,this._time=n,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};class A{constructor(){this.shouldAnimate=!0,this.subscribers=[],this.timer=null,this.activeSubscriptions=0}bypassAnimation(){this.shouldAnimate=!1}resumeAnimation(){this.shouldAnimate=!0}loop=()=>{this.subscribers.forEach((t=>{t.callback(w()-t.startTime,t.duration)}))};start(){this.timer||(this.timer=O(this.loop))}stop(){this.timer&&(this.timer.stop(),this.timer=null)}subscribe(t,e){const n=this.subscribers.push({startTime:w(),callback:t,duration:this.shouldAnimate?e:0});return this.activeSubscriptions++,this.start(),n}unsubscribe(t){null!==t&&this.subscribers[t-1]&&(delete this.subscribers[t-1],this.activeSubscriptions--),0===this.activeSubscriptions&&this.stop()}}const P=i().createContext({transitionTimer:new A,animationTimer:new A});P.displayName="TimerContext";var R=P;function C(t,e){return _(t)?t(e):t}function _(t){return"function"==typeof t}function T(t,e){if(t)return Object.keys(t).reduce(((n,r)=>(n[r]=e(t[r]),n)),{})}r(9082),r(8532);const G={startsWith:["data-","aria-"],exactMatch:[]},z=t=>{const e={...t};return Object.fromEntries(Object.entries(e).filter((t=>{let[e]=t;return(t=>!(!(t=>{let e=!1;return G.startsWith.forEach((n=>{new RegExp(`\\b(${n})(\\w|-)+`,"g").test(t)&&(e=!0)})),e})(t)&&!(t=>G.exactMatch.includes(t))(t)))(e)})).map((e=>{let[n,r]=e;return[n,C(r,t)]})))};function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},I.apply(this,arguments)}class N extends i().Component{static displayName="VictoryContainer";static role="container";static defaultProps={className:"VictoryContainer",portalComponent:i().createElement(l,null),portalZIndex:99,responsive:!0,role:"img"};static contextType=R;constructor(t){super(t),this.containerId=s()(t)&&void 0!==t.containerId?t.containerId:c()("victory-container-"),this.shouldHandleWheel=!!(t&&t.events&&t.events.onWheel)}savePortalRef=t=>(this.portalRef=t,t);portalUpdate=(t,e)=>this.portalRef.portalUpdate(t,e);portalRegister=()=>this.portalRef.portalRegister();portalDeregister=t=>this.portalRef.portalDeregister(t);saveContainerRef=t=>(_(this.props.containerRef)&&this.props.containerRef(t),this.containerRef=t,t);handleWheel=t=>t.preventDefault();componentDidMount(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.addEventListener("wheel",this.handleWheel)}componentWillUnmount(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.removeEventListener("wheel",this.handleWheel)}getIdForElement(t){return`${this.containerId}-${t}`}getChildren(t){return t.children}getOUIAProps(t){const{ouiaId:e,ouiaSafe:n,ouiaType:r}=t;return{...e&&{"data-ouia-component-id":e},...r&&{"data-ouia-component-type":r},...void 0!==n&&{"data-ouia-safe":n}}}renderContainer(t,n,r){const{title:o,desc:a,portalComponent:s,className:u,width:c,height:l,portalZIndex:h,responsive:p}=t,x=this.getChildren(t),d=p?{width:"100%",height:"100%"}:{width:c,height:l},y=Object.assign({pointerEvents:"none",touchAction:"none",position:"relative"},d),m=Object.assign({zIndex:h,position:"absolute",top:0,left:0},d),v=Object.assign({pointerEvents:"all"},d),g=Object.assign({overflow:"visible"},d),b={width:c,height:l,viewBox:n.viewBox,preserveAspectRatio:n.preserveAspectRatio,style:g};return i().createElement(f.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},i().createElement("div",I({style:e()({},r,y),className:u,ref:this.saveContainerRef},this.getOUIAProps(t)),i().createElement("svg",I({},n,{style:v}),o?i().createElement("title",{id:this.getIdForElement("title")},o):null,a?i().createElement("desc",{id:this.getIdForElement("desc")},a):null,x),i().createElement("div",{style:m},i().cloneElement(s,{...b,ref:this.savePortalRef}))))}render(){const{width:t,height:e,responsive:n,events:r,title:o,desc:i,tabIndex:a,preserveAspectRatio:s,role:u}=this.props,c=n?this.props.style:function(t,e){void 0===e&&(e=[]);const n={};for(const r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(this.props.style,["height","width"]),l=z(this.props),f=Object.assign({width:t,height:e,tabIndex:a,role:u,"aria-labelledby":[o&&this.getIdForElement("title"),this.props["aria-labelledby"]].filter(Boolean).join(" ")||void 0,"aria-describedby":[i&&this.getIdForElement("desc"),this.props["aria-describedby"]].filter(Boolean).join(" ")||void 0,viewBox:n?`0 0 ${t} ${e}`:void 0,preserveAspectRatio:n?s:void 0,...l},r);return this.renderContainer(this.props,f,c)}}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},U.apply(this,arguments)}const V=(0,n.forwardRef)(((t,e)=>{const{desc:n,id:r,tabIndex:o,origin:a,...s}=t,u={vectorEffect:"non-scaling-stroke",id:C(r,t)?.toString(),tabIndex:C(o,t),...s};return n?i().createElement("rect",U({},u,{ref:e}),i().createElement("desc",null,n)):i().createElement("rect",U({},u,{ref:e}))}));function W(t){return Array.isArray(t)&&t.some((t=>t instanceof Date))}function k(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=t.concat(n);return W(o)?new Date(Math.max(...o)):Math.max(...o)}function $(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=t.concat(n);return W(o)?new Date(Math.min(...o)):Math.min(...o)}function H(t,e,n){const{a:r,d:o,e:i,f:a}=e;return"y"===n?o*t+a:r*t+i}function F(t){return!(!t||void 0===t.identifier)}function X(t){if(F(t.nativeEvent))return;const e=t=>"svg"===t.nodeName?t:t.parentNode?e(t.parentNode):t;return e(t.target)}function Y(t,e){if(F(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};const n=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,r=function(t){return t.getScreenCTM().inverse()}(e||X(n));return{x:H(n.clientX,r,"x"),y:H(n.clientY,r,"y")}}function q(t,e){const{horizontal:n}=t,r=t.scale,o=e||{x:r.x.domain(),y:r.y.domain()};return{x:n?[r.y(o.y[0]),r.y(o.y[1])]:[r.x(o.x[0]),r.x(o.x[1])],y:n?[r.x(o.x[0]),r.x(o.x[1])]:[r.y(o.y[0]),r.y(o.y[1])]}}function L(t,e,n,r){const{polar:o,horizontal:i}=t;if(!o)return{x:i?e.x.invert(r):e.x.invert(n),y:i?e.y.invert(n):e.y.invert(r)};const a=t.origin||{x:0,y:0},s=n-a.x,u=r-a.y,c=Math.abs(s*Math.sqrt(1+Math.pow(-u/s,2))),l=(-Math.atan2(u,s)+2*Math.PI)%(2*Math.PI);return{x:e.x.invert(l),y:e.y.invert(c)}}function Z(t){const{x1:e,x2:n,y1:r,y2:o,scale:i}=t,a=L(t,i,e,r),s=L(t,i,n,o),u=(t,e)=>[$([t,e]),k([t,e])];return{x:u(a.x,s.x),y:u(a.y,s.y)}}var J=r(8163),K=r.n(J),Q=r(7491),tt=r.n(Q);const et={getDimension(t){const{horizontal:e,brushDimension:n}=t;return e&&n?"x"===n?"y":"x":n},withinBounds(t,e,n){const{x1:r,x2:o,y1:i,y2:a}=T(e,Number),{x:s,y:u}=T(t,Number),c=n?n/2:0;return s+c>=Math.min(r,o)&&s-c<=Math.max(r,o)&&u+c>=Math.min(i,a)&&u-c<=Math.max(i,a)},getDomainBox(t,n,r){const o=this.getDimension(t),i=e()({},n,t.domain),a=e()({},r,i),s=q(t,i),u=q(t,a);return{x1:"y"!==o?Math.min(...u.x):Math.min(...s.x),x2:"y"!==o?Math.max(...u.x):Math.max(...s.x),y1:"x"!==o?Math.min(...u.y):Math.min(...s.y),y2:"x"!==o?Math.max(...u.y):Math.max(...s.y)}},getHandles(t,e){const n=this.getDimension(t),{x1:r,x2:o,y1:i,y2:a}=e,s=Math.min(r,o),u=Math.max(r,o),c=Math.min(i,a),l=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==n&&{x1:s-f,x2:s+f,y1:i,y2:a},right:"y"!==n&&{x1:u-f,x2:u+f,y1:i,y2:a},top:"x"!==n&&{x1:r,x2:o,y1:c-f,y2:c+f},bottom:"x"!==n&&{x1:r,x2:o,y1:l-f,y2:l+f}}},getActiveHandles(t,e,n){const r=this.getHandles(e,n),o=["top","bottom","left","right"].reduce(((e,n)=>r[n]&&this.withinBounds(t,r[n])?e.concat(n):e),[]);return o.length&&o},getResizeMutation(t,e){const{x1:n,y1:r,x2:o,y2:i}=t,a={left:{x1:Math.max(n,o),x2:Math.min(n,o),y1:r,y2:i},right:{x1:Math.min(n,o),x2:Math.max(n,o),y1:r,y2:i},top:{y1:Math.max(r,i),y2:Math.min(r,i),x1:n,x2:o},bottom:{y1:Math.min(r,i),y2:Math.max(r,i),x1:n,x2:o}};return e.reduce(((t,e)=>Object.assign(t,a[e])),{})},getMinimumDomain:()=>({x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}),getDefaultBrushArea(t,e,n){const{domain:r,fullDomain:o,scale:i,horizontal:a,allowResize:s}=t,u=s||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===u)return this.getMinimumDomain();if("disable"===u)return e;if("move"===u){const r=this.getDomainBox(t,o,e),s=t.parentSVG||X(n),u=this.panBox({...t,...r,brushDomain:e,startX:(r.x1+r.x2)/2,startY:(r.y1+r.y2)/2},Y(n,s)),c=t.fullDomainBox||this.getDomainBox(t,o);return Z({...this.constrainBox(u,c),scale:i,horizontal:a})}return r},getSelectionMutation(t,e,n){const{x:r,y:o}=t,{x1:i,x2:a,y1:s,y2:u}=e;return{x1:"y"!==n?r:i,y1:"x"!==n?o:s,x2:"y"!==n?r:a,y2:"x"!==n?o:u}},panBox(t,n){const{domain:r,startX:o,startY:i}=t,a=this.getDimension(t),s=e()({},t.brushDomain,r),u=e()({},t.fullDomain,r),{x1:c,x2:l,y1:f,y2:h}=t.x1?t:this.getDomainBox(t,u,s),{x:p,y:x}=n,d=o?o-p:0,y=i?i-x:0;return{x1:"y"!==a?Math.min(c,l)-d:Math.min(c,l),x2:"y"!==a?Math.max(c,l)-d:Math.max(c,l),y1:"x"!==a?Math.min(f,h)-y:Math.min(f,h),y2:"x"!==a?Math.max(f,h)-y:Math.max(f,h)}},constrainBox(t,e){const{x1:n,y1:r,x2:o,y2:i}=T(e,Number);return{x1:t.x2>o?o-Math.abs(t.x2-t.x1):Math.max(t.x1,n),y1:t.y2>i?i-Math.abs(t.y2-t.y1):Math.max(t.y1,r),x2:t.x1<n?n+Math.abs(t.x2-t.x1):Math.min(t.x2,o),y2:t.y1<r?r+Math.abs(t.y2-t.y1):Math.min(t.y2,i)}},constrainPoint(t,e){const{x1:n,y1:r,x2:o,y2:i}=T(e,Number);return{x:Math.min(Math.max(t.x,n),o),y:Math.min(Math.max(t.y,r),i)}},hasMoved(t){const{x1:e,x2:n,y1:r,y2:o,mouseMoveThreshold:i}=t,a=this.getDimension(t),s=Math.abs(e-n)>=i,u=Math.abs(r-o)>=i;switch(a){case"x":return s;case"y":return u;default:return s||u}},onMouseDown(t,n){t.preventDefault();const{handleWidth:r,cachedBrushDomain:o,domain:i,allowResize:a,allowDrag:s,allowDraw:u}=n,c=this.getDimension(n),l=a||n.defaultBrushArea?n.defaultBrushArea:"move";if(!a&&!s)return{};const f=n.fullDomainBox||this.getDomainBox(n,i),h=n.parentSVG||X(t),{x:p,y:x}=Y(t,h);if(!this.withinBounds({x:p,y:x},f,r))return{};const d=e()({},n.brushDomain,i),y=tt()(d,o)?n.currentDomain||d||i:d||i,m=this.getDomainBox(n,i,y),v=a&&this.getActiveHandles({x:p,y:x},n,m);return v?[{target:"parent",mutation:()=>({isSelecting:!0,domainBox:m,fullDomainBox:f,cachedBrushDomain:d,currentDomain:y,parentSVG:h,...this.getResizeMutation(m,v)})}]:this.withinBounds({x:p,y:x},m)&&!tt()(i,y)?[{target:"parent",mutation:()=>({isPanning:s,startX:p,startY:x,domainBox:m,fullDomainBox:f,currentDomain:y,cachedBrushDomain:d,parentSVG:h,...m})}]:u?[{target:"parent",mutation:()=>({isSelecting:a||"move"===l,domainBox:m,fullDomainBox:f,parentSVG:h,cachedBrushDomain:d,cachedCurrentDomain:y,currentDomain:this.getMinimumDomain(),...this.getSelectionMutation({x:p,y:x},m,c)})}]:{}},onGlobalMouseMove(t,n){const{scale:r,isPanning:o,isSelecting:i,fullDomainBox:a,onBrushDomainChange:s,allowResize:u,allowDrag:c,horizontal:l,mouseMoveThreshold:f,parentSVG:h}=n,p=this.getDimension(n),{x:x,y:d}=Y(t,h);if(!u&&!c||f>0&&!this.hasMoved({...n,x2:x,y2:d}))return{};if(c&&o){const{startX:t,startY:o}=n,i=this.panBox(n,{x:x,y:d}),u=this.constrainBox(i,a),c=Z({...u,scale:r,horizontal:l}),f={currentDomain:c,parentSVG:h,startX:i.x2>=a.x2||i.x1<=a.x1?t:x,startY:i.y2>=a.y2||i.y1<=a.y1?o:d,...u};return _(s)&&s(c,e()({},f,n)),[{target:"parent",mutation:()=>f}]}if(u&&i){const{x:t,y:o}=this.constrainPoint({x:"y"!==p?x:n.x2,y:"x"!==p?d:n.y2},a),i=Z({x2:t,y2:o,x1:n.x1,y1:n.y1,scale:r,horizontal:l}),u={x2:t,y2:o,currentDomain:i,parentSVG:h};return _(s)&&s(i,e()({},u,n)),[{target:"parent",mutation:()=>u}]}return{}},onGlobalMouseUp(t,n){if(!n.isPanning&&!n.isSelecting)return{};const{x1:r,y1:o,x2:i,y2:a,isPanning:s,isSelecting:u,onBrushDomainChange:c,onBrushDomainChangeEnd:l,onBrushCleared:f,currentDomain:h,allowResize:p,allowDrag:x}=n,d=p||n.defaultBrushArea?n.defaultBrushArea:"move",y={isPanning:!1,isSelecting:!1};if(!p&&(void 0===d||"none"===d)||r!==i&&o!==a)(x&&s||p&&u)&&_(l)&&l(h,e()({},y,n));else{const r=n.cachedCurrentDomain||h,o=this.getDefaultBrushArea(n,r,t);y.currentDomain=o,_(c)&&c(o,e()({},y,n)),_(l)&&l(o,e()({},y,n)),_(f)&&f(o,e()({},y,n))}return[{target:"parent",mutation:()=>y}]}},nt={...et,onMouseDown:et.onMouseDown.bind(et),onGlobalMouseUp:et.onGlobalMouseUp.bind(et),onGlobalMouseMove:K()(et.onGlobalMouseMove.bind(et),16,{leading:!0,trailing:!1})};function rt(t){return class extends t{static displayName="VictoryBrushContainer";static defaultProps={...N.defaultProps,allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:i().createElement(V,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:i().createElement(V,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0};static defaultEvents=t=>[{target:"parent",eventHandlers:{onMouseDown:(e,n)=>t.disable?{}:nt.onMouseDown(e,n),onTouchStart:(e,n)=>t.disable?{}:nt.onMouseDown(e,n),onGlobalMouseMove:(e,n)=>t.disable||!n.isPanning&&!n.isSelecting?{}:nt.onGlobalMouseMove(e,n),onGlobalTouchMove:(e,n)=>t.disable||!n.isPanning&&!n.isSelecting?{}:nt.onGlobalMouseMove(e,n),onGlobalMouseUp:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n),onGlobalTouchEnd:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n),onGlobalTouchCancel:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n)}}];getSelectBox(t,n){const{x:r,y:o}=n,{brushStyle:a,brushComponent:s,name:u}=t,c=s.props&&s.props.style,l=t.allowDrag||t.allowResize?"move":"auto";return r[0]!==r[1]&&o[0]!==o[1]?i().cloneElement(s,{key:`${u}-brush`,width:Math.abs(r[1]-r[0])||1,height:Math.abs(o[1]-o[0])||1,x:Math.min(r[0],r[1]),y:Math.min(o[0],o[1]),cursor:l,style:e()({},c,a)}):null}getCursorPointers(t){const e={yProps:"ns-resize",xProps:"ew-resize"};return!t.allowResize&&t.allowDrag?(e.xProps="move",e.yProps="move"):t.allowResize||t.allowDrag||(e.xProps="auto",e.yProps="auto"),e}getHandles(t,n){const{handleWidth:r,handleStyle:o,handleComponent:a,name:s}=t,u=nt.getDomainBox(t,n),{x1:c,x2:l,y1:f,y2:h}=u,{top:p,bottom:x,left:d,right:y}=nt.getHandles(t,u),m=Math.abs(l-c)||1,v=Math.abs(h-f)||1,g=a.props&&a.props.style||{},b=e()({},g,o),M=this.getCursorPointers(t),w={style:b,width:m,height:r,cursor:M.yProps},D={style:b,width:r,height:v,cursor:M.xProps},B={top:p&&Object.assign({x:p.x1,y:p.y1},w),bottom:x&&Object.assign({x:x.x1,y:x.y1},w),left:d&&Object.assign({y:d.y1,x:d.x1},D),right:y&&Object.assign({y:y.y1,x:y.x1},D)},O=["top","bottom","left","right"].reduce(((t,e)=>B[e]?t.concat(i().cloneElement(a,Object.assign({key:`${s}-handle-${e}`},B[e]))):t),[]);return O.length?O:null}getRect(t){const{currentDomain:n,cachedBrushDomain:r}=t,o=e()({},t.brushDomain,t.domain),i=tt()(o,r)?e()({},n,o):o,a=q(t,i),s=this.getSelectBox(t,a);return s?[s,this.getHandles(t,i)]:[]}getChildren(t){return[...i().Children.toArray(t.children),...this.getRect(t)]}}}const ot=rt(N)}(),o}()}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.VictoryBrushContainer=e(require("react")):t.VictoryBrushContainer=e(t.React)}(self,(function(t){return function(){var e={2596:function(t,e,n){var r=n(2373).Symbol;t.exports=r},6082:function(t){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},8644:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},9559:function(t){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},4132:function(t,e,n){var r=n(8347),o=n(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},8347:function(t,e,n){var r=n(5525);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},6457:function(t,e,n){var r=n(9559),o=n(3608);t.exports=function t(e,n,i,a,s){var u=-1,c=e.length;for(i||(i=o),s||(s=[]);++u<c;){var l=e[u];n>0&&i(l)?n>1?t(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},4432:function(t,e,n){var r=n(9026),o=n(3110);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},6776:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},5436:function(t,e,n){var r=n(6371),o=n(5066);t.exports=function(t,e){return r(t,e,(function(e,n){return o(t,n)}))}},6371:function(t,e,n){var r=n(4432),o=n(6539),i=n(9026);t.exports=function(t,e,n){for(var a=-1,s=e.length,u={};++a<s;){var c=e[a],l=r(t,c);n(l,c)&&o(u,i(c,t),l)}return u}},1600:function(t){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},3301:function(t,e,n){var r=n(4432);t.exports=function(t){return function(e){return r(e,t)}}},6317:function(t,e,n){var r=n(5346),o=n(4280),i=n(201);t.exports=function(t,e){return i(o(t,e,r),t+"")}},6539:function(t,e,n){var r=n(4132),o=n(9026),i=n(9099),a=n(7709),s=n(3110);t.exports=function(t,e,n,u){if(!a(t))return t;for(var c=-1,l=(e=o(e,t)).length,f=l-1,h=t;null!=h&&++c<l;){var p=s(e[c]),x=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return t;if(c!=f){var d=h[p];void 0===(x=u?u(d,p,h):void 0)&&(x=a(d)?d:i(e[c+1])?[]:{})}r(h,p,x),h=h[p]}return t}},6316:function(t,e,n){var r=n(2596),o=n(8644),i=n(163),a=n(1995),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},9026:function(t,e,n){var r=n(163),o=n(726),i=n(7801),a=n(7010);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},5525:function(t,e,n){var r=n(3743),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:function(t,e,n){var r=n(2645),o=n(4280),i=n(201);t.exports=function(t){return i(o(t,void 0,r),t+"")}},2117:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},3743:function(t){t.exports=function(t,e){return null==t?void 0:t[e]}},3096:function(t,e,n){var r=n(9026),o=n(5075),i=n(163),a=n(9099),s=n(8454),u=n(3110);t.exports=function(t,e,n){for(var c=-1,l=(e=r(e,t)).length,f=!1;++c<l;){var h=u(e[c]);if(!(f=null!=t&&n(t,h)))break;t=t[h]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&s(l)&&a(h,l)&&(i(t)||o(t))}},3608:function(t,e,n){var r=n(2596),o=n(5075),i=n(163),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:function(t){var e=/^(?:0|[1-9]\d*)$/;t.exports=function(t,n){var r=typeof t;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&e.test(t))&&t>-1&&t%1==0&&t<n}},8286:function(t){t.exports=function(){return!1}},726:function(t,e,n){var r=n(163),o=n(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=e&&t in Object(e)}},2453:function(t){t.exports=function(t){return t}},4280:function(t,e,n){var r=n(6082),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),u=Array(s);++a<s;)u[a]=i[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=i[a];return c[e]=n(u),r(t,this,c)}}},2373:function(t,e,n){var r=n(2117),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},201:function(t){t.exports=function(t){return t}},7801:function(t,e,n){var r=n(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=a},3110:function(t,e,n){var r=n(1995);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},5034:function(t,e,n){var r=n(7709),o=n(6987),i=n(5812),a=Math.max,s=Math.min;t.exports=function(t,e,n){var u,c,l,f,h,p,x=0,d=!1,y=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var n=u,r=c;return u=c=void 0,x=e,f=t.apply(r,n)}function g(t){return x=t,h=setTimeout(M,e),d?v(t):f}function b(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-x>=l}function M(){var t=o();if(b(t))return w(t);h=setTimeout(M,function(t){var n=e-(t-p);return y?s(n,l-(t-x)):n}(t))}function w(t){return h=void 0,m&&u?v(t):(u=c=void 0,f)}function D(){var t=o(),n=b(t);if(u=arguments,c=this,p=t,n){if(void 0===h)return g(p);if(y)return clearTimeout(h),h=setTimeout(M,e),v(p)}return void 0===h&&(h=setTimeout(M,e)),f}return e=i(e)||0,r(n)&&(d=!!n.leading,l=(y="maxWait"in n)?a(i(n.maxWait)||0,e):l,m="trailing"in n?!!n.trailing:m),D.cancel=function(){void 0!==h&&clearTimeout(h),x=0,u=p=c=h=void 0},D.flush=function(){return void 0===h?f:w(o())},D}},1893:function(t,e,n){var r=n(6317),o=n(788),i=n(8286),a=n(8855),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&i(e[0],e[1],c)&&(r=1);++n<r;)for(var l=e[n],f=a(l),h=-1,p=f.length;++h<p;){var x=f[h],d=t[x];(void 0===d||o(d,s[x])&&!u.call(t,x))&&(t[x]=l[x])}return t}));t.exports=c},788:function(t){t.exports=function(t,e){return t===e||t!=t&&e!=e}},2645:function(t,e,n){var r=n(6457);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},5066:function(t,e,n){var r=n(6776),o=n(3096);t.exports=function(t,e){return null!=t&&o(t,e,r)}},5346:function(t){t.exports=function(t){return t}},5075:function(t){t.exports=function(){return!1}},163:function(t){var e=Array.isArray;t.exports=e},8454:function(t){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},7709:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},1995:function(t){t.exports=function(){return!1}},8855:function(t){t.exports=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}},6987:function(t,e,n){var r=n(2373);t.exports=function(){return r.Date.now()}},9082:function(t,e,n){var r=n(5436),o=n(5557)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},8532:function(t,e,n){var r=n(1600),o=n(3301),i=n(726),a=n(3110);t.exports=function(t){return i(t)?r(a(t)):o(t)}},8163:function(t,e,n){var r=n(5034),o=n(7709);t.exports=function(t,e,n){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),r(t,e,{leading:i,maxWait:e,trailing:a})}},5812:function(t){t.exports=function(t){return t}},7010:function(t,e,n){var r=n(6316);t.exports=function(t){return null==t?"":r(t)}},660:function(t,e,n){var r=n(7010),o=0;t.exports=function(t){var e=++o;return r(t)+e}},7491:function(t){var e="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){if(t.constructor!==a.constructor)return!1;var s,u,c,l;if(Array.isArray(t)){if((s=t.length)!=a.length)return!1;for(u=s;0!=u--;)if(!i(t[u],a[u]))return!1;return!0}if(n&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;for(l=t.entries();!(u=l.next()).done;)if(!i(u.value[1],a.get(u.value[0])))return!1;return!0}if(r&&t instanceof Set&&a instanceof Set){if(t.size!==a.size)return!1;for(l=t.entries();!(u=l.next()).done;)if(!a.has(u.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((s=t.length)!=a.length)return!1;for(u=s;0!=u--;)if(t[u]!==a[u])return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if((s=(c=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(u=s;0!=u--;)if(!Object.prototype.hasOwnProperty.call(a,c[u]))return!1;if(e&&t instanceof Element)return!1;for(u=s;0!=u--;)if(("_owner"!==c[u]&&"__v"!==c[u]&&"__o"!==c[u]||!t.$$typeof)&&!i(t[c[u]],a[c[u]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,e){try{return i(t,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:function(e){"use strict";e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){"use strict";r.r(o),r.d(o,{BrushHelpers:function(){return nt},VictoryBrushContainer:function(){return ot},brushContainerMixin:function(){return rt}});var t=r(1893),e=r.n(t),n=r(9787),i=r.n(n),a=r(7709),s=r.n(a),u=r(660),c=r.n(u);class l extends i().Component{static displayName="Portal";constructor(t){super(t),this.map={},this.index=1}portalRegister=()=>++this.index;portalUpdate=(t,e)=>{this.map[t]=e,this.forceUpdate()};portalDeregister=t=>{delete this.map[t],this.forceUpdate()};getChildren(){return Object.keys(this.map).map((t=>{const e=this.map[t];return e?i().cloneElement(e,{key:t}):e}))}render(){return i().createElement("svg",this.props,this.getChildren())}}const f=i().createContext({});f.displayName="PortalContext";var h,p,x=0,d=0,y=0,m=0,v=0,g=0,b="object"==typeof performance&&performance.now?performance:Date,M="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function w(){return v||(M(D),v=b.now()+g)}function D(){v=0}function B(){this._call=this._time=this._next=null}function O(t,e,n){var r=new B;return r.restart(t,e,n),r}function j(){v=(m=b.now())+g,x=d=0;try{!function(){w(),++x;for(var t,e=h;e;)(t=v-e._time)>=0&&e._call.call(void 0,t),e=e._next;--x}()}finally{x=0,function(){for(var t,e,n=h,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:h=e);p=t,S(r)}(),v=0}}function E(){var t=b.now(),e=t-m;e>1e3&&(g-=e,m=t)}function S(t){x||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(j,t-b.now()-g)),y&&(y=clearInterval(y))):(y||(m=b.now(),y=setInterval(E,1e3)),x=1,M(j)))}B.prototype=O.prototype={constructor:B,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?w():+n)+(null==e?0:+e),this._next||p===this||(p?p._next=this:h=this,p=this),this._call=t,this._time=n,S()},stop:function(){this._call&&(this._call=null,this._time=1/0,S())}};class A{constructor(){this.shouldAnimate=!0,this.subscribers=[],this.timer=null,this.activeSubscriptions=0}bypassAnimation(){this.shouldAnimate=!1}resumeAnimation(){this.shouldAnimate=!0}loop=()=>{this.subscribers.forEach((t=>{t.callback(w()-t.startTime,t.duration)}))};start(){this.timer||(this.timer=O(this.loop))}stop(){this.timer&&(this.timer.stop(),this.timer=null)}subscribe(t,e){const n=this.subscribers.push({startTime:w(),callback:t,duration:this.shouldAnimate?e:0});return this.activeSubscriptions++,this.start(),n}unsubscribe(t){null!==t&&this.subscribers[t-1]&&(delete this.subscribers[t-1],this.activeSubscriptions--),0===this.activeSubscriptions&&this.stop()}}const P=i().createContext({transitionTimer:new A,animationTimer:new A});P.displayName="TimerContext";var R=P;function C(t,e){return _(t)?t(e):t}function _(t){return"function"==typeof t}function T(t,e){if(t)return Object.keys(t).reduce(((n,r)=>(n[r]=e(t[r]),n)),{})}r(9082),r(8532);const G={startsWith:["data-","aria-"],exactMatch:[]},z=t=>{const e={...t};return Object.fromEntries(Object.entries(e).filter((t=>{let[e]=t;return(t=>!(!(t=>{let e=!1;return G.startsWith.forEach((n=>{new RegExp(`\\b(${n})(\\w|-)+`,"g").test(t)&&(e=!0)})),e})(t)&&!(t=>G.exactMatch.includes(t))(t)))(e)})).map((e=>{let[n,r]=e;return[n,C(r,t)]})))};function I(){return I=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},I.apply(this,arguments)}class N extends i().Component{static displayName="VictoryContainer";static role="container";static defaultProps={className:"VictoryContainer",portalComponent:i().createElement(l,null),portalZIndex:99,responsive:!0,role:"img"};static contextType=R;constructor(t){super(t),this.containerId=s()(t)&&void 0!==t.containerId?t.containerId:c()("victory-container-"),this.shouldHandleWheel=!!(t&&t.events&&t.events.onWheel)}savePortalRef=t=>(this.portalRef=t,t);portalUpdate=(t,e)=>this.portalRef.portalUpdate(t,e);portalRegister=()=>this.portalRef.portalRegister();portalDeregister=t=>this.portalRef.portalDeregister(t);saveContainerRef=t=>(_(this.props.containerRef)&&this.props.containerRef(t),this.containerRef=t,t);handleWheel=t=>t.preventDefault();componentDidMount(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.addEventListener("wheel",this.handleWheel)}componentWillUnmount(){this.shouldHandleWheel&&this.containerRef&&this.containerRef.removeEventListener("wheel",this.handleWheel)}getIdForElement(t){return`${this.containerId}-${t}`}getChildren(t){return t.children}getOUIAProps(t){const{ouiaId:e,ouiaSafe:n,ouiaType:r}=t;return{...e&&{"data-ouia-component-id":e},...r&&{"data-ouia-component-type":r},...void 0!==n&&{"data-ouia-safe":n}}}renderContainer(t,n,r){const{title:o,desc:a,portalComponent:s,className:u,width:c,height:l,portalZIndex:h,responsive:p}=t,x=this.getChildren(t),d=p?{width:"100%",height:"100%"}:{width:c,height:l},y=Object.assign({pointerEvents:"none",touchAction:"none",position:"relative"},d),m=Object.assign({zIndex:h,position:"absolute",top:0,left:0},d),v=Object.assign({pointerEvents:"all"},d),g=Object.assign({overflow:"visible"},d),b={width:c,height:l,viewBox:n.viewBox,preserveAspectRatio:n.preserveAspectRatio,style:g};return i().createElement(f.Provider,{value:{portalUpdate:this.portalUpdate,portalRegister:this.portalRegister,portalDeregister:this.portalDeregister}},i().createElement("div",I({style:e()({},r,y),className:u,ref:this.saveContainerRef},this.getOUIAProps(t)),i().createElement("svg",I({},n,{style:v}),o?i().createElement("title",{id:this.getIdForElement("title")},o):null,a?i().createElement("desc",{id:this.getIdForElement("desc")},a):null,x),i().createElement("div",{style:m},i().cloneElement(s,{...b,ref:this.savePortalRef}))))}render(){const{width:t,height:e,responsive:n,events:r,title:o,desc:i,tabIndex:a,preserveAspectRatio:s,role:u}=this.props,c=n?this.props.style:function(t,e){void 0===e&&(e=[]);const n={};for(const r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}(this.props.style,["height","width"]),l=z(this.props),f=Object.assign({width:t,height:e,tabIndex:a,role:u,"aria-labelledby":[o&&this.getIdForElement("title"),this.props["aria-labelledby"]].filter(Boolean).join(" ")||void 0,"aria-describedby":[i&&this.getIdForElement("desc"),this.props["aria-describedby"]].filter(Boolean).join(" ")||void 0,viewBox:n?`0 0 ${t} ${e}`:void 0,preserveAspectRatio:n?s:void 0,...l},r);return this.renderContainer(this.props,f,c)}}function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},U.apply(this,arguments)}const V=(0,n.forwardRef)(((t,e)=>{const{desc:n,id:r,tabIndex:o,origin:a,...s}=t,u={vectorEffect:"non-scaling-stroke",id:C(r,t)?.toString(),tabIndex:C(o,t),...s};return n?i().createElement("rect",U({},u,{ref:e}),i().createElement("desc",null,n)):i().createElement("rect",U({},u,{ref:e}))}));function W(t){return Array.isArray(t)&&t.some((t=>t instanceof Date))}function k(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=t.concat(n);return W(o)?new Date(Math.max(...o)):Math.max(...o)}function $(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];const o=t.concat(n);return W(o)?new Date(Math.min(...o)):Math.min(...o)}function H(t,e,n){const{a:r,d:o,e:i,f:a}=e;return"y"===n?o*t+a:r*t+i}function F(t){return!(!t||void 0===t.identifier)}function X(t){if(F(t.nativeEvent))return;const e=t=>"svg"===t.nodeName?t:t.parentNode?e(t.parentNode):t;return e(t.target)}function Y(t,e){if(F(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};const n=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,r=function(t){return t.getScreenCTM().inverse()}(e||X(n));return{x:H(n.clientX,r,"x"),y:H(n.clientY,r,"y")}}function q(t,e){const{horizontal:n}=t,r=t.scale,o=e||{x:r.x.domain(),y:r.y.domain()};return{x:n?[r.y(o.y[0]),r.y(o.y[1])]:[r.x(o.x[0]),r.x(o.x[1])],y:n?[r.x(o.x[0]),r.x(o.x[1])]:[r.y(o.y[0]),r.y(o.y[1])]}}function L(t,e,n,r){const{polar:o,horizontal:i}=t;if(!o)return{x:i?e.x.invert(r):e.x.invert(n),y:i?e.y.invert(n):e.y.invert(r)};const a=t.origin||{x:0,y:0},s=n-a.x,u=r-a.y,c=Math.abs(s*Math.sqrt(1+Math.pow(-u/s,2))),l=(-Math.atan2(u,s)+2*Math.PI)%(2*Math.PI);return{x:e.x.invert(l),y:e.y.invert(c)}}function Z(t){const{x1:e,x2:n,y1:r,y2:o,scale:i}=t,a=L(t,i,e,r),s=L(t,i,n,o),u=(t,e)=>[$([t,e]),k([t,e])];return{x:u(a.x,s.x),y:u(a.y,s.y)}}var J=r(8163),K=r.n(J),Q=r(7491),tt=r.n(Q);const et={getDimension(t){const{horizontal:e,brushDimension:n}=t;return e&&n?"x"===n?"y":"x":n},withinBounds(t,e,n){const{x1:r,x2:o,y1:i,y2:a}=T(e,Number),{x:s,y:u}=T(t,Number),c=n?n/2:0;return s+c>=Math.min(r,o)&&s-c<=Math.max(r,o)&&u+c>=Math.min(i,a)&&u-c<=Math.max(i,a)},getDomainBox(t,n,r){const o=this.getDimension(t),i=e()({},n,t.domain),a=e()({},r,i),s=q(t,i),u=q(t,a);return{x1:"y"!==o?Math.min(...u.x):Math.min(...s.x),x2:"y"!==o?Math.max(...u.x):Math.max(...s.x),y1:"x"!==o?Math.min(...u.y):Math.min(...s.y),y2:"x"!==o?Math.max(...u.y):Math.max(...s.y)}},getHandles(t,e){const n=this.getDimension(t),{x1:r,x2:o,y1:i,y2:a}=e,s=Math.min(r,o),u=Math.max(r,o),c=Math.min(i,a),l=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==n&&{x1:s-f,x2:s+f,y1:i,y2:a},right:"y"!==n&&{x1:u-f,x2:u+f,y1:i,y2:a},top:"x"!==n&&{x1:r,x2:o,y1:c-f,y2:c+f},bottom:"x"!==n&&{x1:r,x2:o,y1:l-f,y2:l+f}}},getActiveHandles(t,e,n){const r=this.getHandles(e,n),o=["top","bottom","left","right"].reduce(((e,n)=>r[n]&&this.withinBounds(t,r[n])?e.concat(n):e),[]);return o.length&&o},getResizeMutation(t,e){const{x1:n,y1:r,x2:o,y2:i}=t,a={left:{x1:Math.max(n,o),x2:Math.min(n,o),y1:r,y2:i},right:{x1:Math.min(n,o),x2:Math.max(n,o),y1:r,y2:i},top:{y1:Math.max(r,i),y2:Math.min(r,i),x1:n,x2:o},bottom:{y1:Math.min(r,i),y2:Math.max(r,i),x1:n,x2:o}};return e.reduce(((t,e)=>Object.assign(t,a[e])),{})},getMinimumDomain:()=>({x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}),getDefaultBrushArea(t,e,n){const{domain:r,fullDomain:o,scale:i,horizontal:a,allowResize:s}=t,u=s||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===u)return this.getMinimumDomain();if("disable"===u)return e;if("move"===u){const r=this.getDomainBox(t,o,e),s=t.parentSVG||X(n),u=this.panBox({...t,...r,brushDomain:e,startX:(r.x1+r.x2)/2,startY:(r.y1+r.y2)/2},Y(n,s)),c=t.fullDomainBox||this.getDomainBox(t,o);return Z({...this.constrainBox(u,c),scale:i,horizontal:a})}return r},getSelectionMutation(t,e,n){const{x:r,y:o}=t,{x1:i,x2:a,y1:s,y2:u}=e;return{x1:"y"!==n?r:i,y1:"x"!==n?o:s,x2:"y"!==n?r:a,y2:"x"!==n?o:u}},panBox(t,n){const{domain:r,startX:o,startY:i}=t,a=this.getDimension(t),s=e()({},t.brushDomain,r),u=e()({},t.fullDomain,r),{x1:c,x2:l,y1:f,y2:h}=t.x1?t:this.getDomainBox(t,u,s),{x:p,y:x}=n,d=o?o-p:0,y=i?i-x:0;return{x1:"y"!==a?Math.min(c,l)-d:Math.min(c,l),x2:"y"!==a?Math.max(c,l)-d:Math.max(c,l),y1:"x"!==a?Math.min(f,h)-y:Math.min(f,h),y2:"x"!==a?Math.max(f,h)-y:Math.max(f,h)}},constrainBox(t,e){const{x1:n,y1:r,x2:o,y2:i}=T(e,Number);return{x1:t.x2>o?o-Math.abs(t.x2-t.x1):Math.max(t.x1,n),y1:t.y2>i?i-Math.abs(t.y2-t.y1):Math.max(t.y1,r),x2:t.x1<n?n+Math.abs(t.x2-t.x1):Math.min(t.x2,o),y2:t.y1<r?r+Math.abs(t.y2-t.y1):Math.min(t.y2,i)}},constrainPoint(t,e){const{x1:n,y1:r,x2:o,y2:i}=T(e,Number);return{x:Math.min(Math.max(t.x,n),o),y:Math.min(Math.max(t.y,r),i)}},hasMoved(t){const{x1:e,x2:n,y1:r,y2:o,mouseMoveThreshold:i}=t,a=this.getDimension(t),s=Math.abs(e-n)>=i,u=Math.abs(r-o)>=i;switch(a){case"x":return s;case"y":return u;default:return s||u}},onMouseDown(t,n){t.preventDefault();const{handleWidth:r,cachedBrushDomain:o,domain:i,allowResize:a,allowDrag:s,allowDraw:u}=n,c=this.getDimension(n),l=a||n.defaultBrushArea?n.defaultBrushArea:"move";if(!a&&!s)return{};const f=n.fullDomainBox||this.getDomainBox(n,i),h=n.parentSVG||X(t),{x:p,y:x}=Y(t,h);if(!this.withinBounds({x:p,y:x},f,r))return{};const d=e()({},n.brushDomain,i),y=tt()(d,o)?n.currentDomain||d||i:d||i,m=this.getDomainBox(n,i,y),v=a&&this.getActiveHandles({x:p,y:x},n,m);return v?[{target:"parent",mutation:()=>({isSelecting:!0,domainBox:m,fullDomainBox:f,cachedBrushDomain:d,currentDomain:y,parentSVG:h,...this.getResizeMutation(m,v)})}]:this.withinBounds({x:p,y:x},m)&&!tt()(i,y)?[{target:"parent",mutation:()=>({isPanning:s,startX:p,startY:x,domainBox:m,fullDomainBox:f,currentDomain:y,cachedBrushDomain:d,parentSVG:h,...m})}]:u?[{target:"parent",mutation:()=>({isSelecting:a||"move"===l,domainBox:m,fullDomainBox:f,parentSVG:h,cachedBrushDomain:d,cachedCurrentDomain:y,currentDomain:this.getMinimumDomain(),...this.getSelectionMutation({x:p,y:x},m,c)})}]:{}},onGlobalMouseMove(t,n){const{scale:r,isPanning:o,isSelecting:i,fullDomainBox:a,onBrushDomainChange:s,allowResize:u,allowDrag:c,horizontal:l,mouseMoveThreshold:f,parentSVG:h}=n,p=this.getDimension(n),{x:x,y:d}=Y(t,h);if(!u&&!c||f>0&&!this.hasMoved({...n,x2:x,y2:d}))return{};if(c&&o){const{startX:t,startY:o}=n,i=this.panBox(n,{x:x,y:d}),u=this.constrainBox(i,a),c=Z({...u,scale:r,horizontal:l}),f={currentDomain:c,parentSVG:h,startX:i.x2>=a.x2||i.x1<=a.x1?t:x,startY:i.y2>=a.y2||i.y1<=a.y1?o:d,...u};return _(s)&&s(c,e()({},f,n)),[{target:"parent",mutation:()=>f}]}if(u&&i){const{x:t,y:o}=this.constrainPoint({x:"y"!==p?x:n.x2,y:"x"!==p?d:n.y2},a),i=Z({x2:t,y2:o,x1:n.x1,y1:n.y1,scale:r,horizontal:l}),u={x2:t,y2:o,currentDomain:i,parentSVG:h};return _(s)&&s(i,e()({},u,n)),[{target:"parent",mutation:()=>u}]}return{}},onGlobalMouseUp(t,n){if(!n.isPanning&&!n.isSelecting)return{};const{x1:r,y1:o,x2:i,y2:a,isPanning:s,isSelecting:u,onBrushDomainChange:c,onBrushDomainChangeEnd:l,onBrushCleared:f,currentDomain:h,allowResize:p,allowDrag:x}=n,d=p||n.defaultBrushArea?n.defaultBrushArea:"move",y={isPanning:!1,isSelecting:!1};if(!p&&(void 0===d||"none"===d)||r!==i&&o!==a)(x&&s||p&&u)&&_(l)&&l(h,e()({},y,n));else{const r=n.cachedCurrentDomain||h,o=this.getDefaultBrushArea(n,r,t);y.currentDomain=o,_(c)&&c(o,e()({},y,n)),_(l)&&l(o,e()({},y,n)),_(f)&&f(o,e()({},y,n))}return[{target:"parent",mutation:()=>y}]}},nt={...et,onMouseDown:et.onMouseDown.bind(et),onGlobalMouseUp:et.onGlobalMouseUp.bind(et),onGlobalMouseMove:K()(et.onGlobalMouseMove.bind(et),16,{leading:!0,trailing:!1})};function rt(t){return class extends t{static displayName="VictoryBrushContainer";static defaultProps={...N.defaultProps,allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:i().createElement(V,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:i().createElement(V,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0};static defaultEvents(t){return[{target:"parent",eventHandlers:{onMouseDown:(e,n)=>t.disable?{}:nt.onMouseDown(e,n),onTouchStart:(e,n)=>t.disable?{}:nt.onMouseDown(e,n),onGlobalMouseMove:(e,n)=>t.disable||!n.isPanning&&!n.isSelecting?{}:nt.onGlobalMouseMove(e,n),onGlobalTouchMove:(e,n)=>t.disable||!n.isPanning&&!n.isSelecting?{}:nt.onGlobalMouseMove(e,n),onGlobalMouseUp:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n),onGlobalTouchEnd:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n),onGlobalTouchCancel:(e,n)=>t.disable?{}:nt.onGlobalMouseUp(e,n)}}]}getSelectBox(t,n){const{x:r,y:o}=n,{brushStyle:a,brushComponent:s,name:u}=t,c=s.props&&s.props.style,l=t.allowDrag||t.allowResize?"move":"auto";return r[0]!==r[1]&&o[0]!==o[1]?i().cloneElement(s,{key:`${u}-brush`,width:Math.abs(r[1]-r[0])||1,height:Math.abs(o[1]-o[0])||1,x:Math.min(r[0],r[1]),y:Math.min(o[0],o[1]),cursor:l,style:e()({},c,a)}):null}getCursorPointers(t){const e={yProps:"ns-resize",xProps:"ew-resize"};return!t.allowResize&&t.allowDrag?(e.xProps="move",e.yProps="move"):t.allowResize||t.allowDrag||(e.xProps="auto",e.yProps="auto"),e}getHandles(t,n){const{handleWidth:r,handleStyle:o,handleComponent:a,name:s}=t,u=nt.getDomainBox(t,n),{x1:c,x2:l,y1:f,y2:h}=u,{top:p,bottom:x,left:d,right:y}=nt.getHandles(t,u),m=Math.abs(l-c)||1,v=Math.abs(h-f)||1,g=a.props&&a.props.style||{},b=e()({},g,o),M=this.getCursorPointers(t),w={style:b,width:m,height:r,cursor:M.yProps},D={style:b,width:r,height:v,cursor:M.xProps},B={top:p&&Object.assign({x:p.x1,y:p.y1},w),bottom:x&&Object.assign({x:x.x1,y:x.y1},w),left:d&&Object.assign({y:d.y1,x:d.x1},D),right:y&&Object.assign({y:y.y1,x:y.x1},D)},O=["top","bottom","left","right"].reduce(((t,e)=>B[e]?t.concat(i().cloneElement(a,Object.assign({key:`${s}-handle-${e}`},B[e]))):t),[]);return O.length?O:null}getRect(t){const{currentDomain:n,cachedBrushDomain:r}=t,o=e()({},t.brushDomain,t.domain),i=tt()(o,r)?e()({},n,o):o,a=q(t,i),s=this.getSelectBox(t,a);return s?[s,this.getHandles(t,i)]:[]}getChildren(t){return[...i().Children.toArray(t.children),...this.getRect(t)]}}}const ot=rt(N)}(),o}()}));
|
|
2
2
|
//# sourceMappingURL=victory-brush-container.min.js.map
|
package/es/brush-helpers.d.ts
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
|
-
export declare const BrushHelpers: {
|
|
3
|
-
onMouseDown: (evt: any, targetProps: any) => {};
|
|
4
|
-
onGlobalMouseUp: (evt: any, targetProps: any) => {};
|
|
5
|
-
onGlobalMouseMove: import("lodash").DebouncedFunc<(evt: any, targetProps: any) => {}>;
|
|
6
|
-
getDimension(props: any): any;
|
|
7
|
-
withinBounds(point: any, bounds: any, padding?: any): boolean;
|
|
8
|
-
getDomainBox(props: any, fullDomain: any, selectedDomain?: any): {
|
|
9
|
-
x1: number;
|
|
10
|
-
x2: number;
|
|
11
|
-
y1: number;
|
|
12
|
-
y2: number;
|
|
13
|
-
};
|
|
14
|
-
getHandles(props: any, domainBox: any): {
|
|
15
|
-
left: false | {
|
|
16
|
-
x1: number;
|
|
17
|
-
x2: number;
|
|
18
|
-
y1: any;
|
|
19
|
-
y2: any;
|
|
20
|
-
};
|
|
21
|
-
right: false | {
|
|
22
|
-
x1: number;
|
|
23
|
-
x2: number;
|
|
24
|
-
y1: any;
|
|
25
|
-
y2: any;
|
|
26
|
-
};
|
|
27
|
-
top: false | {
|
|
28
|
-
x1: any;
|
|
29
|
-
x2: any;
|
|
30
|
-
y1: number;
|
|
31
|
-
y2: number;
|
|
32
|
-
};
|
|
33
|
-
bottom: false | {
|
|
34
|
-
x1: any;
|
|
35
|
-
x2: any;
|
|
36
|
-
y1: number;
|
|
37
|
-
y2: number;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
getActiveHandles(point: any, props: any, domainBox: any): 0 | string[];
|
|
41
|
-
getResizeMutation(box: any, handles: any): any;
|
|
42
|
-
getMinimumDomain(): {
|
|
43
|
-
x: number[];
|
|
44
|
-
y: number[];
|
|
45
|
-
};
|
|
46
|
-
getDefaultBrushArea(targetProps: any, cachedDomain: any, evt: any): any;
|
|
47
|
-
getSelectionMutation(point: any, box: any, brushDimension: any): {
|
|
48
|
-
x1: any;
|
|
49
|
-
y1: any;
|
|
50
|
-
x2: any;
|
|
51
|
-
y2: any;
|
|
52
|
-
};
|
|
53
|
-
panBox(props: any, point: any): {
|
|
54
|
-
x1: number;
|
|
55
|
-
x2: number;
|
|
56
|
-
y1: number;
|
|
57
|
-
y2: number;
|
|
58
|
-
};
|
|
59
|
-
constrainBox(box: any, fullDomainBox: any): {
|
|
60
|
-
x1: number;
|
|
61
|
-
y1: number;
|
|
62
|
-
x2: any;
|
|
63
|
-
y2: any;
|
|
64
|
-
};
|
|
65
|
-
constrainPoint(point: any, fullDomainBox: any): {
|
|
66
|
-
x: number;
|
|
67
|
-
y: number;
|
|
68
|
-
};
|
|
69
|
-
hasMoved(props: any): boolean;
|
|
70
|
-
};
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
export declare const BrushHelpers: {
|
|
3
|
+
onMouseDown: (evt: any, targetProps: any) => {};
|
|
4
|
+
onGlobalMouseUp: (evt: any, targetProps: any) => {};
|
|
5
|
+
onGlobalMouseMove: import("lodash").DebouncedFunc<(evt: any, targetProps: any) => {}>;
|
|
6
|
+
getDimension(props: any): any;
|
|
7
|
+
withinBounds(point: any, bounds: any, padding?: any): boolean;
|
|
8
|
+
getDomainBox(props: any, fullDomain: any, selectedDomain?: any): {
|
|
9
|
+
x1: number;
|
|
10
|
+
x2: number;
|
|
11
|
+
y1: number;
|
|
12
|
+
y2: number;
|
|
13
|
+
};
|
|
14
|
+
getHandles(props: any, domainBox: any): {
|
|
15
|
+
left: false | {
|
|
16
|
+
x1: number;
|
|
17
|
+
x2: number;
|
|
18
|
+
y1: any;
|
|
19
|
+
y2: any;
|
|
20
|
+
};
|
|
21
|
+
right: false | {
|
|
22
|
+
x1: number;
|
|
23
|
+
x2: number;
|
|
24
|
+
y1: any;
|
|
25
|
+
y2: any;
|
|
26
|
+
};
|
|
27
|
+
top: false | {
|
|
28
|
+
x1: any;
|
|
29
|
+
x2: any;
|
|
30
|
+
y1: number;
|
|
31
|
+
y2: number;
|
|
32
|
+
};
|
|
33
|
+
bottom: false | {
|
|
34
|
+
x1: any;
|
|
35
|
+
x2: any;
|
|
36
|
+
y1: number;
|
|
37
|
+
y2: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
getActiveHandles(point: any, props: any, domainBox: any): 0 | string[];
|
|
41
|
+
getResizeMutation(box: any, handles: any): any;
|
|
42
|
+
getMinimumDomain(): {
|
|
43
|
+
x: number[];
|
|
44
|
+
y: number[];
|
|
45
|
+
};
|
|
46
|
+
getDefaultBrushArea(targetProps: any, cachedDomain: any, evt: any): any;
|
|
47
|
+
getSelectionMutation(point: any, box: any, brushDimension: any): {
|
|
48
|
+
x1: any;
|
|
49
|
+
y1: any;
|
|
50
|
+
x2: any;
|
|
51
|
+
y2: any;
|
|
52
|
+
};
|
|
53
|
+
panBox(props: any, point: any): {
|
|
54
|
+
x1: number;
|
|
55
|
+
x2: number;
|
|
56
|
+
y1: number;
|
|
57
|
+
y2: number;
|
|
58
|
+
};
|
|
59
|
+
constrainBox(box: any, fullDomainBox: any): {
|
|
60
|
+
x1: number;
|
|
61
|
+
y1: number;
|
|
62
|
+
x2: any;
|
|
63
|
+
y2: any;
|
|
64
|
+
};
|
|
65
|
+
constrainPoint(point: any, fullDomainBox: any): {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
};
|
|
69
|
+
hasMoved(props: any): boolean;
|
|
70
|
+
};
|
|
71
71
|
//# sourceMappingURL=brush-helpers.d.ts.map
|
package/es/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./victory-brush-container";
|
|
2
|
-
export * from "./brush-helpers";
|
|
1
|
+
export * from "./victory-brush-container";
|
|
2
|
+
export * from "./brush-helpers";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|