@orderly.network/chart 2.8.0 → 2.8.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var react=require('react'),recharts=require('recharts'),i18n=require('@orderly.network/i18n'),ui=require('@orderly.network/ui'),utils=require('@orderly.network/utils'),jsxRuntime=require('react/jsx-runtime');var E=Object.create;var A=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var b=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);var U=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of H(r))!Q.call(t,a)&&a!==e&&A(t,a,{get:()=>r[a],enumerable:!(o=Y(r,a))||o.enumerable});return t};var J=(t,r,e)=>(e=t!=null?E(q(t)):{},U(!t||!t.__esModule?A(e,"default",{value:t,enumerable:true}):e,t));var z=b(k=>{Object.defineProperty(k,"__esModule",{value:true});Object.defineProperty(k,"default",{enumerable:true,get:function(){return Xe}});function V(t,r){return {handler:t,config:r}}V.withOptions=function(t,r=()=>({})){let e=function(o){return {__options:o,handler:t(o),config:r(o)}};return e.__isOptionsFunction=true,e.__pluginFunction=t,e.__configFunction=r,e};var Xe=V;});var N=b(P=>{Object.defineProperty(P,"__esModule",{value:true});Object.defineProperty(P,"default",{enumerable:true,get:function(){return Ye}});var We=Ee(z());function Ee(t){return t&&t.__esModule?t:{default:t}}var Ye=We.default;});var $=b((ho,M)=>{var R=N();M.exports=(R.__esModule?R:{default:R}).default;});var d=t=>{let r=Math.abs(t),e=r===0?0:r<=10?2:r<=100?1:0,o=utils.numberToHumanStyle(r,e);return t<0?`-${o}`:o};var p=t=>{let{label:r,value:e,prefix:o,unit:a="USDC",coloring:i=false,dp:n,rm:g}=t;return jsxRuntime.jsxs(ui.Box,{intensity:600,p:3,r:"md",children:[jsxRuntime.jsxs(ui.Flex,{direction:"row",className:t.titleClassName,children:[o,jsxRuntime.jsx(ui.Text.numeral,{unit:a,as:"div",size:"sm",coloring:i,showIdentifier:i,unitClassName:"oui-text-base-contrast-54 oui-ml-1",weight:"semibold",rm:g,dp:n,children:e})]}),jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:54,weight:"semibold",children:r})]})};var S=()=>{let t=document.documentElement,r=getComputedStyle(t);return {primary:y(r.getPropertyValue("--oui-color-primary")),primaryLight:y(r.getPropertyValue("--oui-color-primary-light")),secondary:y(r.getPropertyValue("--oui-color-secondary")),success:y(r.getPropertyValue("--oui-color-success")),warning:y(r.getPropertyValue("--oui-color-warning")),danger:y(r.getPropertyValue("--oui-color-danger")),info:y(r.getPropertyValue("--oui-color-info")),loss:y(r.getPropertyValue("--oui-color-trading-loss")),profit:y(r.getPropertyValue("--oui-color-trading-profit"))}},y=t=>`rgb(${t.split(" ").join(",")})`;var m=t=>react.useMemo(()=>{let e=S();return {profit:t?.profit||e.profit,loss:t?.loss||e.loss,primary:e.primary,primaryLight:e.primaryLight}},[t]);var ft=t=>{let{fill:r,x:e,y:o,width:a,height:i}=t,n=Math.abs(i);return jsxRuntime.jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:n,stroke:"none",fill:r})},dt=t=>{let{x:r,y:e,stroke:o,payload:a,index:i,width:n,containerWidth:g}=t,{t:X}=i18n.useTranslation(),W=i===0?48:g>0?g-10:n+a.offset;return jsxRuntime.jsx("g",{transform:`translate(${W},${e-6})`,children:jsxRuntime.jsx("text",{x:0,y:0,dy:16,textAnchor:i===0?"start":"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:X("chart.now")})})},yt=t=>{let{width:r,height:e,stroke:o,fill:a}=t;return jsxRuntime.jsx(recharts.Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},ht=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},Ct=t=>{let{invisible:r,data:e,responsiveContainerProps:o}=t,a=m(t.colors),i=react.useRef(0);return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:ui.cn(r&&"chart-invisible"),onResize:n=>{i.current=n;},...o,children:jsxRuntime.jsxs(recharts.BarChart,{data:e,margin:{left:-10,top:10,right:10,bottom:30},children:[!r&&jsxRuntime.jsx(recharts.Tooltip,{cursor:jsxRuntime.jsx(yt,{}),content:jsxRuntime.jsx(ht,{})}),jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.ReferenceLine,{y:0,stroke:"rgba(0,0,0,0.04)"}),!r&&jsxRuntime.jsx(recharts.Bar,{dataKey:"pnl",shape:jsxRuntime.jsx(ft,{}),children:e.map((n,g)=>jsxRuntime.jsx(recharts.Cell,{fill:n.pnl>0?a.profit:a.loss},`cell-${g}`))}),jsxRuntime.jsx(recharts.YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickFormatter:n=>d(n),tickLine:false,axisLine:false,dataKey:"pnl"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",tickLine:false,interval:e.length-2,height:1,tick:jsxRuntime.jsx(dt,{containerWidth:i.current}),stroke:"#FFFFFF",strokeOpacity:.04})]})})};var h=t=>{let{x:r,y:e,stroke:o,payload:a,index:i}=t,{t:n}=i18n.useTranslation();return jsxRuntime.jsx("g",{transform:`translate(${r},${e-6})`,children:jsxRuntime.jsx("text",{x:0,y:0,dy:16,textAnchor:"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:n("chart.now")})})};var wt=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},_t=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},Bt=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=ui.useScreen(),a=react.useMemo(()=>_t(t.data),[t.data]),i=jsxRuntime.jsxs(recharts.LineChart,{data:a,margin:{top:20,right:10,left:-10,bottom:0},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(wt,{})}),!t.invisible&&jsxRuntime.jsx(recharts.Line,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ht=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},qt=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},Qt=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=ui.useScreen(),a=react.useId(),i=react.useMemo(()=>qt(t.data),[t.data]),n=jsxRuntime.jsxs(recharts.AreaChart,{data:i,margin:{top:20,right:10,left:-10,bottom:0},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(Ht,{})}),!t.invisible&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{stopColor:e.primary,offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:e.primary,offset:"100%",stopOpacity:0})]})}),jsxRuntime.jsx(recharts.Area,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${a})`})]})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:n})};var se=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},le=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=react.useId(),{isMobile:a}=ui.useScreen(),i=a?jsxRuntime.jsxs(recharts.AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:n=>d(n)}),!t.invisible&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsxRuntime.jsx(recharts.Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]}):jsxRuntime.jsxs(recharts.LineChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(se,{})}),!t.invisible&&jsxRuntime.jsx(recharts.Line,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var xe=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},Fe=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=react.useId(),{isMobile:a}=ui.useScreen(),i=jsxRuntime.jsxs(recharts.AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(xe,{})}),!t.invisible&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsxRuntime.jsx(recharts.Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ke=t=>{let{fill:r,x:e,y:o,width:a,height:i,opacity:n}=t,g=Math.abs(i);return jsxRuntime.jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:g,stroke:"none",fill:r,opacity:n})},Ve=t=>{let{width:r,height:e,payload:o,stroke:a,fill:i}=t;return o?.[0]?.value===0?null:jsxRuntime.jsx(recharts.Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},ze=t=>{let{active:r,payload:e,label:o,tooltip:a}=t;return e?.[0]?.value===0?null:r&&e&&e.length?jsxRuntime.jsx(p,{label:o,value:e[0].value,titleClassName:"oui-gap-4",rm:a?.rm,dp:a?.dp}):null},Ne=t=>{let r=m(t.colors?.fill?{profit:t.colors?.fill,loss:t.colors?.fill}:void 0),e=t.data?.reduce((i,n)=>i+n.volume,0)===0,o=t.data?.reduce((i,n)=>i>n.volume?i:n.volume,0),a=o<=10?2:o<=100?1:0;return jsxRuntime.jsx(ui.Box,{className:ui.cn(t.className),children:jsxRuntime.jsx(recharts.ResponsiveContainer,{children:jsxRuntime.jsxs(recharts.BarChart,{data:t.data,margin:{left:-0,top:6,right:0,bottom:20},children:[jsxRuntime.jsx(recharts.Tooltip,{cursor:jsxRuntime.jsx(Ve,{}),content:jsxRuntime.jsx(ze,{tooltip:t.tooltip})}),jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.08,repeatCount:6}),jsxRuntime.jsx(recharts.ReferenceLine,{y:0,stroke:"#000"}),jsxRuntime.jsx(recharts.Bar,{dataKey:"volume",shape:jsxRuntime.jsx(Ke,{}),minPointSize:1,children:t.data.map((i,n)=>jsxRuntime.jsx(recharts.Cell,{fill:i.volume>0?r.profit:r.loss,opacity:i.opacity},`cell-${n}`))}),jsxRuntime.jsx(recharts.YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,dataKey:"volume",tickFormatter:(i,n)=>e?`${n*100}`:Me(i,a),width:45}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",tickLine:false,interval:t.data.length-2,height:1,tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},stroke:"rgb(229, 231, 235)",strokeOpacity:.2})]})})})};function Me(t,r=0){let e=["","K","M","B","T"],o=0;for(;t>=1e3&&o<e.length-1;)t/=1e3,o++;return `${$e(t,r)}${e[o]}`}function $e(t,r){let e=t.toString(),o=e.indexOf(".");if(o===-1||r===0)return e.split(".")[0];let a=o+r+1;return e.slice(0,a)}var G=J($()),He=()=>(0, G.default)(function({addComponents:t,addBase:r}){t({".xAxis":{".recharts-cartesian-axis-tick:first-child text":{"text-anchor":"start"},".recharts-cartesian-axis-tick:last-child text":{"text-anchor":"end"}}},{respectPrefix:false});});Object.defineProperty(exports,"Area",{enumerable:true,get:function(){return recharts.Area}});Object.defineProperty(exports,"AreaChart",{enumerable:true,get:function(){return recharts.AreaChart}});Object.defineProperty(exports,"Bar",{enumerable:true,get:function(){return recharts.Bar}});Object.defineProperty(exports,"BarChart",{enumerable:true,get:function(){return recharts.BarChart}});Object.defineProperty(exports,"Cell",{enumerable:true,get:function(){return recharts.Cell}});Object.defineProperty(exports,"Line",{enumerable:true,get:function(){return recharts.Line}});Object.defineProperty(exports,"LineChart",{enumerable:true,get:function(){return recharts.LineChart}});exports.AssetAreaChart=Fe;exports.AssetLineChart=le;exports.PnLBarChart=Ct;exports.PnlAreaChart=Qt;exports.PnlLineChart=Bt;exports.VolBarChart=Ne;exports.chartPlugin=He;//# sourceMappingURL=index.js.map
1
+ 'use strict';var react=require('react'),recharts=require('recharts'),i18n=require('@orderly.network/i18n'),ui=require('@orderly.network/ui'),utils=require('@orderly.network/utils'),jsxRuntime=require('react/jsx-runtime');var Y=Object.create;var L=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var F=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);var J=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of q(r))!U.call(t,a)&&a!==e&&L(t,a,{get:()=>r[a],enumerable:!(o=H(r,a))||o.enumerable});return t};var Z=(t,r,e)=>(e=t!=null?Y(Q(t)):{},J(!t||!t.__esModule?L(e,"default",{value:t,enumerable:true}):e,t));var $=F(R=>{Object.defineProperty(R,"__esModule",{value:true});Object.defineProperty(R,"default",{enumerable:true,get:function(){return Xe}});function M(t,r){return {handler:t,config:r}}M.withOptions=function(t,r=()=>({})){let e=function(o){return {__options:o,handler:t(o),config:r(o)}};return e.__isOptionsFunction=true,e.__pluginFunction=t,e.__configFunction=r,e};var Xe=M;});var G=F(A=>{Object.defineProperty(A,"__esModule",{value:true});Object.defineProperty(A,"default",{enumerable:true,get:function(){return Ye}});var We=Ee($());function Ee(t){return t&&t.__esModule?t:{default:t}}var Ye=We.default;});var W=F((ho,X)=>{var T=G();X.exports=(T.__esModule?T:{default:T}).default;});var d=t=>{let r=Math.abs(t),e=r===0?0:r<=10?2:r<=100?1:0,o=utils.numberToHumanStyle(r,e);return t<0?`-${o}`:o};var p=t=>{let{label:r,value:e,prefix:o,unit:a="USDC",coloring:i=false,dp:n,rm:y}=t;return jsxRuntime.jsxs(ui.Box,{intensity:600,p:3,r:"md",children:[jsxRuntime.jsxs(ui.Flex,{direction:"row",className:t.titleClassName,children:[o,jsxRuntime.jsx(ui.Text.numeral,{unit:a,as:"div",size:"sm",coloring:i,showIdentifier:i,unitClassName:"oui-text-base-contrast-54 oui-ml-1",weight:"semibold",rm:y,dp:n,children:e})]}),jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:54,weight:"semibold",children:r})]})};var _=()=>{let t=document.documentElement,r=getComputedStyle(t);return {primary:h(r.getPropertyValue("--oui-color-primary")),primaryLight:h(r.getPropertyValue("--oui-color-primary-light")),secondary:h(r.getPropertyValue("--oui-color-secondary")),success:h(r.getPropertyValue("--oui-color-success")),warning:h(r.getPropertyValue("--oui-color-warning")),danger:h(r.getPropertyValue("--oui-color-danger")),info:h(r.getPropertyValue("--oui-color-info")),loss:h(r.getPropertyValue("--oui-color-trading-loss")),profit:h(r.getPropertyValue("--oui-color-trading-profit"))}},h=t=>`rgb(${t.split(" ").join(",")})`;var m=t=>react.useMemo(()=>{let e=_();return {profit:t?.profit||e.profit,loss:t?.loss||e.loss,primary:e.primary,primaryLight:e.primaryLight}},[t]);var dt=t=>{let{fill:r,x:e,y:o,width:a,height:i}=t,n=Math.abs(i);return jsxRuntime.jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:n,stroke:"none",fill:r})},yt=t=>{let{x:r,y:e,stroke:o,payload:a,index:i,width:n,containerWidth:y}=t,{t:v}=i18n.useTranslation(),x=i===0?48:y>0?y-10:n+a.offset;return jsxRuntime.jsx("g",{transform:`translate(${x},${e-6})`,children:jsxRuntime.jsx("text",{x:0,y:0,dy:16,textAnchor:i===0?"start":"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:v("chart.now")})})},ht=t=>{let{width:r,height:e,stroke:o,fill:a}=t;return jsxRuntime.jsx(recharts.Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},Ct=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},gt=t=>{let{invisible:r,data:e,responsiveContainerProps:o}=t,a=m(t.colors),i=react.useRef(0);return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:ui.cn(r&&"chart-invisible"),onResize:n=>{i.current=n;},...o,children:jsxRuntime.jsxs(recharts.BarChart,{data:e,margin:{left:-10,top:10,right:10,bottom:30},children:[!r&&jsxRuntime.jsx(recharts.Tooltip,{cursor:jsxRuntime.jsx(ht,{}),content:jsxRuntime.jsx(Ct,{})}),jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.ReferenceLine,{y:0,stroke:"rgba(0,0,0,0.04)"}),!r&&jsxRuntime.jsx(recharts.Bar,{dataKey:"pnl",shape:jsxRuntime.jsx(dt,{}),children:e.map((n,y)=>jsxRuntime.jsx(recharts.Cell,{fill:n.pnl>0?a.profit:a.loss},`cell-${y}`))}),jsxRuntime.jsx(recharts.YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickFormatter:n=>d(n),tickLine:false,axisLine:false,dataKey:"pnl"}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",tickLine:false,interval:e.length-2,height:1,tick:jsxRuntime.jsx(yt,{containerWidth:i.current}),stroke:"#FFFFFF",strokeOpacity:.04})]})})};var C=t=>{let{x:r,y:e,stroke:o,payload:a,index:i}=t,{t:n}=i18n.useTranslation();return jsxRuntime.jsx("g",{transform:`translate(${r},${e-6})`,children:jsxRuntime.jsx("text",{x:0,y:0,dy:16,textAnchor:"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:n("chart.now")})})};var _t=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},Bt=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},It=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=ui.useScreen(),a=react.useMemo(()=>Bt(t.data),[t.data]),i=jsxRuntime.jsxs(recharts.LineChart,{data:a,margin:{top:20,right:10,left:-10,bottom:0},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(_t,{})}),!t.invisible&&jsxRuntime.jsx(recharts.Line,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ht=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},qt=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},Qt=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=ui.useScreen(),a=react.useId(),i=react.useMemo(()=>qt(t.data),[t.data]),n=react.useMemo(()=>i.map(v=>v.pnl).sort((v,x)=>v-x)[0]||0,[i]),y=jsxRuntime.jsxs(recharts.AreaChart,{data:i,margin:{top:20,right:10,left:-10,bottom:0},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(Ht,{})}),!t.invisible&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{stopColor:e.primary,offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:e.primary,offset:"100%",stopOpacity:0})]})}),jsxRuntime.jsx(recharts.Area,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${a})`,baseValue:n||0})]})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:y})};var se=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},le=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=react.useId(),{isMobile:a}=ui.useScreen(),i=a?jsxRuntime.jsxs(recharts.AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:n=>d(n)}),!t.invisible&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsxRuntime.jsx(recharts.Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]}):jsxRuntime.jsxs(recharts.LineChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(se,{})}),!t.invisible&&jsxRuntime.jsx(recharts.Line,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var xe=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=i18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},Fe=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=react.useId(),{isMobile:a}=ui.useScreen(),i=jsxRuntime.jsxs(recharts.AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsxRuntime.jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsxRuntime.jsx(recharts.YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsxRuntime.jsx(recharts.Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsxRuntime.jsx(xe,{})}),!t.invisible&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsxRuntime.jsx(recharts.Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]});return jsxRuntime.jsx(recharts.ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ve=t=>{let{fill:r,x:e,y:o,width:a,height:i,opacity:n}=t,y=Math.abs(i);return jsxRuntime.jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:y,stroke:"none",fill:r,opacity:n})},Ke=t=>{let{width:r,height:e,payload:o,stroke:a,fill:i}=t;return o?.[0]?.value===0?null:jsxRuntime.jsx(recharts.Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},ze=t=>{let{active:r,payload:e,label:o,tooltip:a}=t;return e?.[0]?.value===0?null:r&&e&&e.length?jsxRuntime.jsx(p,{label:o,value:e[0].value,titleClassName:"oui-gap-4",rm:a?.rm,dp:a?.dp}):null},Ne=t=>{let r=m(t.colors?.fill?{profit:t.colors?.fill,loss:t.colors?.fill}:void 0),e=t.data?.reduce((i,n)=>i+n.volume,0)===0,o=t.data?.reduce((i,n)=>i>n.volume?i:n.volume,0),a=o<=10?2:o<=100?1:0;return jsxRuntime.jsx(ui.Box,{className:ui.cn(t.className),children:jsxRuntime.jsx(recharts.ResponsiveContainer,{children:jsxRuntime.jsxs(recharts.BarChart,{data:t.data,margin:{left:-0,top:6,right:0,bottom:20},children:[jsxRuntime.jsx(recharts.Tooltip,{cursor:jsxRuntime.jsx(Ke,{}),content:jsxRuntime.jsx(ze,{tooltip:t.tooltip})}),jsxRuntime.jsx(recharts.CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.08,repeatCount:6}),jsxRuntime.jsx(recharts.ReferenceLine,{y:0,stroke:"#000"}),jsxRuntime.jsx(recharts.Bar,{dataKey:"volume",shape:jsxRuntime.jsx(Ve,{}),minPointSize:1,children:t.data.map((i,n)=>jsxRuntime.jsx(recharts.Cell,{fill:i.volume>0?r.profit:r.loss,opacity:i.opacity},`cell-${n}`))}),jsxRuntime.jsx(recharts.YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,dataKey:"volume",tickFormatter:(i,n)=>e?`${n*100}`:Me(i,a),width:45}),jsxRuntime.jsx(recharts.XAxis,{dataKey:"date",tickLine:false,interval:t.data.length-2,height:1,tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},stroke:"rgb(229, 231, 235)",strokeOpacity:.2})]})})})};function Me(t,r=0){let e=["","K","M","B","T"],o=0;for(;t>=1e3&&o<e.length-1;)t/=1e3,o++;return `${$e(t,r)}${e[o]}`}function $e(t,r){let e=t.toString(),o=e.indexOf(".");if(o===-1||r===0)return e.split(".")[0];let a=o+r+1;return e.slice(0,a)}var E=Z(W()),He=()=>(0, E.default)(function({addComponents:t,addBase:r}){t({".xAxis":{".recharts-cartesian-axis-tick:first-child text":{"text-anchor":"start"},".recharts-cartesian-axis-tick:last-child text":{"text-anchor":"end"}}},{respectPrefix:false});});Object.defineProperty(exports,"Area",{enumerable:true,get:function(){return recharts.Area}});Object.defineProperty(exports,"AreaChart",{enumerable:true,get:function(){return recharts.AreaChart}});Object.defineProperty(exports,"Bar",{enumerable:true,get:function(){return recharts.Bar}});Object.defineProperty(exports,"BarChart",{enumerable:true,get:function(){return recharts.BarChart}});Object.defineProperty(exports,"Cell",{enumerable:true,get:function(){return recharts.Cell}});Object.defineProperty(exports,"Line",{enumerable:true,get:function(){return recharts.Line}});Object.defineProperty(exports,"LineChart",{enumerable:true,get:function(){return recharts.LineChart}});exports.AssetAreaChart=Fe;exports.AssetLineChart=le;exports.PnLBarChart=gt;exports.PnlAreaChart=Qt;exports.PnlLineChart=It;exports.VolBarChart=Ne;exports.chartPlugin=He;//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/util/createPlugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/public/create-plugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/plugin.js","../src/utils/yTickFormatter.ts","../src/orderly/customTooltip.tsx","../src/utils/theme.ts","../src/orderly/useColors.ts","../src/orderly/pnlBar.tsx","../src/orderly/xAxisLabel.tsx","../src/orderly/pnlLine.tsx","../src/orderly/pnlArea.tsx","../src/orderly/assetLine.tsx","../src/orderly/assetArea.tsx","../src/orderly/volBar.tsx","../src/tailwindcss/theme.ts"],"names":["require_createPlugin","__commonJSMin","exports","_default","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","require_create_plugin","_createPlugin","_interop_require_default","obj","require_plugin","module","tickFormatter","value","absValue","dp","formatted","numberToHumanStyle","OrderlyChartTooltip","props","label","prefix","unit","coloring","rm","jsxs","Box","Flex","jsx","Text","getThemeColors","root","computedStyle","convertToRGB","color","useColors","colors","useMemo","themeColors","RoundedRectangle","fill","x","y","width","height","absHeight","XAxisLabel","stroke","payload","index","containerWidth","t","useTranslation","_x","CustomizedCross","Cross","CustomTooltip","active","todayStr","useRef","PnLBarChart","invisible","data","responsiveContainerProps","widthRef","ResponsiveContainer","cn","BarChart","Tooltip","CartesianGrid","ReferenceLine","Bar","entry","Cell","YAxis","XAxis","dataTransfer","series","acc","item","PnlLineChart","isMobile","useScreen","chartComponent","LineChart","Line","PnlAreaChart","colorId","useId","AreaChart","Fragment","Area","AssetLineChart","AssetAreaChart","opacity","tooltip","VolBarChart","isEmpty","pre","cur","maxVolume","decimal","number","decimalPlaces","abbreviations","toFixedWithoutRounding","num","fix","numStr","decimalIndex","cutoffIndex","import_plugin","chartPlugin","addComponents","addBase"],"mappings":"6NAAA,IAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,wBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,mBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,OAAA,CAAA,EAAA,UAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,EAAA,CAAA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UAAS,CACtBG,CAAAA,CAAeD,CAAAA,CAAO,OAAA,CAAQ,GAAG,CAAA,CAEvC,GAAIC,CAAAA,GAAiB,EAAA,EAAMF,IAAQ,CAAA,CACjC,OAAOC,EAAO,KAAA,CAAM,GAAG,EAAE,CAAC,CAAA,CAG5B,IAAME,CAAAA,CAAcD,EAAeF,CAAAA,CAAM,CAAA,CAEzC,OAAOC,CAAAA,CAAO,KAAA,CAAM,EAAGE,CAAW,CACpC,CCnNA,IAAAC,CAAAA,CAAmB,OAGNC,EAAAA,CAA6B,IAAA,IACxC,CAAA,CAAAhH,OAAAA,EAAO,SAAU,CAAE,aAAA,CAAAiH,EAAe,OAAA,CAAAC,CAAQ,EAAG,CAC3CD,CAAAA,CACE,CACE,QAAA,CAAU,CACR,gDAAA,CAAkD,CAChD,cAAe,OACjB,CAAA,CACA,gDAAiD,CAC/C,aAAA,CAAe,KACjB,CACF,CACF,CAAA,CACA,CACE,cAAe,KACjB,CACF,EACF,CAAC","file":"index.js","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","import { numberToHumanStyle } from \"@orderly.network/utils\";\n\nexport const tickFormatter = (value: number) => {\n const absValue = Math.abs(value);\n const dp = absValue === 0 ? 0 : absValue <= 10 ? 2 : absValue <= 100 ? 1 : 0;\n const formatted = numberToHumanStyle(absValue, dp);\n return value < 0 ? `-${formatted}` : formatted;\n};\n","import { Box, Flex, Text } from \"@orderly.network/ui\";\n\nexport const OrderlyChartTooltip = (props: {\n label: string;\n value: string | number;\n unit?: string;\n prefix?: React.ReactNode;\n titleClassName?: string;\n coloring?: boolean;\n dp?: number;\n rm?: number;\n}) => {\n const {\n label,\n value,\n prefix,\n unit = \"USDC\",\n coloring = false,\n dp,\n rm,\n } = props;\n return (\n <Box intensity={600} p={3} r=\"md\">\n <Flex direction={\"row\"} className={props.titleClassName}>\n {prefix}\n <Text.numeral\n unit={unit}\n as=\"div\"\n size=\"sm\"\n coloring={coloring}\n showIdentifier={coloring}\n unitClassName=\"oui-text-base-contrast-54 oui-ml-1\"\n weight=\"semibold\"\n rm={rm}\n dp={dp}\n >\n {value}\n </Text.numeral>\n </Flex>\n <Text size=\"2xs\" intensity={54} weight=\"semibold\">\n {label}\n </Text>\n </Box>\n );\n};\n","export const getThemeColors = () => {\n const root = document.documentElement;\n const computedStyle = getComputedStyle(root);\n\n const colors = {\n primary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary\")\n ),\n primaryLight: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary-light\")\n ),\n secondary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-secondary\")\n ),\n success: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-success\")\n ),\n warning: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-warning\")\n ),\n danger: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-danger\")),\n info: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-info\")),\n loss: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-loss\")\n ),\n profit: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-profit\")\n ),\n };\n\n return colors;\n};\n\nconst convertToRGB = (color: string) => {\n return `rgb(${color.split(\" \").join(\",\")})`;\n};\n","import { useMemo } from \"react\";\nimport { getThemeColors } from \"../utils/theme\";\n\nexport const useColors = (colors?: { profit: string; loss: string }) => {\n const _colors = useMemo(() => {\n const themeColors = getThemeColors();\n return {\n profit: colors?.profit || themeColors.profit,\n loss: colors?.loss || themeColors.loss,\n primary: themeColors.primary,\n primaryLight: themeColors.primaryLight,\n };\n }, [colors]);\n\n return _colors;\n};\n","import React, { useRef } from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { cn } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type PnLChartDataItem = {\n date: string;\n pnl: number;\n};\n\nexport type PnLChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: ReadonlyArray<PnLChartDataItem> | PnLChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst RoundedRectangle: React.FC<any> = (props) => {\n const { fill, x, y, width, height } = props;\n\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n />\n );\n};\n\nexport const XAxisLabel: React.FC<any> = (props) => {\n const { x, y, stroke, payload, index, width, containerWidth } = props;\n const { t } = useTranslation();\n const _x =\n index === 0\n ? 48\n : containerWidth > 0\n ? containerWidth - 10\n : width + payload.offset;\n\n return (\n <g transform={`translate(${_x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor={index === 0 ? \"start\" : \"end\"}\n // textAnchor={\"start\"}\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n\nconst CustomizedCross: React.FC<any> = (props) => {\n const { width, height, stroke, fill } = props;\n return (\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nexport const PnLBarChart: React.FC<PnLChartProps> = (props) => {\n const { invisible, data, responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const widthRef = useRef<number>(0);\n return (\n <ResponsiveContainer\n className={cn(invisible && \"chart-invisible\")}\n onResize={(width) => {\n widthRef.current = width;\n }}\n {...responsiveContainerProps}\n >\n <BarChart\n data={data as any[]}\n margin={{ left: -10, top: 10, right: 10, bottom: 30 }}\n >\n {!invisible && (\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip />}\n />\n )}\n\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n\n <ReferenceLine y={0} stroke=\"rgba(0,0,0,0.04)\" />\n\n {!invisible && (\n <Bar dataKey=\"pnl\" shape={<RoundedRectangle />}>\n {data.map((entry, index) => {\n return (\n <Cell\n key={`cell-${index}`}\n fill={entry.pnl > 0 ? colors.profit : colors.loss}\n />\n );\n })}\n </Bar>\n )}\n\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickFormatter={(value) => tickFormatter(value)}\n tickLine={false}\n axisLine={false}\n dataKey={\"pnl\"}\n />\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel containerWidth={widthRef.current} />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n </BarChart>\n </ResponsiveContainer>\n );\n};\n","import { useTranslation } from \"@orderly.network/i18n\";\n\nexport const XAxisLabel = (props: any) => {\n const { x, y, stroke, payload, index } = props;\n const { t } = useTranslation();\n return (\n <g transform={`translate(${x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor=\"end\"\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useMemo, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const chartComponent = (\n <LineChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useMemo, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n AreaChart,\n Area,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const colorId = useId();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const chartComponent = (\n <AreaChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor={colors.primary} offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor={colors.primary} offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = isMobile ? (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={(value) => tickFormatter(value)}\n />\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n ) : (\n <LineChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {/* <Legend /> */}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","import React from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport { Box, cn } from \"@orderly.network/ui\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type VolChartDataItem = {\n date: string;\n volume: number;\n opacity?: string | number;\n};\n\nexport type VolChartTooltip = {\n rm?: number;\n dp?: number;\n};\n\nexport type VolChartProps = {\n colors?: { fill: string };\n data: ReadonlyArray<VolChartDataItem> | VolChartDataItem[];\n tooltip?: VolChartTooltip;\n className?: string;\n};\n\nconst RoundedRectangle = (props: any) => {\n const { fill, x, y, width, height, opacity } = props;\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n opacity={opacity}\n />\n );\n};\n\nconst CustomizedCross = (props: any) => {\n const { width, height, payload, stroke, fill } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n return (\n // @ts-ignore\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip = (\n props: TooltipProps<any, any> & { tooltip?: VolChartTooltip },\n) => {\n const { active, payload, label, tooltip } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label}\n value={payload[0].value}\n // prefix=\"Commission\"\n titleClassName=\"oui-gap-4\"\n rm={tooltip?.rm}\n dp={tooltip?.dp}\n />\n );\n }\n\n return null;\n};\n\nexport const VolBarChart: React.FC<VolChartProps> = (props) => {\n const colors = useColors(\n props.colors?.fill\n ? { profit: props.colors?.fill, loss: props.colors?.fill }\n : undefined,\n );\n\n const isEmpty =\n (props.data as any)?.reduce((pre: any, cur: any) => pre + cur.volume, 0) ===\n 0;\n\n const maxVolume = (props.data as any)?.reduce(\n (pre: any, cur: any) => (pre > cur.volume ? pre : cur.volume),\n 0,\n );\n\n const decimal = maxVolume <= 10 ? 2 : maxVolume <= 100 ? 1 : 0;\n\n return (\n // @ts-ignore\n <Box className={cn(props.className)}>\n {/* @ts-ignore */}\n <ResponsiveContainer>\n {/* @ts-ignore */}\n <BarChart\n data={props.data as any[]}\n margin={{ left: -0, top: 6, right: 0, bottom: 20 }}\n >\n {/* @ts-ignore */}\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip tooltip={props.tooltip} />}\n />\n <CartesianGrid\n vertical={false}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.08}\n repeatCount={6}\n />\n {/* @ts-ignore */}\n <ReferenceLine y={0} stroke=\"#000\" />\n {/* @ts-ignore */}\n <Bar dataKey=\"volume\" shape={<RoundedRectangle />} minPointSize={1}>\n {props.data.map((entry, index) => {\n return (\n // @ts-ignore\n <Cell\n key={`cell-${index}`}\n fill={entry.volume > 0 ? colors.profit : colors.loss}\n opacity={entry.opacity}\n />\n );\n })}\n </Bar>\n {/* @ts-ignore */}\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n dataKey={\"volume\"}\n tickFormatter={(value, index) => {\n if (isEmpty) return `${index * 100}`;\n return numberToHumanStyle(value, decimal);\n }}\n width={45}\n />\n {/* @ts-ignore */}\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={props.data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n stroke=\"rgb(229, 231, 235)\"\n strokeOpacity={0.2}\n />\n </BarChart>\n </ResponsiveContainer>\n </Box>\n );\n};\nfunction numberToHumanStyle(number: number, decimalPlaces: number = 0): string {\n const abbreviations = [\"\", \"K\", \"M\", \"B\", \"T\"];\n\n let index = 0;\n while (number >= 1000 && index < abbreviations.length - 1) {\n number /= 1000;\n index++;\n }\n\n const roundedNumber = toFixedWithoutRounding(number, decimalPlaces);\n\n return `${roundedNumber}${abbreviations[index]}`;\n}\n\nfunction toFixedWithoutRounding(num: number, fix: number): string {\n const numStr = num.toString();\n const decimalIndex = numStr.indexOf(\".\");\n\n if (decimalIndex === -1 || fix === 0) {\n return numStr.split(\".\")[0];\n }\n\n const cutoffIndex = decimalIndex + fix + 1;\n\n return numStr.slice(0, cutoffIndex);\n}\n","import plugin from \"tailwindcss/plugin\";\nimport type { PluginCreator } from \"tailwindcss/types/config\";\n\nexport const chartPlugin: PluginCreator = () =>\n plugin(function ({ addComponents, addBase }) {\n addComponents(\n {\n \".xAxis\": {\n \".recharts-cartesian-axis-tick:first-child text\": {\n \"text-anchor\": \"start\",\n },\n \".recharts-cartesian-axis-tick:last-child text\": {\n \"text-anchor\": \"end\",\n },\n },\n },\n {\n respectPrefix: false,\n },\n );\n });\n"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/util/createPlugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/public/create-plugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/plugin.js","../src/utils/yTickFormatter.ts","../src/orderly/customTooltip.tsx","../src/utils/theme.ts","../src/orderly/useColors.ts","../src/orderly/pnlBar.tsx","../src/orderly/xAxisLabel.tsx","../src/orderly/pnlLine.tsx","../src/orderly/pnlArea.tsx","../src/orderly/assetLine.tsx","../src/orderly/assetArea.tsx","../src/orderly/volBar.tsx","../src/tailwindcss/theme.ts"],"names":["require_createPlugin","__commonJSMin","exports","_default","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","require_create_plugin","_createPlugin","_interop_require_default","obj","require_plugin","module","tickFormatter","value","absValue","dp","formatted","numberToHumanStyle","OrderlyChartTooltip","props","label","prefix","unit","coloring","rm","jsxs","Box","Flex","jsx","Text","getThemeColors","root","computedStyle","convertToRGB","color","useColors","colors","useMemo","themeColors","RoundedRectangle","fill","x","y","width","height","absHeight","XAxisLabel","stroke","payload","index","containerWidth","t","useTranslation","_x","CustomizedCross","Cross","CustomTooltip","active","todayStr","useRef","PnLBarChart","invisible","data","responsiveContainerProps","widthRef","ResponsiveContainer","cn","BarChart","Tooltip","CartesianGrid","ReferenceLine","Bar","entry","Cell","YAxis","XAxis","dataTransfer","series","acc","item","PnlLineChart","isMobile","useScreen","chartComponent","LineChart","Line","PnlAreaChart","colorId","useId","baseValue","a","b","AreaChart","Fragment","Area","AssetLineChart","AssetAreaChart","opacity","tooltip","VolBarChart","isEmpty","pre","cur","maxVolume","decimal","number","decimalPlaces","abbreviations","toFixedWithoutRounding","num","fix","numStr","decimalIndex","cutoffIndex","import_plugin","chartPlugin","addComponents","addBase"],"mappings":"6NAAA,IAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,wBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,mBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAA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A,CAAkD,CAChD,cAAe,OACjB,CAAA,CACA,gDAAiD,CAC/C,aAAA,CAAe,KACjB,CACF,CACF,CAAA,CACA,CACE,cAAe,KACjB,CACF,EACF,CAAC","file":"index.js","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","import { numberToHumanStyle } from \"@orderly.network/utils\";\n\nexport const tickFormatter = (value: number) => {\n const absValue = Math.abs(value);\n const dp = absValue === 0 ? 0 : absValue <= 10 ? 2 : absValue <= 100 ? 1 : 0;\n const formatted = numberToHumanStyle(absValue, dp);\n return value < 0 ? `-${formatted}` : formatted;\n};\n","import { Box, Flex, Text } from \"@orderly.network/ui\";\n\nexport const OrderlyChartTooltip = (props: {\n label: string;\n value: string | number;\n unit?: string;\n prefix?: React.ReactNode;\n titleClassName?: string;\n coloring?: boolean;\n dp?: number;\n rm?: number;\n}) => {\n const {\n label,\n value,\n prefix,\n unit = \"USDC\",\n coloring = false,\n dp,\n rm,\n } = props;\n return (\n <Box intensity={600} p={3} r=\"md\">\n <Flex direction={\"row\"} className={props.titleClassName}>\n {prefix}\n <Text.numeral\n unit={unit}\n as=\"div\"\n size=\"sm\"\n coloring={coloring}\n showIdentifier={coloring}\n unitClassName=\"oui-text-base-contrast-54 oui-ml-1\"\n weight=\"semibold\"\n rm={rm}\n dp={dp}\n >\n {value}\n </Text.numeral>\n </Flex>\n <Text size=\"2xs\" intensity={54} weight=\"semibold\">\n {label}\n </Text>\n </Box>\n );\n};\n","export const getThemeColors = () => {\n const root = document.documentElement;\n const computedStyle = getComputedStyle(root);\n\n const colors = {\n primary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary\")\n ),\n primaryLight: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary-light\")\n ),\n secondary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-secondary\")\n ),\n success: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-success\")\n ),\n warning: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-warning\")\n ),\n danger: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-danger\")),\n info: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-info\")),\n loss: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-loss\")\n ),\n profit: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-profit\")\n ),\n };\n\n return colors;\n};\n\nconst convertToRGB = (color: string) => {\n return `rgb(${color.split(\" \").join(\",\")})`;\n};\n","import { useMemo } from \"react\";\nimport { getThemeColors } from \"../utils/theme\";\n\nexport const useColors = (colors?: { profit: string; loss: string }) => {\n const _colors = useMemo(() => {\n const themeColors = getThemeColors();\n return {\n profit: colors?.profit || themeColors.profit,\n loss: colors?.loss || themeColors.loss,\n primary: themeColors.primary,\n primaryLight: themeColors.primaryLight,\n };\n }, [colors]);\n\n return _colors;\n};\n","import React, { useRef } from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { cn } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type PnLChartDataItem = {\n date: string;\n pnl: number;\n};\n\nexport type PnLChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: ReadonlyArray<PnLChartDataItem> | PnLChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst RoundedRectangle: React.FC<any> = (props) => {\n const { fill, x, y, width, height } = props;\n\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n />\n );\n};\n\nexport const XAxisLabel: React.FC<any> = (props) => {\n const { x, y, stroke, payload, index, width, containerWidth } = props;\n const { t } = useTranslation();\n const _x =\n index === 0\n ? 48\n : containerWidth > 0\n ? containerWidth - 10\n : width + payload.offset;\n\n return (\n <g transform={`translate(${_x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor={index === 0 ? \"start\" : \"end\"}\n // textAnchor={\"start\"}\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n\nconst CustomizedCross: React.FC<any> = (props) => {\n const { width, height, stroke, fill } = props;\n return (\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nexport const PnLBarChart: React.FC<PnLChartProps> = (props) => {\n const { invisible, data, responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const widthRef = useRef<number>(0);\n return (\n <ResponsiveContainer\n className={cn(invisible && \"chart-invisible\")}\n onResize={(width) => {\n widthRef.current = width;\n }}\n {...responsiveContainerProps}\n >\n <BarChart\n data={data as any[]}\n margin={{ left: -10, top: 10, right: 10, bottom: 30 }}\n >\n {!invisible && (\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip />}\n />\n )}\n\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n\n <ReferenceLine y={0} stroke=\"rgba(0,0,0,0.04)\" />\n\n {!invisible && (\n <Bar dataKey=\"pnl\" shape={<RoundedRectangle />}>\n {data.map((entry, index) => {\n return (\n <Cell\n key={`cell-${index}`}\n fill={entry.pnl > 0 ? colors.profit : colors.loss}\n />\n );\n })}\n </Bar>\n )}\n\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickFormatter={(value) => tickFormatter(value)}\n tickLine={false}\n axisLine={false}\n dataKey={\"pnl\"}\n />\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel containerWidth={widthRef.current} />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n </BarChart>\n </ResponsiveContainer>\n );\n};\n","import { useTranslation } from \"@orderly.network/i18n\";\n\nexport const XAxisLabel = (props: any) => {\n const { x, y, stroke, payload, index } = props;\n const { t } = useTranslation();\n return (\n <g transform={`translate(${x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor=\"end\"\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useMemo, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const chartComponent = (\n <LineChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useMemo, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n AreaChart,\n Area,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const colorId = useId();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const baseValue = useMemo(\n () => data.map((item) => item.pnl).sort((a, b) => a - b)[0] || 0,\n [data],\n );\n\n const chartComponent = (\n <AreaChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor={colors.primary} offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor={colors.primary} offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n baseValue={baseValue || 0}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = isMobile ? (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={(value) => tickFormatter(value)}\n />\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n ) : (\n <LineChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {/* <Legend /> */}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","import React from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport { Box, cn } from \"@orderly.network/ui\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type VolChartDataItem = {\n date: string;\n volume: number;\n opacity?: string | number;\n};\n\nexport type VolChartTooltip = {\n rm?: number;\n dp?: number;\n};\n\nexport type VolChartProps = {\n colors?: { fill: string };\n data: ReadonlyArray<VolChartDataItem> | VolChartDataItem[];\n tooltip?: VolChartTooltip;\n className?: string;\n};\n\nconst RoundedRectangle = (props: any) => {\n const { fill, x, y, width, height, opacity } = props;\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n opacity={opacity}\n />\n );\n};\n\nconst CustomizedCross = (props: any) => {\n const { width, height, payload, stroke, fill } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n return (\n // @ts-ignore\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip = (\n props: TooltipProps<any, any> & { tooltip?: VolChartTooltip },\n) => {\n const { active, payload, label, tooltip } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label}\n value={payload[0].value}\n // prefix=\"Commission\"\n titleClassName=\"oui-gap-4\"\n rm={tooltip?.rm}\n dp={tooltip?.dp}\n />\n );\n }\n\n return null;\n};\n\nexport const VolBarChart: React.FC<VolChartProps> = (props) => {\n const colors = useColors(\n props.colors?.fill\n ? { profit: props.colors?.fill, loss: props.colors?.fill }\n : undefined,\n );\n\n const isEmpty =\n (props.data as any)?.reduce((pre: any, cur: any) => pre + cur.volume, 0) ===\n 0;\n\n const maxVolume = (props.data as any)?.reduce(\n (pre: any, cur: any) => (pre > cur.volume ? pre : cur.volume),\n 0,\n );\n\n const decimal = maxVolume <= 10 ? 2 : maxVolume <= 100 ? 1 : 0;\n\n return (\n // @ts-ignore\n <Box className={cn(props.className)}>\n {/* @ts-ignore */}\n <ResponsiveContainer>\n {/* @ts-ignore */}\n <BarChart\n data={props.data as any[]}\n margin={{ left: -0, top: 6, right: 0, bottom: 20 }}\n >\n {/* @ts-ignore */}\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip tooltip={props.tooltip} />}\n />\n <CartesianGrid\n vertical={false}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.08}\n repeatCount={6}\n />\n {/* @ts-ignore */}\n <ReferenceLine y={0} stroke=\"#000\" />\n {/* @ts-ignore */}\n <Bar dataKey=\"volume\" shape={<RoundedRectangle />} minPointSize={1}>\n {props.data.map((entry, index) => {\n return (\n // @ts-ignore\n <Cell\n key={`cell-${index}`}\n fill={entry.volume > 0 ? colors.profit : colors.loss}\n opacity={entry.opacity}\n />\n );\n })}\n </Bar>\n {/* @ts-ignore */}\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n dataKey={\"volume\"}\n tickFormatter={(value, index) => {\n if (isEmpty) return `${index * 100}`;\n return numberToHumanStyle(value, decimal);\n }}\n width={45}\n />\n {/* @ts-ignore */}\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={props.data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n stroke=\"rgb(229, 231, 235)\"\n strokeOpacity={0.2}\n />\n </BarChart>\n </ResponsiveContainer>\n </Box>\n );\n};\nfunction numberToHumanStyle(number: number, decimalPlaces: number = 0): string {\n const abbreviations = [\"\", \"K\", \"M\", \"B\", \"T\"];\n\n let index = 0;\n while (number >= 1000 && index < abbreviations.length - 1) {\n number /= 1000;\n index++;\n }\n\n const roundedNumber = toFixedWithoutRounding(number, decimalPlaces);\n\n return `${roundedNumber}${abbreviations[index]}`;\n}\n\nfunction toFixedWithoutRounding(num: number, fix: number): string {\n const numStr = num.toString();\n const decimalIndex = numStr.indexOf(\".\");\n\n if (decimalIndex === -1 || fix === 0) {\n return numStr.split(\".\")[0];\n }\n\n const cutoffIndex = decimalIndex + fix + 1;\n\n return numStr.slice(0, cutoffIndex);\n}\n","import plugin from \"tailwindcss/plugin\";\nimport type { PluginCreator } from \"tailwindcss/types/config\";\n\nexport const chartPlugin: PluginCreator = () =>\n plugin(function ({ addComponents, addBase }) {\n addComponents(\n {\n \".xAxis\": {\n \".recharts-cartesian-axis-tick:first-child text\": {\n \"text-anchor\": \"start\",\n },\n \".recharts-cartesian-axis-tick:last-child text\": {\n \"text-anchor\": \"end\",\n },\n },\n },\n {\n respectPrefix: false,\n },\n );\n });\n"]}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {useMemo,useRef,useId}from'react';import {ResponsiveContainer,BarChart,Tooltip,CartesianGrid,ReferenceLine,Bar,Cell,YAxis,XAxis,LineChart,Line,AreaChart,Area,Cross}from'recharts';export{Area,AreaChart,Bar,BarChart,Cell,Line,LineChart}from'recharts';import {useTranslation}from'@orderly.network/i18n';import {cn,useScreen,Box,Flex,Text}from'@orderly.network/ui';import {numberToHumanStyle}from'@orderly.network/utils';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var E=Object.create;var A=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var b=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);var U=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of H(r))!Q.call(t,a)&&a!==e&&A(t,a,{get:()=>r[a],enumerable:!(o=Y(r,a))||o.enumerable});return t};var J=(t,r,e)=>(e=t!=null?E(q(t)):{},U(!t||!t.__esModule?A(e,"default",{value:t,enumerable:true}):e,t));var z=b(k=>{Object.defineProperty(k,"__esModule",{value:true});Object.defineProperty(k,"default",{enumerable:true,get:function(){return Xe}});function V(t,r){return {handler:t,config:r}}V.withOptions=function(t,r=()=>({})){let e=function(o){return {__options:o,handler:t(o),config:r(o)}};return e.__isOptionsFunction=true,e.__pluginFunction=t,e.__configFunction=r,e};var Xe=V;});var N=b(P=>{Object.defineProperty(P,"__esModule",{value:true});Object.defineProperty(P,"default",{enumerable:true,get:function(){return Ye}});var We=Ee(z());function Ee(t){return t&&t.__esModule?t:{default:t}}var Ye=We.default;});var $=b((ho,M)=>{var R=N();M.exports=(R.__esModule?R:{default:R}).default;});var d=t=>{let r=Math.abs(t),e=r===0?0:r<=10?2:r<=100?1:0,o=numberToHumanStyle(r,e);return t<0?`-${o}`:o};var p=t=>{let{label:r,value:e,prefix:o,unit:a="USDC",coloring:i=false,dp:n,rm:g}=t;return jsxs(Box,{intensity:600,p:3,r:"md",children:[jsxs(Flex,{direction:"row",className:t.titleClassName,children:[o,jsx(Text.numeral,{unit:a,as:"div",size:"sm",coloring:i,showIdentifier:i,unitClassName:"oui-text-base-contrast-54 oui-ml-1",weight:"semibold",rm:g,dp:n,children:e})]}),jsx(Text,{size:"2xs",intensity:54,weight:"semibold",children:r})]})};var S=()=>{let t=document.documentElement,r=getComputedStyle(t);return {primary:y(r.getPropertyValue("--oui-color-primary")),primaryLight:y(r.getPropertyValue("--oui-color-primary-light")),secondary:y(r.getPropertyValue("--oui-color-secondary")),success:y(r.getPropertyValue("--oui-color-success")),warning:y(r.getPropertyValue("--oui-color-warning")),danger:y(r.getPropertyValue("--oui-color-danger")),info:y(r.getPropertyValue("--oui-color-info")),loss:y(r.getPropertyValue("--oui-color-trading-loss")),profit:y(r.getPropertyValue("--oui-color-trading-profit"))}},y=t=>`rgb(${t.split(" ").join(",")})`;var m=t=>useMemo(()=>{let e=S();return {profit:t?.profit||e.profit,loss:t?.loss||e.loss,primary:e.primary,primaryLight:e.primaryLight}},[t]);var ft=t=>{let{fill:r,x:e,y:o,width:a,height:i}=t,n=Math.abs(i);return jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:n,stroke:"none",fill:r})},dt=t=>{let{x:r,y:e,stroke:o,payload:a,index:i,width:n,containerWidth:g}=t,{t:X}=useTranslation(),W=i===0?48:g>0?g-10:n+a.offset;return jsx("g",{transform:`translate(${W},${e-6})`,children:jsx("text",{x:0,y:0,dy:16,textAnchor:i===0?"start":"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:X("chart.now")})})},yt=t=>{let{width:r,height:e,stroke:o,fill:a}=t;return jsx(Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},ht=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},Ct=t=>{let{invisible:r,data:e,responsiveContainerProps:o}=t,a=m(t.colors),i=useRef(0);return jsx(ResponsiveContainer,{className:cn(r&&"chart-invisible"),onResize:n=>{i.current=n;},...o,children:jsxs(BarChart,{data:e,margin:{left:-10,top:10,right:10,bottom:30},children:[!r&&jsx(Tooltip,{cursor:jsx(yt,{}),content:jsx(ht,{})}),jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(ReferenceLine,{y:0,stroke:"rgba(0,0,0,0.04)"}),!r&&jsx(Bar,{dataKey:"pnl",shape:jsx(ft,{}),children:e.map((n,g)=>jsx(Cell,{fill:n.pnl>0?a.profit:a.loss},`cell-${g}`))}),jsx(YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickFormatter:n=>d(n),tickLine:false,axisLine:false,dataKey:"pnl"}),jsx(XAxis,{dataKey:"date",tickLine:false,interval:e.length-2,height:1,tick:jsx(dt,{containerWidth:i.current}),stroke:"#FFFFFF",strokeOpacity:.04})]})})};var h=t=>{let{x:r,y:e,stroke:o,payload:a,index:i}=t,{t:n}=useTranslation();return jsx("g",{transform:`translate(${r},${e-6})`,children:jsx("text",{x:0,y:0,dy:16,textAnchor:"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:n("chart.now")})})};var wt=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},_t=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},Bt=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=useScreen(),a=useMemo(()=>_t(t.data),[t.data]),i=jsxs(LineChart,{data:a,margin:{top:20,right:10,left:-10,bottom:0},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(wt,{})}),!t.invisible&&jsx(Line,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ht=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},qt=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},Qt=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=useScreen(),a=useId(),i=useMemo(()=>qt(t.data),[t.data]),n=jsxs(AreaChart,{data:i,margin:{top:20,right:10,left:-10,bottom:0},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(Ht,{})}),!t.invisible&&jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{stopColor:e.primary,offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:e.primary,offset:"100%",stopOpacity:0})]})}),jsx(Area,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${a})`})]})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:n})};var se=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},le=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=useId(),{isMobile:a}=useScreen(),i=a?jsxs(AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:n=>d(n)}),!t.invisible&&jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsx(Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]}):jsxs(LineChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(se,{})}),!t.invisible&&jsx(Line,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var xe=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},Fe=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=useId(),{isMobile:a}=useScreen(),i=jsxs(AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(h,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(xe,{})}),!t.invisible&&jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsx(Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ke=t=>{let{fill:r,x:e,y:o,width:a,height:i,opacity:n}=t,g=Math.abs(i);return jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:g,stroke:"none",fill:r,opacity:n})},Ve=t=>{let{width:r,height:e,payload:o,stroke:a,fill:i}=t;return o?.[0]?.value===0?null:jsx(Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},ze=t=>{let{active:r,payload:e,label:o,tooltip:a}=t;return e?.[0]?.value===0?null:r&&e&&e.length?jsx(p,{label:o,value:e[0].value,titleClassName:"oui-gap-4",rm:a?.rm,dp:a?.dp}):null},Ne=t=>{let r=m(t.colors?.fill?{profit:t.colors?.fill,loss:t.colors?.fill}:void 0),e=t.data?.reduce((i,n)=>i+n.volume,0)===0,o=t.data?.reduce((i,n)=>i>n.volume?i:n.volume,0),a=o<=10?2:o<=100?1:0;return jsx(Box,{className:cn(t.className),children:jsx(ResponsiveContainer,{children:jsxs(BarChart,{data:t.data,margin:{left:-0,top:6,right:0,bottom:20},children:[jsx(Tooltip,{cursor:jsx(Ve,{}),content:jsx(ze,{tooltip:t.tooltip})}),jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.08,repeatCount:6}),jsx(ReferenceLine,{y:0,stroke:"#000"}),jsx(Bar,{dataKey:"volume",shape:jsx(Ke,{}),minPointSize:1,children:t.data.map((i,n)=>jsx(Cell,{fill:i.volume>0?r.profit:r.loss,opacity:i.opacity},`cell-${n}`))}),jsx(YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,dataKey:"volume",tickFormatter:(i,n)=>e?`${n*100}`:Me(i,a),width:45}),jsx(XAxis,{dataKey:"date",tickLine:false,interval:t.data.length-2,height:1,tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},stroke:"rgb(229, 231, 235)",strokeOpacity:.2})]})})})};function Me(t,r=0){let e=["","K","M","B","T"],o=0;for(;t>=1e3&&o<e.length-1;)t/=1e3,o++;return `${$e(t,r)}${e[o]}`}function $e(t,r){let e=t.toString(),o=e.indexOf(".");if(o===-1||r===0)return e.split(".")[0];let a=o+r+1;return e.slice(0,a)}var G=J($()),He=()=>(0, G.default)(function({addComponents:t,addBase:r}){t({".xAxis":{".recharts-cartesian-axis-tick:first-child text":{"text-anchor":"start"},".recharts-cartesian-axis-tick:last-child text":{"text-anchor":"end"}}},{respectPrefix:false});});export{Fe as AssetAreaChart,le as AssetLineChart,Ct as PnLBarChart,Qt as PnlAreaChart,Bt as PnlLineChart,Ne as VolBarChart,He as chartPlugin};//# sourceMappingURL=index.mjs.map
1
+ import {useMemo,useRef,useId}from'react';import {ResponsiveContainer,BarChart,Tooltip,CartesianGrid,ReferenceLine,Bar,Cell,YAxis,XAxis,LineChart,Line,AreaChart,Area,Cross}from'recharts';export{Area,AreaChart,Bar,BarChart,Cell,Line,LineChart}from'recharts';import {useTranslation}from'@orderly.network/i18n';import {cn,useScreen,Box,Flex,Text}from'@orderly.network/ui';import {numberToHumanStyle}from'@orderly.network/utils';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var Y=Object.create;var L=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var F=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports);var J=(t,r,e,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of q(r))!U.call(t,a)&&a!==e&&L(t,a,{get:()=>r[a],enumerable:!(o=H(r,a))||o.enumerable});return t};var Z=(t,r,e)=>(e=t!=null?Y(Q(t)):{},J(!t||!t.__esModule?L(e,"default",{value:t,enumerable:true}):e,t));var $=F(R=>{Object.defineProperty(R,"__esModule",{value:true});Object.defineProperty(R,"default",{enumerable:true,get:function(){return Xe}});function M(t,r){return {handler:t,config:r}}M.withOptions=function(t,r=()=>({})){let e=function(o){return {__options:o,handler:t(o),config:r(o)}};return e.__isOptionsFunction=true,e.__pluginFunction=t,e.__configFunction=r,e};var Xe=M;});var G=F(A=>{Object.defineProperty(A,"__esModule",{value:true});Object.defineProperty(A,"default",{enumerable:true,get:function(){return Ye}});var We=Ee($());function Ee(t){return t&&t.__esModule?t:{default:t}}var Ye=We.default;});var W=F((ho,X)=>{var T=G();X.exports=(T.__esModule?T:{default:T}).default;});var d=t=>{let r=Math.abs(t),e=r===0?0:r<=10?2:r<=100?1:0,o=numberToHumanStyle(r,e);return t<0?`-${o}`:o};var p=t=>{let{label:r,value:e,prefix:o,unit:a="USDC",coloring:i=false,dp:n,rm:y}=t;return jsxs(Box,{intensity:600,p:3,r:"md",children:[jsxs(Flex,{direction:"row",className:t.titleClassName,children:[o,jsx(Text.numeral,{unit:a,as:"div",size:"sm",coloring:i,showIdentifier:i,unitClassName:"oui-text-base-contrast-54 oui-ml-1",weight:"semibold",rm:y,dp:n,children:e})]}),jsx(Text,{size:"2xs",intensity:54,weight:"semibold",children:r})]})};var _=()=>{let t=document.documentElement,r=getComputedStyle(t);return {primary:h(r.getPropertyValue("--oui-color-primary")),primaryLight:h(r.getPropertyValue("--oui-color-primary-light")),secondary:h(r.getPropertyValue("--oui-color-secondary")),success:h(r.getPropertyValue("--oui-color-success")),warning:h(r.getPropertyValue("--oui-color-warning")),danger:h(r.getPropertyValue("--oui-color-danger")),info:h(r.getPropertyValue("--oui-color-info")),loss:h(r.getPropertyValue("--oui-color-trading-loss")),profit:h(r.getPropertyValue("--oui-color-trading-profit"))}},h=t=>`rgb(${t.split(" ").join(",")})`;var m=t=>useMemo(()=>{let e=_();return {profit:t?.profit||e.profit,loss:t?.loss||e.loss,primary:e.primary,primaryLight:e.primaryLight}},[t]);var dt=t=>{let{fill:r,x:e,y:o,width:a,height:i}=t,n=Math.abs(i);return jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:n,stroke:"none",fill:r})},yt=t=>{let{x:r,y:e,stroke:o,payload:a,index:i,width:n,containerWidth:y}=t,{t:v}=useTranslation(),x=i===0?48:y>0?y-10:n+a.offset;return jsx("g",{transform:`translate(${x},${e-6})`,children:jsx("text",{x:0,y:0,dy:16,textAnchor:i===0?"start":"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:v("chart.now")})})},ht=t=>{let{width:r,height:e,stroke:o,fill:a}=t;return jsx(Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},Ct=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},gt=t=>{let{invisible:r,data:e,responsiveContainerProps:o}=t,a=m(t.colors),i=useRef(0);return jsx(ResponsiveContainer,{className:cn(r&&"chart-invisible"),onResize:n=>{i.current=n;},...o,children:jsxs(BarChart,{data:e,margin:{left:-10,top:10,right:10,bottom:30},children:[!r&&jsx(Tooltip,{cursor:jsx(ht,{}),content:jsx(Ct,{})}),jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(ReferenceLine,{y:0,stroke:"rgba(0,0,0,0.04)"}),!r&&jsx(Bar,{dataKey:"pnl",shape:jsx(dt,{}),children:e.map((n,y)=>jsx(Cell,{fill:n.pnl>0?a.profit:a.loss},`cell-${y}`))}),jsx(YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickFormatter:n=>d(n),tickLine:false,axisLine:false,dataKey:"pnl"}),jsx(XAxis,{dataKey:"date",tickLine:false,interval:e.length-2,height:1,tick:jsx(yt,{containerWidth:i.current}),stroke:"#FFFFFF",strokeOpacity:.04})]})})};var C=t=>{let{x:r,y:e,stroke:o,payload:a,index:i}=t,{t:n}=useTranslation();return jsx("g",{transform:`translate(${r},${e-6})`,children:jsx("text",{x:0,y:0,dy:16,textAnchor:"end",fontSize:10,fill:"rgba(255,255,255,0.54)",children:i===0?a.value:n("chart.now")})})};var _t=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},Bt=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},It=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=useScreen(),a=useMemo(()=>Bt(t.data),[t.data]),i=jsxs(LineChart,{data:a,margin:{top:20,right:10,left:-10,bottom:0},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(_t,{})}),!t.invisible&&jsx(Line,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ht=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value,coloring:true}):null},qt=t=>{let r=[];return t?.reduce((e,o)=>(e+=o.pnl,r.push({...o,pnl:e,_pnl:o.pnl}),e),0),r},Qt=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),{isMobile:o}=useScreen(),a=useId(),i=useMemo(()=>qt(t.data),[t.data]),n=useMemo(()=>i.map(v=>v.pnl).sort((v,x)=>v-x)[0]||0,[i]),y=jsxs(AreaChart,{data:i,margin:{top:20,right:10,left:-10,bottom:0},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"pnl",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(Ht,{})}),!t.invisible&&jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:a,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{stopColor:e.primary,offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:e.primary,offset:"100%",stopOpacity:0})]})}),jsx(Area,{type:"natural",dataKey:"pnl",stroke:e.primary,strokeWidth:o?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${a})`,baseValue:n||0})]})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:y})};var se=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},le=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=useId(),{isMobile:a}=useScreen(),i=a?jsxs(AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:n=>d(n)}),!t.invisible&&jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsx(Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]}):jsxs(LineChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(se,{})}),!t.invisible&&jsx(Line,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var xe=t=>{let{active:r,payload:e,label:o}=t,a=useRef(new Date().toISOString().split("T")[0]),{t:i}=useTranslation();return r&&e&&e.length?jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},Fe=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=useId(),{isMobile:a}=useScreen(),i=jsxs(AreaChart,{width:530,height:180,data:t.data,margin:{top:20,right:10,left:-20,bottom:-10},children:[jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.04}),jsx(XAxis,{dataKey:"date",interval:t.data.length-2,tick:jsx(C,{}),stroke:"#FFFFFF",strokeOpacity:.04}),jsx(YAxis,{dataKey:"account_value",tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,tickFormatter:d}),!t.invisible&&jsx(Tooltip,{cursor:{strokeDasharray:"3 2",strokeOpacity:.16},content:jsx(xe,{})}),!t.invisible&&jsxs(Fragment,{children:[jsx("defs",{children:jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsx("stop",{stopColor:"#00B49E",offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:"#00B49E",offset:"100%",stopOpacity:0})]})}),jsx(Area,{type:"natural",dataKey:"account_value",stroke:e.profit,strokeWidth:a?1.5:2,dot:false,isAnimationActive:false,fill:`url(#${o})`})]})]});return jsx(ResponsiveContainer,{className:t.invisible?"chart-invisible":void 0,...r,children:i})};var Ve=t=>{let{fill:r,x:e,y:o,width:a,height:i,opacity:n}=t,y=Math.abs(i);return jsx("rect",{rx:2,x:e,y:i>0?o:o+i,width:a,height:y,stroke:"none",fill:r,opacity:n})},Ke=t=>{let{width:r,height:e,payload:o,stroke:a,fill:i}=t;return o?.[0]?.value===0?null:jsx(Cross,{x:t.x+t.width/2,top:t.top,height:e,width:1,stroke:"rgba(255,255,255,0.16)",strokeDasharray:"3 2",fill:"none"})},ze=t=>{let{active:r,payload:e,label:o,tooltip:a}=t;return e?.[0]?.value===0?null:r&&e&&e.length?jsx(p,{label:o,value:e[0].value,titleClassName:"oui-gap-4",rm:a?.rm,dp:a?.dp}):null},Ne=t=>{let r=m(t.colors?.fill?{profit:t.colors?.fill,loss:t.colors?.fill}:void 0),e=t.data?.reduce((i,n)=>i+n.volume,0)===0,o=t.data?.reduce((i,n)=>i>n.volume?i:n.volume,0),a=o<=10?2:o<=100?1:0;return jsx(Box,{className:cn(t.className),children:jsx(ResponsiveContainer,{children:jsxs(BarChart,{data:t.data,margin:{left:-0,top:6,right:0,bottom:20},children:[jsx(Tooltip,{cursor:jsx(Ke,{}),content:jsx(ze,{tooltip:t.tooltip})}),jsx(CartesianGrid,{vertical:false,stroke:"#FFFFFF",strokeOpacity:.08,repeatCount:6}),jsx(ReferenceLine,{y:0,stroke:"#000"}),jsx(Bar,{dataKey:"volume",shape:jsx(Ve,{}),minPointSize:1,children:t.data.map((i,n)=>jsx(Cell,{fill:i.volume>0?r.profit:r.loss,opacity:i.opacity},`cell-${n}`))}),jsx(YAxis,{tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},tickLine:false,axisLine:false,dataKey:"volume",tickFormatter:(i,n)=>e?`${n*100}`:Me(i,a),width:45}),jsx(XAxis,{dataKey:"date",tickLine:false,interval:t.data.length-2,height:1,tick:{fontSize:10,fill:"rgba(255,255,255,0.54)"},stroke:"rgb(229, 231, 235)",strokeOpacity:.2})]})})})};function Me(t,r=0){let e=["","K","M","B","T"],o=0;for(;t>=1e3&&o<e.length-1;)t/=1e3,o++;return `${$e(t,r)}${e[o]}`}function $e(t,r){let e=t.toString(),o=e.indexOf(".");if(o===-1||r===0)return e.split(".")[0];let a=o+r+1;return e.slice(0,a)}var E=Z(W()),He=()=>(0, E.default)(function({addComponents:t,addBase:r}){t({".xAxis":{".recharts-cartesian-axis-tick:first-child text":{"text-anchor":"start"},".recharts-cartesian-axis-tick:last-child text":{"text-anchor":"end"}}},{respectPrefix:false});});export{Fe as AssetAreaChart,le as AssetLineChart,gt as PnLBarChart,Qt as PnlAreaChart,It as PnlLineChart,Ne as VolBarChart,He as chartPlugin};//# sourceMappingURL=index.mjs.map
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/util/createPlugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/public/create-plugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/plugin.js","../src/utils/yTickFormatter.ts","../src/orderly/customTooltip.tsx","../src/utils/theme.ts","../src/orderly/useColors.ts","../src/orderly/pnlBar.tsx","../src/orderly/xAxisLabel.tsx","../src/orderly/pnlLine.tsx","../src/orderly/pnlArea.tsx","../src/orderly/assetLine.tsx","../src/orderly/assetArea.tsx","../src/orderly/volBar.tsx","../src/tailwindcss/theme.ts"],"names":["require_createPlugin","__commonJSMin","exports","_default","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","require_create_plugin","_createPlugin","_interop_require_default","obj","require_plugin","module","tickFormatter","value","absValue","dp","formatted","numberToHumanStyle","OrderlyChartTooltip","props","label","prefix","unit","coloring","rm","jsxs","Box","Flex","jsx","Text","getThemeColors","root","computedStyle","convertToRGB","color","useColors","colors","useMemo","themeColors","RoundedRectangle","fill","x","y","width","height","absHeight","XAxisLabel","stroke","payload","index","containerWidth","t","useTranslation","_x","CustomizedCross","Cross","CustomTooltip","active","todayStr","useRef","PnLBarChart","invisible","data","responsiveContainerProps","widthRef","ResponsiveContainer","cn","BarChart","Tooltip","CartesianGrid","ReferenceLine","Bar","entry","Cell","YAxis","XAxis","dataTransfer","series","acc","item","PnlLineChart","isMobile","useScreen","chartComponent","LineChart","Line","PnlAreaChart","colorId","useId","AreaChart","Fragment","Area","AssetLineChart","AssetAreaChart","opacity","tooltip","VolBarChart","isEmpty","pre","cur","maxVolume","decimal","number","decimalPlaces","abbreviations","toFixedWithoutRounding","num","fix","numStr","decimalIndex","cutoffIndex","import_plugin","chartPl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AU,CAAE,aAAA,CAAAiH,EAAe,OAAA,CAAAC,CAAQ,EAAG,CAC3CD,CAAAA,CACE,CACE,QAAA,CAAU,CACR,gDAAA,CAAkD,CAChD,cAAe,OACjB,CAAA,CACA,gDAAiD,CAC/C,aAAA,CAAe,KACjB,CACF,CACF,CAAA,CACA,CACE,cAAe,KACjB,CACF,EACF,CAAC","file":"index.mjs","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","import { numberToHumanStyle } from \"@orderly.network/utils\";\n\nexport const tickFormatter = (value: number) => {\n const absValue = Math.abs(value);\n const dp = absValue === 0 ? 0 : absValue <= 10 ? 2 : absValue <= 100 ? 1 : 0;\n const formatted = numberToHumanStyle(absValue, dp);\n return value < 0 ? `-${formatted}` : formatted;\n};\n","import { Box, Flex, Text } from \"@orderly.network/ui\";\n\nexport const OrderlyChartTooltip = (props: {\n label: string;\n value: string | number;\n unit?: string;\n prefix?: React.ReactNode;\n titleClassName?: string;\n coloring?: boolean;\n dp?: number;\n rm?: number;\n}) => {\n const {\n label,\n value,\n prefix,\n unit = \"USDC\",\n coloring = false,\n dp,\n rm,\n } = props;\n return (\n <Box intensity={600} p={3} r=\"md\">\n <Flex direction={\"row\"} className={props.titleClassName}>\n {prefix}\n <Text.numeral\n unit={unit}\n as=\"div\"\n size=\"sm\"\n coloring={coloring}\n showIdentifier={coloring}\n unitClassName=\"oui-text-base-contrast-54 oui-ml-1\"\n weight=\"semibold\"\n rm={rm}\n dp={dp}\n >\n {value}\n </Text.numeral>\n </Flex>\n <Text size=\"2xs\" intensity={54} weight=\"semibold\">\n {label}\n </Text>\n </Box>\n );\n};\n","export const getThemeColors = () => {\n const root = document.documentElement;\n const computedStyle = getComputedStyle(root);\n\n const colors = {\n primary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary\")\n ),\n primaryLight: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary-light\")\n ),\n secondary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-secondary\")\n ),\n success: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-success\")\n ),\n warning: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-warning\")\n ),\n danger: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-danger\")),\n info: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-info\")),\n loss: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-loss\")\n ),\n profit: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-profit\")\n ),\n };\n\n return colors;\n};\n\nconst convertToRGB = (color: string) => {\n return `rgb(${color.split(\" \").join(\",\")})`;\n};\n","import { useMemo } from \"react\";\nimport { getThemeColors } from \"../utils/theme\";\n\nexport const useColors = (colors?: { profit: string; loss: string }) => {\n const _colors = useMemo(() => {\n const themeColors = getThemeColors();\n return {\n profit: colors?.profit || themeColors.profit,\n loss: colors?.loss || themeColors.loss,\n primary: themeColors.primary,\n primaryLight: themeColors.primaryLight,\n };\n }, [colors]);\n\n return _colors;\n};\n","import React, { useRef } from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { cn } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type PnLChartDataItem = {\n date: string;\n pnl: number;\n};\n\nexport type PnLChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: ReadonlyArray<PnLChartDataItem> | PnLChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst RoundedRectangle: React.FC<any> = (props) => {\n const { fill, x, y, width, height } = props;\n\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n />\n );\n};\n\nexport const XAxisLabel: React.FC<any> = (props) => {\n const { x, y, stroke, payload, index, width, containerWidth } = props;\n const { t } = useTranslation();\n const _x =\n index === 0\n ? 48\n : containerWidth > 0\n ? containerWidth - 10\n : width + payload.offset;\n\n return (\n <g transform={`translate(${_x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor={index === 0 ? \"start\" : \"end\"}\n // textAnchor={\"start\"}\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n\nconst CustomizedCross: React.FC<any> = (props) => {\n const { width, height, stroke, fill } = props;\n return (\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nexport const PnLBarChart: React.FC<PnLChartProps> = (props) => {\n const { invisible, data, responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const widthRef = useRef<number>(0);\n return (\n <ResponsiveContainer\n className={cn(invisible && \"chart-invisible\")}\n onResize={(width) => {\n widthRef.current = width;\n }}\n {...responsiveContainerProps}\n >\n <BarChart\n data={data as any[]}\n margin={{ left: -10, top: 10, right: 10, bottom: 30 }}\n >\n {!invisible && (\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip />}\n />\n )}\n\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n\n <ReferenceLine y={0} stroke=\"rgba(0,0,0,0.04)\" />\n\n {!invisible && (\n <Bar dataKey=\"pnl\" shape={<RoundedRectangle />}>\n {data.map((entry, index) => {\n return (\n <Cell\n key={`cell-${index}`}\n fill={entry.pnl > 0 ? colors.profit : colors.loss}\n />\n );\n })}\n </Bar>\n )}\n\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickFormatter={(value) => tickFormatter(value)}\n tickLine={false}\n axisLine={false}\n dataKey={\"pnl\"}\n />\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel containerWidth={widthRef.current} />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n </BarChart>\n </ResponsiveContainer>\n );\n};\n","import { useTranslation } from \"@orderly.network/i18n\";\n\nexport const XAxisLabel = (props: any) => {\n const { x, y, stroke, payload, index } = props;\n const { t } = useTranslation();\n return (\n <g transform={`translate(${x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor=\"end\"\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useMemo, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const chartComponent = (\n <LineChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useMemo, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n AreaChart,\n Area,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const colorId = useId();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const chartComponent = (\n <AreaChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor={colors.primary} offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor={colors.primary} offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = isMobile ? (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={(value) => tickFormatter(value)}\n />\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n ) : (\n <LineChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {/* <Legend /> */}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","import React from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport { Box, cn } from \"@orderly.network/ui\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type VolChartDataItem = {\n date: string;\n volume: number;\n opacity?: string | number;\n};\n\nexport type VolChartTooltip = {\n rm?: number;\n dp?: number;\n};\n\nexport type VolChartProps = {\n colors?: { fill: string };\n data: ReadonlyArray<VolChartDataItem> | VolChartDataItem[];\n tooltip?: VolChartTooltip;\n className?: string;\n};\n\nconst RoundedRectangle = (props: any) => {\n const { fill, x, y, width, height, opacity } = props;\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n opacity={opacity}\n />\n );\n};\n\nconst CustomizedCross = (props: any) => {\n const { width, height, payload, stroke, fill } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n return (\n // @ts-ignore\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip = (\n props: TooltipProps<any, any> & { tooltip?: VolChartTooltip },\n) => {\n const { active, payload, label, tooltip } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label}\n value={payload[0].value}\n // prefix=\"Commission\"\n titleClassName=\"oui-gap-4\"\n rm={tooltip?.rm}\n dp={tooltip?.dp}\n />\n );\n }\n\n return null;\n};\n\nexport const VolBarChart: React.FC<VolChartProps> = (props) => {\n const colors = useColors(\n props.colors?.fill\n ? { profit: props.colors?.fill, loss: props.colors?.fill }\n : undefined,\n );\n\n const isEmpty =\n (props.data as any)?.reduce((pre: any, cur: any) => pre + cur.volume, 0) ===\n 0;\n\n const maxVolume = (props.data as any)?.reduce(\n (pre: any, cur: any) => (pre > cur.volume ? pre : cur.volume),\n 0,\n );\n\n const decimal = maxVolume <= 10 ? 2 : maxVolume <= 100 ? 1 : 0;\n\n return (\n // @ts-ignore\n <Box className={cn(props.className)}>\n {/* @ts-ignore */}\n <ResponsiveContainer>\n {/* @ts-ignore */}\n <BarChart\n data={props.data as any[]}\n margin={{ left: -0, top: 6, right: 0, bottom: 20 }}\n >\n {/* @ts-ignore */}\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip tooltip={props.tooltip} />}\n />\n <CartesianGrid\n vertical={false}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.08}\n repeatCount={6}\n />\n {/* @ts-ignore */}\n <ReferenceLine y={0} stroke=\"#000\" />\n {/* @ts-ignore */}\n <Bar dataKey=\"volume\" shape={<RoundedRectangle />} minPointSize={1}>\n {props.data.map((entry, index) => {\n return (\n // @ts-ignore\n <Cell\n key={`cell-${index}`}\n fill={entry.volume > 0 ? colors.profit : colors.loss}\n opacity={entry.opacity}\n />\n );\n })}\n </Bar>\n {/* @ts-ignore */}\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n dataKey={\"volume\"}\n tickFormatter={(value, index) => {\n if (isEmpty) return `${index * 100}`;\n return numberToHumanStyle(value, decimal);\n }}\n width={45}\n />\n {/* @ts-ignore */}\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={props.data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n stroke=\"rgb(229, 231, 235)\"\n strokeOpacity={0.2}\n />\n </BarChart>\n </ResponsiveContainer>\n </Box>\n );\n};\nfunction numberToHumanStyle(number: number, decimalPlaces: number = 0): string {\n const abbreviations = [\"\", \"K\", \"M\", \"B\", \"T\"];\n\n let index = 0;\n while (number >= 1000 && index < abbreviations.length - 1) {\n number /= 1000;\n index++;\n }\n\n const roundedNumber = toFixedWithoutRounding(number, decimalPlaces);\n\n return `${roundedNumber}${abbreviations[index]}`;\n}\n\nfunction toFixedWithoutRounding(num: number, fix: number): string {\n const numStr = num.toString();\n const decimalIndex = numStr.indexOf(\".\");\n\n if (decimalIndex === -1 || fix === 0) {\n return numStr.split(\".\")[0];\n }\n\n const cutoffIndex = decimalIndex + fix + 1;\n\n return numStr.slice(0, cutoffIndex);\n}\n","import plugin from \"tailwindcss/plugin\";\nimport type { PluginCreator } from \"tailwindcss/types/config\";\n\nexport const chartPlugin: PluginCreator = () =>\n plugin(function ({ addComponents, addBase }) {\n addComponents(\n {\n \".xAxis\": {\n \".recharts-cartesian-axis-tick:first-child text\": {\n \"text-anchor\": \"start\",\n },\n \".recharts-cartesian-axis-tick:last-child text\": {\n \"text-anchor\": \"end\",\n },\n },\n },\n {\n respectPrefix: false,\n },\n );\n });\n"]}
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/util/createPlugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/lib/public/create-plugin.js","../../../node_modules/.pnpm/tailwindcss@3.4.17_ts-node@10.9.2_@swc+core@1.13.2_@swc+helpers@0.5.17__@types+node@24.3.1_typescript@5.8.3_/node_modules/tailwindcss/plugin.js","../src/utils/yTickFormatter.ts","../src/orderly/customTooltip.tsx","../src/utils/theme.ts","../src/orderly/useColors.ts","../src/orderly/pnlBar.tsx","../src/orderly/xAxisLabel.tsx","../src/orderly/pnlLine.tsx","../src/orderly/pnlArea.tsx","../src/orderly/assetLine.tsx","../src/orderly/assetArea.tsx","../src/orderly/volBar.tsx","../src/tailwindcss/theme.ts"],"names":["require_createPlugin","__commonJSMin","exports","_default","createPlugin","plugin","config","pluginFunction","configFunction","optionsFunction","options","require_create_plugin","_createPlugin","_interop_require_default","obj","require_plugin","module","tickFormatter","value","absValue","dp","formatted","numberToHumanStyle","OrderlyChartTooltip","props","label","prefix","unit","coloring","rm","jsxs","Box","Flex","jsx","Text","getThemeColors","root","computedStyle","convertToRGB","color","useColors","colors","useMemo","themeColors","RoundedRectangle","fill","x","y","width","height","absHeight","XAxisLabel","stroke","payload","index","containerWidth","t","useTranslation","_x","CustomizedCross","Cross","CustomTooltip","active","todayStr","useRef","PnLBarChart","invisible","data","responsiveContainerProps","widthRef","ResponsiveContainer","cn","BarChart","Tooltip","CartesianGrid","ReferenceLine","Bar","entry","Cell","YAxis","XAxis","dataTransfer","series","acc","item","PnlLineChart","isMobile","useScreen","chartComponent","LineChart","Line","PnlAreaChart","colorId","useId","baseValue","a","b","AreaChart","Fragment","Area","AssetLineChart","AssetAreaChart","opacity","tooltip","VolBarChart","isEmpty","pre","cur","maxVolume","decimal","number","decimalPlaces","abbreviations","toFixedWithoutRounding","num","fix","numStr","decimalIndex","cutoffIndex","import_plugin","chartPlugin","addComponents","addBase"],"mappings":"0dAAA,IAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,wBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,mBAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,cAAA,CAAA,CAAA,CAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA,OAAA,CAAA,EAAA,QAAA,EAAA,OAAA,CAAA,EAAA,UAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA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ACZ,KAAOwD,CAAAA,EAAU,KAAQxD,CAAAA,CAAQ0D,CAAAA,CAAc,MAAA,CAAS,CAAA,EACtDF,GAAU,GAAA,CACVxD,CAAAA,EAAAA,CAKF,OAAO,CAAA,EAFe2D,EAAAA,CAAuBH,EAAQC,CAAa,CAE3C,CAAA,EAAGC,CAAAA,CAAc1D,CAAK,CAAC,CAAA,CAChD,CAEA,SAAS2D,EAAAA,CAAuBC,EAAaC,CAAAA,CAAqB,CAChE,IAAMC,CAAAA,CAASF,EAAI,QAAA,EAAS,CACtBG,EAAeD,CAAAA,CAAO,OAAA,CAAQ,GAAG,CAAA,CAEvC,GAAIC,CAAAA,GAAiB,EAAA,EAAMF,IAAQ,CAAA,CACjC,OAAOC,EAAO,KAAA,CAAM,GAAG,EAAE,CAAC,CAAA,CAG5B,IAAME,CAAAA,CAAcD,EAAeF,CAAAA,CAAM,CAAA,CAEzC,OAAOC,CAAAA,CAAO,KAAA,CAAM,EAAGE,CAAW,CACpC,CCnNA,IAAAC,CAAAA,CAAmB,OAGNC,EAAAA,CAA6B,IAAA,IACxC,CAAA,CAAAnH,OAAAA,EAAO,SAAU,CAAE,aAAA,CAAAoH,EAAe,OAAA,CAAAC,CAAQ,EAAG,CAC3CD,CAAAA,CACE,CACE,QAAA,CAAU,CACR,gDAAA,CAAkD,CAChD,cAAe,OACjB,CAAA,CACA,gDAAiD,CAC/C,aAAA,CAAe,KACjB,CACF,CACF,CAAA,CACA,CACE,cAAe,KACjB,CACF,EACF,CAAC","file":"index.mjs","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nfunction createPlugin(plugin, config) {\n return {\n handler: plugin,\n config\n };\n}\ncreatePlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {\n const optionsFunction = function(options) {\n return {\n __options: options,\n handler: pluginFunction(options),\n config: configFunction(options)\n };\n };\n optionsFunction.__isOptionsFunction = true;\n // Expose plugin dependencies so that `object-hash` returns a different\n // value if anything here changes, to ensure a rebuild is triggered.\n optionsFunction.__pluginFunction = pluginFunction;\n optionsFunction.__configFunction = configFunction;\n return optionsFunction;\n};\nconst _default = createPlugin;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function() {\n return _default;\n }\n});\nconst _createPlugin = /*#__PURE__*/ _interop_require_default(require(\"../util/createPlugin\"));\nfunction _interop_require_default(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\nconst _default = _createPlugin.default;\n","let createPlugin = require('./lib/public/create-plugin')\nmodule.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default\n","import { numberToHumanStyle } from \"@orderly.network/utils\";\n\nexport const tickFormatter = (value: number) => {\n const absValue = Math.abs(value);\n const dp = absValue === 0 ? 0 : absValue <= 10 ? 2 : absValue <= 100 ? 1 : 0;\n const formatted = numberToHumanStyle(absValue, dp);\n return value < 0 ? `-${formatted}` : formatted;\n};\n","import { Box, Flex, Text } from \"@orderly.network/ui\";\n\nexport const OrderlyChartTooltip = (props: {\n label: string;\n value: string | number;\n unit?: string;\n prefix?: React.ReactNode;\n titleClassName?: string;\n coloring?: boolean;\n dp?: number;\n rm?: number;\n}) => {\n const {\n label,\n value,\n prefix,\n unit = \"USDC\",\n coloring = false,\n dp,\n rm,\n } = props;\n return (\n <Box intensity={600} p={3} r=\"md\">\n <Flex direction={\"row\"} className={props.titleClassName}>\n {prefix}\n <Text.numeral\n unit={unit}\n as=\"div\"\n size=\"sm\"\n coloring={coloring}\n showIdentifier={coloring}\n unitClassName=\"oui-text-base-contrast-54 oui-ml-1\"\n weight=\"semibold\"\n rm={rm}\n dp={dp}\n >\n {value}\n </Text.numeral>\n </Flex>\n <Text size=\"2xs\" intensity={54} weight=\"semibold\">\n {label}\n </Text>\n </Box>\n );\n};\n","export const getThemeColors = () => {\n const root = document.documentElement;\n const computedStyle = getComputedStyle(root);\n\n const colors = {\n primary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary\")\n ),\n primaryLight: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-primary-light\")\n ),\n secondary: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-secondary\")\n ),\n success: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-success\")\n ),\n warning: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-warning\")\n ),\n danger: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-danger\")),\n info: convertToRGB(computedStyle.getPropertyValue(\"--oui-color-info\")),\n loss: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-loss\")\n ),\n profit: convertToRGB(\n computedStyle.getPropertyValue(\"--oui-color-trading-profit\")\n ),\n };\n\n return colors;\n};\n\nconst convertToRGB = (color: string) => {\n return `rgb(${color.split(\" \").join(\",\")})`;\n};\n","import { useMemo } from \"react\";\nimport { getThemeColors } from \"../utils/theme\";\n\nexport const useColors = (colors?: { profit: string; loss: string }) => {\n const _colors = useMemo(() => {\n const themeColors = getThemeColors();\n return {\n profit: colors?.profit || themeColors.profit,\n loss: colors?.loss || themeColors.loss,\n primary: themeColors.primary,\n primaryLight: themeColors.primaryLight,\n };\n }, [colors]);\n\n return _colors;\n};\n","import React, { useRef } from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { cn } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type PnLChartDataItem = {\n date: string;\n pnl: number;\n};\n\nexport type PnLChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: ReadonlyArray<PnLChartDataItem> | PnLChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst RoundedRectangle: React.FC<any> = (props) => {\n const { fill, x, y, width, height } = props;\n\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n />\n );\n};\n\nexport const XAxisLabel: React.FC<any> = (props) => {\n const { x, y, stroke, payload, index, width, containerWidth } = props;\n const { t } = useTranslation();\n const _x =\n index === 0\n ? 48\n : containerWidth > 0\n ? containerWidth - 10\n : width + payload.offset;\n\n return (\n <g transform={`translate(${_x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor={index === 0 ? \"start\" : \"end\"}\n // textAnchor={\"start\"}\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n\nconst CustomizedCross: React.FC<any> = (props) => {\n const { width, height, stroke, fill } = props;\n return (\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nexport const PnLBarChart: React.FC<PnLChartProps> = (props) => {\n const { invisible, data, responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const widthRef = useRef<number>(0);\n return (\n <ResponsiveContainer\n className={cn(invisible && \"chart-invisible\")}\n onResize={(width) => {\n widthRef.current = width;\n }}\n {...responsiveContainerProps}\n >\n <BarChart\n data={data as any[]}\n margin={{ left: -10, top: 10, right: 10, bottom: 30 }}\n >\n {!invisible && (\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip />}\n />\n )}\n\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n\n <ReferenceLine y={0} stroke=\"rgba(0,0,0,0.04)\" />\n\n {!invisible && (\n <Bar dataKey=\"pnl\" shape={<RoundedRectangle />}>\n {data.map((entry, index) => {\n return (\n <Cell\n key={`cell-${index}`}\n fill={entry.pnl > 0 ? colors.profit : colors.loss}\n />\n );\n })}\n </Bar>\n )}\n\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickFormatter={(value) => tickFormatter(value)}\n tickLine={false}\n axisLine={false}\n dataKey={\"pnl\"}\n />\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel containerWidth={widthRef.current} />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n </BarChart>\n </ResponsiveContainer>\n );\n};\n","import { useTranslation } from \"@orderly.network/i18n\";\n\nexport const XAxisLabel = (props: any) => {\n const { x, y, stroke, payload, index } = props;\n const { t } = useTranslation();\n return (\n <g transform={`translate(${x},${y - 6})`}>\n <text\n x={0}\n y={0}\n dy={16}\n textAnchor=\"end\"\n fontSize={10}\n fill={\"rgba(255,255,255,0.54)\"}\n >\n {index === 0 ? payload.value : t(\"chart.now\")}\n </text>\n </g>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useMemo, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const chartComponent = (\n <LineChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useMemo, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n AreaChart,\n Area,\n Tooltip,\n ResponsiveContainer,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: any;\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n coloring\n />\n );\n }\n\n return null;\n};\n\nconst dataTransfer = (data: any[]) => {\n const series: any[] = [];\n data?.reduce<any>((acc, item) => {\n acc += item.pnl;\n series.push({ ...item, pnl: acc, _pnl: item.pnl });\n return acc;\n }, 0);\n return series;\n};\n\nexport const PnlAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n\n const { isMobile } = useScreen();\n\n const colorId = useId();\n\n const data = useMemo(() => dataTransfer(props.data), [props.data]);\n\n const baseValue = useMemo(\n () => data.map((item) => item.pnl).sort((a, b) => a - b)[0] || 0,\n [data],\n );\n\n const chartComponent = (\n <AreaChart\n data={data}\n margin={{ top: 20, right: 10, left: -10, bottom: 0 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"pnl\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor={colors.primary} offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor={colors.primary} offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"pnl\"\n stroke={colors.primary}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n baseValue={baseValue || 0}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n LineChart,\n XAxis,\n YAxis,\n Line,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlLineChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetLineChart: React.FC<PnlLineChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = isMobile ? (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={(value) => tickFormatter(value)}\n />\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n ) : (\n <LineChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {/* <Legend /> */}\n {!props.invisible && (\n <Line\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n />\n )}\n </LineChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useId, useRef } from \"react\";\nimport {\n XAxis,\n YAxis,\n CartesianGrid,\n Tooltip,\n ResponsiveContainer,\n AreaChart,\n Area,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport type { Props as ResponsiveContainerProps } from \"recharts/types/component/ResponsiveContainer\";\nimport { useTranslation } from \"@orderly.network/i18n\";\nimport { useScreen } from \"@orderly.network/ui\";\nimport { tickFormatter } from \"../utils/yTickFormatter\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\nimport { XAxisLabel } from \"./xAxisLabel\";\n\nexport type AssetChartDataItem = {\n date: string;\n account_value: number;\n};\n\nexport type PnlAreaChartProps = {\n colors?: {\n profit: string;\n loss: string;\n };\n data: AssetChartDataItem[];\n invisible?: boolean;\n responsiveContainerProps?: Omit<ResponsiveContainerProps, \"children\">;\n};\n\nconst CustomTooltip: React.FC<TooltipProps<any, any>> = (props) => {\n const { active, payload, label } = props;\n const todayStr = useRef(new Date().toISOString().split(\"T\")[0]);\n const { t } = useTranslation();\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label === todayStr.current ? t(\"chart.now\") : label}\n value={payload[0].value}\n />\n );\n }\n\n return null;\n};\n\nexport const AssetAreaChart: React.FC<PnlAreaChartProps> = (props) => {\n const { responsiveContainerProps } = props;\n const colors = useColors(props.colors);\n const colorId = useId();\n const { isMobile } = useScreen();\n const chartComponent = (\n <AreaChart\n width={530}\n height={180}\n data={props.data}\n margin={{ top: 20, right: 10, left: -20, bottom: -10 }}\n >\n <CartesianGrid vertical={false} stroke=\"#FFFFFF\" strokeOpacity={0.04} />\n <XAxis\n dataKey=\"date\"\n interval={props.data.length - 2}\n // tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tick={<XAxisLabel />}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.04}\n />\n <YAxis\n dataKey=\"account_value\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n tickFormatter={tickFormatter}\n />\n {!props.invisible && (\n <Tooltip\n cursor={{ strokeDasharray: \"3 2\", strokeOpacity: 0.16 }}\n content={<CustomTooltip />}\n />\n )}\n {!props.invisible && (\n <>\n <defs>\n <linearGradient id={colorId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop stopColor=\"#00B49E\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#00B49E\" offset=\"100%\" stopOpacity={0} />\n </linearGradient>\n </defs>\n <Area\n type=\"natural\"\n dataKey=\"account_value\"\n stroke={colors.profit}\n strokeWidth={isMobile ? 1.5 : 2}\n dot={false}\n isAnimationActive={false}\n fill={`url(#${colorId})`}\n />\n </>\n )}\n </AreaChart>\n );\n\n return (\n <ResponsiveContainer\n className={props.invisible ? \"chart-invisible\" : undefined}\n {...responsiveContainerProps}\n >\n {chartComponent}\n </ResponsiveContainer>\n );\n};\n","import React from \"react\";\nimport {\n BarChart,\n XAxis,\n YAxis,\n ResponsiveContainer,\n Bar,\n Cell,\n Tooltip,\n CartesianGrid,\n ReferenceLine,\n Cross,\n} from \"recharts\";\nimport type { TooltipProps } from \"recharts\";\nimport { Box, cn } from \"@orderly.network/ui\";\nimport { OrderlyChartTooltip } from \"./customTooltip\";\nimport { useColors } from \"./useColors\";\n\nexport type VolChartDataItem = {\n date: string;\n volume: number;\n opacity?: string | number;\n};\n\nexport type VolChartTooltip = {\n rm?: number;\n dp?: number;\n};\n\nexport type VolChartProps = {\n colors?: { fill: string };\n data: ReadonlyArray<VolChartDataItem> | VolChartDataItem[];\n tooltip?: VolChartTooltip;\n className?: string;\n};\n\nconst RoundedRectangle = (props: any) => {\n const { fill, x, y, width, height, opacity } = props;\n const absHeight = Math.abs(height);\n\n return (\n <rect\n rx={2}\n x={x}\n y={height > 0 ? y : y + height}\n width={width}\n height={absHeight}\n stroke=\"none\"\n fill={fill}\n opacity={opacity}\n />\n );\n};\n\nconst CustomizedCross = (props: any) => {\n const { width, height, payload, stroke, fill } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n return (\n // @ts-ignore\n <Cross\n // y={props.y + props.top}\n x={props.x + props.width / 2}\n top={props.top}\n height={height}\n width={1}\n stroke={\"rgba(255,255,255,0.16)\"}\n strokeDasharray={\"3 2\"}\n fill={\"none\"}\n />\n );\n};\n\nconst CustomTooltip = (\n props: TooltipProps<any, any> & { tooltip?: VolChartTooltip },\n) => {\n const { active, payload, label, tooltip } = props;\n\n if (payload?.[0]?.value === 0) {\n return null;\n }\n\n if (active && payload && payload.length) {\n return (\n <OrderlyChartTooltip\n label={label}\n value={payload[0].value}\n // prefix=\"Commission\"\n titleClassName=\"oui-gap-4\"\n rm={tooltip?.rm}\n dp={tooltip?.dp}\n />\n );\n }\n\n return null;\n};\n\nexport const VolBarChart: React.FC<VolChartProps> = (props) => {\n const colors = useColors(\n props.colors?.fill\n ? { profit: props.colors?.fill, loss: props.colors?.fill }\n : undefined,\n );\n\n const isEmpty =\n (props.data as any)?.reduce((pre: any, cur: any) => pre + cur.volume, 0) ===\n 0;\n\n const maxVolume = (props.data as any)?.reduce(\n (pre: any, cur: any) => (pre > cur.volume ? pre : cur.volume),\n 0,\n );\n\n const decimal = maxVolume <= 10 ? 2 : maxVolume <= 100 ? 1 : 0;\n\n return (\n // @ts-ignore\n <Box className={cn(props.className)}>\n {/* @ts-ignore */}\n <ResponsiveContainer>\n {/* @ts-ignore */}\n <BarChart\n data={props.data as any[]}\n margin={{ left: -0, top: 6, right: 0, bottom: 20 }}\n >\n {/* @ts-ignore */}\n <Tooltip\n // cursor={{ fillOpacity: 0.1 }}\n cursor={<CustomizedCross />}\n content={<CustomTooltip tooltip={props.tooltip} />}\n />\n <CartesianGrid\n vertical={false}\n stroke=\"#FFFFFF\"\n strokeOpacity={0.08}\n repeatCount={6}\n />\n {/* @ts-ignore */}\n <ReferenceLine y={0} stroke=\"#000\" />\n {/* @ts-ignore */}\n <Bar dataKey=\"volume\" shape={<RoundedRectangle />} minPointSize={1}>\n {props.data.map((entry, index) => {\n return (\n // @ts-ignore\n <Cell\n key={`cell-${index}`}\n fill={entry.volume > 0 ? colors.profit : colors.loss}\n opacity={entry.opacity}\n />\n );\n })}\n </Bar>\n {/* @ts-ignore */}\n <YAxis\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n tickLine={false}\n axisLine={false}\n dataKey={\"volume\"}\n tickFormatter={(value, index) => {\n if (isEmpty) return `${index * 100}`;\n return numberToHumanStyle(value, decimal);\n }}\n width={45}\n />\n {/* @ts-ignore */}\n <XAxis\n dataKey=\"date\"\n // axisLine={false}\n tickLine={false}\n interval={props.data.length - 2}\n // tick={renderQuarterTick}\n height={1}\n // scale=\"time\"\n tick={{ fontSize: 10, fill: \"rgba(255,255,255,0.54)\" }}\n stroke=\"rgb(229, 231, 235)\"\n strokeOpacity={0.2}\n />\n </BarChart>\n </ResponsiveContainer>\n </Box>\n );\n};\nfunction numberToHumanStyle(number: number, decimalPlaces: number = 0): string {\n const abbreviations = [\"\", \"K\", \"M\", \"B\", \"T\"];\n\n let index = 0;\n while (number >= 1000 && index < abbreviations.length - 1) {\n number /= 1000;\n index++;\n }\n\n const roundedNumber = toFixedWithoutRounding(number, decimalPlaces);\n\n return `${roundedNumber}${abbreviations[index]}`;\n}\n\nfunction toFixedWithoutRounding(num: number, fix: number): string {\n const numStr = num.toString();\n const decimalIndex = numStr.indexOf(\".\");\n\n if (decimalIndex === -1 || fix === 0) {\n return numStr.split(\".\")[0];\n }\n\n const cutoffIndex = decimalIndex + fix + 1;\n\n return numStr.slice(0, cutoffIndex);\n}\n","import plugin from \"tailwindcss/plugin\";\nimport type { PluginCreator } from \"tailwindcss/types/config\";\n\nexport const chartPlugin: PluginCreator = () =>\n plugin(function ({ addComponents, addBase }) {\n addComponents(\n {\n \".xAxis\": {\n \".recharts-cartesian-axis-tick:first-child text\": {\n \"text-anchor\": \"start\",\n },\n \".recharts-cartesian-axis-tick:last-child text\": {\n \"text-anchor\": \"end\",\n },\n },\n },\n {\n respectPrefix: false,\n },\n );\n });\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderly.network/chart",
3
- "version": "2.8.0",
3
+ "version": "2.8.1-alpha.0",
4
4
  "description": "Charting library for Orderly Network",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -23,7 +23,7 @@
23
23
  "react-dom": "^18.2.0",
24
24
  "tailwindcss": "^3.4.4",
25
25
  "tsup": "^8.1.0",
26
- "tsconfig": "0.11.0"
26
+ "tsconfig": "0.11.1-alpha.0"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": ">=18",
@@ -36,9 +36,9 @@
36
36
  "d3-selection": "^3.0.0",
37
37
  "d3-shape": "^3.2.0",
38
38
  "recharts": "^2.12.7",
39
- "@orderly.network/i18n": "2.8.0",
40
- "@orderly.network/ui": "2.8.0",
41
- "@orderly.network/utils": "2.8.0"
39
+ "@orderly.network/i18n": "2.8.1-alpha.0",
40
+ "@orderly.network/ui": "2.8.1-alpha.0",
41
+ "@orderly.network/utils": "2.8.1-alpha.0"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsup",