cl-react-graph
Version:
2 lines • 18.1 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{"+x/X":function(e,t,a){"use strict";function o(e,t){this._context=e,this._t=t}function n(e){return new o(e,0)}function i(e){return new o(e,1)}a.d(t,"c",(function(){return n})),a.d(t,"b",(function(){return i})),o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var a=this._x*(1-this._t)+e*this._t;this._context.lineTo(a,this._y),this._context.lineTo(a,t)}}this._x=e,this._y=t}},t.a=function(e){return new o(e,.5)}},"/e6I":function(e,t,a){"use strict";a.r(t);var o=a("q1tI"),n=a.n(o),i=a("ofer"),r=a("tRbT"),l=a("30+C"),c=a("oa/T"),s=a("Z3vd"),d=a("ZGBi"),p=a("UhlP"),u=a("bzer"),h=a("Ruab"),b=a("uaBJ"),m=a("ExZL"),g=a("9Dj+"),y=a("H8eV"),f={data:b.e,splitBins:["Male","Female"],groupLayout:u.e.OVERLAID,width:600,height:500,splitAxisHeight:50,xAxisHeight:20,direction:u.d.HORIZONTAL,showBinPercentages:!1};function x(e,t){switch(t.type){case"SET_SHOW_PERCENTAGES":return Object.assign({},e,{showBinPercentages:t.show});case"SET_DIRECTION":return Object.assign({},e,{direction:t.direction})}return e}t.default=function(){var e=Object(o.useReducer)(x,f),t=e[0],a=e[1],b=Object(o.useState)(0),k=b[0],w=b[1],v=n.a.createElement(h.a,Object.assign({id:"demo"},t));return n.a.createElement(g.a,null,n.a.createElement(y.a,{title:"Line Chart",description:""}),n.a.createElement(i.a,{variant:"h2"},"Tornado Chart"),n.a.createElement("div",null,n.a.createElement(r.a,{container:!0,spacing:5,className:"wrapper"},n.a.createElement(r.a,{item:!0,xs:12,md:6},n.a.createElement(l.a,null,n.a.createElement(c.a,null,v,n.a.createElement(s.a,{onClick:function(){return w(0===k?1:0)}},"Toggle Data"))),n.a.createElement("br",null),n.a.createElement(l.a,null,n.a.createElement(c.a,null,n.a.createElement(m.a,{component:v})))),n.a.createElement(r.a,{item:!0,xs:12,md:6},n.a.createElement(d.a,{control:n.a.createElement(p.a,{checked:t.showBinPercentages,color:"primary",onChange:function(e,t){a({type:"SET_SHOW_PERCENTAGES",show:t})}}),label:"Show points"}),n.a.createElement(d.a,{control:n.a.createElement(p.a,{checked:t.direction===u.d.VERTICAL,color:"primary",onChange:function(e,o){a({type:"SET_DIRECTION",direction:t.direction===u.d.VERTICAL?u.d.HORIZONTAL:u.d.VERTICAL})}}),label:"Direction "+t.direction})),n.a.createElement(r.a,{item:!0,xs:12,md:6}))))}},"4hqb":function(e,t,a){"use strict";a.d(t,"b",(function(){return i}));var o=a("q1tI"),n=o.createContext();function i(){return o.useContext(n)}t.a=n},EHdT:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var o=a("q1tI"),n=a("4hqb");function i(){return o.useContext(n.a)}},UhlP:function(e,t,a){"use strict";var o=a("k1TG"),n=a("aXB2"),i=a("q1tI"),r=a("iuhU"),l=a("H2TA"),c=a("ye/S"),s=a("NqtD"),d=a("8j0Q"),p=a("yCxk"),u=a("EHdT"),h=a("PsDL"),b=i.forwardRef((function(e,t){var a=e.autoFocus,l=e.checked,c=e.checkedIcon,s=e.classes,b=e.className,m=e.defaultChecked,g=e.disabled,y=e.icon,f=e.id,x=e.inputProps,k=e.inputRef,w=e.name,v=e.onBlur,T=e.onChange,O=e.onFocus,S=e.readOnly,C=e.required,E=e.tabIndex,D=e.type,j=e.value,z=Object(n.a)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),_=Object(p.a)({controlled:l,default:Boolean(m),name:"SwitchBase",state:"checked"}),R=Object(d.a)(_,2),I=R[0],N=R[1],$=Object(u.a)(),Z=g;$&&void 0===Z&&(Z=$.disabled);var B="checkbox"===D||"radio"===D;return i.createElement(h.a,Object(o.a)({component:"span",className:Object(r.a)(s.root,b,I&&s.checked,Z&&s.disabled),disabled:Z,tabIndex:null,role:void 0,onFocus:function(e){O&&O(e),$&&$.onFocus&&$.onFocus(e)},onBlur:function(e){v&&v(e),$&&$.onBlur&&$.onBlur(e)},ref:t},z),i.createElement("input",Object(o.a)({autoFocus:a,checked:l,defaultChecked:m,className:s.input,disabled:Z,id:B&&f,name:w,onChange:function(e){var t=e.target.checked;N(t),T&&T(e,t)},readOnly:S,ref:k,required:C,tabIndex:E,type:D,value:j},x)),I?c:y)})),m=Object(l.a)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(b),g=i.forwardRef((function(e,t){var a=e.classes,l=e.className,c=e.color,d=void 0===c?"secondary":c,p=e.edge,u=void 0!==p&&p,h=e.size,b=void 0===h?"medium":h,g=Object(n.a)(e,["classes","className","color","edge","size"]),y=i.createElement("span",{className:a.thumb});return i.createElement("span",{className:Object(r.a)(a.root,l,{start:a.edgeStart,end:a.edgeEnd}[u],"small"===b&&a["size".concat(Object(s.a)(b))])},i.createElement(m,Object(o.a)({type:"checkbox",icon:y,checkedIcon:y,classes:{root:Object(r.a)(a.switchBase,a["color".concat(Object(s.a)(d))]),input:a.input,checked:a.checked,disabled:a.disabled},ref:t},g)),i.createElement("span",{className:a.track}))}));t.a=Object(l.a)((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(c.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(c.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(g)},Z3vd:function(e,t,a){"use strict";var o=a("aXB2"),n=a("k1TG"),i=a("q1tI"),r=a("iuhU"),l=a("H2TA"),c=a("ye/S"),s=a("VD++"),d=a("NqtD"),p=i.forwardRef((function(e,t){var a=e.children,l=e.classes,c=e.className,p=e.color,u=void 0===p?"default":p,h=e.component,b=void 0===h?"button":h,m=e.disabled,g=void 0!==m&&m,y=e.disableElevation,f=void 0!==y&&y,x=e.disableFocusRipple,k=void 0!==x&&x,w=e.endIcon,v=e.focusVisibleClassName,T=e.fullWidth,O=void 0!==T&&T,S=e.size,C=void 0===S?"medium":S,E=e.startIcon,D=e.type,j=void 0===D?"button":D,z=e.variant,_=void 0===z?"text":z,R=Object(o.a)(e,["children","classes","className","color","component","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"]),I=E&&i.createElement("span",{className:Object(r.a)(l.startIcon,l["iconSize".concat(Object(d.a)(C))])},E),N=w&&i.createElement("span",{className:Object(r.a)(l.endIcon,l["iconSize".concat(Object(d.a)(C))])},w);return i.createElement(s.a,Object(n.a)({className:Object(r.a)(l.root,l[_],c,"inherit"===u?l.colorInherit:"default"!==u&&l["".concat(_).concat(Object(d.a)(u))],"medium"!==C&&[l["".concat(_,"Size").concat(Object(d.a)(C))],l["size".concat(Object(d.a)(C))]],f&&l.disableElevation,g&&l.disabled,O&&l.fullWidth),component:b,disabled:g,focusRipple:!k,focusVisibleClassName:Object(r.a)(l.focusVisible,v),ref:t,type:j},R),i.createElement("span",{className:l.label},I,a,N))}));t.a=Object(l.a)((function(e){return{root:Object(n.a)({},e.typography.button,{boxSizing:"border-box",minWidth:64,padding:"6px 16px",borderRadius:e.shape.borderRadius,color:e.palette.text.primary,transition:e.transitions.create(["background-color","box-shadow","border"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none",backgroundColor:Object(c.b)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}},"&$disabled":{color:e.palette.action.disabled}}),label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},text:{padding:"6px 8px"},textPrimary:{color:e.palette.primary.main,"&:hover":{backgroundColor:Object(c.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},textSecondary:{color:e.palette.secondary.main,"&:hover":{backgroundColor:Object(c.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlined:{padding:"5px 15px",border:"1px solid ".concat("light"===e.palette.type?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)"),"&$disabled":{border:"1px solid ".concat(e.palette.action.disabledBackground)}},outlinedPrimary:{color:e.palette.primary.main,border:"1px solid ".concat(Object(c.b)(e.palette.primary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.primary.main),backgroundColor:Object(c.b)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},outlinedSecondary:{color:e.palette.secondary.main,border:"1px solid ".concat(Object(c.b)(e.palette.secondary.main,.5)),"&:hover":{border:"1px solid ".concat(e.palette.secondary.main),backgroundColor:Object(c.b)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{border:"1px solid ".concat(e.palette.action.disabled)}},contained:{color:e.palette.getContrastText(e.palette.grey[300]),backgroundColor:e.palette.grey[300],boxShadow:e.shadows[2],"&:hover":{backgroundColor:e.palette.grey.A100,boxShadow:e.shadows[4],"@media (hover: none)":{boxShadow:e.shadows[2],backgroundColor:e.palette.grey[300]},"&$disabled":{backgroundColor:e.palette.action.disabledBackground}},"&$focusVisible":{boxShadow:e.shadows[6]},"&:active":{boxShadow:e.shadows[8]},"&$disabled":{color:e.palette.action.disabled,boxShadow:e.shadows[0],backgroundColor:e.palette.action.disabledBackground}},containedPrimary:{color:e.palette.primary.contrastText,backgroundColor:e.palette.primary.main,"&:hover":{backgroundColor:e.palette.primary.dark,"@media (hover: none)":{backgroundColor:e.palette.primary.main}}},containedSecondary:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.main,"&:hover":{backgroundColor:e.palette.secondary.dark,"@media (hover: none)":{backgroundColor:e.palette.secondary.main}}},disableElevation:{boxShadow:"none","&:hover":{boxShadow:"none"},"&$focusVisible":{boxShadow:"none"},"&:active":{boxShadow:"none"},"&$disabled":{boxShadow:"none"}},focusVisible:{},disabled:{},colorInherit:{color:"inherit",borderColor:"currentColor"},textSizeSmall:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},textSizeLarge:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},outlinedSizeSmall:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},outlinedSizeLarge:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},containedSizeSmall:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},containedSizeLarge:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},sizeSmall:{},sizeLarge:{},fullWidth:{width:"100%"},startIcon:{display:"inherit",marginRight:8,marginLeft:-4,"&$iconSizeSmall":{marginLeft:-2}},endIcon:{display:"inherit",marginRight:-4,marginLeft:8,"&$iconSizeSmall":{marginRight:-2}},iconSizeSmall:{"& > *:first-child":{fontSize:18}},iconSizeMedium:{"& > *:first-child":{fontSize:20}},iconSizeLarge:{"& > *:first-child":{fontSize:22}}}}),{name:"MuiButton"})(p)},ZGBi:function(e,t,a){"use strict";var o=a("k1TG"),n=a("aXB2"),i=a("q1tI"),r=a("iuhU"),l=a("EHdT"),c=a("H2TA"),s=a("ofer"),d=a("NqtD"),p=i.forwardRef((function(e,t){e.checked;var a=e.classes,c=e.className,p=e.control,u=e.disabled,h=(e.inputRef,e.label),b=e.labelPlacement,m=void 0===b?"end":b,g=(e.name,e.onChange,e.value,Object(n.a)(e,["checked","classes","className","control","disabled","inputRef","label","labelPlacement","name","onChange","value"])),y=Object(l.a)(),f=u;void 0===f&&void 0!==p.props.disabled&&(f=p.props.disabled),void 0===f&&y&&(f=y.disabled);var x={disabled:f};return["checked","name","onChange","value","inputRef"].forEach((function(t){void 0===p.props[t]&&void 0!==e[t]&&(x[t]=e[t])})),i.createElement("label",Object(o.a)({className:Object(r.a)(a.root,c,"end"!==m&&a["labelPlacement".concat(Object(d.a)(m))],f&&a.disabled),ref:t},g),i.cloneElement(p,x),i.createElement(s.a,{component:"span",className:Object(r.a)(a.label,f&&a.disabled)},h))}));t.a=Object(c.a)((function(e){return{root:{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,"&$disabled":{cursor:"default"}},labelPlacementStart:{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},labelPlacementTop:{flexDirection:"column-reverse",marginLeft:16},labelPlacementBottom:{flexDirection:"column",marginLeft:16},disabled:{},label:{"&$disabled":{color:e.palette.text.disabled}}}}),{name:"MuiFormControlLabel"})(p)},uaBJ:function(e,t,a){"use strict";a.d(t,"b",(function(){return l})),a.d(t,"a",(function(){return c})),a.d(t,"e",(function(){return s})),a.d(t,"d",(function(){return d})),a.d(t,"c",(function(){return p}));var o=a("+x/X"),n=a("SSiR"),i=new Date,r=new Array(100).fill("").map((function(e,t){return new Date((new Date).setDate(i.getDate()+t))})).map((function(e,t){return{x:e,y:1e3*t}})),l=[{label:"cdd7c30f-4d9b-433c-a5d4-12bb39df89c6 usage",line:{fill:{fill:"rgba(11, 85, 167, 0.7)",show:!0},show:!0,stroke:"#000",strokeDashArray:"0",strokeDashOffset:0,curveType:o.c},point:{fill:"#000",radius:2,show:!0,stroke:"#000"},data:r}],c=[{label:"rob Allocation",line:{curveType:n.a,fill:{fill:"rgba(11, 85, 167, 0.2)",show:!0},show:!0,stroke:"rgb(11, 85, 167)",strokeDashArray:"0",strokeDashOffset:0},point:{fill:"#000",radius:4,show:!0,stroke:""},data:r},{label:"rob'",line:{curveType:n.a,fill:{fill:"rgba(11, 85, 167, 0.7)",show:!0},show:!0,stroke:"#000",strokeDashArray:"0",strokeDashOffset:0},point:{fill:"",radius:0,show:!1,stroke:""},data:[{x:new Date("2019-08-20T00:00:00.000Z"),y:0},{x:new Date("2019-08-21T00:00:00.000Z"),y:0},{x:new Date("2019-08-22T00:00:00.000Z"),y:0},{x:new Date("2019-08-23T00:00:00.000Z"),y:0},{x:new Date("2019-08-24T00:00:00.000Z"),y:0},{x:new Date("2019-08-25T00:00:00.000Z"),y:0},{x:new Date("2019-08-26T00:00:00.000Z"),y:0},{x:new Date("2019-08-27T00:00:00.000Z"),y:0}]},{label:"Their Allocation",line:{curveType:n.a,fill:{fill:"rgba(0, 169, 123, 0.2)",show:!0},show:!0,stroke:"rgb(0, 169, 123)",strokeDashArray:"0",strokeDashOffset:0},point:{fill:"",radius:0,show:!1,stroke:""},data:[{x:new Date("2019-08-20T00:00:00.000Z"),y:0},{x:new Date("2019-08-21T00:00:00.000Z"),y:0},{x:new Date("2019-08-22T00:00:00.000Z"),y:0},{x:new Date("2019-08-23T00:00:00.000Z"),y:0},{x:new Date("2019-08-24T00:00:00.000Z"),y:0},{x:new Date("2019-08-25T00:00:00.000Z"),y:0},{x:new Date("2019-08-26T00:00:00.000Z"),y:0},{x:new Date("2019-08-27T00:00:00.000Z"),y:0}]},{label:"Theirs",line:{curveType:n.a,fill:{fill:"rgba(0, 169, 123, 0.7)",show:!0},show:!0,stroke:"#000",strokeDashArray:"0",strokeDashOffset:0},point:{fill:"",radius:0,show:!1,stroke:""},data:[{x:new Date("2019-08-20T00:00:00.000Z"),y:0},{x:new Date("2019-08-21T00:00:00.000Z"),y:0},{x:new Date("2019-08-22T00:00:00.000Z"),y:0},{x:new Date("2019-08-23T00:00:00.000Z"),y:0},{x:new Date("2019-08-24T00:00:00.000Z"),y:0},{x:new Date("2019-08-25T00:00:00.000Z"),y:0},{x:new Date("2019-08-26T00:00:00.000Z"),y:0},{x:new Date("2019-08-27T00:00:00.000Z"),y:0}]}],s={bins:["16-18","18-25","25-35","35-50","50-65","65-∞"],counts:[{label:"Background",data:[[200,2600,5100,9700,8400,6700],[2002,2100,4700,8700,4900,1400]]},{label:"Foreground",data:[[100,260,510,970,840,670],[1e3,5500,470,870,490,140]]}]},d={label:"Scatter data",point:{fill:"#000",radius:4,show:!0,stroke:""},data:[{x:0,y:1,z:5},{x:2,y:1,z:5},{x:3,y:3,z:10},{x:4,y:4,z:5},{x:5,y:1,z:15},{x:6,y:6,z:5},{x:7,y:7,z:15}]},p=[{label:"Germany",axes:[{axis:"strength",value:13},{axis:"intelligence",value:6},{axis:"charisma",value:5},{axis:"dexterity",value:9},{axis:"luck",value:2}]},{label:"Argentina",axes:[{axis:"strength",value:6},{axis:"intelligence",value:7},{axis:"charisma",value:10},{axis:"dexterity",value:13},{axis:"luck",value:9}]}]}}]);
//# sourceMappingURL=component---src-pages-tornado-tsx-7c08c03a4410843396a0.js.map