victory-brush-container 37.3.1 → 37.3.3
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 +8 -0
- package/dist/victory-brush-container.js +137 -96
- package/dist/victory-brush-container.min.js +1 -1
- package/es/brush-helpers.d.ts +0 -1
- package/es/brush-helpers.js +14 -18
- package/es/victory-brush-container.d.ts +41 -41
- package/es/victory-brush-container.js +5 -5
- package/lib/brush-helpers.d.ts +0 -1
- package/lib/brush-helpers.js +14 -18
- package/lib/victory-brush-container.d.ts +41 -41
- package/lib/victory-brush-container.js +5 -5
- package/package.json +6 -38
- package/src/brush-helpers.ts +4 -5
- package/src/victory-brush-container.tsx +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.VictoryBrushContainer=n(require("react")):t.VictoryBrushContainer=n(t.React)}(self,(function(t){return function(){var n={2596:function(t,n,e){var r=e(2373).Symbol;t.exports=r},6082:function(t){t.exports=function(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}},8644:function(t){t.exports=function(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}},9559:function(t){t.exports=function(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}},4132:function(t,n,e){var r=e(8347),o=e(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,n,e){var a=t[n];i.call(t,n)&&o(a,e)&&(void 0!==e||n in t)||r(t,n,e)}},8347:function(t,n,e){var r=e(5525);t.exports=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}},6457:function(t,n,e){var r=e(9559),o=e(3608);t.exports=function t(n,e,i,a,u){var s=-1,c=n.length;for(i||(i=o),u||(u=[]);++s<c;){var l=n[s];e>0&&i(l)?e>1?t(l,e-1,i,a,u):r(u,l):a||(u[u.length]=l)}return u}},4432:function(t,n,e){var r=e(9026),o=e(3110);t.exports=function(t,n){for(var e=0,i=(n=r(n,t)).length;null!=t&&e<i;)t=t[o(n[e++])];return e&&e==i?t:void 0}},6776:function(t){t.exports=function(t,n){return null!=t&&n in Object(t)}},5436:function(t,n,e){var r=e(6371),o=e(5066);t.exports=function(t,n){return r(t,n,(function(n,e){return o(t,e)}))}},6371:function(t,n,e){var r=e(4432),o=e(6539),i=e(9026);t.exports=function(t,n,e){for(var a=-1,u=n.length,s={};++a<u;){var c=n[a],l=r(t,c);e(l,c)&&o(s,i(c,t),l)}return s}},1600:function(t){t.exports=function(t){return function(n){return null==n?void 0:n[t]}}},3301:function(t,n,e){var r=e(4432);t.exports=function(t){return function(n){return r(n,t)}}},6317:function(t,n,e){var r=e(5346),o=e(4280),i=e(201);t.exports=function(t,n){return i(o(t,n,r),t+"")}},6539:function(t,n,e){var r=e(4132),o=e(9026),i=e(9099),a=e(7709),u=e(3110);t.exports=function(t,n,e,s){if(!a(t))return t;for(var c=-1,l=(n=o(n,t)).length,f=l-1,h=t;null!=h&&++c<l;){var x=u(n[c]),y=e;if("__proto__"===x||"constructor"===x||"prototype"===x)return t;if(c!=f){var p=h[x];void 0===(y=s?s(p,x,h):void 0)&&(y=a(p)?p:i(n[c+1])?[]:{})}r(h,x,y),h=h[x]}return t}},6316:function(t,n,e){var r=e(2596),o=e(8644),i=e(163),a=e(1995),u=r?r.prototype:void 0,s=u?u.toString:void 0;t.exports=function t(n){if("string"==typeof n)return n;if(i(n))return o(n,t)+"";if(a(n))return s?s.call(n):"";var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}},9026:function(t,n,e){var r=e(163),o=e(726),i=e(7801),a=e(7010);t.exports=function(t,n){return r(t)?t:o(t,n)?[t]:i(a(t))}},5525:function(t,n,e){var r=e(3743),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:function(t,n,e){var r=e(2645),o=e(4280),i=e(201);t.exports=function(t){return i(o(t,void 0,r),t+"")}},2117:function(t,n,e){var r="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=r},3743:function(t){t.exports=function(t,n){return null==t?void 0:t[n]}},3096:function(t,n,e){var r=e(9026),o=e(5075),i=e(163),a=e(9099),u=e(8454),s=e(3110);t.exports=function(t,n,e){for(var c=-1,l=(n=r(n,t)).length,f=!1;++c<l;){var h=s(n[c]);if(!(f=null!=t&&e(t,h)))break;t=t[h]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&u(l)&&a(h,l)&&(i(t)||o(t))}},3608:function(t,n,e){var r=e(2596),o=e(5075),i=e(163),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:function(t){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},8286:function(t){t.exports=function(){return!1}},726:function(t,n,e){var r=e(163),o=e(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,n){if(r(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=n&&t in Object(n)}},2453:function(t){t.exports=function(t){return t}},4280:function(t,n,e){var r=e(6082),o=Math.max;t.exports=function(t,n,e){return n=o(void 0===n?t.length-1:n,0),function(){for(var i=arguments,a=-1,u=o(i.length-n,0),s=Array(u);++a<u;)s[a]=i[n+a];a=-1;for(var c=Array(n+1);++a<n;)c[a]=i[a];return c[n]=e(s),r(t,this,c)}}},2373:function(t,n,e){var r=e(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,n,e){var r=e(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(o,(function(t,e,r,o){n.push(r?o.replace(i,"$1"):e||t)})),n}));t.exports=a},3110:function(t,n,e){var r=e(1995);t.exports=function(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},5034:function(t,n,e){var r=e(7709),o=e(6987),i=e(5812),a=Math.max,u=Math.min;t.exports=function(t,n,e){var s,c,l,f,h,x,y=0,p=!1,d=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(n){var e=s,r=c;return s=c=void 0,y=n,f=t.apply(r,e)}function g(t){return y=t,h=setTimeout(M,n),p?v(t):f}function b(t){var e=t-x;return void 0===x||e>=n||e<0||d&&t-y>=l}function M(){var t=o();if(b(t))return w(t);h=setTimeout(M,function(t){var e=n-(t-x);return d?u(e,l-(t-y)):e}(t))}function w(t){return h=void 0,m&&s?v(t):(s=c=void 0,f)}function D(){var t=o(),e=b(t);if(s=arguments,c=this,x=t,e){if(void 0===h)return g(x);if(d)return clearTimeout(h),h=setTimeout(M,n),v(x)}return void 0===h&&(h=setTimeout(M,n)),f}return n=i(n)||0,r(e)&&(p=!!e.leading,l=(d="maxWait"in e)?a(i(e.maxWait)||0,n):l,m="trailing"in e?!!e.trailing:m),D.cancel=function(){void 0!==h&&clearTimeout(h),y=0,s=x=c=h=void 0},D.flush=function(){return void 0===h?f:w(o())},D}},1893:function(t,n,e){var r=e(6317),o=e(788),i=e(8286),a=e(8855),u=Object.prototype,s=u.hasOwnProperty,c=r((function(t,n){t=Object(t);var e=-1,r=n.length,c=r>2?n[2]:void 0;for(c&&i(n[0],n[1],c)&&(r=1);++e<r;)for(var l=n[e],f=a(l),h=-1,x=f.length;++h<x;){var y=f[h],p=t[y];(void 0===p||o(p,u[y])&&!s.call(t,y))&&(t[y]=l[y])}return t}));t.exports=c},788:function(t){t.exports=function(t,n){return t===n||t!=t&&n!=n}},2645:function(t,n,e){var r=e(6457);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},5066:function(t,n,e){var r=e(6776),o=e(3096);t.exports=function(t,n){return null!=t&&o(t,n,r)}},5346:function(t){t.exports=function(t){return t}},5075:function(t){t.exports=function(){return!1}},163:function(t){var n=Array.isArray;t.exports=n},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 n=typeof t;return null!=t&&("object"==n||"function"==n)}},1995:function(t){t.exports=function(){return!1}},8855:function(t){t.exports=function(t){var n=[];if(null!=t)for(var e in Object(t))n.push(e);return n}},6987:function(t,n,e){var r=e(2373);t.exports=function(){return r.Date.now()}},9082:function(t,n,e){var r=e(5436),o=e(5557)((function(t,n){return null==t?{}:r(t,n)}));t.exports=o},8532:function(t,n,e){var r=e(1600),o=e(3301),i=e(726),a=e(3110);t.exports=function(t){return i(t)?r(a(t)):o(t)}},8163:function(t,n,e){var r=e(5034),o=e(7709);t.exports=function(t,n,e){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(e)&&(i="leading"in e?!!e.leading:i,a="trailing"in e?!!e.trailing:a),r(t,n,{leading:i,maxWait:n,trailing:a})}},5812:function(t){t.exports=function(t){return t}},7010:function(t,n,e){var r=e(6316);t.exports=function(t){return null==t?"":r(t)}},660:function(t,n,e){var r=e(7010),o=0;t.exports=function(t){var n=++o;return r(t)+n}},7491:function(t){var n="undefined"!=typeof Element,e="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 u,s,c,l;if(Array.isArray(t)){if((u=t.length)!=a.length)return!1;for(s=u;0!=s--;)if(!i(t[s],a[s]))return!1;return!0}if(e&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(l=t.entries();!(s=l.next()).done;)if(!a.has(s.value[0]))return!1;for(l=t.entries();!(s=l.next()).done;)if(!i(s.value[1],a.get(s.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();!(s=l.next()).done;)if(!a.has(s.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((u=t.length)!=a.length)return!1;for(s=u;0!=s--;)if(t[s]!==a[s])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((u=(c=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(s=u;0!=s--;)if(!Object.prototype.hasOwnProperty.call(a,c[s]))return!1;if(n&&t instanceof Element)return!1;for(s=u;0!=s--;)if(("_owner"!==c[s]&&"__v"!==c[s]&&"__o"!==c[s]||!t.$$typeof)&&!i(t[c[s]],a[c[s]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,n){try{return i(t,n)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:function(n){"use strict";n.exports=t}},e={};function r(t){var o=e[t];if(void 0!==o)return o.exports;var i=e[t]={exports:{}};return n[t](i,i.exports,r),i.exports}r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,{a:n}),n},r.d=function(t,n){for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},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,n){return Object.prototype.hasOwnProperty.call(t,n)},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 N},VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS:function(){return V},VictoryBrushContainer:function(){return k},useVictoryBrushContainer:function(){return $}});var t=r(1893),n=r.n(t),e=r(9787),i=r.n(e);function a(t,n){return u(t)?t(n):t}function u(t){return"function"==typeof t}function s(t,n){if(t)return Object.keys(t).reduce(((e,r)=>(e[r]=n(t[r]),e)),{})}function c(){return c=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c.apply(this,arguments)}r(9082),r(8532);const l=(0,e.forwardRef)(((t,n)=>{const{desc:e,id:r,tabIndex:o,origin:u,...s}=t,l={vectorEffect:"non-scaling-stroke",id:a(r,t)?.toString(),tabIndex:a(o,t),...s};return e?i().createElement("rect",c({},l,{ref:n}),i().createElement("desc",null,e)):i().createElement("rect",c({},l,{ref:n}))}));function f(t){return Array.isArray(t)&&t.some((t=>t instanceof Date))}function h(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];const o=t.concat(e);return f(o)?new Date(Math.max(...o)):Math.max(...o)}function x(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];const o=t.concat(e);return f(o)?new Date(Math.min(...o)):Math.min(...o)}function y(t,n,e){const{a:r,d:o,e:i,f:a}=n;return"y"===e?o*t+a:r*t+i}function p(t){return!(!t||void 0===t.identifier)}function d(t){if(p(t.nativeEvent))return;const n=t=>"svg"===t.nodeName?t:t.parentNode?n(t.parentNode):t;return n(t.target)}function m(t,n){if(p(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};const e=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,r=function(t){return t.getScreenCTM().inverse()}(n||d(e));return{x:y(e.clientX,r,"x"),y:y(e.clientY,r,"y")}}function v(t,n){const{horizontal:e}=t,r=t.scale,o=n||{x:r.x.domain(),y:r.y.domain()};return{x:e?[r.y(o.y[0]),r.y(o.y[1])]:[r.x(o.x[0]),r.x(o.x[1])],y:e?[r.x(o.x[0]),r.x(o.x[1])]:[r.y(o.y[0]),r.y(o.y[1])]}}function g(t,n,e,r){const{polar:o,horizontal:i}=t;if(!o)return{x:i?n.x.invert(r):n.x.invert(e),y:i?n.y.invert(e):n.y.invert(r)};const a=t.origin||{x:0,y:0},u=e-a.x,s=r-a.y,c=Math.abs(u*Math.sqrt(1+Math.pow(-s/u,2))),l=(-Math.atan2(s,u)+2*Math.PI)%(2*Math.PI);return{x:n.x.invert(l),y:n.y.invert(c)}}function b(t){const{x1:n,x2:e,y1:r,y2:o,scale:i}=t,a=g(t,i,n,r),u=g(t,i,e,o),s=(t,n)=>[x([t,n]),h([t,n])];return{x:s(a.x,u.x),y:s(a.y,u.y)}}var M=r(660),w=r.n(M);function D(){return D=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},D.apply(this,arguments)}const B=i().forwardRef(((t,n)=>i().createElement("svg",D({ref:n},t)))),O={startsWith:["data-","aria-"],exactMatch:[]},E=t=>{const n={...t};return Object.fromEntries(Object.entries(n).filter((t=>{let[n]=t;return(t=>!(!(t=>{let n=!1;return O.startsWith.forEach((e=>{new RegExp(`\\b(${e})(\\w|-)+`,"g").test(t)&&(n=!0)})),n})(t)&&!(t=>O.exactMatch.includes(t))(t)))(n)})).map((n=>{let[e,r]=n;return[e,a(r,t)]})))},j=i().createContext(void 0);j.displayName="PortalContext";const S=t=>{let{children:n}=t;const[e,r]=i().useState(new Map),o=i().useCallback(((t,n)=>{r((e=>{const r=new Map(e);return r.set(t,n),r}))}),[r]),a=i().useCallback((t=>{r((n=>{const e=new Map(n);return e.delete(t),e}))}),[r]),u=i().useMemo((()=>({addChild:o,removeChild:a,children:e})),[o,a,e]);return i().createElement(j.Provider,{value:u},n)},A=t=>{let{as:n,...e}=t;const r=i().useContext(j);if(!r)return null;const o=Array.from(r.children.values());return i().cloneElement(n,e,o)};function P(){return P=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},P.apply(this,arguments)}const C={className:"VictoryContainer",portalComponent:i().createElement(B,null),portalZIndex:99,responsive:!0,role:"img"},R=t=>{const{role:n,title:r,desc:o,children:a,className:s,portalZIndex:c,portalComponent:l,width:f,height:h,style:x,tabIndex:y,responsive:p,events:d,ouiaId:m,ouiaSafe:v,ouiaType:g,dimensions:b,ariaDescribedBy:M,ariaLabelledBy:D,viewBox:B,preserveAspectRatio:O,userProps:j,titleId:R,descId:T,containerRef:G,localContainerRef:z}=function(t){const n={...C,...t},{title:r,desc:o,width:i,height:a,responsive:u}=n,s=(0,e.useRef)(null),c=(0,e.useRef)(w()("victory-container-")),l=n.containerId??c.current,f=t=>`${l}-${t}`,h=E(n),x=u?{width:"100%",height:"100%"}:{width:i,height:a},y=u?`0 0 ${i} ${a}`:void 0,p=u?n.preserveAspectRatio:void 0,d=[r&&f("title"),n["aria-labelledby"]].filter(Boolean).join(" ")||void 0,m=[o&&f("desc"),n["aria-describedby"]].filter(Boolean).join(" ")||void 0,v=f("title"),g=f("desc");return{...n,titleId:v,descId:g,dimensions:x,viewBox:y,preserveAspectRatio:p,ariaLabelledBy:d,ariaDescribedBy:m,userProps:h,localContainerRef:s}}(t);return i().useEffect((()=>{if(!d?.onWheel)return;const t=t=>t.preventDefault(),n=z?.current;return n?.addEventListener("wheel",t),()=>{n?.removeEventListener("wheel",t)}}),[]),i().createElement("div",{className:s,style:{...x,width:p?x?.width:b.width,height:p?x?.height:b.height,pointerEvents:"none",touchAction:"none",position:"relative"},"data-ouia-component-id":m,"data-ouia-component-type":g,"data-ouia-safe":v,ref:(_=[z,G],t=>{_.forEach((n=>{u(n)?n(t):null!=n&&(n.current=t)}))})},i().createElement(S,null,i().createElement("svg",P({width:f,height:h,tabIndex:y,role:n,"aria-labelledby":D,"aria-describedby":M,viewBox:B,preserveAspectRatio:O,style:{...b,pointerEvents:"all"}},j,d),r?i().createElement("title",{id:R},r):null,o?i().createElement("desc",{id:T},o):null,a),i().createElement("div",{style:{...b,zIndex:c,position:"absolute",top:0,left:0}},i().createElement(A,{as:l,width:f,height:h,viewBox:B,preserveAspectRatio:O,style:{...b,overflow:"visible"}}))));var _};R.role="container";var T=r(8163),G=r.n(T),z=r(7491),_=r.n(z);const I={getDimension(t){const{horizontal:n,brushDimension:e}=t;return n&&e?"x"===e?"y":"x":e},withinBounds(t,n,e){const{x1:r,x2:o,y1:i,y2:a}=s(n,Number),{x:u,y:c}=s(t,Number),l=e?e/2:0;return u+l>=Math.min(r,o)&&u-l<=Math.max(r,o)&&c+l>=Math.min(i,a)&&c-l<=Math.max(i,a)},getDomainBox(t,e,r){const o=this.getDimension(t),i=n()({},e,t.domain),a=n()({},r,i),u=v(t,i),s=v(t,a);return{x1:"y"!==o?Math.min(...s.x):Math.min(...u.x),x2:"y"!==o?Math.max(...s.x):Math.max(...u.x),y1:"x"!==o?Math.min(...s.y):Math.min(...u.y),y2:"x"!==o?Math.max(...s.y):Math.max(...u.y)}},getHandles(t,n){const e=this.getDimension(t),{x1:r,x2:o,y1:i,y2:a}=n,u=Math.min(r,o),s=Math.max(r,o),c=Math.min(i,a),l=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==e&&{x1:u-f,x2:u+f,y1:i,y2:a},right:"y"!==e&&{x1:s-f,x2:s+f,y1:i,y2:a},top:"x"!==e&&{x1:r,x2:o,y1:c-f,y2:c+f},bottom:"x"!==e&&{x1:r,x2:o,y1:l-f,y2:l+f}}},getActiveHandles(t,n,e){const r=this.getHandles(n,e),o=["top","bottom","left","right"].reduce(((n,e)=>r[e]&&this.withinBounds(t,r[e])?n.concat(e):n),[]);return o.length&&o},getResizeMutation(t,n){const{x1:e,y1:r,x2:o,y2:i}=t,a={left:{x1:Math.max(e,o),x2:Math.min(e,o),y1:r,y2:i},right:{x1:Math.min(e,o),x2:Math.max(e,o),y1:r,y2:i},top:{y1:Math.max(r,i),y2:Math.min(r,i),x1:e,x2:o},bottom:{y1:Math.min(r,i),y2:Math.max(r,i),x1:e,x2:o}};return n.reduce(((t,n)=>Object.assign(t,a[n])),{})},getMinimumDomain:()=>({x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}),getDefaultBrushArea(t,n,e){const{domain:r,fullDomain:o,scale:i,horizontal:a,allowResize:u}=t,s=u||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===s)return this.getMinimumDomain();if("disable"===s)return n;if("move"===s){const r=this.getDomainBox(t,o,n),u=t.parentSVG||d(e),s=this.panBox({...t,...r,brushDomain:n,startX:(r.x1+r.x2)/2,startY:(r.y1+r.y2)/2},m(e,u)),c=t.fullDomainBox||this.getDomainBox(t,o);return b({...this.constrainBox(s,c),scale:i,horizontal:a})}return r},getSelectionMutation(t,n,e){const{x:r,y:o}=t,{x1:i,x2:a,y1:u,y2:s}=n;return{x1:"y"!==e?r:i,y1:"x"!==e?o:u,x2:"y"!==e?r:a,y2:"x"!==e?o:s}},panBox(t,e){const{domain:r,startX:o,startY:i}=t,a=this.getDimension(t),u=n()({},t.brushDomain,r),s=n()({},t.fullDomain,r),{x1:c,x2:l,y1:f,y2:h}=t.x1?t:this.getDomainBox(t,s,u),{x:x,y:y}=e,p=o?o-x:0,d=i?i-y:0;return{x1:"y"!==a?Math.min(c,l)-p:Math.min(c,l),x2:"y"!==a?Math.max(c,l)-p:Math.max(c,l),y1:"x"!==a?Math.min(f,h)-d:Math.min(f,h),y2:"x"!==a?Math.max(f,h)-d:Math.max(f,h)}},constrainBox(t,n){const{x1:e,y1:r,x2:o,y2:i}=s(n,Number);return{x1:t.x2>o?o-Math.abs(t.x2-t.x1):Math.max(t.x1,e),y1:t.y2>i?i-Math.abs(t.y2-t.y1):Math.max(t.y1,r),x2:t.x1<e?e+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,n){const{x1:e,y1:r,x2:o,y2:i}=s(n,Number);return{x:Math.min(Math.max(t.x,e),o),y:Math.min(Math.max(t.y,r),i)}},hasMoved(t){const{x1:n,x2:e,y1:r,y2:o,mouseMoveThreshold:i}=t,a=this.getDimension(t),u=Math.abs(n-e)>=i,s=Math.abs(r-o)>=i;switch(a){case"x":return u;case"y":return s;default:return u||s}},onMouseDown(t,e){t.preventDefault();const{handleWidth:r,cachedBrushDomain:o,domain:i,allowResize:a,allowDrag:u,allowDraw:s}=e,c=this.getDimension(e),l=a||e.defaultBrushArea?e.defaultBrushArea:"move";if(!a&&!u)return{};const f=e.fullDomainBox||this.getDomainBox(e,i),h=e.parentSVG||d(t),{x:x,y:y}=m(t,h);if(!this.withinBounds({x:x,y:y},f,r))return{};const p=n()({},e.brushDomain,i),v=_()(p,o)?e.currentDomain||p||i:p||i,g=this.getDomainBox(e,i,v),b=a&&this.getActiveHandles({x:x,y:y},e,g);return b?[{target:"parent",mutation:()=>({isSelecting:!0,domainBox:g,fullDomainBox:f,cachedBrushDomain:p,currentDomain:v,parentSVG:h,...this.getResizeMutation(g,b)})}]:this.withinBounds({x:x,y:y},g)&&!_()(i,v)?[{target:"parent",mutation:()=>({isPanning:u,startX:x,startY:y,domainBox:g,fullDomainBox:f,currentDomain:v,cachedBrushDomain:p,parentSVG:h,...g})}]:s?[{target:"parent",mutation:()=>({isSelecting:a||"move"===l,domainBox:g,fullDomainBox:f,parentSVG:h,cachedBrushDomain:p,cachedCurrentDomain:v,currentDomain:this.getMinimumDomain(),...this.getSelectionMutation({x:x,y:y},g,c)})}]:{}},onGlobalMouseMove(t,e){const{scale:r,isPanning:o,isSelecting:i,fullDomainBox:a,onBrushDomainChange:s,allowResize:c,allowDrag:l,horizontal:f,mouseMoveThreshold:h,parentSVG:x}=e,y=this.getDimension(e),{x:p,y:d}=m(t,x);if(!c&&!l||h>0&&!this.hasMoved({...e,x2:p,y2:d}))return{};if(l&&o){const{startX:t,startY:o}=e,i=this.panBox(e,{x:p,y:d}),c=this.constrainBox(i,a),l=b({...c,scale:r,horizontal:f}),h={currentDomain:l,parentSVG:x,startX:i.x2>=a.x2||i.x1<=a.x1?t:p,startY:i.y2>=a.y2||i.y1<=a.y1?o:d,...c};return u(s)&&s(l,n()({},h,e)),[{target:"parent",mutation:()=>h}]}if(c&&i){const{x:t,y:o}=this.constrainPoint({x:"y"!==y?p:e.x2,y:"x"!==y?d:e.y2},a),i=b({x2:t,y2:o,x1:e.x1,y1:e.y1,scale:r,horizontal:f}),c={x2:t,y2:o,currentDomain:i,parentSVG:x};return u(s)&&s(i,n()({},c,e)),[{target:"parent",mutation:()=>c}]}return{}},onGlobalMouseUp(t,e){if(!e.isPanning&&!e.isSelecting)return{};const{x1:r,y1:o,x2:i,y2:a,isPanning:s,isSelecting:c,onBrushDomainChange:l,onBrushDomainChangeEnd:f,onBrushCleared:h,currentDomain:x,allowResize:y,allowDrag:p}=e,d=y||e.defaultBrushArea?e.defaultBrushArea:"move",m={isPanning:!1,isSelecting:!1};if(!y&&(void 0===d||"none"===d)||r!==i&&o!==a)(p&&s||y&&c)&&u(f)&&f(x,n()({},m,e));else{const r=e.cachedCurrentDomain||x,o=this.getDefaultBrushArea(e,r,t);m.currentDomain=o,u(l)&&l(o,n()({},m,e)),u(f)&&f(o,n()({},m,e)),u(h)&&h(o,n()({},m,e))}return[{target:"parent",mutation:()=>m}]}},N={...I,onMouseDown:I.onMouseDown.bind(I),onGlobalMouseUp:I.onGlobalMouseUp.bind(I),onGlobalMouseMove:G()(I.onGlobalMouseMove.bind(I),16,{leading:!0,trailing:!1})},V={allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:i().createElement(l,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:i().createElement(l,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0},$=t=>{const e={...V,...t},{children:r}=e,o=t=>{const{handleWidth:r,handleStyle:o,handleComponent:a,name:u}=e,s=N.getDomainBox(e,t),{x1:c,x2:l,y1:f,y2:h}=s,{top:x,bottom:y,left:p,right:d}=N.getHandles(e,s),m=Math.abs(l-c)||1,v=Math.abs(h-f)||1,g=a.props&&a.props.style||{},b=n()({},g,o),M=(()=>{const t={yProps:"ns-resize",xProps:"ew-resize"};return!e.allowResize&&e.allowDrag?(t.xProps="move",t.yProps="move"):e.allowResize||e.allowDrag||(t.xProps="auto",t.yProps="auto"),t})(),w={style:b,width:m,height:r,cursor:M.yProps},D={style:b,width:r,height:v,cursor:M.xProps},B={top:x&&Object.assign({x:x.x1,y:x.y1},w),bottom:y&&Object.assign({x:y.x1,y:y.y1},w),left:p&&Object.assign({y:p.y1,x:p.x1},D),right:d&&Object.assign({y:d.y1,x:d.x1},D)},O=["top","bottom","left","right"].reduce(((t,n)=>B[n]?t.concat(i().cloneElement(a,Object.assign({key:`${u}-handle-${n}`},B[n]))):t),[]);return O.length?O:null};return{props:e,children:[...i().Children.toArray(r),...(()=>{const{currentDomain:t,cachedBrushDomain:r}=e,a=n()({},e.brushDomain,e.domain),u=_()(a,r)?n()({},t,a):a,s=(t=>{const{x:r,y:o}=t,{brushStyle:a,brushComponent:u,name:s}=e,c=u.props&&u.props.style,l=e.allowDrag||e.allowResize?"move":"auto";return r[0]!==r[1]&&o[0]!==o[1]?i().cloneElement(u,{key:`${s}-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:n()({},c,a)}):null})(v(e,u));return s?[s,o(u)]:[]})()]}},k=t=>{const{props:n,children:e}=$(t);return i().createElement(R,n,e)};k.role="container",k.defaultEvents=t=>{const n={...V,...t},e=(t,e)=>(r,o,i,a)=>n.disable||e?.(o)?{}:t(r,{...n,...o},i,a);return[{target:"parent",eventHandlers:{onMouseDown:e(N.onMouseDown),onTouchStart:e(N.onMouseDown),onGlobalMouseMove:e(N.onGlobalMouseMove,(t=>!t.isPanning&&!t.isSelecting)),onGlobalTouchMove:e(N.onGlobalMouseMove,(t=>!t.isPanning&&!t.isSelecting)),onGlobalMouseUp:e(N.onGlobalMouseUp),onGlobalTouchEnd:e(N.onGlobalMouseUp),onGlobalTouchCancel:e(N.onGlobalMouseUp)}}]}}(),o}()}));
|
|
1
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.VictoryBrushContainer=n(require("react")):t.VictoryBrushContainer=n(t.React)}(self,(function(t){return function(){var n={2596:function(t,n,e){var r=e(2373).Symbol;t.exports=r},6082:function(t){t.exports=function(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)}},8644:function(t){t.exports=function(t,n){for(var e=-1,r=null==t?0:t.length,o=Array(r);++e<r;)o[e]=n(t[e],e,t);return o}},9559:function(t){t.exports=function(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}},4132:function(t,n,e){var r=e(8347),o=e(788),i=Object.prototype.hasOwnProperty;t.exports=function(t,n,e){var a=t[n];i.call(t,n)&&o(a,e)&&(void 0!==e||n in t)||r(t,n,e)}},8347:function(t,n,e){var r=e(5525);t.exports=function(t,n,e){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e}},6457:function(t,n,e){var r=e(9559),o=e(3608);t.exports=function t(n,e,i,a,u){var s=-1,c=n.length;for(i||(i=o),u||(u=[]);++s<c;){var l=n[s];e>0&&i(l)?e>1?t(l,e-1,i,a,u):r(u,l):a||(u[u.length]=l)}return u}},4432:function(t,n,e){var r=e(9026),o=e(3110);t.exports=function(t,n){for(var e=0,i=(n=r(n,t)).length;null!=t&&e<i;)t=t[o(n[e++])];return e&&e==i?t:void 0}},6776:function(t){t.exports=function(t,n){return null!=t&&n in Object(t)}},5436:function(t,n,e){var r=e(6371),o=e(5066);t.exports=function(t,n){return r(t,n,(function(n,e){return o(t,e)}))}},6371:function(t,n,e){var r=e(4432),o=e(6539),i=e(9026);t.exports=function(t,n,e){for(var a=-1,u=n.length,s={};++a<u;){var c=n[a],l=r(t,c);e(l,c)&&o(s,i(c,t),l)}return s}},1600:function(t){t.exports=function(t){return function(n){return null==n?void 0:n[t]}}},3301:function(t,n,e){var r=e(4432);t.exports=function(t){return function(n){return r(n,t)}}},6317:function(t,n,e){var r=e(5346),o=e(4280),i=e(201);t.exports=function(t,n){return i(o(t,n,r),t+"")}},6539:function(t,n,e){var r=e(4132),o=e(9026),i=e(9099),a=e(7709),u=e(3110);t.exports=function(t,n,e,s){if(!a(t))return t;for(var c=-1,l=(n=o(n,t)).length,f=l-1,h=t;null!=h&&++c<l;){var x=u(n[c]),y=e;if("__proto__"===x||"constructor"===x||"prototype"===x)return t;if(c!=f){var p=h[x];void 0===(y=s?s(p,x,h):void 0)&&(y=a(p)?p:i(n[c+1])?[]:{})}r(h,x,y),h=h[x]}return t}},6316:function(t,n,e){var r=e(2596),o=e(8644),i=e(163),a=e(1995),u=r?r.prototype:void 0,s=u?u.toString:void 0;t.exports=function t(n){if("string"==typeof n)return n;if(i(n))return o(n,t)+"";if(a(n))return s?s.call(n):"";var e=n+"";return"0"==e&&1/n==-1/0?"-0":e}},9026:function(t,n,e){var r=e(163),o=e(726),i=e(7801),a=e(7010);t.exports=function(t,n){return r(t)?t:o(t,n)?[t]:i(a(t))}},5525:function(t,n,e){var r=e(3743),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},5557:function(t,n,e){var r=e(2645),o=e(4280),i=e(201);t.exports=function(t){return i(o(t,void 0,r),t+"")}},2117:function(t,n,e){var r="object"==typeof e.g&&e.g&&e.g.Object===Object&&e.g;t.exports=r},3743:function(t){t.exports=function(t,n){return null==t?void 0:t[n]}},3096:function(t,n,e){var r=e(9026),o=e(5075),i=e(163),a=e(9099),u=e(8454),s=e(3110);t.exports=function(t,n,e){for(var c=-1,l=(n=r(n,t)).length,f=!1;++c<l;){var h=s(n[c]);if(!(f=null!=t&&e(t,h)))break;t=t[h]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&u(l)&&a(h,l)&&(i(t)||o(t))}},3608:function(t,n,e){var r=e(2596),o=e(5075),i=e(163),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},9099:function(t){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},8286:function(t){t.exports=function(){return!1}},726:function(t,n,e){var r=e(163),o=e(1995),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,n){if(r(t))return!1;var e=typeof t;return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!o(t))||a.test(t)||!i.test(t)||null!=n&&t in Object(n)}},2453:function(t){t.exports=function(t){return t}},4280:function(t,n,e){var r=e(6082),o=Math.max;t.exports=function(t,n,e){return n=o(void 0===n?t.length-1:n,0),function(){for(var i=arguments,a=-1,u=o(i.length-n,0),s=Array(u);++a<u;)s[a]=i[n+a];a=-1;for(var c=Array(n+1);++a<n;)c[a]=i[a];return c[n]=e(s),r(t,this,c)}}},2373:function(t,n,e){var r=e(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,n,e){var r=e(2453),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(o,(function(t,e,r,o){n.push(r?o.replace(i,"$1"):e||t)})),n}));t.exports=a},3110:function(t,n,e){var r=e(1995);t.exports=function(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},5034:function(t,n,e){var r=e(7709),o=e(6987),i=e(5812),a=Math.max,u=Math.min;t.exports=function(t,n,e){var s,c,l,f,h,x,y=0,p=!1,d=!1,m=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function v(n){var e=s,r=c;return s=c=void 0,y=n,f=t.apply(r,e)}function g(t){return y=t,h=setTimeout(M,n),p?v(t):f}function b(t){var e=t-x;return void 0===x||e>=n||e<0||d&&t-y>=l}function M(){var t=o();if(b(t))return w(t);h=setTimeout(M,function(t){var e=n-(t-x);return d?u(e,l-(t-y)):e}(t))}function w(t){return h=void 0,m&&s?v(t):(s=c=void 0,f)}function D(){var t=o(),e=b(t);if(s=arguments,c=this,x=t,e){if(void 0===h)return g(x);if(d)return clearTimeout(h),h=setTimeout(M,n),v(x)}return void 0===h&&(h=setTimeout(M,n)),f}return n=i(n)||0,r(e)&&(p=!!e.leading,l=(d="maxWait"in e)?a(i(e.maxWait)||0,n):l,m="trailing"in e?!!e.trailing:m),D.cancel=function(){void 0!==h&&clearTimeout(h),y=0,s=x=c=h=void 0},D.flush=function(){return void 0===h?f:w(o())},D}},1893:function(t,n,e){var r=e(6317),o=e(788),i=e(8286),a=e(8855),u=Object.prototype,s=u.hasOwnProperty,c=r((function(t,n){t=Object(t);var e=-1,r=n.length,c=r>2?n[2]:void 0;for(c&&i(n[0],n[1],c)&&(r=1);++e<r;)for(var l=n[e],f=a(l),h=-1,x=f.length;++h<x;){var y=f[h],p=t[y];(void 0===p||o(p,u[y])&&!s.call(t,y))&&(t[y]=l[y])}return t}));t.exports=c},788:function(t){t.exports=function(t,n){return t===n||t!=t&&n!=n}},2645:function(t,n,e){var r=e(6457);t.exports=function(t){return null!=t&&t.length?r(t,1):[]}},5066:function(t,n,e){var r=e(6776),o=e(3096);t.exports=function(t,n){return null!=t&&o(t,n,r)}},5346:function(t){t.exports=function(t){return t}},5075:function(t){t.exports=function(){return!1}},163:function(t){var n=Array.isArray;t.exports=n},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 n=typeof t;return null!=t&&("object"==n||"function"==n)}},1995:function(t){t.exports=function(){return!1}},8855:function(t){t.exports=function(t){var n=[];if(null!=t)for(var e in Object(t))n.push(e);return n}},6987:function(t,n,e){var r=e(2373);t.exports=function(){return r.Date.now()}},9082:function(t,n,e){var r=e(5436),o=e(5557)((function(t,n){return null==t?{}:r(t,n)}));t.exports=o},8532:function(t,n,e){var r=e(1600),o=e(3301),i=e(726),a=e(3110);t.exports=function(t){return i(t)?r(a(t)):o(t)}},8163:function(t,n,e){var r=e(5034),o=e(7709);t.exports=function(t,n,e){var i=!0,a=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return o(e)&&(i="leading"in e?!!e.leading:i,a="trailing"in e?!!e.trailing:a),r(t,n,{leading:i,maxWait:n,trailing:a})}},5812:function(t){t.exports=function(t){return t}},7010:function(t,n,e){var r=e(6316);t.exports=function(t){return null==t?"":r(t)}},660:function(t,n,e){var r=e(7010),o=0;t.exports=function(t){var n=++o;return r(t)+n}},7491:function(t){var n="undefined"!=typeof Element,e="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 u,s,c,l;if(Array.isArray(t)){if((u=t.length)!=a.length)return!1;for(s=u;0!=s--;)if(!i(t[s],a[s]))return!1;return!0}if(e&&t instanceof Map&&a instanceof Map){if(t.size!==a.size)return!1;for(l=t.entries();!(s=l.next()).done;)if(!a.has(s.value[0]))return!1;for(l=t.entries();!(s=l.next()).done;)if(!i(s.value[1],a.get(s.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();!(s=l.next()).done;)if(!a.has(s.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(a)){if((u=t.length)!=a.length)return!1;for(s=u;0!=s--;)if(t[s]!==a[s])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((u=(c=Object.keys(t)).length)!==Object.keys(a).length)return!1;for(s=u;0!=s--;)if(!Object.prototype.hasOwnProperty.call(a,c[s]))return!1;if(n&&t instanceof Element)return!1;for(s=u;0!=s--;)if(("_owner"!==c[s]&&"__v"!==c[s]&&"__o"!==c[s]||!t.$$typeof)&&!i(t[c[s]],a[c[s]]))return!1;return!0}return t!=t&&a!=a}t.exports=function(t,n){try{return i(t,n)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}}},9787:function(n){"use strict";n.exports=t}},e={};function r(t){var o=e[t];if(void 0!==o)return o.exports;var i=e[t]={exports:{}};return n[t](i,i.exports,r),i.exports}r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,{a:n}),n},r.d=function(t,n){for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},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,n){return Object.prototype.hasOwnProperty.call(t,n)},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 N},VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS:function(){return V},VictoryBrushContainer:function(){return k},useVictoryBrushContainer:function(){return $}});var t=r(9787),n=r.n(t),e=r(1893),i=r.n(e);function a(t,n){return u(t)?t(n):t}function u(t){return"function"==typeof t}function s(t,n){if(t)return Object.keys(t).reduce(((e,r)=>(e[r]=n(t[r]),e)),{})}function c(){return c=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c.apply(this,arguments)}r(8532),r(9082);const l=(0,t.forwardRef)(((t,e)=>{const{desc:r,id:o,tabIndex:i,origin:u,...s}=t,l={vectorEffect:"non-scaling-stroke",id:a(o,t)?.toString(),tabIndex:a(i,t),...s};return r?n().createElement("rect",c({},l,{ref:e}),n().createElement("desc",null,r)):n().createElement("rect",c({},l,{ref:e}))}));function f(t){return Array.isArray(t)&&t.some((t=>t instanceof Date))}function h(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];const o=t.concat(e);return f(o)?new Date(Math.max(...o)):Math.max(...o)}function x(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];const o=t.concat(e);return f(o)?new Date(Math.min(...o)):Math.min(...o)}function y(t,n,e){const{a:r,d:o,e:i,f:a}=n;return"y"===e?o*t+a:r*t+i}function p(t){return!(!t||void 0===t.identifier)}function d(t){if(p(t.nativeEvent))return;const n=t=>"svg"===t.nodeName?t:t.parentNode?n(t.parentNode):t;return n(t.target)}function m(t,n){if(p(t.nativeEvent))return{x:t.nativeEvent.locationX,y:t.nativeEvent.locationY};const e=function(t){return t.changedTouches&&t.changedTouches.length>0}(t)?t.changedTouches[0]:t,r=function(t){return t.getScreenCTM().inverse()}(n||d(e));return{x:y(e.clientX,r,"x"),y:y(e.clientY,r,"y")}}function v(t,n){const{horizontal:e}=t,r=t.scale,o=n||{x:r.x.domain(),y:r.y.domain()};return{x:e?[r.y(o.y[0]),r.y(o.y[1])]:[r.x(o.x[0]),r.x(o.x[1])],y:e?[r.x(o.x[0]),r.x(o.x[1])]:[r.y(o.y[0]),r.y(o.y[1])]}}function g(t,n,e,r){const{polar:o,horizontal:i}=t;if(!o)return{x:i?n.x.invert(r):n.x.invert(e),y:i?n.y.invert(e):n.y.invert(r)};const a=t.origin||{x:0,y:0},u=e-a.x,s=r-a.y,c=Math.abs(u*Math.sqrt(1+Math.pow(-s/u,2))),l=(-Math.atan2(s,u)+2*Math.PI)%(2*Math.PI);return{x:n.x.invert(l),y:n.y.invert(c)}}function b(t){const{x1:n,x2:e,y1:r,y2:o,scale:i}=t,a=g(t,i,n,r),u=g(t,i,e,o),s=(t,n)=>[x([t,n]),h([t,n])];return{x:s(a.x,u.x),y:s(a.y,u.y)}}var M=r(660),w=r.n(M);function D(){return D=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},D.apply(this,arguments)}const B=n().forwardRef(((t,e)=>n().createElement("svg",D({ref:e},t)))),O={startsWith:["data-","aria-"],exactMatch:[]},E=t=>{const n={...t};return Object.fromEntries(Object.entries(n).filter((t=>{let[n]=t;return(t=>!(!(t=>{let n=!1;return O.startsWith.forEach((e=>{new RegExp(`\\b(${e})(\\w|-)+`,"g").test(t)&&(n=!0)})),n})(t)&&!(t=>O.exactMatch.includes(t))(t)))(n)})).map((n=>{let[e,r]=n;return[e,a(r,t)]})))},j=n().createContext(void 0);j.displayName="PortalContext";const S=t=>{let{children:e}=t;const[r,o]=n().useState(new Map),i=n().useCallback(((t,n)=>{o((e=>{const r=new Map(e);return r.set(t,n),r}))}),[o]),a=n().useCallback((t=>{o((n=>{const e=new Map(n);return e.delete(t),e}))}),[o]),u=n().useMemo((()=>({addChild:i,removeChild:a,children:r})),[i,a,r]);return n().createElement(j.Provider,{value:u},e)},A=t=>{let{as:e,...r}=t;const o=n().useContext(j);if(!o)return null;const i=Array.from(o.children.values());return n().cloneElement(e,r,i)};function P(){return P=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},P.apply(this,arguments)}const C={className:"VictoryContainer",portalComponent:n().createElement(B,null),portalZIndex:99,responsive:!0,role:"img"},R=e=>{const{role:r,title:o,desc:i,children:a,className:s,portalZIndex:c,portalComponent:l,width:f,height:h,style:x,tabIndex:y,responsive:p,events:d,ouiaId:m,ouiaSafe:v,ouiaType:g,dimensions:b,ariaDescribedBy:M,ariaLabelledBy:D,viewBox:B,preserveAspectRatio:O,userProps:j,titleId:R,descId:T,containerRef:G,localContainerRef:z}=function(n){const e={...C,...n},{title:r,desc:o,width:i,height:a,responsive:u}=e,s=(0,t.useRef)(null),c=(0,t.useRef)(w()("victory-container-")),l=e.containerId??c.current,f=t=>`${l}-${t}`,h=E(e),x=u?{width:"100%",height:"100%"}:{width:i,height:a},y=u?`0 0 ${i} ${a}`:void 0,p=u?e.preserveAspectRatio:void 0,d=[r&&f("title"),e["aria-labelledby"]].filter(Boolean).join(" ")||void 0,m=[o&&f("desc"),e["aria-describedby"]].filter(Boolean).join(" ")||void 0,v=f("title"),g=f("desc");return{...e,titleId:v,descId:g,dimensions:x,viewBox:y,preserveAspectRatio:p,ariaLabelledBy:d,ariaDescribedBy:m,userProps:h,localContainerRef:s}}(e);return n().useEffect((()=>{if(!d?.onWheel)return;const t=t=>t.preventDefault(),n=z?.current;return n?.addEventListener("wheel",t),()=>{n?.removeEventListener("wheel",t)}}),[]),n().createElement("div",{className:s,style:{...x,width:p?x?.width:b.width,height:p?x?.height:b.height,pointerEvents:x?.pointerEvents??"none",touchAction:x?.touchAction??"none",position:x?.position??"relative"},"data-ouia-component-id":m,"data-ouia-component-type":g,"data-ouia-safe":v,ref:(_=[z,G],t=>{_.forEach((n=>{u(n)?n(t):null!=n&&(n.current=t)}))})},n().createElement(S,null,n().createElement("svg",P({width:f,height:h,tabIndex:y,role:r,"aria-labelledby":D,"aria-describedby":M,viewBox:B,preserveAspectRatio:O,style:{...b,pointerEvents:"all"}},j,d),o?n().createElement("title",{id:R},o):null,i?n().createElement("desc",{id:T},i):null,a),n().createElement("div",{style:{...b,zIndex:c,position:"absolute",top:0,left:0}},n().createElement(A,{as:l,width:f,height:h,viewBox:B,preserveAspectRatio:O,style:{...b,overflow:"visible"}}))));var _};R.role="container";var T=r(8163),G=r.n(T),z=r(7491),_=r.n(z);const I={getDimension(t){const{horizontal:n,brushDimension:e}=t;return n&&e?"x"===e?"y":"x":e},withinBounds(t,n,e){const{x1:r,x2:o,y1:i,y2:a}=s(n,Number),{x:u,y:c}=s(t,Number),l=e?e/2:0;return u+l>=Math.min(r,o)&&u-l<=Math.max(r,o)&&c+l>=Math.min(i,a)&&c-l<=Math.max(i,a)},getDomainBox(t,n,e){const r=this.getDimension(t),o=i()({},n,t.domain),a=i()({},e,o),u=v(t,o),s=v(t,a);return{x1:"y"!==r?Math.min(...s.x):Math.min(...u.x),x2:"y"!==r?Math.max(...s.x):Math.max(...u.x),y1:"x"!==r?Math.min(...s.y):Math.min(...u.y),y2:"x"!==r?Math.max(...s.y):Math.max(...u.y)}},getHandles(t,n){const e=this.getDimension(t),{x1:r,x2:o,y1:i,y2:a}=n,u=Math.min(r,o),s=Math.max(r,o),c=Math.min(i,a),l=Math.max(i,a),f=t.handleWidth/2;return{left:"y"!==e&&{x1:u-f,x2:u+f,y1:i,y2:a},right:"y"!==e&&{x1:s-f,x2:s+f,y1:i,y2:a},top:"x"!==e&&{x1:r,x2:o,y1:c-f,y2:c+f},bottom:"x"!==e&&{x1:r,x2:o,y1:l-f,y2:l+f}}},getActiveHandles(t,n,e){const r=this.getHandles(n,e),o=["top","bottom","left","right"].reduce(((n,e)=>r[e]&&this.withinBounds(t,r[e])?n.concat(e):n),[]);return o.length&&o},getResizeMutation(t,n){const{x1:e,y1:r,x2:o,y2:i}=t,a={left:{x1:Math.max(e,o),x2:Math.min(e,o),y1:r,y2:i},right:{x1:Math.min(e,o),x2:Math.max(e,o),y1:r,y2:i},top:{y1:Math.max(r,i),y2:Math.min(r,i),x1:e,x2:o},bottom:{y1:Math.min(r,i),y2:Math.max(r,i),x1:e,x2:o}};return n.reduce(((t,n)=>Object.assign(t,a[n])),{})},getMinimumDomain:()=>({x:[0,1/Number.MAX_SAFE_INTEGER],y:[0,1/Number.MAX_SAFE_INTEGER]}),getDefaultBrushArea(t,n,e){const{domain:r,fullDomain:o,scale:i,horizontal:a,allowResize:u}=t,s=u||t.defaultBrushArea?t.defaultBrushArea:"move";if("none"===s)return this.getMinimumDomain();if("disable"===s)return n;if("move"===s){const r=this.getDomainBox(t,o,n),u=t.parentSVG||d(e),s=this.panBox({...t,...r,brushDomain:n,startX:(r.x1+r.x2)/2,startY:(r.y1+r.y2)/2},m(e,u)),c=t.fullDomainBox||this.getDomainBox(t,o);return b({...this.constrainBox(s,c),scale:i,horizontal:a})}return r},getSelectionMutation(t,n,e){const{x:r,y:o}=t,{x1:i,x2:a,y1:u,y2:s}=n;return{x1:"y"!==e?r:i,y1:"x"!==e?o:u,x2:"y"!==e?r:a,y2:"x"!==e?o:s}},panBox(t,n){const{domain:e,startX:r,startY:o}=t,a=this.getDimension(t),u=i()({},t.brushDomain,e),s=i()({},t.fullDomain,e),{x1:c,x2:l,y1:f,y2:h}=t.x1?t:this.getDomainBox(t,s,u),{x:x,y:y}=n,p=r?r-x:0,d=o?o-y:0;return{x1:"y"!==a?Math.min(c,l)-p:Math.min(c,l),x2:"y"!==a?Math.max(c,l)-p:Math.max(c,l),y1:"x"!==a?Math.min(f,h)-d:Math.min(f,h),y2:"x"!==a?Math.max(f,h)-d:Math.max(f,h)}},constrainBox(t,n){const{x1:e,y1:r,x2:o,y2:i}=s(n,Number);return{x1:t.x2>o?o-Math.abs(t.x2-t.x1):Math.max(t.x1,e),y1:t.y2>i?i-Math.abs(t.y2-t.y1):Math.max(t.y1,r),x2:t.x1<e?e+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,n){const{x1:e,y1:r,x2:o,y2:i}=s(n,Number);return{x:Math.min(Math.max(t.x,e),o),y:Math.min(Math.max(t.y,r),i)}},hasMoved(t){const{x1:n,x2:e,y1:r,y2:o,mouseMoveThreshold:i}=t,a=this.getDimension(t),u=Math.abs(n-e)>=i,s=Math.abs(r-o)>=i;switch(a){case"x":return u;case"y":return s;default:return u||s}},onMouseDown(t,n){t.preventDefault();const{handleWidth:e,cachedBrushDomain:r,domain:o,allowResize:a,allowDrag:u,allowDraw:s}=n,c=this.getDimension(n),l=a||n.defaultBrushArea?n.defaultBrushArea:"move";if(!a&&!u)return{};const f=n.fullDomainBox||this.getDomainBox(n,o),h=n.parentSVG||d(t),{x:x,y:y}=m(t,h);if(!this.withinBounds({x:x,y:y},f,e))return{};const p=i()({},n.brushDomain,o),v=_()(p,r)?n.currentDomain||p||o:p||o,g=this.getDomainBox(n,o,v),b=a&&this.getActiveHandles({x:x,y:y},n,g);return b?[{target:"parent",mutation:()=>({isSelecting:!0,domainBox:g,fullDomainBox:f,cachedBrushDomain:p,currentDomain:v,parentSVG:h,...this.getResizeMutation(g,b)})}]:this.withinBounds({x:x,y:y},g)&&!_()(o,v)?[{target:"parent",mutation:()=>({isPanning:u,startX:x,startY:y,domainBox:g,fullDomainBox:f,currentDomain:v,cachedBrushDomain:p,parentSVG:h,...g})}]:s?[{target:"parent",mutation:()=>({isSelecting:a||"move"===l,domainBox:g,fullDomainBox:f,parentSVG:h,cachedBrushDomain:p,cachedCurrentDomain:v,currentDomain:this.getMinimumDomain(),...this.getSelectionMutation({x:x,y:y},g,c)})}]:{}},onGlobalMouseMove(t,n){const{scale:e,isPanning:r,isSelecting:o,fullDomainBox:a,onBrushDomainChange:s,allowResize:c,allowDrag:l,horizontal:f,mouseMoveThreshold:h,parentSVG:x}=n,y=this.getDimension(n),{x:p,y:d}=m(t,x);if(!c&&!l||h>0&&!this.hasMoved({...n,x2:p,y2:d}))return{};if(l&&r){const{startX:t,startY:r}=n,o=this.panBox(n,{x:p,y:d}),c=this.constrainBox(o,a),l=b({...c,scale:e,horizontal:f}),h={currentDomain:l,parentSVG:x,startX:o.x2>=a.x2||o.x1<=a.x1?t:p,startY:o.y2>=a.y2||o.y1<=a.y1?r:d,...c};return u(s)&&s(l,i()({},h,n)),[{target:"parent",mutation:()=>h}]}if(c&&o){const{x:t,y:r}=this.constrainPoint({x:"y"!==y?p:n.x2,y:"x"!==y?d:n.y2},a),o=b({x2:t,y2:r,x1:n.x1,y1:n.y1,scale:e,horizontal:f}),c={x2:t,y2:r,currentDomain:o,parentSVG:x};return u(s)&&s(o,i()({},c,n)),[{target:"parent",mutation:()=>c}]}return{}},onGlobalMouseUp(t,n){if(!n.isPanning&&!n.isSelecting)return{};const{x1:e,y1:r,x2:o,y2:a,isPanning:s,isSelecting:c,onBrushDomainChange:l,onBrushDomainChangeEnd:f,onBrushCleared:h,currentDomain:x,allowResize:y,allowDrag:p}=n,d=y||n.defaultBrushArea?n.defaultBrushArea:"move",m={isPanning:!1,isSelecting:!1};if(!y&&(void 0===d||"none"===d)||e!==o&&r!==a)(p&&s||y&&c)&&u(f)&&f(x,i()({},m,n));else{const e=n.cachedCurrentDomain||x,r=this.getDefaultBrushArea(n,e,t);m.currentDomain=r,u(l)&&l(r,i()({},m,n)),u(f)&&f(r,i()({},m,n)),u(h)&&h(r,i()({},m,n))}return[{target:"parent",mutation:()=>m}]}},N={...I,onMouseDown:I.onMouseDown.bind(I),onGlobalMouseUp:I.onGlobalMouseUp.bind(I),onGlobalMouseMove:G()(I.onGlobalMouseMove.bind(I),16,{leading:!0,trailing:!1})},V={allowDrag:!0,allowDraw:!0,allowResize:!0,brushComponent:n().createElement(l,null),brushStyle:{stroke:"transparent",fill:"black",fillOpacity:.1},handleComponent:n().createElement(l,null),handleStyle:{stroke:"transparent",fill:"transparent"},handleWidth:8,mouseMoveThreshold:0},$=t=>{const e={...V,...t},{children:r}=e,o=t=>{const{handleWidth:r,handleStyle:o,handleComponent:a,name:u}=e,s=N.getDomainBox(e,t),{x1:c,x2:l,y1:f,y2:h}=s,{top:x,bottom:y,left:p,right:d}=N.getHandles(e,s),m=Math.abs(l-c)||1,v=Math.abs(h-f)||1,g=a.props&&a.props.style||{},b=i()({},g,o),M=(()=>{const t={yProps:"ns-resize",xProps:"ew-resize"};return!e.allowResize&&e.allowDrag?(t.xProps="move",t.yProps="move"):e.allowResize||e.allowDrag||(t.xProps="auto",t.yProps="auto"),t})(),w={style:b,width:m,height:r,cursor:M.yProps},D={style:b,width:r,height:v,cursor:M.xProps},B={top:x&&Object.assign({x:x.x1,y:x.y1},w),bottom:y&&Object.assign({x:y.x1,y:y.y1},w),left:p&&Object.assign({y:p.y1,x:p.x1},D),right:d&&Object.assign({y:d.y1,x:d.x1},D)},O=["top","bottom","left","right"].reduce(((t,e)=>B[e]?t.concat(n().cloneElement(a,Object.assign({key:`${u}-handle-${e}`},B[e]))):t),[]);return O.length?O:null};return{props:e,children:[...n().Children.toArray(r),...(()=>{const{currentDomain:t,cachedBrushDomain:r}=e,a=i()({},e.brushDomain,e.domain),u=_()(a,r)?i()({},t,a):a,s=(t=>{const{x:r,y:o}=t,{brushStyle:a,brushComponent:u,name:s}=e,c=u.props&&u.props.style,l=e.allowDrag||e.allowResize?"move":"auto";return r[0]!==r[1]&&o[0]!==o[1]?n().cloneElement(u,{key:`${s}-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:i()({},c,a)}):null})(v(e,u));return s?[s,o(u)]:[]})()]}},k=t=>{const{props:e,children:r}=$(t);return n().createElement(R,e,r)};k.role="container",k.defaultEvents=t=>{const n={...V,...t},e=(t,e)=>(r,o,i,a)=>n.disable||e?.(o)?{}:t(r,{...n,...o},i,a);return[{target:"parent",eventHandlers:{onMouseDown:e(N.onMouseDown),onTouchStart:e(N.onMouseDown),onGlobalMouseMove:e(N.onGlobalMouseMove,(t=>!t.isPanning&&!t.isSelecting)),onGlobalTouchMove:e(N.onGlobalMouseMove,(t=>!t.isPanning&&!t.isSelecting)),onGlobalMouseUp:e(N.onGlobalMouseUp),onGlobalTouchEnd:e(N.onGlobalMouseUp),onGlobalTouchCancel:e(N.onGlobalMouseUp)}}]}}(),o}()}));
|
|
2
2
|
//# sourceMappingURL=victory-brush-container.min.js.map
|
package/es/brush-helpers.d.ts
CHANGED
package/es/brush-helpers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import defaults from "lodash/defaults";
|
|
2
|
+
import throttle from "lodash/throttle";
|
|
3
3
|
import { Helpers as CoreHelpers, Selection } from "victory-core";
|
|
4
4
|
import isEqual from "react-fast-compare";
|
|
5
5
|
const Helpers = {
|
|
@@ -29,8 +29,8 @@ const Helpers = {
|
|
|
29
29
|
},
|
|
30
30
|
getDomainBox(props, fullDomain, selectedDomain) {
|
|
31
31
|
const brushDimension = this.getDimension(props);
|
|
32
|
-
const fullDomainObject =
|
|
33
|
-
const selectedDomainObject =
|
|
32
|
+
const fullDomainObject = defaults({}, fullDomain, props.domain);
|
|
33
|
+
const selectedDomainObject = defaults({}, selectedDomain, fullDomainObject);
|
|
34
34
|
const fullCoords = Selection.getDomainCoordinates(props, fullDomainObject);
|
|
35
35
|
const selectedCoords = Selection.getDomainCoordinates(props, selectedDomainObject);
|
|
36
36
|
return {
|
|
@@ -186,8 +186,8 @@ const Helpers = {
|
|
|
186
186
|
startY
|
|
187
187
|
} = props;
|
|
188
188
|
const brushDimension = this.getDimension(props);
|
|
189
|
-
const brushDomain =
|
|
190
|
-
const fullDomain =
|
|
189
|
+
const brushDomain = defaults({}, props.brushDomain, domain);
|
|
190
|
+
const fullDomain = defaults({}, props.fullDomain, domain);
|
|
191
191
|
const {
|
|
192
192
|
x1,
|
|
193
193
|
x2,
|
|
@@ -255,7 +255,6 @@ const Helpers = {
|
|
|
255
255
|
return xMoved || yMoved;
|
|
256
256
|
}
|
|
257
257
|
},
|
|
258
|
-
// eslint-disable-next-line max-statements, complexity
|
|
259
258
|
onMouseDown(evt, targetProps) {
|
|
260
259
|
evt.preventDefault();
|
|
261
260
|
const {
|
|
@@ -285,7 +284,7 @@ const Helpers = {
|
|
|
285
284
|
}, fullDomainBox, handleWidth)) {
|
|
286
285
|
return {};
|
|
287
286
|
}
|
|
288
|
-
const brushDomain =
|
|
287
|
+
const brushDomain = defaults({}, targetProps.brushDomain, domain);
|
|
289
288
|
const currentDomain = isEqual(brushDomain, cachedBrushDomain) ? targetProps.currentDomain || brushDomain || domain : brushDomain || domain;
|
|
290
289
|
const domainBox = this.getDomainBox(targetProps, domain, currentDomain);
|
|
291
290
|
const activeHandles = allowResize && this.getActiveHandles({
|
|
@@ -348,7 +347,6 @@ const Helpers = {
|
|
|
348
347
|
})
|
|
349
348
|
}] : {};
|
|
350
349
|
},
|
|
351
|
-
// eslint-disable-next-line max-statements, complexity
|
|
352
350
|
onGlobalMouseMove(evt, targetProps) {
|
|
353
351
|
const {
|
|
354
352
|
scale,
|
|
@@ -397,7 +395,7 @@ const Helpers = {
|
|
|
397
395
|
...constrainedBox
|
|
398
396
|
};
|
|
399
397
|
if (CoreHelpers.isFunction(onBrushDomainChange)) {
|
|
400
|
-
onBrushDomainChange(currentDomain,
|
|
398
|
+
onBrushDomainChange(currentDomain, defaults({}, mutatedProps, targetProps));
|
|
401
399
|
}
|
|
402
400
|
return [{
|
|
403
401
|
target: "parent",
|
|
@@ -426,7 +424,7 @@ const Helpers = {
|
|
|
426
424
|
parentSVG
|
|
427
425
|
};
|
|
428
426
|
if (CoreHelpers.isFunction(onBrushDomainChange)) {
|
|
429
|
-
onBrushDomainChange(currentDomain,
|
|
427
|
+
onBrushDomainChange(currentDomain, defaults({}, mutatedProps, targetProps));
|
|
430
428
|
}
|
|
431
429
|
return [{
|
|
432
430
|
target: "parent",
|
|
@@ -435,13 +433,11 @@ const Helpers = {
|
|
|
435
433
|
}
|
|
436
434
|
return {};
|
|
437
435
|
},
|
|
438
|
-
// eslint-disable-next-line complexity
|
|
439
436
|
onGlobalMouseUp(evt, targetProps) {
|
|
440
437
|
// if a panning or selection has not been started, ignore the event
|
|
441
438
|
if (!targetProps.isPanning && !targetProps.isSelecting) {
|
|
442
439
|
return {};
|
|
443
440
|
}
|
|
444
|
-
// eslint-disable-line max-statements, complexity
|
|
445
441
|
const {
|
|
446
442
|
x1,
|
|
447
443
|
y1,
|
|
@@ -469,17 +465,17 @@ const Helpers = {
|
|
|
469
465
|
const defaultDomain = this.getDefaultBrushArea(targetProps, cachedDomain, evt);
|
|
470
466
|
mutatedProps.currentDomain = defaultDomain;
|
|
471
467
|
if (CoreHelpers.isFunction(onBrushDomainChange)) {
|
|
472
|
-
onBrushDomainChange(defaultDomain,
|
|
468
|
+
onBrushDomainChange(defaultDomain, defaults({}, mutatedProps, targetProps));
|
|
473
469
|
}
|
|
474
470
|
if (CoreHelpers.isFunction(onBrushDomainChangeEnd)) {
|
|
475
|
-
onBrushDomainChangeEnd(defaultDomain,
|
|
471
|
+
onBrushDomainChangeEnd(defaultDomain, defaults({}, mutatedProps, targetProps));
|
|
476
472
|
}
|
|
477
473
|
if (CoreHelpers.isFunction(onBrushCleared)) {
|
|
478
|
-
onBrushCleared(defaultDomain,
|
|
474
|
+
onBrushCleared(defaultDomain, defaults({}, mutatedProps, targetProps));
|
|
479
475
|
}
|
|
480
476
|
} else if (allowDrag && isPanning || allowResize && isSelecting) {
|
|
481
477
|
if (CoreHelpers.isFunction(onBrushDomainChangeEnd)) {
|
|
482
|
-
onBrushDomainChangeEnd(currentDomain,
|
|
478
|
+
onBrushDomainChangeEnd(currentDomain, defaults({}, mutatedProps, targetProps));
|
|
483
479
|
}
|
|
484
480
|
}
|
|
485
481
|
return [{
|
|
@@ -492,7 +488,7 @@ export const BrushHelpers = {
|
|
|
492
488
|
...Helpers,
|
|
493
489
|
onMouseDown: Helpers.onMouseDown.bind(Helpers),
|
|
494
490
|
onGlobalMouseUp: Helpers.onGlobalMouseUp.bind(Helpers),
|
|
495
|
-
onGlobalMouseMove:
|
|
491
|
+
onGlobalMouseMove: throttle(Helpers.onGlobalMouseMove.bind(Helpers), 16,
|
|
496
492
|
// eslint-disable-line no-magic-numbers
|
|
497
493
|
{
|
|
498
494
|
leading: true,
|
|
@@ -65,68 +65,68 @@ export declare const useVictoryBrushContainer: (initialProps: VictoryBrushContai
|
|
|
65
65
|
allowDraw: boolean;
|
|
66
66
|
allowResize: boolean;
|
|
67
67
|
brushComponent: JSX.Element;
|
|
68
|
-
brushDimension?: "x" | "y"
|
|
68
|
+
brushDimension?: "x" | "y";
|
|
69
69
|
brushDomain?: {
|
|
70
|
-
x?: DomainTuple
|
|
71
|
-
y?: DomainTuple
|
|
72
|
-
}
|
|
70
|
+
x?: DomainTuple;
|
|
71
|
+
y?: DomainTuple;
|
|
72
|
+
};
|
|
73
73
|
brushStyle: React.CSSProperties | {
|
|
74
74
|
stroke: string;
|
|
75
75
|
fill: string;
|
|
76
76
|
fillOpacity: number;
|
|
77
77
|
};
|
|
78
|
-
defaultBrushArea?: "
|
|
79
|
-
disable?: boolean
|
|
78
|
+
defaultBrushArea?: "all" | "none" | "disable" | "move";
|
|
79
|
+
disable?: boolean;
|
|
80
80
|
handleComponent: JSX.Element;
|
|
81
81
|
handleStyle: React.CSSProperties | {
|
|
82
82
|
stroke: string;
|
|
83
83
|
fill: string;
|
|
84
84
|
};
|
|
85
85
|
handleWidth: number;
|
|
86
|
-
onBrushCleared?: (
|
|
86
|
+
onBrushCleared?: (domain: {
|
|
87
87
|
x: DomainTuple;
|
|
88
88
|
y: DomainTuple;
|
|
89
|
-
}, props: VictoryBrushContainerProps) => void
|
|
90
|
-
onBrushDomainChange?: (
|
|
89
|
+
}, props: VictoryBrushContainerProps) => void;
|
|
90
|
+
onBrushDomainChange?: (domain: {
|
|
91
91
|
x: DomainTuple;
|
|
92
92
|
y: DomainTuple;
|
|
93
|
-
}, props: VictoryBrushContainerProps) => void
|
|
94
|
-
onBrushDomainChangeEnd?: (
|
|
93
|
+
}, props: VictoryBrushContainerProps) => void;
|
|
94
|
+
onBrushDomainChangeEnd?: (domain: {
|
|
95
95
|
x: DomainTuple;
|
|
96
96
|
y: DomainTuple;
|
|
97
|
-
}, props: VictoryBrushContainerProps) => void
|
|
98
|
-
"aria-describedby"?: string
|
|
99
|
-
"aria-labelledby"?: string
|
|
100
|
-
children?: React.ReactElement
|
|
101
|
-
className?: string
|
|
102
|
-
containerId?:
|
|
103
|
-
containerRef?: React.Ref<HTMLElement
|
|
104
|
-
desc?: string
|
|
105
|
-
events?: React.DOMAttributes<any
|
|
106
|
-
height?: number
|
|
107
|
-
name?: string
|
|
108
|
-
origin?: import("victory-core").OriginType
|
|
109
|
-
polar?: boolean
|
|
110
|
-
portalComponent?: React.ReactElement
|
|
111
|
-
portalZIndex?: number
|
|
112
|
-
preserveAspectRatio?: string
|
|
113
|
-
responsive?: boolean
|
|
114
|
-
role?: string
|
|
97
|
+
}, props: VictoryBrushContainerProps) => void;
|
|
98
|
+
"aria-describedby"?: string;
|
|
99
|
+
"aria-labelledby"?: string;
|
|
100
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
101
|
+
className?: string;
|
|
102
|
+
containerId?: number | string;
|
|
103
|
+
containerRef?: React.Ref<HTMLElement>;
|
|
104
|
+
desc?: string;
|
|
105
|
+
events?: React.DOMAttributes<any>;
|
|
106
|
+
height?: number;
|
|
107
|
+
name?: string;
|
|
108
|
+
origin?: import("victory-core").OriginType;
|
|
109
|
+
polar?: boolean;
|
|
110
|
+
portalComponent?: React.ReactElement;
|
|
111
|
+
portalZIndex?: number;
|
|
112
|
+
preserveAspectRatio?: string;
|
|
113
|
+
responsive?: boolean;
|
|
114
|
+
role?: string;
|
|
115
115
|
scale?: {
|
|
116
|
-
x?: import("victory-core").D3Scale
|
|
117
|
-
y?: import("victory-core").D3Scale
|
|
118
|
-
}
|
|
119
|
-
style?: React.CSSProperties
|
|
120
|
-
tabIndex?: number
|
|
121
|
-
theme?: import("victory-core").VictoryThemeDefinition
|
|
122
|
-
title?: string
|
|
123
|
-
width?: number
|
|
124
|
-
ouiaId?:
|
|
125
|
-
ouiaSafe?: boolean
|
|
126
|
-
ouiaType?: string
|
|
116
|
+
x?: import("victory-core").D3Scale;
|
|
117
|
+
y?: import("victory-core").D3Scale;
|
|
118
|
+
};
|
|
119
|
+
style?: React.CSSProperties;
|
|
120
|
+
tabIndex?: number;
|
|
121
|
+
theme?: import("victory-core").VictoryThemeDefinition;
|
|
122
|
+
title?: string;
|
|
123
|
+
width?: number;
|
|
124
|
+
ouiaId?: number | string;
|
|
125
|
+
ouiaSafe?: boolean;
|
|
126
|
+
ouiaType?: string;
|
|
127
127
|
mouseMoveThreshold: number;
|
|
128
128
|
};
|
|
129
|
-
children: React.ReactElement
|
|
129
|
+
children: React.ReactElement[];
|
|
130
130
|
};
|
|
131
131
|
export declare const VictoryBrushContainer: {
|
|
132
132
|
(initialProps: VictoryBrushContainerProps): JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _defaults from "lodash/defaults";
|
|
2
1
|
import React from "react";
|
|
3
2
|
import { Selection, Rect, VictoryContainer } from "victory-core";
|
|
4
3
|
import { BrushHelpers } from "./brush-helpers";
|
|
4
|
+
import defaults from "lodash/defaults";
|
|
5
5
|
import isEqual from "react-fast-compare";
|
|
6
6
|
export const VICTORY_BRUSH_CONTAINER_DEFAULT_PROPS = {
|
|
7
7
|
allowDrag: true,
|
|
@@ -48,7 +48,7 @@ export const useVictoryBrushContainer = initialProps => {
|
|
|
48
48
|
x: Math.min(x[0], x[1]),
|
|
49
49
|
y: Math.min(y[0], y[1]),
|
|
50
50
|
cursor,
|
|
51
|
-
style:
|
|
51
|
+
style: defaults({}, brushComponentStyle, brushStyle)
|
|
52
52
|
}) : null;
|
|
53
53
|
};
|
|
54
54
|
const getCursorPointers = () => {
|
|
@@ -88,7 +88,7 @@ export const useVictoryBrushContainer = initialProps => {
|
|
|
88
88
|
const width = Math.abs(x2 - x1) || 1;
|
|
89
89
|
const height = Math.abs(y2 - y1) || 1;
|
|
90
90
|
const handleComponentStyle = handleComponent.props && handleComponent.props.style || {};
|
|
91
|
-
const style =
|
|
91
|
+
const style = defaults({}, handleComponentStyle, handleStyle);
|
|
92
92
|
const cursors = getCursorPointers();
|
|
93
93
|
const yProps = {
|
|
94
94
|
style,
|
|
@@ -130,8 +130,8 @@ export const useVictoryBrushContainer = initialProps => {
|
|
|
130
130
|
currentDomain,
|
|
131
131
|
cachedBrushDomain
|
|
132
132
|
} = props;
|
|
133
|
-
const brushDomain =
|
|
134
|
-
const domain = isEqual(brushDomain, cachedBrushDomain) ?
|
|
133
|
+
const brushDomain = defaults({}, props.brushDomain, props.domain);
|
|
134
|
+
const domain = isEqual(brushDomain, cachedBrushDomain) ? defaults({}, currentDomain, brushDomain) : brushDomain;
|
|
135
135
|
const coordinates = Selection.getDomainCoordinates(props, domain);
|
|
136
136
|
const selectBox = getSelectBox(coordinates);
|
|
137
137
|
return selectBox ? [selectBox, getHandles(domain)] : [];
|
package/lib/brush-helpers.d.ts
CHANGED
package/lib/brush-helpers.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BrushHelpers = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
|
8
|
+
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
9
9
|
var _victoryCore = require("victory-core");
|
|
10
10
|
var _reactFastCompare = _interopRequireDefault(require("react-fast-compare"));
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -36,8 +36,8 @@ const Helpers = {
|
|
|
36
36
|
},
|
|
37
37
|
getDomainBox(props, fullDomain, selectedDomain) {
|
|
38
38
|
const brushDimension = this.getDimension(props);
|
|
39
|
-
const fullDomainObject = (0,
|
|
40
|
-
const selectedDomainObject = (0,
|
|
39
|
+
const fullDomainObject = (0, _defaults.default)({}, fullDomain, props.domain);
|
|
40
|
+
const selectedDomainObject = (0, _defaults.default)({}, selectedDomain, fullDomainObject);
|
|
41
41
|
const fullCoords = _victoryCore.Selection.getDomainCoordinates(props, fullDomainObject);
|
|
42
42
|
const selectedCoords = _victoryCore.Selection.getDomainCoordinates(props, selectedDomainObject);
|
|
43
43
|
return {
|
|
@@ -193,8 +193,8 @@ const Helpers = {
|
|
|
193
193
|
startY
|
|
194
194
|
} = props;
|
|
195
195
|
const brushDimension = this.getDimension(props);
|
|
196
|
-
const brushDomain = (0,
|
|
197
|
-
const fullDomain = (0,
|
|
196
|
+
const brushDomain = (0, _defaults.default)({}, props.brushDomain, domain);
|
|
197
|
+
const fullDomain = (0, _defaults.default)({}, props.fullDomain, domain);
|
|
198
198
|
const {
|
|
199
199
|
x1,
|
|
200
200
|
x2,
|
|
@@ -262,7 +262,6 @@ const Helpers = {
|
|
|
262
262
|
return xMoved || yMoved;
|
|
263
263
|
}
|
|
264
264
|
},
|
|
265
|
-
// eslint-disable-next-line max-statements, complexity
|
|
266
265
|
onMouseDown(evt, targetProps) {
|
|
267
266
|
evt.preventDefault();
|
|
268
267
|
const {
|
|
@@ -292,7 +291,7 @@ const Helpers = {
|
|
|
292
291
|
}, fullDomainBox, handleWidth)) {
|
|
293
292
|
return {};
|
|
294
293
|
}
|
|
295
|
-
const brushDomain = (0,
|
|
294
|
+
const brushDomain = (0, _defaults.default)({}, targetProps.brushDomain, domain);
|
|
296
295
|
const currentDomain = (0, _reactFastCompare.default)(brushDomain, cachedBrushDomain) ? targetProps.currentDomain || brushDomain || domain : brushDomain || domain;
|
|
297
296
|
const domainBox = this.getDomainBox(targetProps, domain, currentDomain);
|
|
298
297
|
const activeHandles = allowResize && this.getActiveHandles({
|
|
@@ -355,7 +354,6 @@ const Helpers = {
|
|
|
355
354
|
})
|
|
356
355
|
}] : {};
|
|
357
356
|
},
|
|
358
|
-
// eslint-disable-next-line max-statements, complexity
|
|
359
357
|
onGlobalMouseMove(evt, targetProps) {
|
|
360
358
|
const {
|
|
361
359
|
scale,
|
|
@@ -404,7 +402,7 @@ const Helpers = {
|
|
|
404
402
|
...constrainedBox
|
|
405
403
|
};
|
|
406
404
|
if (_victoryCore.Helpers.isFunction(onBrushDomainChange)) {
|
|
407
|
-
onBrushDomainChange(currentDomain, (0,
|
|
405
|
+
onBrushDomainChange(currentDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
|
|
408
406
|
}
|
|
409
407
|
return [{
|
|
410
408
|
target: "parent",
|
|
@@ -433,7 +431,7 @@ const Helpers = {
|
|
|
433
431
|
parentSVG
|
|
434
432
|
};
|
|
435
433
|
if (_victoryCore.Helpers.isFunction(onBrushDomainChange)) {
|
|
436
|
-
onBrushDomainChange(currentDomain, (0,
|
|
434
|
+
onBrushDomainChange(currentDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
|
|
437
435
|
}
|
|
438
436
|
return [{
|
|
439
437
|
target: "parent",
|
|
@@ -442,13 +440,11 @@ const Helpers = {
|
|
|
442
440
|
}
|
|
443
441
|
return {};
|
|
444
442
|
},
|
|
445
|
-
// eslint-disable-next-line complexity
|
|
446
443
|
onGlobalMouseUp(evt, targetProps) {
|
|
447
444
|
// if a panning or selection has not been started, ignore the event
|
|
448
445
|
if (!targetProps.isPanning && !targetProps.isSelecting) {
|
|
449
446
|
return {};
|
|
450
447
|
}
|
|
451
|
-
// eslint-disable-line max-statements, complexity
|
|
452
448
|
const {
|
|
453
449
|
x1,
|
|
454
450
|
y1,
|
|
@@ -476,17 +472,17 @@ const Helpers = {
|
|
|
476
472
|
const defaultDomain = this.getDefaultBrushArea(targetProps, cachedDomain, evt);
|
|
477
473
|
mutatedProps.currentDomain = defaultDomain;
|
|
478
474
|
if (_victoryCore.Helpers.isFunction(onBrushDomainChange)) {
|
|
479
|
-
onBrushDomainChange(defaultDomain, (0,
|
|
475
|
+
onBrushDomainChange(defaultDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
|
|
480
476
|
}
|
|
481
477
|
if (_victoryCore.Helpers.isFunction(onBrushDomainChangeEnd)) {
|
|
482
|
-
onBrushDomainChangeEnd(defaultDomain, (0,
|
|
478
|
+
onBrushDomainChangeEnd(defaultDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
|
|
483
479
|
}
|
|
484
480
|
if (_victoryCore.Helpers.isFunction(onBrushCleared)) {
|
|
485
|
-
onBrushCleared(defaultDomain, (0,
|
|
481
|
+
onBrushCleared(defaultDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
|
|
486
482
|
}
|
|
487
483
|
} else if (allowDrag && isPanning || allowResize && isSelecting) {
|
|
488
484
|
if (_victoryCore.Helpers.isFunction(onBrushDomainChangeEnd)) {
|
|
489
|
-
onBrushDomainChangeEnd(currentDomain, (0,
|
|
485
|
+
onBrushDomainChangeEnd(currentDomain, (0, _defaults.default)({}, mutatedProps, targetProps));
|
|
490
486
|
}
|
|
491
487
|
}
|
|
492
488
|
return [{
|
|
@@ -499,7 +495,7 @@ const BrushHelpers = exports.BrushHelpers = {
|
|
|
499
495
|
...Helpers,
|
|
500
496
|
onMouseDown: Helpers.onMouseDown.bind(Helpers),
|
|
501
497
|
onGlobalMouseUp: Helpers.onGlobalMouseUp.bind(Helpers),
|
|
502
|
-
onGlobalMouseMove: (0,
|
|
498
|
+
onGlobalMouseMove: (0, _throttle.default)(Helpers.onGlobalMouseMove.bind(Helpers), 16,
|
|
503
499
|
// eslint-disable-line no-magic-numbers
|
|
504
500
|
{
|
|
505
501
|
leading: true,
|
|
@@ -65,68 +65,68 @@ export declare const useVictoryBrushContainer: (initialProps: VictoryBrushContai
|
|
|
65
65
|
allowDraw: boolean;
|
|
66
66
|
allowResize: boolean;
|
|
67
67
|
brushComponent: JSX.Element;
|
|
68
|
-
brushDimension?: "x" | "y"
|
|
68
|
+
brushDimension?: "x" | "y";
|
|
69
69
|
brushDomain?: {
|
|
70
|
-
x?: DomainTuple
|
|
71
|
-
y?: DomainTuple
|
|
72
|
-
}
|
|
70
|
+
x?: DomainTuple;
|
|
71
|
+
y?: DomainTuple;
|
|
72
|
+
};
|
|
73
73
|
brushStyle: React.CSSProperties | {
|
|
74
74
|
stroke: string;
|
|
75
75
|
fill: string;
|
|
76
76
|
fillOpacity: number;
|
|
77
77
|
};
|
|
78
|
-
defaultBrushArea?: "
|
|
79
|
-
disable?: boolean
|
|
78
|
+
defaultBrushArea?: "all" | "none" | "disable" | "move";
|
|
79
|
+
disable?: boolean;
|
|
80
80
|
handleComponent: JSX.Element;
|
|
81
81
|
handleStyle: React.CSSProperties | {
|
|
82
82
|
stroke: string;
|
|
83
83
|
fill: string;
|
|
84
84
|
};
|
|
85
85
|
handleWidth: number;
|
|
86
|
-
onBrushCleared?: (
|
|
86
|
+
onBrushCleared?: (domain: {
|
|
87
87
|
x: DomainTuple;
|
|
88
88
|
y: DomainTuple;
|
|
89
|
-
}, props: VictoryBrushContainerProps) => void
|
|
90
|
-
onBrushDomainChange?: (
|
|
89
|
+
}, props: VictoryBrushContainerProps) => void;
|
|
90
|
+
onBrushDomainChange?: (domain: {
|
|
91
91
|
x: DomainTuple;
|
|
92
92
|
y: DomainTuple;
|
|
93
|
-
}, props: VictoryBrushContainerProps) => void
|
|
94
|
-
onBrushDomainChangeEnd?: (
|
|
93
|
+
}, props: VictoryBrushContainerProps) => void;
|
|
94
|
+
onBrushDomainChangeEnd?: (domain: {
|
|
95
95
|
x: DomainTuple;
|
|
96
96
|
y: DomainTuple;
|
|
97
|
-
}, props: VictoryBrushContainerProps) => void
|
|
98
|
-
"aria-describedby"?: string
|
|
99
|
-
"aria-labelledby"?: string
|
|
100
|
-
children?: React.ReactElement
|
|
101
|
-
className?: string
|
|
102
|
-
containerId?:
|
|
103
|
-
containerRef?: React.Ref<HTMLElement
|
|
104
|
-
desc?: string
|
|
105
|
-
events?: React.DOMAttributes<any
|
|
106
|
-
height?: number
|
|
107
|
-
name?: string
|
|
108
|
-
origin?: import("victory-core").OriginType
|
|
109
|
-
polar?: boolean
|
|
110
|
-
portalComponent?: React.ReactElement
|
|
111
|
-
portalZIndex?: number
|
|
112
|
-
preserveAspectRatio?: string
|
|
113
|
-
responsive?: boolean
|
|
114
|
-
role?: string
|
|
97
|
+
}, props: VictoryBrushContainerProps) => void;
|
|
98
|
+
"aria-describedby"?: string;
|
|
99
|
+
"aria-labelledby"?: string;
|
|
100
|
+
children?: React.ReactElement | React.ReactElement[];
|
|
101
|
+
className?: string;
|
|
102
|
+
containerId?: number | string;
|
|
103
|
+
containerRef?: React.Ref<HTMLElement>;
|
|
104
|
+
desc?: string;
|
|
105
|
+
events?: React.DOMAttributes<any>;
|
|
106
|
+
height?: number;
|
|
107
|
+
name?: string;
|
|
108
|
+
origin?: import("victory-core").OriginType;
|
|
109
|
+
polar?: boolean;
|
|
110
|
+
portalComponent?: React.ReactElement;
|
|
111
|
+
portalZIndex?: number;
|
|
112
|
+
preserveAspectRatio?: string;
|
|
113
|
+
responsive?: boolean;
|
|
114
|
+
role?: string;
|
|
115
115
|
scale?: {
|
|
116
|
-
x?: import("victory-core").D3Scale
|
|
117
|
-
y?: import("victory-core").D3Scale
|
|
118
|
-
}
|
|
119
|
-
style?: React.CSSProperties
|
|
120
|
-
tabIndex?: number
|
|
121
|
-
theme?: import("victory-core").VictoryThemeDefinition
|
|
122
|
-
title?: string
|
|
123
|
-
width?: number
|
|
124
|
-
ouiaId?:
|
|
125
|
-
ouiaSafe?: boolean
|
|
126
|
-
ouiaType?: string
|
|
116
|
+
x?: import("victory-core").D3Scale;
|
|
117
|
+
y?: import("victory-core").D3Scale;
|
|
118
|
+
};
|
|
119
|
+
style?: React.CSSProperties;
|
|
120
|
+
tabIndex?: number;
|
|
121
|
+
theme?: import("victory-core").VictoryThemeDefinition;
|
|
122
|
+
title?: string;
|
|
123
|
+
width?: number;
|
|
124
|
+
ouiaId?: number | string;
|
|
125
|
+
ouiaSafe?: boolean;
|
|
126
|
+
ouiaType?: string;
|
|
127
127
|
mouseMoveThreshold: number;
|
|
128
128
|
};
|
|
129
|
-
children: React.ReactElement
|
|
129
|
+
children: React.ReactElement[];
|
|
130
130
|
};
|
|
131
131
|
export declare const VictoryBrushContainer: {
|
|
132
132
|
(initialProps: VictoryBrushContainerProps): JSX.Element;
|