@gearbox-protocol/permissionless-ui 1.4.1 → 1.4.3
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.
|
@@ -33,17 +33,23 @@ __export(liquidation_graph_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(liquidation_graph_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
36
|
+
var ColorHeatmapModule = __toESM(require("reactochart/ColorHeatmap"));
|
|
37
|
+
var XAxisModule = __toESM(require("reactochart/XAxis"));
|
|
38
|
+
var XLineModule = __toESM(require("reactochart/XLine"));
|
|
39
|
+
var XYPlotModule = __toESM(require("reactochart/XYPlot"));
|
|
40
|
+
var YAxisModule = __toESM(require("reactochart/YAxis"));
|
|
41
|
+
var YLineModule = __toESM(require("reactochart/YLine"));
|
|
42
42
|
var import_use_hf = require('../../hooks/use-hf.js');
|
|
43
43
|
var import_use_liquidation = require('../../hooks/use-liquidation/index.js');
|
|
44
44
|
var import_vspace = require('../vspace.js');
|
|
45
45
|
var import_liquidation_graph_legend = require('./liquidation-graph-legend.js');
|
|
46
46
|
var import_liquidation_graph_tip = require('./liquidation-graph-tip.js');
|
|
47
|
+
const ColorHeatmap = ColorHeatmapModule.default || ColorHeatmapModule;
|
|
48
|
+
const XAxis = XAxisModule.default || XAxisModule;
|
|
49
|
+
const XLine = XLineModule.default || XLineModule;
|
|
50
|
+
const XYPlot = XYPlotModule.default || XYPlotModule;
|
|
51
|
+
const YAxis = YAxisModule.default || YAxisModule;
|
|
52
|
+
const YLine = YLineModule.default || YLineModule;
|
|
47
53
|
const WIDTH = 300;
|
|
48
54
|
const HEIGHT = 300;
|
|
49
55
|
const CROSSHAIR_X = "rct-crosshair-x";
|
|
@@ -150,7 +156,7 @@ function LiquidationGraph({
|
|
|
150
156
|
) }),
|
|
151
157
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vspace.VSpace, { height: 16 }),
|
|
152
158
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full liquidation-graph-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
153
|
-
|
|
159
|
+
XYPlot,
|
|
154
160
|
{
|
|
155
161
|
width,
|
|
156
162
|
height,
|
|
@@ -160,7 +166,7 @@ function LiquidationGraph({
|
|
|
160
166
|
onMouseLeave: handleMouseLeave,
|
|
161
167
|
children: [
|
|
162
168
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
-
|
|
169
|
+
XAxis,
|
|
164
170
|
{
|
|
165
171
|
showLine: false,
|
|
166
172
|
title: (0, import_use_liquidation.formatAxisTipLabel)(xLabel, underlyingToken, xOrder),
|
|
@@ -174,7 +180,7 @@ function LiquidationGraph({
|
|
|
174
180
|
}
|
|
175
181
|
),
|
|
176
182
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
|
-
|
|
183
|
+
YAxis,
|
|
178
184
|
{
|
|
179
185
|
showLine: false,
|
|
180
186
|
title: (0, import_use_liquidation.formatAxisTipLabel)(yLabel, underlyingToken, yOrder),
|
|
@@ -188,7 +194,7 @@ function LiquidationGraph({
|
|
|
188
194
|
}
|
|
189
195
|
),
|
|
190
196
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
-
|
|
197
|
+
ColorHeatmap,
|
|
192
198
|
{
|
|
193
199
|
data: heatmap,
|
|
194
200
|
value: (d) => d.value,
|
|
@@ -199,8 +205,8 @@ function LiquidationGraph({
|
|
|
199
205
|
rectClassName: (p) => (0, import_use_liquidation.getCellClass)(p, currentPoint, activePointX, activePointY)
|
|
200
206
|
}
|
|
201
207
|
),
|
|
202
|
-
activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
|
-
activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
208
|
+
activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(XLine, { value: activePointX, className: CROSSHAIR_X }),
|
|
209
|
+
activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(YLine, { value: activePointY, className: CROSSHAIR_Y })
|
|
204
210
|
]
|
|
205
211
|
}
|
|
206
212
|
) }),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
3
|
+
import * as ColorHeatmapModule from "reactochart/ColorHeatmap";
|
|
4
|
+
import * as XAxisModule from "reactochart/XAxis";
|
|
5
|
+
import * as XLineModule from "reactochart/XLine";
|
|
6
|
+
import * as XYPlotModule from "reactochart/XYPlot";
|
|
7
|
+
import * as YAxisModule from "reactochart/YAxis";
|
|
8
|
+
import * as YLineModule from "reactochart/YLine";
|
|
9
9
|
import { useHF } from "../../hooks/use-hf.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_AXIS_MAX,
|
|
@@ -22,6 +22,12 @@ import {
|
|
|
22
22
|
import { VSpace } from "../vspace.js";
|
|
23
23
|
import { LiquidationGraphLegend } from "./liquidation-graph-legend.js";
|
|
24
24
|
import { LiquidationGraphTip } from "./liquidation-graph-tip.js";
|
|
25
|
+
const ColorHeatmap = ColorHeatmapModule.default || ColorHeatmapModule;
|
|
26
|
+
const XAxis = XAxisModule.default || XAxisModule;
|
|
27
|
+
const XLine = XLineModule.default || XLineModule;
|
|
28
|
+
const XYPlot = XYPlotModule.default || XYPlotModule;
|
|
29
|
+
const YAxis = YAxisModule.default || YAxisModule;
|
|
30
|
+
const YLine = YLineModule.default || YLineModule;
|
|
25
31
|
const WIDTH = 300;
|
|
26
32
|
const HEIGHT = 300;
|
|
27
33
|
const CROSSHAIR_X = "rct-crosshair-x";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
declare module "reactochart/ColorHeatmap" {
|
|
2
|
+
import type { Component } from "react";
|
|
3
|
+
|
|
4
|
+
export interface Cell {
|
|
5
|
+
x: unknown;
|
|
6
|
+
y: unknown;
|
|
7
|
+
value: unknown;
|
|
8
|
+
xEnd?: unknown;
|
|
9
|
+
yEnd?: unknown;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ColorHeatmapProps {
|
|
13
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
14
|
+
data?: any;
|
|
15
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
16
|
+
value?: (d: any) => number;
|
|
17
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
18
|
+
x?: (d: any) => number;
|
|
19
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
20
|
+
xEnd?: (d: any) => number;
|
|
21
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
22
|
+
y?: (d: any) => number;
|
|
23
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
24
|
+
yEnd?: (d: any) => number;
|
|
25
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
26
|
+
rectClassName?: string | ((d: any) => string);
|
|
27
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
28
|
+
rectStyle?: any;
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class ColorHeatmap extends Component<ColorHeatmapProps> {}
|
|
34
|
+
export default ColorHeatmap;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare module "reactochart/XAxis" {
|
|
38
|
+
import type { Component } from "react";
|
|
39
|
+
|
|
40
|
+
interface XAxisProps {
|
|
41
|
+
showLine?: boolean;
|
|
42
|
+
title?: string;
|
|
43
|
+
titleAlign?: string;
|
|
44
|
+
tickCount?: number;
|
|
45
|
+
labelFormat?: (value: number) => string;
|
|
46
|
+
showLabels?: boolean;
|
|
47
|
+
showTicks?: boolean;
|
|
48
|
+
onMouseClickAxis?: () => void;
|
|
49
|
+
nice?: boolean;
|
|
50
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
class XAxis extends Component<XAxisProps> {}
|
|
55
|
+
export default XAxis;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare module "reactochart/XLine" {
|
|
59
|
+
import type { Component } from "react";
|
|
60
|
+
|
|
61
|
+
interface XLineProps {
|
|
62
|
+
value: number;
|
|
63
|
+
className?: string;
|
|
64
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class XLine extends Component<XLineProps> {}
|
|
69
|
+
export default XLine;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
declare module "reactochart/XYPlot" {
|
|
73
|
+
import type { Component } from "react";
|
|
74
|
+
|
|
75
|
+
interface XYPlotProps {
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
xDomain?: [number, number];
|
|
79
|
+
yDomain?: [number, number];
|
|
80
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
81
|
+
onMouseMove?: (e: any) => void;
|
|
82
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
83
|
+
onMouseLeave?: (e: any) => void;
|
|
84
|
+
children?: React.ReactNode;
|
|
85
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
class XYPlot extends Component<XYPlotProps> {}
|
|
90
|
+
export default XYPlot;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare module "reactochart/YAxis" {
|
|
94
|
+
import type { Component } from "react";
|
|
95
|
+
|
|
96
|
+
interface YAxisProps {
|
|
97
|
+
showLine?: boolean;
|
|
98
|
+
title?: string;
|
|
99
|
+
titleAlign?: string;
|
|
100
|
+
tickCount?: number;
|
|
101
|
+
labelFormat?: (value: number) => string;
|
|
102
|
+
showLabels?: boolean;
|
|
103
|
+
showTicks?: boolean;
|
|
104
|
+
onMouseClickAxis?: () => void;
|
|
105
|
+
nice?: boolean;
|
|
106
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
class YAxis extends Component<YAxisProps> {}
|
|
111
|
+
export default YAxis;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare module "reactochart/YLine" {
|
|
115
|
+
import type { Component } from "react";
|
|
116
|
+
|
|
117
|
+
interface YLineProps {
|
|
118
|
+
value: number;
|
|
119
|
+
className?: string;
|
|
120
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class YLine extends Component<YLineProps> {}
|
|
125
|
+
export default YLine;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare module "reactochart/ScatterPlot" {
|
|
129
|
+
import type { Component } from "react";
|
|
130
|
+
|
|
131
|
+
export interface Point {
|
|
132
|
+
x: unknown;
|
|
133
|
+
y: unknown;
|
|
134
|
+
[index: number]: unknown;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface ScatterPlotProps {
|
|
138
|
+
data?: Point[];
|
|
139
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
140
|
+
[key: string]: any;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
class ScatterPlot extends Component<ScatterPlotProps> {}
|
|
144
|
+
export default ScatterPlot;
|
|
145
|
+
}
|