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.81.0 to 0.82.0

./dist/nivo-stream.cjs.js

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("@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;
"use strict";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?Object.assign.bind():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]),z=e.useMemo((function(){return a.stack().keys(l).offset(o.stackOffsetFromProp(v)).order(o.stackOrderFromProp(y))}),[l,v,y]),P=e.useMemo((function(){var e=[],o=[],r=z(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")]}),[z,n,t,i]),q=P[0],E=P[1],G=P[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]),J=d.useInheritedColor(w,A),K=o.usePropertyAccessor(f),N=o.useValueFormatter(p),Q=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:N(e.value),y1:G(e[0]),y2:G(e[1])}})),t={id:l[o],path:F(r)},i=c({},t,{label:K(t),color:R(t)});return c({},i,{data:r.map((function(e){return e.layerLabel=i.label,e.color=i.color,e}))})}))}),[q,l,K,F,R,E,G,N]),U=e.useMemo((function(){return Array.from({length:n.length},(function(e,o){var r=Q.map((function(e){return e.data[o]})).sort((function(e,o){return e.y2-o.y2}));return{index:o,x:Q[0].data[o].x,stack:r}}))}),[n.length,Q]),Z=e.useMemo((function(){return{xScale:E,yScale:G,layers:Q,slices:U}}),[E,G,Q,U]);return{xScale:E,yScale:G,layers:Q,slices:U,getBorderColor:H,getDotSize:V,getDotColor:X,getDotBorderWidth:Y,getDotBorderColor:J,layerContext:Z}},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,z=i.fillOpacity,P=void 0===z?y.fillOpacity:z,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,J=i.dotPosition,K=void 0===J?y.dotPosition:J,N=i.dotComponent,Q=void 0===N?y.dotComponent:N,U=i.dotSize,Z=i.dotColor,$=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:U,dotColor:Z,dotBorderWidth:$,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:P,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:Q,position:K,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 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};
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 O}from"@nivo/tooltip";import{jsx as T,Fragment as w,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?Object.assign.bind():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 T(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 T("g",{children:e.map((function(o,e){return T(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 T(w,{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&&T("line",{x1:0,x2:0,y1:0,y2:n,stroke:"#000",strokeOpacity:.35,strokeWidth:1}),T("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 T("g",{children:e.map((function(o){return T(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 T(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 T(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[T(S,{color:o.color},o.layerId),o.layerLabel,o.formattedValue]}))}),[e]);return T(O,{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,O=o.height,w=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,Oo=o.legends,To=void 0===Oo?V.legends:Oo,wo=o.role,Io=o.ariaLabel,Do=o.ariaLabelledBy,Lo=o.ariaDescribedBy,Mo=p(S,O,w),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,O=void 0===S?R.dotSize:S,T=o.dotColor,w=void 0===T?R.dotColor:T,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 O?O:function(){return O}}),[O]),$=z(w,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=T(g,{width:Fo,height:Go,xScale:N?Ho:null,yScale:U?Xo:null},"grid")),k.includes("axes")&&(Uo.axes=T(b,{xScale:Ho,yScale:Xo,width:Fo,height:Go,top:I,right:E,bottom:Y,left:J},"axes")),k.includes("layers")&&(Uo.layers=T(P,{layers:Yo,fillOpacity:_,borderWidth:eo,getBorderColor:Ro,isInteractive:bo,tooltip:Co},"layers")),k.includes("dots")&&co&&(Uo.dots=T(i,{children:Yo.map((function(o){return T(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=T(A,{slices:Ao,height:Go,tooltip:So},"slices")),k.includes("legends")&&(Uo.legends=T(i,{children:To.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 T(x,j({},o,{containerWidth:Fo,containerHeight:Go,data:r}),e)}))},"legends")),T(m,{width:jo,height:Eo,margin:zo,defs:Qo,role:wo,ariaLabel:Io,ariaLabelledBy:Do,ariaDescribedBy:Lo,children:k.map((function(o,r){var t;return"function"==typeof o?T(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 T(h,{animate:i,isInteractive:r,motionConfig:l,renderWrapper:d,theme:a,children:T(J,j({isInteractive:r},c))})},N=function(o){return T(y,{children:function(e){var r=e.width,t=e.height;return T(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

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

import { ScaleLinear, ScalePoint } from '@nivo/scales';
export declare type StreamLayerId = 'grid' | 'axes' | 'layers' | 'dots' | 'slices' | 'legends';
export type StreamLayerId = 'grid' | 'axes' | 'layers' | 'dots' | 'slices' | 'legends';
export interface StreamCustomLayerProps {

@@ -15,8 +15,8 @@ xScale: ScalePoint<number>;

}
export declare type StreamCustomLayer = FunctionComponent<StreamCustomLayerProps>;
export declare type StreamLayer = StreamLayerId | StreamCustomLayer;
export type StreamCustomLayer = FunctionComponent<StreamCustomLayerProps>;
export type StreamLayer = StreamLayerId | StreamCustomLayer;
export interface StreamDatum {
[key: string]: string | number;
}
export declare type StackFunc<RawDatum extends StreamDatum> = (data: RawDatum[]) => {
export type StackFunc<RawDatum extends StreamDatum> = (data: RawDatum[]) => {
0: number;

@@ -48,8 +48,8 @@ 1: number;

}
export declare type Tooltip = FunctionComponent<TooltipProps>;
export type Tooltip = FunctionComponent<TooltipProps>;
export interface StackTooltipProps {
slice: StreamSliceData;
}
export declare type StackTooltip = FunctionComponent<StackTooltipProps>;
export declare type DotComponent = FunctionComponent<{
export type StackTooltip = FunctionComponent<StackTooltipProps>;
export type DotComponent = FunctionComponent<{
datum: StreamLayerDatum;

@@ -72,3 +72,3 @@ x: number;

}
export declare type StreamCommonProps<RawDatum extends StreamDatum> = {
export type StreamCommonProps<RawDatum extends StreamDatum> = {
label: PropertyAccessor<Omit<StreamLayerData, 'label' | 'color' | 'data'>, string | number>;

@@ -113,3 +113,3 @@ valueFormat: ValueFormat<number>;

};
export declare type StreamSvgProps<RawDatum extends StreamDatum> = Partial<StreamCommonProps<RawDatum>> & StreamDataProps<RawDatum> & SvgDefsAndFill<StreamLayerData> & Dimensions & ModernMotionProps;
export type StreamSvgProps<RawDatum extends StreamDatum> = Partial<StreamCommonProps<RawDatum>> & StreamDataProps<RawDatum> & SvgDefsAndFill<StreamLayerData> & Dimensions & ModernMotionProps;
//# sourceMappingURL=types.d.ts.map
{
"name": "@nivo/stream",
"version": "0.81.0",
"license": "MIT",
"author": {
"name": "Raphaël Benitte",
"url": "https://github.com/plouc"
},
"repository": {
"type": "git",
"url": "https://github.com/plouc/nivo.git",
"directory": "packages/stream"
},
"keywords": [
"nivo",
"dataviz",
"react",
"d3",
"charts",
"stream-chart"
],
"main": "./dist/nivo-stream.cjs.js",
"module": "./dist/nivo-stream.es.js",
"typings": "./dist/types/index.d.ts",
"files": [
"README.md",
"LICENSE.md",
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"dependencies": {
"@nivo/axes": "0.81.0",
"@nivo/colors": "0.81.0",
"@nivo/legends": "0.81.0",
"@nivo/scales": "0.81.0",
"@nivo/tooltip": "0.81.0",
"@react-spring/web": "9.4.5 || ^9.7.2",
"d3-shape": "^1.3.5"
},
"devDependencies": {
"@nivo/core": "0.81.0",
"@types/d3-shape": "^2.0.0"
},
"peerDependencies": {
"@nivo/core": "0.81.0",
"react": ">= 16.14.0 < 19.0.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "56db9cb7738f406a21085c11ab28716044fceb5b"
"name": "@nivo/stream",
"version": "0.82.0",
"license": "MIT",
"author": {
"name": "Raphaël Benitte",
"url": "https://github.com/plouc"
},
"repository": {
"type": "git",
"url": "https://github.com/plouc/nivo.git",
"directory": "packages/stream"
},
"keywords": [
"nivo",
"dataviz",
"react",
"d3",
"charts",
"stream-chart"
],
"main": "./dist/nivo-stream.cjs.js",
"module": "./dist/nivo-stream.es.js",
"types": "./dist/types/index.d.ts",
"files": [
"README.md",
"LICENSE.md",
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"dependencies": {
"@nivo/axes": "0.82.0",
"@nivo/colors": "0.82.0",
"@nivo/legends": "0.82.0",
"@nivo/scales": "0.82.0",
"@nivo/tooltip": "0.82.0",
"@react-spring/web": "9.4.5 || ^9.7.2",
"@types/d3-shape": "^2.0.0",
"d3-shape": "^1.3.5"
},
"peerDependencies": {
"@nivo/core": "workspace:*",
"react": ">= 16.14.0 < 19.0.0"
},
"devDependencies": {
"@nivo/core": "0.82.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "579fc012df24e154a387243559165e344b6523da"
}

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