Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nivo/stream

Package Overview
Dependencies
Maintainers
2
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nivo/stream - npm Package Compare versions

Comparing version 0.79.1 to 0.80.0

2

dist/nivo-stream.cjs.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),o=require("@nivo/core"),r=require("@nivo/axes"),t=require("@nivo/legends"),i=require("@react-spring/web"),n=require("@nivo/tooltip"),l=require("react/jsx-runtime"),a=require("d3-shape"),d=require("d3-scale"),s=require("@nivo/colors");function c(){return c=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},c.apply(this,arguments)}var u=function(r){var t=r.layer,a=r.fillOpacity,d=r.borderWidth,s=r.getBorderColor,c=r.isInteractive,u=r.tooltip,f=n.useTooltip(),p=f.showTooltipFromEvent,h=f.hideTooltip,v=e.useCallback((function(o){p(e.createElement(u,{layer:t}),o,"left")}),[p,t]),g=o.useMotionConfig(),m=g.animate,y=g.config,x=o.useAnimatedPath(t.path),b=i.useSpring({color:t.color,config:y,immediate:!m});return l.jsx(i.animated.path,{d:x,fill:t.fill?t.fill:b.color,fillOpacity:a,stroke:s(t),strokeWidth:d,onMouseMove:c?v:void 0,onMouseEnter:c?v:void 0,onMouseLeave:c?h:void 0})},f=function(e){var o=e.layers,r=e.fillOpacity,t=e.borderWidth,i=e.getBorderColor,n=e.isInteractive,a=e.tooltip;return l.jsx("g",{children:o.map((function(e,o){return l.jsx(u,{layer:e,getBorderColor:i,borderWidth:t,fillOpacity:r,isInteractive:n,tooltip:a},o)}))})},p=function(e,o){var r=e.y2;return"center"===o?r=e.y1+(e.y2-e.y1)/2:"start"===o&&(r=e.y1),r},h=function(o){var r=o.data,t=o.dotComponent,i=o.position,n=o.getSize,a=o.getColor,d=o.getBorderWidth,s=o.getBorderColor;return l.jsx(l.Fragment,{children:r.map((function(o,r){return e.createElement(t,{key:r,datum:o,x:o.x,y:p(o,i),size:n(o),color:a(o),borderWidth:d(o),borderColor:s(o)})}))})},v=function(o){var r=o.slice,t=o.height,i=o.tooltip,a=e.useState(!1),d=a[0],s=a[1],c=n.useTooltip(),u=c.showTooltipFromEvent,f=c.hideTooltip,p=e.useCallback((function(o){s(!0),u(e.createElement(i,{slice:r}),o,"left")}),[s,u,i,r]),h=e.useCallback((function(){s(!1),f()}),[s,f]);return l.jsxs("g",{transform:"translate("+r.x+", 0)",children:[d&&l.jsx("line",{x1:0,x2:0,y1:0,y2:t,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),l.jsx("rect",{x:-20,width:40,height:t,fill:"#000",fillOpacity:0,onMouseEnter:p,onMouseMove:p,onMouseLeave:h})]})},g=function(e){var o=e.slices,r=e.height,t=e.tooltip;return l.jsx("g",{children:o.map((function(e){return l.jsx(v,{slice:e,height:r,tooltip:t},e.index)}))})},m={label:"id",order:"none",offsetType:"wiggle",curve:"catmullRom",axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,colors:{scheme:"nivo"},fillOpacity:1,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableDots:!1,dotPosition:"center",dotComponent:function(e){var r=e.x,t=e.y,n=e.size,a=e.color,d=e.borderWidth,s=e.borderColor,c=o.useMotionConfig(),u=c.animate,f=c.config,p=i.useSpring({x:r,y:t,radius:.5*n,color:a,config:f,immediate:!u});return l.jsx(i.animated.circle,{cx:p.x,cy:p.y,r:p.radius,fill:p.color,strokeWidth:d,stroke:s})},dotSize:6,dotColor:{from:"color"},dotBorderWidth:0,dotBorderColor:{from:"color"},isInteractive:!0,tooltip:function(e){var o=e.layer;return l.jsx(n.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},enableStackTooltip:!0,stackTooltip:function(o){var r=o.slice,t=e.useMemo((function(){return r.stack.map((function(e){return[l.jsx(n.Chip,{color:e.color},e.layerId),e.layerLabel,e.formattedValue]}))}),[r]);return l.jsx(n.TableTooltip,{rows:t})},legends:[],legendLabel:"id",role:"application"},y=c({},m,{layers:["grid","axes","layers","dots","slices","legends"],defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),x=function(r){var t=r.width,i=r.height,n=r.data,l=r.keys,u=r.label,f=void 0===u?m.label:u,p=r.valueFormat,h=r.offsetType,v=void 0===h?m.offsetType:h,g=r.order,y=void 0===g?m.order:g,x=r.curve,b=void 0===x?m.curve:x,C=r.colors,B=void 0===C?m.colors:C,j=r.borderColor,S=void 0===j?m.borderColor:j,k=r.dotSize,W=void 0===k?m.dotSize:k,M=r.dotColor,T=void 0===M?m.dotColor:M,O=r.dotBorderWidth,I=void 0===O?m.dotBorderWidth:O,D=r.dotBorderColor,w=void 0===D?m.dotBorderColor:D,L=o.useCurveInterpolation(b),F=e.useMemo((function(){return a.area().x((function(e){return e.x})).y0((function(e){return e.y1})).y1((function(e){return e.y2})).curve(L)}),[L]),P=e.useMemo((function(){return a.stack().keys(l).offset(o.stackOffsetFromProp(v)).order(o.stackOrderFromProp(y))}),[l,v,y]),z=e.useMemo((function(){var e=[],o=[],r=P(n).map((function(r){return r.map((function(t){return e.push(t[0]),o.push(t[1]),c({},t,{value:t.data[r.key]})}))})),l=Math.min.apply(Math,e),a=Math.max.apply(Math,o);return[r,d.scalePoint().domain(Array.from({length:n.length},(function(e,o){return o}))).range([0,t]),d.scaleLinear().domain([l,a]).range([i,0])]}),[P,n,t,i]),q=z[0],E=z[1],G=z[2],A=o.useTheme(),R=s.useOrdinalColorScale(B,"id"),H=s.useInheritedColor(S,A),V=e.useMemo((function(){return"function"==typeof W?W:function(){return W}}),[W]),X=s.useInheritedColor(T,A),Y=e.useMemo((function(){return"function"==typeof I?I:function(){return I}}),[I]),_=s.useInheritedColor(w,A),J=o.usePropertyAccessor(f),K=o.useValueFormatter(p),N=e.useMemo((function(){return q.map((function(e,o){var r=e.map((function(e,r){return{layerId:l[o],layerLabel:"",index:r,color:"",x:E(r),value:e.value,formattedValue:K(e.value),y1:G(e[0]),y2:G(e[1])}})),t={id:l[o],path:F(r)},i=c({},t,{label:J(t),color:R(t)});return c({},i,{data:r.map((function(e){return e.layerLabel=i.label,e.color=i.color,e}))})}))}),[q,l,J,F,R,E,G,K]),Q=e.useMemo((function(){return Array.from({length:n.length},(function(e,o){var r=N.map((function(e){return e.data[o]})).sort((function(e,o){return e.y2-o.y2}));return{index:o,x:N[0].data[o].x,stack:r}}))}),[n.length,N]),U=e.useMemo((function(){return{xScale:E,yScale:G,layers:N,slices:Q}}),[E,G,N,Q]);return{xScale:E,yScale:G,layers:N,slices:Q,getBorderColor:H,getDotSize:V,getDotColor:X,getDotBorderWidth:Y,getDotBorderColor:_,layerContext:U}},b=["isInteractive","animate","motionConfig","theme","renderWrapper"],C=function(i){var n=i.data,a=i.keys,d=i.label,s=i.valueFormat,u=i.offsetType,p=i.order,v=i.curve,m=i.layers,b=void 0===m?y.layers:m,C=i.width,B=i.height,j=i.margin,S=i.axisTop,k=i.axisRight,W=i.axisBottom,M=void 0===W?y.axisBottom:W,T=i.axisLeft,O=void 0===T?y.axisLeft:T,I=i.enableGridX,D=void 0===I?y.enableGridX:I,w=i.enableGridY,L=void 0===w?y.enableGridY:w,F=i.colors,P=i.fillOpacity,z=void 0===P?y.fillOpacity:P,q=i.borderWidth,E=void 0===q?y.borderWidth:q,G=i.borderColor,A=i.defs,R=void 0===A?y.defs:A,H=i.fill,V=void 0===H?y.fill:H,X=i.enableDots,Y=void 0===X?y.enableDots:X,_=i.dotPosition,J=void 0===_?y.dotPosition:_,K=i.dotComponent,N=void 0===K?y.dotComponent:K,Q=i.dotSize,U=i.dotColor,Z=i.dotBorderWidth,$=i.dotBorderColor,ee=i.isInteractive,oe=void 0===ee?y.isInteractive:ee,re=i.tooltip,te=void 0===re?y.tooltip:re,ie=i.enableStackTooltip,ne=void 0===ie?y.enableStackTooltip:ie,le=i.stackTooltip,ae=void 0===le?y.stackTooltip:le,de=i.legends,se=void 0===de?y.legends:de,ce=i.role,ue=i.ariaLabel,fe=i.ariaLabelledBy,pe=i.ariaDescribedBy,he=o.useDimensions(C,B,j),ve=he.margin,ge=he.innerWidth,me=he.innerHeight,ye=he.outerWidth,xe=he.outerHeight,be=x({width:ge,height:me,data:n,keys:a,label:d,valueFormat:s,offsetType:u,order:p,curve:v,colors:F,borderColor:G,dotSize:Q,dotColor:U,dotBorderWidth:Z,dotBorderColor:$}),Ce=be.xScale,Be=be.yScale,je=be.layers,Se=be.slices,ke=be.getBorderColor,We=be.getDotSize,Me=be.getDotColor,Te=be.getDotBorderWidth,Oe=be.getDotBorderColor,Ie=be.layerContext,De=o.bindDefs(R,je,V),we={grid:null,axes:null,layers:null,dots:null,slices:null,legends:null};return b.includes("grid")&&(we.grid=l.jsx(r.Grid,{width:ge,height:me,xScale:D?Ce:null,yScale:L?Be:null},"grid")),b.includes("axes")&&(we.axes=l.jsx(r.Axes,{xScale:Ce,yScale:Be,width:ge,height:me,top:S,right:k,bottom:M,left:O},"axes")),b.includes("layers")&&(we.layers=l.jsx(f,{layers:je,fillOpacity:z,borderWidth:E,getBorderColor:ke,isInteractive:oe,tooltip:te},"layers")),b.includes("dots")&&Y&&(we.dots=l.jsx(e.Fragment,{children:je.map((function(e){return l.jsx(h,{id:e.id,color:e.color,data:e.data,dotComponent:N,position:J,getSize:We,getColor:Me,getBorderWidth:Te,getBorderColor:Oe},e.id)}))},"dots")),b.includes("slices")&&oe&&ne&&(we.slices=l.jsx(g,{slices:Se,height:me,tooltip:ae},"slices")),b.includes("legends")&&(we.legends=l.jsx(e.Fragment,{children:se.map((function(e,o){var r=je.map((function(e){return{id:e.id,label:e.label,color:e.color,fill:e.fill}})).reverse();return l.jsx(t.BoxLegendSvg,c({},e,{containerWidth:ge,containerHeight:me,data:r}),o)}))},"legends")),l.jsx(o.SvgWrapper,{width:ye,height:xe,margin:ve,defs:De,role:ce,ariaLabel:ue,ariaLabelledBy:fe,ariaDescribedBy:pe,children:b.map((function(o,r){var t;return"function"==typeof o?l.jsx(e.Fragment,{children:e.createElement(o,Ie)},r):null!=(t=null==we?void 0:we[o])?t:null}))})},B=function(e){var r=e.isInteractive,t=void 0===r?y.isInteractive:r,i=e.animate,n=void 0===i?y.animate:i,a=e.motionConfig,d=void 0===a?y.motionConfig:a,s=e.theme,u=e.renderWrapper,f=function(e,o){if(null==e)return{};var r,t,i={},n=Object.keys(e);for(t=0;t<n.length;t++)r=n[t],o.indexOf(r)>=0||(i[r]=e[r]);return i}(e,b);return l.jsx(o.Container,{animate:n,isInteractive:t,motionConfig:d,renderWrapper:u,theme:s,children:l.jsx(C,c({isInteractive:t},f))})};exports.ResponsiveStream=function(e){return l.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,t=o.height;return l.jsx(B,c({width:r,height:t},e))}})},exports.Stream=B,exports.defaultProps=m,exports.svgDefaultProps=y;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),o=require("@nivo/core"),r=require("@nivo/axes"),t=require("@nivo/legends"),i=require("@react-spring/web"),n=require("@nivo/tooltip"),l=require("react/jsx-runtime"),a=require("d3-shape"),d=require("@nivo/colors"),s=require("@nivo/scales");function c(){return c=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},c.apply(this,arguments)}var u=function(r){var t=r.layer,a=r.fillOpacity,d=r.borderWidth,s=r.getBorderColor,c=r.isInteractive,u=r.tooltip,f=n.useTooltip(),p=f.showTooltipFromEvent,h=f.hideTooltip,v=e.useCallback((function(o){p(e.createElement(u,{layer:t}),o,"left")}),[p,t]),m=o.useMotionConfig(),g=m.animate,y=m.config,x=o.useAnimatedPath(t.path),b=i.useSpring({color:t.color,config:y,immediate:!g});return l.jsx(i.animated.path,{d:x,fill:t.fill?t.fill:b.color,fillOpacity:a,stroke:s(t),strokeWidth:d,onMouseMove:c?v:void 0,onMouseEnter:c?v:void 0,onMouseLeave:c?h:void 0})},f=function(e){var o=e.layers,r=e.fillOpacity,t=e.borderWidth,i=e.getBorderColor,n=e.isInteractive,a=e.tooltip;return l.jsx("g",{children:o.map((function(e,o){return l.jsx(u,{layer:e,getBorderColor:i,borderWidth:t,fillOpacity:r,isInteractive:n,tooltip:a},o)}))})},p=function(e,o){var r=e.y2;return"center"===o?r=e.y1+(e.y2-e.y1)/2:"start"===o&&(r=e.y1),r},h=function(o){var r=o.data,t=o.dotComponent,i=o.position,n=o.getSize,a=o.getColor,d=o.getBorderWidth,s=o.getBorderColor;return l.jsx(l.Fragment,{children:r.map((function(o,r){return e.createElement(t,{key:r,datum:o,x:o.x,y:p(o,i),size:n(o),color:a(o),borderWidth:d(o),borderColor:s(o)})}))})},v=function(o){var r=o.slice,t=o.height,i=o.tooltip,a=e.useState(!1),d=a[0],s=a[1],c=n.useTooltip(),u=c.showTooltipFromEvent,f=c.hideTooltip,p=e.useCallback((function(o){s(!0),u(e.createElement(i,{slice:r}),o,"left")}),[s,u,i,r]),h=e.useCallback((function(){s(!1),f()}),[s,f]);return l.jsxs("g",{transform:"translate("+r.x+", 0)",children:[d&&l.jsx("line",{x1:0,x2:0,y1:0,y2:t,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),l.jsx("rect",{x:-20,width:40,height:t,fill:"#000",fillOpacity:0,onMouseEnter:p,onMouseMove:p,onMouseLeave:h})]})},m=function(e){var o=e.slices,r=e.height,t=e.tooltip;return l.jsx("g",{children:o.map((function(e){return l.jsx(v,{slice:e,height:r,tooltip:t},e.index)}))})},g={label:"id",order:"none",offsetType:"wiggle",curve:"catmullRom",axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,colors:{scheme:"nivo"},fillOpacity:1,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableDots:!1,dotPosition:"center",dotComponent:function(e){var r=e.x,t=e.y,n=e.size,a=e.color,d=e.borderWidth,s=e.borderColor,c=o.useMotionConfig(),u=c.animate,f=c.config,p=i.useSpring({x:r,y:t,radius:.5*n,color:a,config:f,immediate:!u});return l.jsx(i.animated.circle,{cx:p.x,cy:p.y,r:p.radius,fill:p.color,strokeWidth:d,stroke:s})},dotSize:6,dotColor:{from:"color"},dotBorderWidth:0,dotBorderColor:{from:"color"},isInteractive:!0,tooltip:function(e){var o=e.layer;return l.jsx(n.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},enableStackTooltip:!0,stackTooltip:function(o){var r=o.slice,t=e.useMemo((function(){return r.stack.map((function(e){return[l.jsx(n.Chip,{color:e.color},e.layerId),e.layerLabel,e.formattedValue]}))}),[r]);return l.jsx(n.TableTooltip,{rows:t})},legends:[],legendLabel:"id",role:"application"},y=c({},g,{layers:["grid","axes","layers","dots","slices","legends"],defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),x=function(r){var t=r.width,i=r.height,n=r.data,l=r.keys,u=r.label,f=void 0===u?g.label:u,p=r.valueFormat,h=r.offsetType,v=void 0===h?g.offsetType:h,m=r.order,y=void 0===m?g.order:m,x=r.curve,b=void 0===x?g.curve:x,C=r.colors,B=void 0===C?g.colors:C,j=r.borderColor,S=void 0===j?g.borderColor:j,k=r.dotSize,W=void 0===k?g.dotSize:k,M=r.dotColor,T=void 0===M?g.dotColor:M,O=r.dotBorderWidth,I=void 0===O?g.dotBorderWidth:O,D=r.dotBorderColor,w=void 0===D?g.dotBorderColor:D,L=o.useCurveInterpolation(b),F=e.useMemo((function(){return a.area().x((function(e){return e.x})).y0((function(e){return e.y1})).y1((function(e){return e.y2})).curve(L)}),[L]),P=e.useMemo((function(){return a.stack().keys(l).offset(o.stackOffsetFromProp(v)).order(o.stackOrderFromProp(y))}),[l,v,y]),z=e.useMemo((function(){var e=[],o=[],r=P(n).map((function(r){return r.map((function(t){return e.push(t[0]),o.push(t[1]),c({},t,{value:t.data[r.key]})}))})),l=Math.min.apply(Math,e),a=Math.max.apply(Math,o);return[r,s.createPointScale({type:"point"},{all:Array.from({length:n.length},(function(e,o){return o})),min:0,max:n.length},t),s.createLinearScale({type:"linear"},{all:[l,a],min:l,max:a},i,"y")]}),[P,n,t,i]),q=z[0],E=z[1],G=z[2],A=o.useTheme(),R=d.useOrdinalColorScale(B,"id"),H=d.useInheritedColor(S,A),V=e.useMemo((function(){return"function"==typeof W?W:function(){return W}}),[W]),X=d.useInheritedColor(T,A),Y=e.useMemo((function(){return"function"==typeof I?I:function(){return I}}),[I]),_=d.useInheritedColor(w,A),J=o.usePropertyAccessor(f),K=o.useValueFormatter(p),N=e.useMemo((function(){return q.map((function(e,o){var r=e.map((function(e,r){return{layerId:l[o],layerLabel:"",index:r,color:"",x:E(r),value:e.value,formattedValue:K(e.value),y1:G(e[0]),y2:G(e[1])}})),t={id:l[o],path:F(r)},i=c({},t,{label:J(t),color:R(t)});return c({},i,{data:r.map((function(e){return e.layerLabel=i.label,e.color=i.color,e}))})}))}),[q,l,J,F,R,E,G,K]),Q=e.useMemo((function(){return Array.from({length:n.length},(function(e,o){var r=N.map((function(e){return e.data[o]})).sort((function(e,o){return e.y2-o.y2}));return{index:o,x:N[0].data[o].x,stack:r}}))}),[n.length,N]),U=e.useMemo((function(){return{xScale:E,yScale:G,layers:N,slices:Q}}),[E,G,N,Q]);return{xScale:E,yScale:G,layers:N,slices:Q,getBorderColor:H,getDotSize:V,getDotColor:X,getDotBorderWidth:Y,getDotBorderColor:_,layerContext:U}},b=["isInteractive","animate","motionConfig","theme","renderWrapper"],C=function(i){var n=i.data,a=i.keys,d=i.label,s=i.valueFormat,u=i.offsetType,p=i.order,v=i.curve,g=i.layers,b=void 0===g?y.layers:g,C=i.width,B=i.height,j=i.margin,S=i.axisTop,k=i.axisRight,W=i.axisBottom,M=void 0===W?y.axisBottom:W,T=i.axisLeft,O=void 0===T?y.axisLeft:T,I=i.enableGridX,D=void 0===I?y.enableGridX:I,w=i.enableGridY,L=void 0===w?y.enableGridY:w,F=i.colors,P=i.fillOpacity,z=void 0===P?y.fillOpacity:P,q=i.borderWidth,E=void 0===q?y.borderWidth:q,G=i.borderColor,A=i.defs,R=void 0===A?y.defs:A,H=i.fill,V=void 0===H?y.fill:H,X=i.enableDots,Y=void 0===X?y.enableDots:X,_=i.dotPosition,J=void 0===_?y.dotPosition:_,K=i.dotComponent,N=void 0===K?y.dotComponent:K,Q=i.dotSize,U=i.dotColor,Z=i.dotBorderWidth,$=i.dotBorderColor,ee=i.isInteractive,oe=void 0===ee?y.isInteractive:ee,re=i.tooltip,te=void 0===re?y.tooltip:re,ie=i.enableStackTooltip,ne=void 0===ie?y.enableStackTooltip:ie,le=i.stackTooltip,ae=void 0===le?y.stackTooltip:le,de=i.legends,se=void 0===de?y.legends:de,ce=i.role,ue=i.ariaLabel,fe=i.ariaLabelledBy,pe=i.ariaDescribedBy,he=o.useDimensions(C,B,j),ve=he.margin,me=he.innerWidth,ge=he.innerHeight,ye=he.outerWidth,xe=he.outerHeight,be=x({width:me,height:ge,data:n,keys:a,label:d,valueFormat:s,offsetType:u,order:p,curve:v,colors:F,borderColor:G,dotSize:Q,dotColor:U,dotBorderWidth:Z,dotBorderColor:$}),Ce=be.xScale,Be=be.yScale,je=be.layers,Se=be.slices,ke=be.getBorderColor,We=be.getDotSize,Me=be.getDotColor,Te=be.getDotBorderWidth,Oe=be.getDotBorderColor,Ie=be.layerContext,De=o.bindDefs(R,je,V),we={grid:null,axes:null,layers:null,dots:null,slices:null,legends:null};return b.includes("grid")&&(we.grid=l.jsx(r.Grid,{width:me,height:ge,xScale:D?Ce:null,yScale:L?Be:null},"grid")),b.includes("axes")&&(we.axes=l.jsx(r.Axes,{xScale:Ce,yScale:Be,width:me,height:ge,top:S,right:k,bottom:M,left:O},"axes")),b.includes("layers")&&(we.layers=l.jsx(f,{layers:je,fillOpacity:z,borderWidth:E,getBorderColor:ke,isInteractive:oe,tooltip:te},"layers")),b.includes("dots")&&Y&&(we.dots=l.jsx(e.Fragment,{children:je.map((function(e){return l.jsx(h,{id:e.id,color:e.color,data:e.data,dotComponent:N,position:J,getSize:We,getColor:Me,getBorderWidth:Te,getBorderColor:Oe},e.id)}))},"dots")),b.includes("slices")&&oe&&ne&&(we.slices=l.jsx(m,{slices:Se,height:ge,tooltip:ae},"slices")),b.includes("legends")&&(we.legends=l.jsx(e.Fragment,{children:se.map((function(e,o){var r=je.map((function(e){return{id:e.id,label:e.label,color:e.color,fill:e.fill}})).reverse();return l.jsx(t.BoxLegendSvg,c({},e,{containerWidth:me,containerHeight:ge,data:r}),o)}))},"legends")),l.jsx(o.SvgWrapper,{width:ye,height:xe,margin:ve,defs:De,role:ce,ariaLabel:ue,ariaLabelledBy:fe,ariaDescribedBy:pe,children:b.map((function(o,r){var t;return"function"==typeof o?l.jsx(e.Fragment,{children:e.createElement(o,Ie)},r):null!=(t=null==we?void 0:we[o])?t:null}))})},B=function(e){var r=e.isInteractive,t=void 0===r?y.isInteractive:r,i=e.animate,n=void 0===i?y.animate:i,a=e.motionConfig,d=void 0===a?y.motionConfig:a,s=e.theme,u=e.renderWrapper,f=function(e,o){if(null==e)return{};var r,t,i={},n=Object.keys(e);for(t=0;t<n.length;t++)r=n[t],o.indexOf(r)>=0||(i[r]=e[r]);return i}(e,b);return l.jsx(o.Container,{animate:n,isInteractive:t,motionConfig:d,renderWrapper:u,theme:s,children:l.jsx(C,c({isInteractive:t},f))})};exports.ResponsiveStream=function(e){return l.jsx(o.ResponsiveWrapper,{children:function(o){var r=o.width,t=o.height;return l.jsx(B,c({width:r,height:t},e))}})},exports.Stream=B,exports.defaultProps=g,exports.svgDefaultProps=y;
//# sourceMappingURL=nivo-stream.cjs.js.map

@@ -1,2 +0,2 @@

import{useCallback as o,createElement as e,useState as r,useMemo as t,Fragment as i}from"react";import{useMotionConfig as n,useAnimatedPath as l,useCurveInterpolation as a,stackOffsetFromProp as d,stackOrderFromProp as c,useTheme as s,usePropertyAccessor as u,useValueFormatter as f,Container as h,useDimensions as p,bindDefs as v,SvgWrapper as m,ResponsiveWrapper as g}from"@nivo/core";import{Grid as y,Axes as b}from"@nivo/axes";import{BoxLegendSvg as C}from"@nivo/legends";import{useSpring as x,animated as B}from"@react-spring/web";import{useTooltip as W,BasicTooltip as k,Chip as S,TableTooltip as T}from"@nivo/tooltip";import{jsx as w,Fragment as O,jsxs as I}from"react/jsx-runtime";import{area as D,stack as L}from"d3-shape";import{scalePoint as M,scaleLinear as z}from"d3-scale";import{useOrdinalColorScale as F,useInheritedColor as G}from"@nivo/colors";function j(){return j=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(o[t]=r[t])}return o},j.apply(this,arguments)}var E=function(r){var t=r.layer,i=r.fillOpacity,a=r.borderWidth,d=r.getBorderColor,c=r.isInteractive,s=r.tooltip,u=W(),f=u.showTooltipFromEvent,h=u.hideTooltip,p=o((function(o){f(e(s,{layer:t}),o,"left")}),[f,t]),v=n(),m=v.animate,g=v.config,y=l(t.path),b=x({color:t.color,config:g,immediate:!m});return w(B.path,{d:y,fill:t.fill?t.fill:b.color,fillOpacity:i,stroke:d(t),strokeWidth:a,onMouseMove:c?p:void 0,onMouseEnter:c?p:void 0,onMouseLeave:c?h:void 0})},P=function(o){var e=o.layers,r=o.fillOpacity,t=o.borderWidth,i=o.getBorderColor,n=o.isInteractive,l=o.tooltip;return w("g",{children:e.map((function(o,e){return w(E,{layer:o,getBorderColor:i,borderWidth:t,fillOpacity:r,isInteractive:n,tooltip:l},e)}))})},H=function(o,e){var r=o.y2;return"center"===e?r=o.y1+(o.y2-o.y1)/2:"start"===e&&(r=o.y1),r},X=function(o){var r=o.data,t=o.dotComponent,i=o.position,n=o.getSize,l=o.getColor,a=o.getBorderWidth,d=o.getBorderColor;return w(O,{children:r.map((function(o,r){return e(t,{key:r,datum:o,x:o.x,y:H(o,i),size:n(o),color:l(o),borderWidth:a(o),borderColor:d(o)})}))})},Y=function(t){var i=t.slice,n=t.height,l=t.tooltip,a=r(!1),d=a[0],c=a[1],s=W(),u=s.showTooltipFromEvent,f=s.hideTooltip,h=o((function(o){c(!0),u(e(l,{slice:i}),o,"left")}),[c,u,l,i]),p=o((function(){c(!1),f()}),[c,f]);return I("g",{transform:"translate("+i.x+", 0)",children:[d&&w("line",{x1:0,x2:0,y1:0,y2:n,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),w("rect",{x:-20,width:40,height:n,fill:"#000",fillOpacity:0,onMouseEnter:h,onMouseMove:h,onMouseLeave:p})]})},A=function(o){var e=o.slices,r=o.height,t=o.tooltip;return w("g",{children:e.map((function(o){return w(Y,{slice:o,height:r,tooltip:t},o.index)}))})},R={label:"id",order:"none",offsetType:"wiggle",curve:"catmullRom",axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,colors:{scheme:"nivo"},fillOpacity:1,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableDots:!1,dotPosition:"center",dotComponent:function(o){var e=o.x,r=o.y,t=o.size,i=o.color,l=o.borderWidth,a=o.borderColor,d=n(),c=d.animate,s=d.config,u=x({x:e,y:r,radius:.5*t,color:i,config:s,immediate:!c});return w(B.circle,{cx:u.x,cy:u.y,r:u.radius,fill:u.color,strokeWidth:l,stroke:a})},dotSize:6,dotColor:{from:"color"},dotBorderWidth:0,dotBorderColor:{from:"color"},isInteractive:!0,tooltip:function(o){var e=o.layer;return w(k,{id:e.label,enableChip:!0,color:e.color})},enableStackTooltip:!0,stackTooltip:function(o){var e=o.slice,r=t((function(){return e.stack.map((function(o){return[w(S,{color:o.color},o.layerId),o.layerLabel,o.formattedValue]}))}),[e]);return w(T,{rows:r})},legends:[],legendLabel:"id",role:"application"},V=j({},R,{layers:["grid","axes","layers","dots","slices","legends"],defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),q=["isInteractive","animate","motionConfig","theme","renderWrapper"],J=function(o){var r=o.data,n=o.keys,l=o.label,h=o.valueFormat,g=o.offsetType,x=o.order,B=o.curve,W=o.layers,k=void 0===W?V.layers:W,S=o.width,T=o.height,O=o.margin,I=o.axisTop,E=o.axisRight,H=o.axisBottom,Y=void 0===H?V.axisBottom:H,q=o.axisLeft,J=void 0===q?V.axisLeft:q,K=o.enableGridX,N=void 0===K?V.enableGridX:K,Q=o.enableGridY,U=void 0===Q?V.enableGridY:Q,Z=o.colors,$=o.fillOpacity,_=void 0===$?V.fillOpacity:$,oo=o.borderWidth,eo=void 0===oo?V.borderWidth:oo,ro=o.borderColor,to=o.defs,io=void 0===to?V.defs:to,no=o.fill,lo=void 0===no?V.fill:no,ao=o.enableDots,co=void 0===ao?V.enableDots:ao,so=o.dotPosition,uo=void 0===so?V.dotPosition:so,fo=o.dotComponent,ho=void 0===fo?V.dotComponent:fo,po=o.dotSize,vo=o.dotColor,mo=o.dotBorderWidth,go=o.dotBorderColor,yo=o.isInteractive,bo=void 0===yo?V.isInteractive:yo,Co=o.tooltip,xo=void 0===Co?V.tooltip:Co,Bo=o.enableStackTooltip,Wo=void 0===Bo?V.enableStackTooltip:Bo,ko=o.stackTooltip,So=void 0===ko?V.stackTooltip:ko,To=o.legends,wo=void 0===To?V.legends:To,Oo=o.role,Io=o.ariaLabel,Do=o.ariaLabelledBy,Lo=o.ariaDescribedBy,Mo=p(S,T,O),zo=Mo.margin,Fo=Mo.innerWidth,Go=Mo.innerHeight,jo=Mo.outerWidth,Eo=Mo.outerHeight,Po=function(o){var e=o.width,r=o.height,i=o.data,n=o.keys,l=o.label,h=void 0===l?R.label:l,p=o.valueFormat,v=o.offsetType,m=void 0===v?R.offsetType:v,g=o.order,y=void 0===g?R.order:g,b=o.curve,C=void 0===b?R.curve:b,x=o.colors,B=void 0===x?R.colors:x,W=o.borderColor,k=void 0===W?R.borderColor:W,S=o.dotSize,T=void 0===S?R.dotSize:S,w=o.dotColor,O=void 0===w?R.dotColor:w,I=o.dotBorderWidth,E=void 0===I?R.dotBorderWidth:I,P=o.dotBorderColor,H=void 0===P?R.dotBorderColor:P,X=a(C),Y=t((function(){return D().x((function(o){return o.x})).y0((function(o){return o.y1})).y1((function(o){return o.y2})).curve(X)}),[X]),A=t((function(){return L().keys(n).offset(d(m)).order(c(y))}),[n,m,y]),V=t((function(){var o=[],t=[],n=A(i).map((function(e){return e.map((function(r){return o.push(r[0]),t.push(r[1]),j({},r,{value:r.data[e.key]})}))})),l=Math.min.apply(Math,o),a=Math.max.apply(Math,t);return[n,M().domain(Array.from({length:i.length},(function(o,e){return e}))).range([0,e]),z().domain([l,a]).range([r,0])]}),[A,i,e,r]),q=V[0],J=V[1],K=V[2],N=s(),Q=F(B,"id"),U=G(k,N),Z=t((function(){return"function"==typeof T?T:function(){return T}}),[T]),$=G(O,N),_=t((function(){return"function"==typeof E?E:function(){return E}}),[E]),oo=G(H,N),eo=u(h),ro=f(p),to=t((function(){return q.map((function(o,e){var r=o.map((function(o,r){return{layerId:n[e],layerLabel:"",index:r,color:"",x:J(r),value:o.value,formattedValue:ro(o.value),y1:K(o[0]),y2:K(o[1])}})),t={id:n[e],path:Y(r)},i=j({},t,{label:eo(t),color:Q(t)});return j({},i,{data:r.map((function(o){return o.layerLabel=i.label,o.color=i.color,o}))})}))}),[q,n,eo,Y,Q,J,K,ro]),io=t((function(){return Array.from({length:i.length},(function(o,e){var r=to.map((function(o){return o.data[e]})).sort((function(o,e){return o.y2-e.y2}));return{index:e,x:to[0].data[e].x,stack:r}}))}),[i.length,to]),no=t((function(){return{xScale:J,yScale:K,layers:to,slices:io}}),[J,K,to,io]);return{xScale:J,yScale:K,layers:to,slices:io,getBorderColor:U,getDotSize:Z,getDotColor:$,getDotBorderWidth:_,getDotBorderColor:oo,layerContext:no}}({width:Fo,height:Go,data:r,keys:n,label:l,valueFormat:h,offsetType:g,order:x,curve:B,colors:Z,borderColor:ro,dotSize:po,dotColor:vo,dotBorderWidth:mo,dotBorderColor:go}),Ho=Po.xScale,Xo=Po.yScale,Yo=Po.layers,Ao=Po.slices,Ro=Po.getBorderColor,Vo=Po.getDotSize,qo=Po.getDotColor,Jo=Po.getDotBorderWidth,Ko=Po.getDotBorderColor,No=Po.layerContext,Qo=v(io,Yo,lo),Uo={grid:null,axes:null,layers:null,dots:null,slices:null,legends:null};return k.includes("grid")&&(Uo.grid=w(y,{width:Fo,height:Go,xScale:N?Ho:null,yScale:U?Xo:null},"grid")),k.includes("axes")&&(Uo.axes=w(b,{xScale:Ho,yScale:Xo,width:Fo,height:Go,top:I,right:E,bottom:Y,left:J},"axes")),k.includes("layers")&&(Uo.layers=w(P,{layers:Yo,fillOpacity:_,borderWidth:eo,getBorderColor:Ro,isInteractive:bo,tooltip:xo},"layers")),k.includes("dots")&&co&&(Uo.dots=w(i,{children:Yo.map((function(o){return w(X,{id:o.id,color:o.color,data:o.data,dotComponent:ho,position:uo,getSize:Vo,getColor:qo,getBorderWidth:Jo,getBorderColor:Ko},o.id)}))},"dots")),k.includes("slices")&&bo&&Wo&&(Uo.slices=w(A,{slices:Ao,height:Go,tooltip:So},"slices")),k.includes("legends")&&(Uo.legends=w(i,{children:wo.map((function(o,e){var r=Yo.map((function(o){return{id:o.id,label:o.label,color:o.color,fill:o.fill}})).reverse();return w(C,j({},o,{containerWidth:Fo,containerHeight:Go,data:r}),e)}))},"legends")),w(m,{width:jo,height:Eo,margin:zo,defs:Qo,role:Oo,ariaLabel:Io,ariaLabelledBy:Do,ariaDescribedBy:Lo,children:k.map((function(o,r){var t;return"function"==typeof o?w(i,{children:e(o,No)},r):null!=(t=null==Uo?void 0:Uo[o])?t:null}))})},K=function(o){var e=o.isInteractive,r=void 0===e?V.isInteractive:e,t=o.animate,i=void 0===t?V.animate:t,n=o.motionConfig,l=void 0===n?V.motionConfig:n,a=o.theme,d=o.renderWrapper,c=function(o,e){if(null==o)return{};var r,t,i={},n=Object.keys(o);for(t=0;t<n.length;t++)r=n[t],e.indexOf(r)>=0||(i[r]=o[r]);return i}(o,q);return w(h,{animate:i,isInteractive:r,motionConfig:l,renderWrapper:d,theme:a,children:w(J,j({isInteractive:r},c))})},N=function(o){return w(g,{children:function(e){var r=e.width,t=e.height;return w(K,j({width:r,height:t},o))}})};export{N as ResponsiveStream,K as Stream,R as defaultProps,V as svgDefaultProps};
import{useCallback as o,createElement as e,useState as r,useMemo as t,Fragment as i}from"react";import{useMotionConfig as n,useAnimatedPath as l,useCurveInterpolation as a,stackOffsetFromProp as d,stackOrderFromProp as c,useTheme as s,usePropertyAccessor as u,useValueFormatter as f,Container as h,useDimensions as p,bindDefs as v,SvgWrapper as m,ResponsiveWrapper as y}from"@nivo/core";import{Grid as g,Axes as b}from"@nivo/axes";import{BoxLegendSvg as x}from"@nivo/legends";import{useSpring as C,animated as B}from"@react-spring/web";import{useTooltip as W,BasicTooltip as k,Chip as S,TableTooltip as T}from"@nivo/tooltip";import{jsx as w,Fragment as O,jsxs as I}from"react/jsx-runtime";import{area as D,stack as L}from"d3-shape";import{useOrdinalColorScale as M,useInheritedColor as z}from"@nivo/colors";import{createPointScale as F,createLinearScale as G}from"@nivo/scales";function j(){return j=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(o[t]=r[t])}return o},j.apply(this,arguments)}var E=function(r){var t=r.layer,i=r.fillOpacity,a=r.borderWidth,d=r.getBorderColor,c=r.isInteractive,s=r.tooltip,u=W(),f=u.showTooltipFromEvent,h=u.hideTooltip,p=o((function(o){f(e(s,{layer:t}),o,"left")}),[f,t]),v=n(),m=v.animate,y=v.config,g=l(t.path),b=C({color:t.color,config:y,immediate:!m});return w(B.path,{d:g,fill:t.fill?t.fill:b.color,fillOpacity:i,stroke:d(t),strokeWidth:a,onMouseMove:c?p:void 0,onMouseEnter:c?p:void 0,onMouseLeave:c?h:void 0})},P=function(o){var e=o.layers,r=o.fillOpacity,t=o.borderWidth,i=o.getBorderColor,n=o.isInteractive,l=o.tooltip;return w("g",{children:e.map((function(o,e){return w(E,{layer:o,getBorderColor:i,borderWidth:t,fillOpacity:r,isInteractive:n,tooltip:l},e)}))})},H=function(o,e){var r=o.y2;return"center"===e?r=o.y1+(o.y2-o.y1)/2:"start"===e&&(r=o.y1),r},X=function(o){var r=o.data,t=o.dotComponent,i=o.position,n=o.getSize,l=o.getColor,a=o.getBorderWidth,d=o.getBorderColor;return w(O,{children:r.map((function(o,r){return e(t,{key:r,datum:o,x:o.x,y:H(o,i),size:n(o),color:l(o),borderWidth:a(o),borderColor:d(o)})}))})},Y=function(t){var i=t.slice,n=t.height,l=t.tooltip,a=r(!1),d=a[0],c=a[1],s=W(),u=s.showTooltipFromEvent,f=s.hideTooltip,h=o((function(o){c(!0),u(e(l,{slice:i}),o,"left")}),[c,u,l,i]),p=o((function(){c(!1),f()}),[c,f]);return I("g",{transform:"translate("+i.x+", 0)",children:[d&&w("line",{x1:0,x2:0,y1:0,y2:n,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),w("rect",{x:-20,width:40,height:n,fill:"#000",fillOpacity:0,onMouseEnter:h,onMouseMove:h,onMouseLeave:p})]})},A=function(o){var e=o.slices,r=o.height,t=o.tooltip;return w("g",{children:e.map((function(o){return w(Y,{slice:o,height:r,tooltip:t},o.index)}))})},R={label:"id",order:"none",offsetType:"wiggle",curve:"catmullRom",axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,colors:{scheme:"nivo"},fillOpacity:1,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableDots:!1,dotPosition:"center",dotComponent:function(o){var e=o.x,r=o.y,t=o.size,i=o.color,l=o.borderWidth,a=o.borderColor,d=n(),c=d.animate,s=d.config,u=C({x:e,y:r,radius:.5*t,color:i,config:s,immediate:!c});return w(B.circle,{cx:u.x,cy:u.y,r:u.radius,fill:u.color,strokeWidth:l,stroke:a})},dotSize:6,dotColor:{from:"color"},dotBorderWidth:0,dotBorderColor:{from:"color"},isInteractive:!0,tooltip:function(o){var e=o.layer;return w(k,{id:e.label,enableChip:!0,color:e.color})},enableStackTooltip:!0,stackTooltip:function(o){var e=o.slice,r=t((function(){return e.stack.map((function(o){return[w(S,{color:o.color},o.layerId),o.layerLabel,o.formattedValue]}))}),[e]);return w(T,{rows:r})},legends:[],legendLabel:"id",role:"application"},V=j({},R,{layers:["grid","axes","layers","dots","slices","legends"],defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),q=["isInteractive","animate","motionConfig","theme","renderWrapper"],J=function(o){var r=o.data,n=o.keys,l=o.label,h=o.valueFormat,y=o.offsetType,C=o.order,B=o.curve,W=o.layers,k=void 0===W?V.layers:W,S=o.width,T=o.height,O=o.margin,I=o.axisTop,E=o.axisRight,H=o.axisBottom,Y=void 0===H?V.axisBottom:H,q=o.axisLeft,J=void 0===q?V.axisLeft:q,K=o.enableGridX,N=void 0===K?V.enableGridX:K,Q=o.enableGridY,U=void 0===Q?V.enableGridY:Q,Z=o.colors,$=o.fillOpacity,_=void 0===$?V.fillOpacity:$,oo=o.borderWidth,eo=void 0===oo?V.borderWidth:oo,ro=o.borderColor,to=o.defs,io=void 0===to?V.defs:to,no=o.fill,lo=void 0===no?V.fill:no,ao=o.enableDots,co=void 0===ao?V.enableDots:ao,so=o.dotPosition,uo=void 0===so?V.dotPosition:so,fo=o.dotComponent,ho=void 0===fo?V.dotComponent:fo,po=o.dotSize,vo=o.dotColor,mo=o.dotBorderWidth,yo=o.dotBorderColor,go=o.isInteractive,bo=void 0===go?V.isInteractive:go,xo=o.tooltip,Co=void 0===xo?V.tooltip:xo,Bo=o.enableStackTooltip,Wo=void 0===Bo?V.enableStackTooltip:Bo,ko=o.stackTooltip,So=void 0===ko?V.stackTooltip:ko,To=o.legends,wo=void 0===To?V.legends:To,Oo=o.role,Io=o.ariaLabel,Do=o.ariaLabelledBy,Lo=o.ariaDescribedBy,Mo=p(S,T,O),zo=Mo.margin,Fo=Mo.innerWidth,Go=Mo.innerHeight,jo=Mo.outerWidth,Eo=Mo.outerHeight,Po=function(o){var e=o.width,r=o.height,i=o.data,n=o.keys,l=o.label,h=void 0===l?R.label:l,p=o.valueFormat,v=o.offsetType,m=void 0===v?R.offsetType:v,y=o.order,g=void 0===y?R.order:y,b=o.curve,x=void 0===b?R.curve:b,C=o.colors,B=void 0===C?R.colors:C,W=o.borderColor,k=void 0===W?R.borderColor:W,S=o.dotSize,T=void 0===S?R.dotSize:S,w=o.dotColor,O=void 0===w?R.dotColor:w,I=o.dotBorderWidth,E=void 0===I?R.dotBorderWidth:I,P=o.dotBorderColor,H=void 0===P?R.dotBorderColor:P,X=a(x),Y=t((function(){return D().x((function(o){return o.x})).y0((function(o){return o.y1})).y1((function(o){return o.y2})).curve(X)}),[X]),A=t((function(){return L().keys(n).offset(d(m)).order(c(g))}),[n,m,g]),V=t((function(){var o=[],t=[],n=A(i).map((function(e){return e.map((function(r){return o.push(r[0]),t.push(r[1]),j({},r,{value:r.data[e.key]})}))})),l=Math.min.apply(Math,o),a=Math.max.apply(Math,t);return[n,F({type:"point"},{all:Array.from({length:i.length},(function(o,e){return e})),min:0,max:i.length},e),G({type:"linear"},{all:[l,a],min:l,max:a},r,"y")]}),[A,i,e,r]),q=V[0],J=V[1],K=V[2],N=s(),Q=M(B,"id"),U=z(k,N),Z=t((function(){return"function"==typeof T?T:function(){return T}}),[T]),$=z(O,N),_=t((function(){return"function"==typeof E?E:function(){return E}}),[E]),oo=z(H,N),eo=u(h),ro=f(p),to=t((function(){return q.map((function(o,e){var r=o.map((function(o,r){return{layerId:n[e],layerLabel:"",index:r,color:"",x:J(r),value:o.value,formattedValue:ro(o.value),y1:K(o[0]),y2:K(o[1])}})),t={id:n[e],path:Y(r)},i=j({},t,{label:eo(t),color:Q(t)});return j({},i,{data:r.map((function(o){return o.layerLabel=i.label,o.color=i.color,o}))})}))}),[q,n,eo,Y,Q,J,K,ro]),io=t((function(){return Array.from({length:i.length},(function(o,e){var r=to.map((function(o){return o.data[e]})).sort((function(o,e){return o.y2-e.y2}));return{index:e,x:to[0].data[e].x,stack:r}}))}),[i.length,to]),no=t((function(){return{xScale:J,yScale:K,layers:to,slices:io}}),[J,K,to,io]);return{xScale:J,yScale:K,layers:to,slices:io,getBorderColor:U,getDotSize:Z,getDotColor:$,getDotBorderWidth:_,getDotBorderColor:oo,layerContext:no}}({width:Fo,height:Go,data:r,keys:n,label:l,valueFormat:h,offsetType:y,order:C,curve:B,colors:Z,borderColor:ro,dotSize:po,dotColor:vo,dotBorderWidth:mo,dotBorderColor:yo}),Ho=Po.xScale,Xo=Po.yScale,Yo=Po.layers,Ao=Po.slices,Ro=Po.getBorderColor,Vo=Po.getDotSize,qo=Po.getDotColor,Jo=Po.getDotBorderWidth,Ko=Po.getDotBorderColor,No=Po.layerContext,Qo=v(io,Yo,lo),Uo={grid:null,axes:null,layers:null,dots:null,slices:null,legends:null};return k.includes("grid")&&(Uo.grid=w(g,{width:Fo,height:Go,xScale:N?Ho:null,yScale:U?Xo:null},"grid")),k.includes("axes")&&(Uo.axes=w(b,{xScale:Ho,yScale:Xo,width:Fo,height:Go,top:I,right:E,bottom:Y,left:J},"axes")),k.includes("layers")&&(Uo.layers=w(P,{layers:Yo,fillOpacity:_,borderWidth:eo,getBorderColor:Ro,isInteractive:bo,tooltip:Co},"layers")),k.includes("dots")&&co&&(Uo.dots=w(i,{children:Yo.map((function(o){return w(X,{id:o.id,color:o.color,data:o.data,dotComponent:ho,position:uo,getSize:Vo,getColor:qo,getBorderWidth:Jo,getBorderColor:Ko},o.id)}))},"dots")),k.includes("slices")&&bo&&Wo&&(Uo.slices=w(A,{slices:Ao,height:Go,tooltip:So},"slices")),k.includes("legends")&&(Uo.legends=w(i,{children:wo.map((function(o,e){var r=Yo.map((function(o){return{id:o.id,label:o.label,color:o.color,fill:o.fill}})).reverse();return w(x,j({},o,{containerWidth:Fo,containerHeight:Go,data:r}),e)}))},"legends")),w(m,{width:jo,height:Eo,margin:zo,defs:Qo,role:Oo,ariaLabel:Io,ariaLabelledBy:Do,ariaDescribedBy:Lo,children:k.map((function(o,r){var t;return"function"==typeof o?w(i,{children:e(o,No)},r):null!=(t=null==Uo?void 0:Uo[o])?t:null}))})},K=function(o){var e=o.isInteractive,r=void 0===e?V.isInteractive:e,t=o.animate,i=void 0===t?V.animate:t,n=o.motionConfig,l=void 0===n?V.motionConfig:n,a=o.theme,d=o.renderWrapper,c=function(o,e){if(null==o)return{};var r,t,i={},n=Object.keys(o);for(t=0;t<n.length;t++)r=n[t],e.indexOf(r)>=0||(i[r]=o[r]);return i}(o,q);return w(h,{animate:i,isInteractive:r,motionConfig:l,renderWrapper:d,theme:a,children:w(J,j({isInteractive:r},c))})},N=function(o){return w(y,{children:function(e){var r=e.width,t=e.height;return w(K,j({width:r,height:t},o))}})};export{N as ResponsiveStream,K as Stream,R as defaultProps,V as svgDefaultProps};
//# sourceMappingURL=nivo-stream.es.js.map

@@ -1,2 +0,2 @@

!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("react"),require("@nivo/core"),require("@nivo/axes"),require("@nivo/legends"),require("@react-spring/web"),require("@nivo/tooltip"),require("react/jsx-runtime"),require("d3-shape"),require("d3-scale"),require("@nivo/colors")):"function"==typeof define&&define.amd?define(["exports","react","@nivo/core","@nivo/axes","@nivo/legends","@react-spring/web","@nivo/tooltip","react/jsx-runtime","d3-shape","d3-scale","@nivo/colors"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).nivo=e.nivo||{},e.React,e.nivo,e.nivo,e.nivo,e["@react-spring/web"],e.nivo,e["react/jsx-runtime"],e.d3,e.d3,e.nivo)}(this,(function(e,o,r,t,i,n,l,a,d,s,c){"use strict";function u(){return u=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},u.apply(this,arguments)}var f=function(e){var t=e.layer,i=e.fillOpacity,d=e.borderWidth,s=e.getBorderColor,c=e.isInteractive,u=e.tooltip,f=l.useTooltip(),p=f.showTooltipFromEvent,v=f.hideTooltip,h=o.useCallback((function(e){p(o.createElement(u,{layer:t}),e,"left")}),[p,t]),g=r.useMotionConfig(),m=g.animate,y=g.config,x=r.useAnimatedPath(t.path),b=n.useSpring({color:t.color,config:y,immediate:!m});return a.jsx(n.animated.path,{d:x,fill:t.fill?t.fill:b.color,fillOpacity:i,stroke:s(t),strokeWidth:d,onMouseMove:c?h:void 0,onMouseEnter:c?h:void 0,onMouseLeave:c?v:void 0})},p=function(e){var o=e.layers,r=e.fillOpacity,t=e.borderWidth,i=e.getBorderColor,n=e.isInteractive,l=e.tooltip;return a.jsx("g",{children:o.map((function(e,o){return a.jsx(f,{layer:e,getBorderColor:i,borderWidth:t,fillOpacity:r,isInteractive:n,tooltip:l},o)}))})},v=function(e,o){var r=e.y2;return"center"===o?r=e.y1+(e.y2-e.y1)/2:"start"===o&&(r=e.y1),r},h=function(e){var r=e.data,t=e.dotComponent,i=e.position,n=e.getSize,l=e.getColor,d=e.getBorderWidth,s=e.getBorderColor;return a.jsx(a.Fragment,{children:r.map((function(e,r){return o.createElement(t,{key:r,datum:e,x:e.x,y:v(e,i),size:n(e),color:l(e),borderWidth:d(e),borderColor:s(e)})}))})},g=function(e){var r=e.slice,t=e.height,i=e.tooltip,n=o.useState(!1),d=n[0],s=n[1],c=l.useTooltip(),u=c.showTooltipFromEvent,f=c.hideTooltip,p=o.useCallback((function(e){s(!0),u(o.createElement(i,{slice:r}),e,"left")}),[s,u,i,r]),v=o.useCallback((function(){s(!1),f()}),[s,f]);return a.jsxs("g",{transform:"translate("+r.x+", 0)",children:[d&&a.jsx("line",{x1:0,x2:0,y1:0,y2:t,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),a.jsx("rect",{x:-20,width:40,height:t,fill:"#000",fillOpacity:0,onMouseEnter:p,onMouseMove:p,onMouseLeave:v})]})},m=function(e){var o=e.slices,r=e.height,t=e.tooltip;return a.jsx("g",{children:o.map((function(e){return a.jsx(g,{slice:e,height:r,tooltip:t},e.index)}))})},y={label:"id",order:"none",offsetType:"wiggle",curve:"catmullRom",axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,colors:{scheme:"nivo"},fillOpacity:1,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableDots:!1,dotPosition:"center",dotComponent:function(e){var o=e.x,t=e.y,i=e.size,l=e.color,d=e.borderWidth,s=e.borderColor,c=r.useMotionConfig(),u=c.animate,f=c.config,p=n.useSpring({x:o,y:t,radius:.5*i,color:l,config:f,immediate:!u});return a.jsx(n.animated.circle,{cx:p.x,cy:p.y,r:p.radius,fill:p.color,strokeWidth:d,stroke:s})},dotSize:6,dotColor:{from:"color"},dotBorderWidth:0,dotBorderColor:{from:"color"},isInteractive:!0,tooltip:function(e){var o=e.layer;return a.jsx(l.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},enableStackTooltip:!0,stackTooltip:function(e){var r=e.slice,t=o.useMemo((function(){return r.stack.map((function(e){return[a.jsx(l.Chip,{color:e.color},e.layerId),e.layerLabel,e.formattedValue]}))}),[r]);return a.jsx(l.TableTooltip,{rows:t})},legends:[],legendLabel:"id",role:"application"},x=u({},y,{layers:["grid","axes","layers","dots","slices","legends"],defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),b=function(e){var t=e.width,i=e.height,n=e.data,l=e.keys,a=e.label,f=void 0===a?y.label:a,p=e.valueFormat,v=e.offsetType,h=void 0===v?y.offsetType:v,g=e.order,m=void 0===g?y.order:g,x=e.curve,b=void 0===x?y.curve:x,C=e.colors,j=void 0===C?y.colors:C,B=e.borderColor,S=void 0===B?y.borderColor:B,k=e.dotSize,W=void 0===k?y.dotSize:k,M=e.dotColor,T=void 0===M?y.dotColor:M,O=e.dotBorderWidth,I=void 0===O?y.dotBorderWidth:O,w=e.dotBorderColor,D=void 0===w?y.dotBorderColor:w,L=r.useCurveInterpolation(b),F=o.useMemo((function(){return d.area().x((function(e){return e.x})).y0((function(e){return e.y1})).y1((function(e){return e.y2})).curve(L)}),[L]),P=o.useMemo((function(){return d.stack().keys(l).offset(r.stackOffsetFromProp(h)).order(r.stackOrderFromProp(m))}),[l,h,m]),z=o.useMemo((function(){var e=[],o=[],r=P(n).map((function(r){return r.map((function(t){return e.push(t[0]),o.push(t[1]),u({},t,{value:t.data[r.key]})}))})),l=Math.min.apply(Math,e),a=Math.max.apply(Math,o);return[r,s.scalePoint().domain(Array.from({length:n.length},(function(e,o){return o}))).range([0,t]),s.scaleLinear().domain([l,a]).range([i,0])]}),[P,n,t,i]),q=z[0],E=z[1],G=z[2],A=r.useTheme(),R=c.useOrdinalColorScale(j,"id"),H=c.useInheritedColor(S,A),V=o.useMemo((function(){return"function"==typeof W?W:function(){return W}}),[W]),X=c.useInheritedColor(T,A),Y=o.useMemo((function(){return"function"==typeof I?I:function(){return I}}),[I]),_=c.useInheritedColor(D,A),J=r.usePropertyAccessor(f),K=r.useValueFormatter(p),N=o.useMemo((function(){return q.map((function(e,o){var r=e.map((function(e,r){return{layerId:l[o],layerLabel:"",index:r,color:"",x:E(r),value:e.value,formattedValue:K(e.value),y1:G(e[0]),y2:G(e[1])}})),t={id:l[o],path:F(r)},i=u({},t,{label:J(t),color:R(t)});return u({},i,{data:r.map((function(e){return e.layerLabel=i.label,e.color=i.color,e}))})}))}),[q,l,J,F,R,E,G,K]),Q=o.useMemo((function(){return Array.from({length:n.length},(function(e,o){var r=N.map((function(e){return e.data[o]})).sort((function(e,o){return e.y2-o.y2}));return{index:o,x:N[0].data[o].x,stack:r}}))}),[n.length,N]),U=o.useMemo((function(){return{xScale:E,yScale:G,layers:N,slices:Q}}),[E,G,N,Q]);return{xScale:E,yScale:G,layers:N,slices:Q,getBorderColor:H,getDotSize:V,getDotColor:X,getDotBorderWidth:Y,getDotBorderColor:_,layerContext:U}},C=["isInteractive","animate","motionConfig","theme","renderWrapper"],j=function(e){var n=e.data,l=e.keys,d=e.label,s=e.valueFormat,c=e.offsetType,f=e.order,v=e.curve,g=e.layers,y=void 0===g?x.layers:g,C=e.width,j=e.height,B=e.margin,S=e.axisTop,k=e.axisRight,W=e.axisBottom,M=void 0===W?x.axisBottom:W,T=e.axisLeft,O=void 0===T?x.axisLeft:T,I=e.enableGridX,w=void 0===I?x.enableGridX:I,D=e.enableGridY,L=void 0===D?x.enableGridY:D,F=e.colors,P=e.fillOpacity,z=void 0===P?x.fillOpacity:P,q=e.borderWidth,E=void 0===q?x.borderWidth:q,G=e.borderColor,A=e.defs,R=void 0===A?x.defs:A,H=e.fill,V=void 0===H?x.fill:H,X=e.enableDots,Y=void 0===X?x.enableDots:X,_=e.dotPosition,J=void 0===_?x.dotPosition:_,K=e.dotComponent,N=void 0===K?x.dotComponent:K,Q=e.dotSize,U=e.dotColor,Z=e.dotBorderWidth,$=e.dotBorderColor,ee=e.isInteractive,oe=void 0===ee?x.isInteractive:ee,re=e.tooltip,te=void 0===re?x.tooltip:re,ie=e.enableStackTooltip,ne=void 0===ie?x.enableStackTooltip:ie,le=e.stackTooltip,ae=void 0===le?x.stackTooltip:le,de=e.legends,se=void 0===de?x.legends:de,ce=e.role,ue=e.ariaLabel,fe=e.ariaLabelledBy,pe=e.ariaDescribedBy,ve=r.useDimensions(C,j,B),he=ve.margin,ge=ve.innerWidth,me=ve.innerHeight,ye=ve.outerWidth,xe=ve.outerHeight,be=b({width:ge,height:me,data:n,keys:l,label:d,valueFormat:s,offsetType:c,order:f,curve:v,colors:F,borderColor:G,dotSize:Q,dotColor:U,dotBorderWidth:Z,dotBorderColor:$}),Ce=be.xScale,je=be.yScale,Be=be.layers,Se=be.slices,ke=be.getBorderColor,We=be.getDotSize,Me=be.getDotColor,Te=be.getDotBorderWidth,Oe=be.getDotBorderColor,Ie=be.layerContext,we=r.bindDefs(R,Be,V),De={grid:null,axes:null,layers:null,dots:null,slices:null,legends:null};return y.includes("grid")&&(De.grid=a.jsx(t.Grid,{width:ge,height:me,xScale:w?Ce:null,yScale:L?je:null},"grid")),y.includes("axes")&&(De.axes=a.jsx(t.Axes,{xScale:Ce,yScale:je,width:ge,height:me,top:S,right:k,bottom:M,left:O},"axes")),y.includes("layers")&&(De.layers=a.jsx(p,{layers:Be,fillOpacity:z,borderWidth:E,getBorderColor:ke,isInteractive:oe,tooltip:te},"layers")),y.includes("dots")&&Y&&(De.dots=a.jsx(o.Fragment,{children:Be.map((function(e){return a.jsx(h,{id:e.id,color:e.color,data:e.data,dotComponent:N,position:J,getSize:We,getColor:Me,getBorderWidth:Te,getBorderColor:Oe},e.id)}))},"dots")),y.includes("slices")&&oe&&ne&&(De.slices=a.jsx(m,{slices:Se,height:me,tooltip:ae},"slices")),y.includes("legends")&&(De.legends=a.jsx(o.Fragment,{children:se.map((function(e,o){var r=Be.map((function(e){return{id:e.id,label:e.label,color:e.color,fill:e.fill}})).reverse();return a.jsx(i.BoxLegendSvg,u({},e,{containerWidth:ge,containerHeight:me,data:r}),o)}))},"legends")),a.jsx(r.SvgWrapper,{width:ye,height:xe,margin:he,defs:we,role:ce,ariaLabel:ue,ariaLabelledBy:fe,ariaDescribedBy:pe,children:y.map((function(e,r){var t;return"function"==typeof e?a.jsx(o.Fragment,{children:o.createElement(e,Ie)},r):null!=(t=null==De?void 0:De[e])?t:null}))})},B=function(e){var o=e.isInteractive,t=void 0===o?x.isInteractive:o,i=e.animate,n=void 0===i?x.animate:i,l=e.motionConfig,d=void 0===l?x.motionConfig:l,s=e.theme,c=e.renderWrapper,f=function(e,o){if(null==e)return{};var r,t,i={},n=Object.keys(e);for(t=0;t<n.length;t++)r=n[t],o.indexOf(r)>=0||(i[r]=e[r]);return i}(e,C);return a.jsx(r.Container,{animate:n,isInteractive:t,motionConfig:d,renderWrapper:c,theme:s,children:a.jsx(j,u({isInteractive:t},f))})};e.ResponsiveStream=function(e){return a.jsx(r.ResponsiveWrapper,{children:function(o){var r=o.width,t=o.height;return a.jsx(B,u({width:r,height:t},e))}})},e.Stream=B,e.defaultProps=y,e.svgDefaultProps=x,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("react"),require("@nivo/core"),require("@nivo/axes"),require("@nivo/legends"),require("@react-spring/web"),require("@nivo/tooltip"),require("react/jsx-runtime"),require("d3-shape"),require("@nivo/colors"),require("@nivo/scales")):"function"==typeof define&&define.amd?define(["exports","react","@nivo/core","@nivo/axes","@nivo/legends","@react-spring/web","@nivo/tooltip","react/jsx-runtime","d3-shape","@nivo/colors","@nivo/scales"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self).nivo=e.nivo||{},e.React,e.nivo,e.nivo,e.nivo,e["@react-spring/web"],e.nivo,e["react/jsx-runtime"],e.d3,e.nivo,e.nivo)}(this,(function(e,o,r,t,i,n,l,a,d,s,c){"use strict";function u(){return u=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},u.apply(this,arguments)}var f=function(e){var t=e.layer,i=e.fillOpacity,d=e.borderWidth,s=e.getBorderColor,c=e.isInteractive,u=e.tooltip,f=l.useTooltip(),p=f.showTooltipFromEvent,v=f.hideTooltip,h=o.useCallback((function(e){p(o.createElement(u,{layer:t}),e,"left")}),[p,t]),m=r.useMotionConfig(),g=m.animate,y=m.config,x=r.useAnimatedPath(t.path),b=n.useSpring({color:t.color,config:y,immediate:!g});return a.jsx(n.animated.path,{d:x,fill:t.fill?t.fill:b.color,fillOpacity:i,stroke:s(t),strokeWidth:d,onMouseMove:c?h:void 0,onMouseEnter:c?h:void 0,onMouseLeave:c?v:void 0})},p=function(e){var o=e.layers,r=e.fillOpacity,t=e.borderWidth,i=e.getBorderColor,n=e.isInteractive,l=e.tooltip;return a.jsx("g",{children:o.map((function(e,o){return a.jsx(f,{layer:e,getBorderColor:i,borderWidth:t,fillOpacity:r,isInteractive:n,tooltip:l},o)}))})},v=function(e,o){var r=e.y2;return"center"===o?r=e.y1+(e.y2-e.y1)/2:"start"===o&&(r=e.y1),r},h=function(e){var r=e.data,t=e.dotComponent,i=e.position,n=e.getSize,l=e.getColor,d=e.getBorderWidth,s=e.getBorderColor;return a.jsx(a.Fragment,{children:r.map((function(e,r){return o.createElement(t,{key:r,datum:e,x:e.x,y:v(e,i),size:n(e),color:l(e),borderWidth:d(e),borderColor:s(e)})}))})},m=function(e){var r=e.slice,t=e.height,i=e.tooltip,n=o.useState(!1),d=n[0],s=n[1],c=l.useTooltip(),u=c.showTooltipFromEvent,f=c.hideTooltip,p=o.useCallback((function(e){s(!0),u(o.createElement(i,{slice:r}),e,"left")}),[s,u,i,r]),v=o.useCallback((function(){s(!1),f()}),[s,f]);return a.jsxs("g",{transform:"translate("+r.x+", 0)",children:[d&&a.jsx("line",{x1:0,x2:0,y1:0,y2:t,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),a.jsx("rect",{x:-20,width:40,height:t,fill:"#000",fillOpacity:0,onMouseEnter:p,onMouseMove:p,onMouseLeave:v})]})},g=function(e){var o=e.slices,r=e.height,t=e.tooltip;return a.jsx("g",{children:o.map((function(e){return a.jsx(m,{slice:e,height:r,tooltip:t},e.index)}))})},y={label:"id",order:"none",offsetType:"wiggle",curve:"catmullRom",axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,colors:{scheme:"nivo"},fillOpacity:1,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableDots:!1,dotPosition:"center",dotComponent:function(e){var o=e.x,t=e.y,i=e.size,l=e.color,d=e.borderWidth,s=e.borderColor,c=r.useMotionConfig(),u=c.animate,f=c.config,p=n.useSpring({x:o,y:t,radius:.5*i,color:l,config:f,immediate:!u});return a.jsx(n.animated.circle,{cx:p.x,cy:p.y,r:p.radius,fill:p.color,strokeWidth:d,stroke:s})},dotSize:6,dotColor:{from:"color"},dotBorderWidth:0,dotBorderColor:{from:"color"},isInteractive:!0,tooltip:function(e){var o=e.layer;return a.jsx(l.BasicTooltip,{id:o.label,enableChip:!0,color:o.color})},enableStackTooltip:!0,stackTooltip:function(e){var r=e.slice,t=o.useMemo((function(){return r.stack.map((function(e){return[a.jsx(l.Chip,{color:e.color},e.layerId),e.layerLabel,e.formattedValue]}))}),[r]);return a.jsx(l.TableTooltip,{rows:t})},legends:[],legendLabel:"id",role:"application"},x=u({},y,{layers:["grid","axes","layers","dots","slices","legends"],defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),b=function(e){var t=e.width,i=e.height,n=e.data,l=e.keys,a=e.label,f=void 0===a?y.label:a,p=e.valueFormat,v=e.offsetType,h=void 0===v?y.offsetType:v,m=e.order,g=void 0===m?y.order:m,x=e.curve,b=void 0===x?y.curve:x,C=e.colors,j=void 0===C?y.colors:C,B=e.borderColor,S=void 0===B?y.borderColor:B,k=e.dotSize,W=void 0===k?y.dotSize:k,M=e.dotColor,T=void 0===M?y.dotColor:M,O=e.dotBorderWidth,I=void 0===O?y.dotBorderWidth:O,w=e.dotBorderColor,D=void 0===w?y.dotBorderColor:w,L=r.useCurveInterpolation(b),F=o.useMemo((function(){return d.area().x((function(e){return e.x})).y0((function(e){return e.y1})).y1((function(e){return e.y2})).curve(L)}),[L]),P=o.useMemo((function(){return d.stack().keys(l).offset(r.stackOffsetFromProp(h)).order(r.stackOrderFromProp(g))}),[l,h,g]),z=o.useMemo((function(){var e=[],o=[],r=P(n).map((function(r){return r.map((function(t){return e.push(t[0]),o.push(t[1]),u({},t,{value:t.data[r.key]})}))})),l=Math.min.apply(Math,e),a=Math.max.apply(Math,o);return[r,c.createPointScale({type:"point"},{all:Array.from({length:n.length},(function(e,o){return o})),min:0,max:n.length},t),c.createLinearScale({type:"linear"},{all:[l,a],min:l,max:a},i,"y")]}),[P,n,t,i]),q=z[0],E=z[1],G=z[2],A=r.useTheme(),R=s.useOrdinalColorScale(j,"id"),H=s.useInheritedColor(S,A),V=o.useMemo((function(){return"function"==typeof W?W:function(){return W}}),[W]),X=s.useInheritedColor(T,A),Y=o.useMemo((function(){return"function"==typeof I?I:function(){return I}}),[I]),_=s.useInheritedColor(D,A),J=r.usePropertyAccessor(f),K=r.useValueFormatter(p),N=o.useMemo((function(){return q.map((function(e,o){var r=e.map((function(e,r){return{layerId:l[o],layerLabel:"",index:r,color:"",x:E(r),value:e.value,formattedValue:K(e.value),y1:G(e[0]),y2:G(e[1])}})),t={id:l[o],path:F(r)},i=u({},t,{label:J(t),color:R(t)});return u({},i,{data:r.map((function(e){return e.layerLabel=i.label,e.color=i.color,e}))})}))}),[q,l,J,F,R,E,G,K]),Q=o.useMemo((function(){return Array.from({length:n.length},(function(e,o){var r=N.map((function(e){return e.data[o]})).sort((function(e,o){return e.y2-o.y2}));return{index:o,x:N[0].data[o].x,stack:r}}))}),[n.length,N]),U=o.useMemo((function(){return{xScale:E,yScale:G,layers:N,slices:Q}}),[E,G,N,Q]);return{xScale:E,yScale:G,layers:N,slices:Q,getBorderColor:H,getDotSize:V,getDotColor:X,getDotBorderWidth:Y,getDotBorderColor:_,layerContext:U}},C=["isInteractive","animate","motionConfig","theme","renderWrapper"],j=function(e){var n=e.data,l=e.keys,d=e.label,s=e.valueFormat,c=e.offsetType,f=e.order,v=e.curve,m=e.layers,y=void 0===m?x.layers:m,C=e.width,j=e.height,B=e.margin,S=e.axisTop,k=e.axisRight,W=e.axisBottom,M=void 0===W?x.axisBottom:W,T=e.axisLeft,O=void 0===T?x.axisLeft:T,I=e.enableGridX,w=void 0===I?x.enableGridX:I,D=e.enableGridY,L=void 0===D?x.enableGridY:D,F=e.colors,P=e.fillOpacity,z=void 0===P?x.fillOpacity:P,q=e.borderWidth,E=void 0===q?x.borderWidth:q,G=e.borderColor,A=e.defs,R=void 0===A?x.defs:A,H=e.fill,V=void 0===H?x.fill:H,X=e.enableDots,Y=void 0===X?x.enableDots:X,_=e.dotPosition,J=void 0===_?x.dotPosition:_,K=e.dotComponent,N=void 0===K?x.dotComponent:K,Q=e.dotSize,U=e.dotColor,Z=e.dotBorderWidth,$=e.dotBorderColor,ee=e.isInteractive,oe=void 0===ee?x.isInteractive:ee,re=e.tooltip,te=void 0===re?x.tooltip:re,ie=e.enableStackTooltip,ne=void 0===ie?x.enableStackTooltip:ie,le=e.stackTooltip,ae=void 0===le?x.stackTooltip:le,de=e.legends,se=void 0===de?x.legends:de,ce=e.role,ue=e.ariaLabel,fe=e.ariaLabelledBy,pe=e.ariaDescribedBy,ve=r.useDimensions(C,j,B),he=ve.margin,me=ve.innerWidth,ge=ve.innerHeight,ye=ve.outerWidth,xe=ve.outerHeight,be=b({width:me,height:ge,data:n,keys:l,label:d,valueFormat:s,offsetType:c,order:f,curve:v,colors:F,borderColor:G,dotSize:Q,dotColor:U,dotBorderWidth:Z,dotBorderColor:$}),Ce=be.xScale,je=be.yScale,Be=be.layers,Se=be.slices,ke=be.getBorderColor,We=be.getDotSize,Me=be.getDotColor,Te=be.getDotBorderWidth,Oe=be.getDotBorderColor,Ie=be.layerContext,we=r.bindDefs(R,Be,V),De={grid:null,axes:null,layers:null,dots:null,slices:null,legends:null};return y.includes("grid")&&(De.grid=a.jsx(t.Grid,{width:me,height:ge,xScale:w?Ce:null,yScale:L?je:null},"grid")),y.includes("axes")&&(De.axes=a.jsx(t.Axes,{xScale:Ce,yScale:je,width:me,height:ge,top:S,right:k,bottom:M,left:O},"axes")),y.includes("layers")&&(De.layers=a.jsx(p,{layers:Be,fillOpacity:z,borderWidth:E,getBorderColor:ke,isInteractive:oe,tooltip:te},"layers")),y.includes("dots")&&Y&&(De.dots=a.jsx(o.Fragment,{children:Be.map((function(e){return a.jsx(h,{id:e.id,color:e.color,data:e.data,dotComponent:N,position:J,getSize:We,getColor:Me,getBorderWidth:Te,getBorderColor:Oe},e.id)}))},"dots")),y.includes("slices")&&oe&&ne&&(De.slices=a.jsx(g,{slices:Se,height:ge,tooltip:ae},"slices")),y.includes("legends")&&(De.legends=a.jsx(o.Fragment,{children:se.map((function(e,o){var r=Be.map((function(e){return{id:e.id,label:e.label,color:e.color,fill:e.fill}})).reverse();return a.jsx(i.BoxLegendSvg,u({},e,{containerWidth:me,containerHeight:ge,data:r}),o)}))},"legends")),a.jsx(r.SvgWrapper,{width:ye,height:xe,margin:he,defs:we,role:ce,ariaLabel:ue,ariaLabelledBy:fe,ariaDescribedBy:pe,children:y.map((function(e,r){var t;return"function"==typeof e?a.jsx(o.Fragment,{children:o.createElement(e,Ie)},r):null!=(t=null==De?void 0:De[e])?t:null}))})},B=function(e){var o=e.isInteractive,t=void 0===o?x.isInteractive:o,i=e.animate,n=void 0===i?x.animate:i,l=e.motionConfig,d=void 0===l?x.motionConfig:l,s=e.theme,c=e.renderWrapper,f=function(e,o){if(null==e)return{};var r,t,i={},n=Object.keys(e);for(t=0;t<n.length;t++)r=n[t],o.indexOf(r)>=0||(i[r]=e[r]);return i}(e,C);return a.jsx(r.Container,{animate:n,isInteractive:t,motionConfig:d,renderWrapper:c,theme:s,children:a.jsx(j,u({isInteractive:t},f))})};e.ResponsiveStream=function(e){return a.jsx(r.ResponsiveWrapper,{children:function(o){var r=o.width,t=o.height;return a.jsx(B,u({width:r,height:t},e))}})},e.Stream=B,e.defaultProps=y,e.svgDefaultProps=x,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=nivo-stream.umd.js.map

@@ -19,4 +19,4 @@ import { StreamCommonProps, StreamCustomLayerProps, StreamDataProps, StreamDatum, StreamLayerData, StreamLayerDatum, StreamSliceData } from './types';

}) => {
xScale: import("d3-scale").ScalePoint<number>;
yScale: import("d3-scale").ScaleLinear<number, number, never>;
xScale: import("@nivo/scales").ScalePoint<number>;
yScale: import("@nivo/scales").ScaleLinear<number>;
layers: StreamLayerData[];

@@ -23,0 +23,0 @@ slices: StreamSliceData[];

@@ -6,6 +6,7 @@ import { FunctionComponent, AriaAttributes } from 'react';

import { LegendProps } from '@nivo/legends';
import { ScaleLinear, ScalePoint } from '@nivo/scales';
export declare type StreamLayerId = 'grid' | 'axes' | 'layers' | 'dots' | 'slices' | 'legends';
export interface StreamCustomLayerProps {
xScale: any;
yScale: any;
xScale: ScalePoint<number>;
yScale: ScaleLinear<number>;
layers: StreamLayerData[];

@@ -12,0 +13,0 @@ slices: StreamSliceData[];

{
"name": "@nivo/stream",
"version": "0.79.1",
"version": "0.80.0",
"license": "MIT",

@@ -32,19 +32,17 @@ "author": {

"dependencies": {
"@nivo/axes": "0.79.0",
"@nivo/colors": "0.79.1",
"@nivo/legends": "0.79.1",
"@nivo/scales": "0.79.0",
"@nivo/tooltip": "0.79.0",
"@react-spring/web": "9.3.1",
"d3-scale": "^3.2.3",
"@nivo/axes": "0.80.0",
"@nivo/colors": "0.80.0",
"@nivo/legends": "0.80.0",
"@nivo/scales": "0.80.0",
"@nivo/tooltip": "0.80.0",
"@react-spring/web": "9.4.5",
"d3-shape": "^1.3.5"
},
"devDependencies": {
"@nivo/core": "0.79.0",
"@types/d3-scale": "^3.2.2",
"@nivo/core": "0.80.0",
"@types/d3-shape": "^2.0.0"
},
"peerDependencies": {
"@nivo/core": "0.79.0",
"react": ">= 16.14.0 < 18.0.0"
"@nivo/core": "0.80.0",
"react": ">= 16.14.0 < 19.0.0"
},

@@ -54,3 +52,3 @@ "publishConfig": {

},
"gitHead": "f0a673005e918b2e2d3e635c6f214aa088bac5e1"
"gitHead": "df352b82a7d3b7938fb3a1bd9be3f602cbc8a67f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc