@kodiak-finance/orderly-chart 2.7.4
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.d.mts +94 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +48 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Props } from 'recharts/types/component/ResponsiveContainer';
|
|
3
|
+
export { Area, AreaChart, Bar, BarChart, Cell, Line, LineChart } from 'recharts';
|
|
4
|
+
import { PluginCreator } from 'tailwindcss/types/config';
|
|
5
|
+
|
|
6
|
+
type PnLChartDataItem = {
|
|
7
|
+
date: string;
|
|
8
|
+
pnl: number;
|
|
9
|
+
};
|
|
10
|
+
type PnLChartProps = {
|
|
11
|
+
colors?: {
|
|
12
|
+
profit: string;
|
|
13
|
+
loss: string;
|
|
14
|
+
};
|
|
15
|
+
data: ReadonlyArray<PnLChartDataItem> | PnLChartDataItem[];
|
|
16
|
+
invisible?: boolean;
|
|
17
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
18
|
+
};
|
|
19
|
+
declare const PnLBarChart: React.FC<PnLChartProps>;
|
|
20
|
+
|
|
21
|
+
type PnlLineChartProps$1 = {
|
|
22
|
+
colors?: {
|
|
23
|
+
profit: string;
|
|
24
|
+
loss: string;
|
|
25
|
+
};
|
|
26
|
+
data: any;
|
|
27
|
+
invisible?: boolean;
|
|
28
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
29
|
+
};
|
|
30
|
+
declare const PnlLineChart: React.FC<PnlLineChartProps$1>;
|
|
31
|
+
|
|
32
|
+
type PnlAreaChartProps$1 = {
|
|
33
|
+
colors?: {
|
|
34
|
+
profit: string;
|
|
35
|
+
loss: string;
|
|
36
|
+
};
|
|
37
|
+
data: any;
|
|
38
|
+
invisible?: boolean;
|
|
39
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
40
|
+
};
|
|
41
|
+
declare const PnlAreaChart: React.FC<PnlAreaChartProps$1>;
|
|
42
|
+
|
|
43
|
+
type AssetChartDataItem$1 = {
|
|
44
|
+
date: string;
|
|
45
|
+
account_value: number;
|
|
46
|
+
};
|
|
47
|
+
type PnlLineChartProps = {
|
|
48
|
+
colors?: {
|
|
49
|
+
profit: string;
|
|
50
|
+
loss: string;
|
|
51
|
+
};
|
|
52
|
+
data: AssetChartDataItem$1[];
|
|
53
|
+
invisible?: boolean;
|
|
54
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
55
|
+
};
|
|
56
|
+
declare const AssetLineChart: React.FC<PnlLineChartProps>;
|
|
57
|
+
|
|
58
|
+
type AssetChartDataItem = {
|
|
59
|
+
date: string;
|
|
60
|
+
account_value: number;
|
|
61
|
+
};
|
|
62
|
+
type PnlAreaChartProps = {
|
|
63
|
+
colors?: {
|
|
64
|
+
profit: string;
|
|
65
|
+
loss: string;
|
|
66
|
+
};
|
|
67
|
+
data: AssetChartDataItem[];
|
|
68
|
+
invisible?: boolean;
|
|
69
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
70
|
+
};
|
|
71
|
+
declare const AssetAreaChart: React.FC<PnlAreaChartProps>;
|
|
72
|
+
|
|
73
|
+
type VolChartDataItem = {
|
|
74
|
+
date: string;
|
|
75
|
+
volume: number;
|
|
76
|
+
opacity?: string | number;
|
|
77
|
+
};
|
|
78
|
+
type VolChartTooltip = {
|
|
79
|
+
rm?: number;
|
|
80
|
+
dp?: number;
|
|
81
|
+
};
|
|
82
|
+
type VolChartProps = {
|
|
83
|
+
colors?: {
|
|
84
|
+
fill: string;
|
|
85
|
+
};
|
|
86
|
+
data: ReadonlyArray<VolChartDataItem> | VolChartDataItem[];
|
|
87
|
+
tooltip?: VolChartTooltip;
|
|
88
|
+
className?: string;
|
|
89
|
+
};
|
|
90
|
+
declare const VolBarChart: React.FC<VolChartProps>;
|
|
91
|
+
|
|
92
|
+
declare const chartPlugin: PluginCreator;
|
|
93
|
+
|
|
94
|
+
export { AssetAreaChart, type AssetChartDataItem$1 as AssetChartDataItem, AssetLineChart, PnLBarChart, PnlAreaChart, type PnlAreaChartProps, PnlLineChart, type PnlLineChartProps, VolBarChart, type VolChartDataItem, chartPlugin };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Props } from 'recharts/types/component/ResponsiveContainer';
|
|
3
|
+
export { Area, AreaChart, Bar, BarChart, Cell, Line, LineChart } from 'recharts';
|
|
4
|
+
import { PluginCreator } from 'tailwindcss/types/config';
|
|
5
|
+
|
|
6
|
+
type PnLChartDataItem = {
|
|
7
|
+
date: string;
|
|
8
|
+
pnl: number;
|
|
9
|
+
};
|
|
10
|
+
type PnLChartProps = {
|
|
11
|
+
colors?: {
|
|
12
|
+
profit: string;
|
|
13
|
+
loss: string;
|
|
14
|
+
};
|
|
15
|
+
data: ReadonlyArray<PnLChartDataItem> | PnLChartDataItem[];
|
|
16
|
+
invisible?: boolean;
|
|
17
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
18
|
+
};
|
|
19
|
+
declare const PnLBarChart: React.FC<PnLChartProps>;
|
|
20
|
+
|
|
21
|
+
type PnlLineChartProps$1 = {
|
|
22
|
+
colors?: {
|
|
23
|
+
profit: string;
|
|
24
|
+
loss: string;
|
|
25
|
+
};
|
|
26
|
+
data: any;
|
|
27
|
+
invisible?: boolean;
|
|
28
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
29
|
+
};
|
|
30
|
+
declare const PnlLineChart: React.FC<PnlLineChartProps$1>;
|
|
31
|
+
|
|
32
|
+
type PnlAreaChartProps$1 = {
|
|
33
|
+
colors?: {
|
|
34
|
+
profit: string;
|
|
35
|
+
loss: string;
|
|
36
|
+
};
|
|
37
|
+
data: any;
|
|
38
|
+
invisible?: boolean;
|
|
39
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
40
|
+
};
|
|
41
|
+
declare const PnlAreaChart: React.FC<PnlAreaChartProps$1>;
|
|
42
|
+
|
|
43
|
+
type AssetChartDataItem$1 = {
|
|
44
|
+
date: string;
|
|
45
|
+
account_value: number;
|
|
46
|
+
};
|
|
47
|
+
type PnlLineChartProps = {
|
|
48
|
+
colors?: {
|
|
49
|
+
profit: string;
|
|
50
|
+
loss: string;
|
|
51
|
+
};
|
|
52
|
+
data: AssetChartDataItem$1[];
|
|
53
|
+
invisible?: boolean;
|
|
54
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
55
|
+
};
|
|
56
|
+
declare const AssetLineChart: React.FC<PnlLineChartProps>;
|
|
57
|
+
|
|
58
|
+
type AssetChartDataItem = {
|
|
59
|
+
date: string;
|
|
60
|
+
account_value: number;
|
|
61
|
+
};
|
|
62
|
+
type PnlAreaChartProps = {
|
|
63
|
+
colors?: {
|
|
64
|
+
profit: string;
|
|
65
|
+
loss: string;
|
|
66
|
+
};
|
|
67
|
+
data: AssetChartDataItem[];
|
|
68
|
+
invisible?: boolean;
|
|
69
|
+
responsiveContainerProps?: Omit<Props, "children">;
|
|
70
|
+
};
|
|
71
|
+
declare const AssetAreaChart: React.FC<PnlAreaChartProps>;
|
|
72
|
+
|
|
73
|
+
type VolChartDataItem = {
|
|
74
|
+
date: string;
|
|
75
|
+
volume: number;
|
|
76
|
+
opacity?: string | number;
|
|
77
|
+
};
|
|
78
|
+
type VolChartTooltip = {
|
|
79
|
+
rm?: number;
|
|
80
|
+
dp?: number;
|
|
81
|
+
};
|
|
82
|
+
type VolChartProps = {
|
|
83
|
+
colors?: {
|
|
84
|
+
fill: string;
|
|
85
|
+
};
|
|
86
|
+
data: ReadonlyArray<VolChartDataItem> | VolChartDataItem[];
|
|
87
|
+
tooltip?: VolChartTooltip;
|
|
88
|
+
className?: string;
|
|
89
|
+
};
|
|
90
|
+
declare const VolBarChart: React.FC<VolChartProps>;
|
|
91
|
+
|
|
92
|
+
declare const chartPlugin: PluginCreator;
|
|
93
|
+
|
|
94
|
+
export { AssetAreaChart, type AssetChartDataItem$1 as AssetChartDataItem, AssetLineChart, PnLBarChart, PnlAreaChart, type PnlAreaChartProps, PnlLineChart, type PnlLineChartProps, VolBarChart, type VolChartDataItem, chartPlugin };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var react=require('react'),recharts=require('recharts'),orderlyI18n=require('@kodiak-finance/orderly-i18n'),orderlyUi=require('@kodiak-finance/orderly-ui'),orderlyUtils=require('@kodiak-finance/orderly-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 F=(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=F(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=F(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 $=F((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=orderlyUtils.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(orderlyUi.Box,{intensity:600,p:3,r:"md",children:[jsxRuntime.jsxs(orderlyUi.Flex,{direction:"row",className:t.titleClassName,children:[o,jsxRuntime.jsx(orderlyUi.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(orderlyUi.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}=orderlyI18n.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}=orderlyI18n.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:orderlyUi.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}=orderlyI18n.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}=orderlyI18n.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}=orderlyUi.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}=orderlyI18n.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}=orderlyUi.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:"#608CFF",offset:"0%",stopOpacity:.5}),jsxRuntime.jsx("stop",{stopColor:"#608CFF",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}=orderlyI18n.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}=orderlyUi.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 be=t=>{let{active:r,payload:e,label:o}=t,a=react.useRef(new Date().toISOString().split("T")[0]),{t:i}=orderlyI18n.useTranslation();return r&&e&&e.length?jsxRuntime.jsx(p,{label:o===a.current?i("chart.now"):o,value:e[0].value}):null},xe=t=>{let{responsiveContainerProps:r}=t,e=m(t.colors),o=react.useId(),{isMobile:a}=orderlyUi.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(be,{})}),!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(orderlyUi.Box,{className:orderlyUi.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=xe;exports.AssetLineChart=le;exports.PnLBarChart=Ct;exports.PnlAreaChart=Qt;exports.PnlLineChart=Bt;exports.VolBarChart=Ne;exports.chartPlugin=He;//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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":"uQAAA,IAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,IAAA,CAAA,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ACA,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 \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { cn } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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=\"#608CFF\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#608CFF\" 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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-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
ADDED
|
@@ -0,0 +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'@kodiak-finance/orderly-i18n';import {cn,useScreen,Box,Flex,Text}from'@kodiak-finance/orderly-ui';import {numberToHumanStyle}from'@kodiak-finance/orderly-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 F=(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=F(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=F(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 $=F((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:"#608CFF",offset:"0%",stopOpacity:.5}),jsx("stop",{stopColor:"#608CFF",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 be=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},xe=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(be,{})}),!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{xe as AssetAreaChart,le as AssetLineChart,Ct as PnLBarChart,Qt as PnlAreaChart,Bt as PnlLineChart,Ne as VolBarChart,He as chartPlugin};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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":"+eAAA,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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AwB,EAAW,CAC7E,IAAMC,CAAAA,CAAgB,CAAC,GAAI,GAAA,CAAK,GAAA,CAAK,GAAA,CAAK,GAAG,EAEzCvD,CAAAA,CAAQ,CAAA,CACZ,KAAOqD,CAAAA,EAAU,GAAA,EAAQrD,EAAQuD,CAAAA,CAAc,MAAA,CAAS,CAAA,EACtDF,CAAAA,EAAU,IACVrD,CAAAA,EAAAA,CAKF,OAAO,GAFewD,EAAAA,CAAuBH,CAAAA,CAAQC,CAAa,CAE3C,CAAA,EAAGC,CAAAA,CAAcvD,CAAK,CAAC,CAAA,CAChD,CAEA,SAASwD,EAAAA,CAAuBC,CAAAA,CAAaC,EAAqB,CAChE,IAAMC,CAAAA,CAASF,CAAAA,CAAI,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.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 \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { cn } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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=\"#608CFF\" offset=\"0%\" stopOpacity={0.5} />\n <stop stopColor=\"#608CFF\" 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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-i18n\";\nimport { useScreen } from \"@kodiak-finance/orderly-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 \"@kodiak-finance/orderly-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
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kodiak-finance/orderly-chart",
|
|
3
|
+
"version": "2.7.4",
|
|
4
|
+
"description": "Charting library for Orderly Network",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"keywords": [],
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/d3-array": "^3.2.1",
|
|
16
|
+
"@types/d3-axis": "^3.0.6",
|
|
17
|
+
"@types/d3-scale": "^4.0.8",
|
|
18
|
+
"@types/d3-selection": "^3.0.10",
|
|
19
|
+
"@types/d3-shape": "^3.1.6",
|
|
20
|
+
"@types/react": "^18.3.2",
|
|
21
|
+
"@types/react-dom": "^18.3.0",
|
|
22
|
+
"react": "^18.2.0",
|
|
23
|
+
"react-dom": "^18.2.0",
|
|
24
|
+
"tailwindcss": "^3.4.4",
|
|
25
|
+
"tsup": "^8.1.0",
|
|
26
|
+
"tsconfig": "0.10.4"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=18",
|
|
30
|
+
"react-dom": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"d3-array": "^3.2.4",
|
|
34
|
+
"d3-axis": "^3.0.0",
|
|
35
|
+
"d3-scale": "^4.0.2",
|
|
36
|
+
"d3-selection": "^3.0.0",
|
|
37
|
+
"d3-shape": "^3.2.0",
|
|
38
|
+
"recharts": "^2.12.7",
|
|
39
|
+
"@kodiak-finance/orderly-i18n": "2.7.4",
|
|
40
|
+
"@kodiak-finance/orderly-utils": "2.7.4",
|
|
41
|
+
"@kodiak-finance/orderly-ui": "2.7.4"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup",
|
|
45
|
+
"build:css": "tailwindcss build -i src/tailwind.css -o dist/styles.css",
|
|
46
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
47
|
+
}
|
|
48
|
+
}
|