hyperprop-charting-library 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hyperprop-charting-library.cjs +1475 -0
- package/dist/hyperprop-charting-library.d.ts +170 -0
- package/dist/hyperprop-charting-library.js +1450 -0
- package/dist/index.cjs +1475 -0
- package/dist/index.d.cts +170 -0
- package/dist/index.d.ts +170 -0
- package/dist/index.js +1450 -0
- package/package.json +27 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
interface ChartOptions {
|
|
2
|
+
width?: number;
|
|
3
|
+
height?: number;
|
|
4
|
+
backgroundColor?: string;
|
|
5
|
+
axisColor?: string;
|
|
6
|
+
axis?: AxisOptions;
|
|
7
|
+
upColor?: string;
|
|
8
|
+
downColor?: string;
|
|
9
|
+
gridColor?: string;
|
|
10
|
+
fontFamily?: string;
|
|
11
|
+
candleBodyWidthRatio?: number;
|
|
12
|
+
candleMinWidth?: number;
|
|
13
|
+
candleWickWidth?: number;
|
|
14
|
+
autoScaleSmoothing?: number;
|
|
15
|
+
autoScaleIgnoreLatestCandle?: boolean;
|
|
16
|
+
doubleClickEnabled?: boolean;
|
|
17
|
+
doubleClickAction?: "reset" | "placeLimitOrder";
|
|
18
|
+
crosshair?: CrosshairOptions;
|
|
19
|
+
grid?: GridOptions;
|
|
20
|
+
watermark?: WatermarkOptions;
|
|
21
|
+
priceLines?: PriceLineOptions[];
|
|
22
|
+
orderLines?: OrderLineOptions[];
|
|
23
|
+
tickerLine?: TickerLineOptions;
|
|
24
|
+
}
|
|
25
|
+
interface AxisOptions {
|
|
26
|
+
lineColor?: string;
|
|
27
|
+
textColor?: string;
|
|
28
|
+
fontSize?: number;
|
|
29
|
+
lineWidth?: number;
|
|
30
|
+
}
|
|
31
|
+
interface GridOptions {
|
|
32
|
+
color?: string;
|
|
33
|
+
opacity?: number;
|
|
34
|
+
horizontalLines?: boolean;
|
|
35
|
+
verticalLines?: boolean;
|
|
36
|
+
horizontalTickCount?: number;
|
|
37
|
+
}
|
|
38
|
+
interface CrosshairOptions {
|
|
39
|
+
visible?: boolean;
|
|
40
|
+
color?: string;
|
|
41
|
+
width?: number;
|
|
42
|
+
style?: "solid" | "dotted" | "dashed";
|
|
43
|
+
showHorizontal?: boolean;
|
|
44
|
+
showVertical?: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface WatermarkOptions {
|
|
47
|
+
visible?: boolean;
|
|
48
|
+
text?: string;
|
|
49
|
+
color?: string;
|
|
50
|
+
opacity?: number;
|
|
51
|
+
fontSize?: number;
|
|
52
|
+
fontWeight?: number | string;
|
|
53
|
+
thickness?: number;
|
|
54
|
+
}
|
|
55
|
+
interface PriceLineOptions {
|
|
56
|
+
id?: string;
|
|
57
|
+
price: number;
|
|
58
|
+
label?: string;
|
|
59
|
+
visible?: boolean;
|
|
60
|
+
style?: "solid" | "dotted" | "dashed";
|
|
61
|
+
thickness?: number;
|
|
62
|
+
color?: string;
|
|
63
|
+
labelBackgroundColor?: string;
|
|
64
|
+
labelTextColor?: string;
|
|
65
|
+
labelBorderRadius?: number;
|
|
66
|
+
showLabel?: boolean;
|
|
67
|
+
}
|
|
68
|
+
interface OrderLineOptions {
|
|
69
|
+
id?: string;
|
|
70
|
+
type: "market" | "limit" | "stop" | "takeProfit";
|
|
71
|
+
side: "buy" | "sell";
|
|
72
|
+
price: number;
|
|
73
|
+
behavior?: "static" | "follow";
|
|
74
|
+
followPrice?: number;
|
|
75
|
+
qty?: number;
|
|
76
|
+
pnl?: number;
|
|
77
|
+
label?: string;
|
|
78
|
+
visible?: boolean;
|
|
79
|
+
style?: "solid" | "dotted" | "dashed";
|
|
80
|
+
thickness?: number;
|
|
81
|
+
color?: string;
|
|
82
|
+
labelBackgroundColor?: string;
|
|
83
|
+
labelTextColor?: string;
|
|
84
|
+
labelBorderRadius?: number;
|
|
85
|
+
showCloseButton?: boolean;
|
|
86
|
+
widgetPosition?: "left" | "center" | "right";
|
|
87
|
+
draggable?: boolean;
|
|
88
|
+
actionButtonText?: string;
|
|
89
|
+
actionButtonAction?: "execute" | "cancel" | "close" | string;
|
|
90
|
+
actionButtonTextColor?: string;
|
|
91
|
+
actionButtonBackgroundColor?: string;
|
|
92
|
+
actionButtonBorderRadius?: number;
|
|
93
|
+
actionButtonMinWidth?: number;
|
|
94
|
+
actionButtonPaddingX?: number;
|
|
95
|
+
actionButtonFullHeight?: boolean;
|
|
96
|
+
actionButtonFontWeight?: number | string;
|
|
97
|
+
actionButtonBorderColor?: string;
|
|
98
|
+
actionButtonBorderStyle?: "solid" | "dotted" | "dashed";
|
|
99
|
+
actionButtons?: OrderActionButton[];
|
|
100
|
+
connectorToPrice?: number;
|
|
101
|
+
connectorColor?: string;
|
|
102
|
+
connectorStyle?: "solid" | "dotted" | "dashed";
|
|
103
|
+
connectorThickness?: number;
|
|
104
|
+
connectorAnchorPaddingRight?: number;
|
|
105
|
+
fillToPrice?: number;
|
|
106
|
+
fillColor?: string;
|
|
107
|
+
}
|
|
108
|
+
interface OrderActionEvent {
|
|
109
|
+
orderId?: string;
|
|
110
|
+
action: "close" | "cancel" | "move" | "createLimit" | "execute" | string;
|
|
111
|
+
price?: number;
|
|
112
|
+
dragging?: boolean;
|
|
113
|
+
line?: OrderLineOptions;
|
|
114
|
+
}
|
|
115
|
+
interface OrderActionButton {
|
|
116
|
+
text: string;
|
|
117
|
+
action: "execute" | "cancel" | "close" | string;
|
|
118
|
+
draggable?: boolean;
|
|
119
|
+
textColor?: string;
|
|
120
|
+
backgroundColor?: string;
|
|
121
|
+
borderColor?: string;
|
|
122
|
+
borderStyle?: "solid" | "dotted" | "dashed";
|
|
123
|
+
borderRadius?: number;
|
|
124
|
+
minWidth?: number;
|
|
125
|
+
paddingX?: number;
|
|
126
|
+
fullHeight?: boolean;
|
|
127
|
+
fontWeight?: number | string;
|
|
128
|
+
}
|
|
129
|
+
interface ChartClickEvent {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
price?: number;
|
|
133
|
+
region: "plot" | "x-axis" | "y-axis";
|
|
134
|
+
}
|
|
135
|
+
interface TickerLineOptions {
|
|
136
|
+
visible?: boolean;
|
|
137
|
+
style?: "solid" | "dotted" | "dashed";
|
|
138
|
+
thickness?: number;
|
|
139
|
+
color?: string;
|
|
140
|
+
labelBackgroundColor?: string;
|
|
141
|
+
labelTextColor?: string;
|
|
142
|
+
labelBorderRadius?: number;
|
|
143
|
+
}
|
|
144
|
+
interface ChartInstance {
|
|
145
|
+
setData: (data: OhlcDataPoint[]) => void;
|
|
146
|
+
setPriceLines: (lines: PriceLineOptions[]) => void;
|
|
147
|
+
addPriceLine: (line: PriceLineOptions) => string;
|
|
148
|
+
removePriceLine: (id: string) => void;
|
|
149
|
+
setOrderLines: (lines: OrderLineOptions[]) => void;
|
|
150
|
+
addOrderLine: (line: OrderLineOptions) => string;
|
|
151
|
+
updateOrderLine: (id: string, patch: Partial<OrderLineOptions>) => void;
|
|
152
|
+
removeOrderLine: (id: string) => void;
|
|
153
|
+
onOrderAction: (handler: ((event: OrderActionEvent) => void) | null) => void;
|
|
154
|
+
onChartClick: (handler: ((event: ChartClickEvent) => void) | null) => void;
|
|
155
|
+
setDoubleClickEnabled: (enabled: boolean) => void;
|
|
156
|
+
setDoubleClickAction: (action: "reset" | "placeLimitOrder") => void;
|
|
157
|
+
resize: (width?: number, height?: number) => void;
|
|
158
|
+
destroy: () => void;
|
|
159
|
+
}
|
|
160
|
+
interface OhlcDataPoint {
|
|
161
|
+
t: string;
|
|
162
|
+
o: number;
|
|
163
|
+
h: number;
|
|
164
|
+
l: number;
|
|
165
|
+
c: number;
|
|
166
|
+
v?: number;
|
|
167
|
+
}
|
|
168
|
+
declare function createChart(element: HTMLElement, options?: ChartOptions): ChartInstance;
|
|
169
|
+
|
|
170
|
+
export { type AxisOptions, type ChartClickEvent, type ChartInstance, type ChartOptions, type CrosshairOptions, type GridOptions, type OhlcDataPoint, type OrderActionButton, type OrderActionEvent, type OrderLineOptions, type PriceLineOptions, type TickerLineOptions, type WatermarkOptions, createChart };
|