cl-react-graph
Version:
2 lines • 11.4 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{"+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"),h=a("bzer"),u=a("Ruab"),b=a("uaBJ"),m=a("ExZL"),x=a("9Dj+"),y=a("H8eV"),f={data:b.c,splitBins:["Male","Female"],groupLayout:h.e.OVERLAID,width:600,height:500,splitAxisHeight:50,xAxisHeight:20,direction:h.d.HORIZONTAL,showBinPercentages:!1};function g(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)(g,f),t=e[0],a=e[1],b=Object(o.useState)(0),w=b[0],T=b[1],S=n.a.createElement(u.a,Object.assign({id:"demo"},t));return n.a.createElement(x.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,S,n.a.createElement(s.a,{onClick:function(){return T(0===w?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:S})))),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===h.d.VERTICAL,color:"primary",onChange:function(e,o){a({type:"SET_DIRECTION",direction:t.direction===h.d.VERTICAL?h.d.HORIZONTAL:h.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)}},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,h=void 0===p?"default":p,u=e.component,b=void 0===u?"button":u,m=e.disabled,x=void 0!==m&&m,y=e.disableElevation,f=void 0!==y&&y,g=e.disableFocusRipple,w=void 0!==g&&g,T=e.endIcon,S=e.focusVisibleClassName,v=e.fullWidth,k=void 0!==v&&v,D=e.size,E=void 0===D?"medium":D,_=e.startIcon,C=e.type,O=void 0===C?"button":C,z=e.variant,Z=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"]),j=_&&i.createElement("span",{className:Object(r.a)(l.startIcon,l["iconSize".concat(Object(d.a)(E))])},_),I=T&&i.createElement("span",{className:Object(r.a)(l.endIcon,l["iconSize".concat(Object(d.a)(E))])},T);return i.createElement(s.a,Object(n.a)({className:Object(r.a)(l.root,l[Z],c,"inherit"===h?l.colorInherit:"default"!==h&&l["".concat(Z).concat(Object(d.a)(h))],"medium"!==E&&[l["".concat(Z,"Size").concat(Object(d.a)(E))],l["size".concat(Object(d.a)(E))]],f&&l.disableElevation,x&&l.disabled,k&&l.fullWidth),component:b,disabled:x,focusRipple:!w,focusVisibleClassName:Object(r.a)(l.focusVisible,S),ref:t,type:O},R),i.createElement("span",{className:l.label},j,a,I))}));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)},uaBJ:function(e,t,a){"use strict";a.d(t,"b",(function(){return l})),a.d(t,"a",(function(){return c})),a.d(t,"c",(function(){return s}));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]]}]}}}]);
//# sourceMappingURL=component---src-pages-tornado-tsx-02fbe40a9be7b4283a61.js.map