@pipsend/charts 1.1.2 → 1.2.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/pipsend-charts.development.mjs +4732 -4065
- package/dist/pipsend-charts.production.mjs +2 -2
- package/dist/pipsend-charts.standalone.development.js +4732 -4065
- package/dist/pipsend-charts.standalone.development.mjs +4732 -4065
- package/dist/pipsend-charts.standalone.production.js +2 -2
- package/dist/pipsend-charts.standalone.production.mjs +2 -2
- package/dist/typings.d.ts +50 -0
- package/package.json +1 -83
package/dist/typings.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ declare abstract class DrawingToolBase implements IDrawingTool {
|
|
|
24
24
|
isVisible(): boolean;
|
|
25
25
|
getState(): DrawingToolState;
|
|
26
26
|
abstract remove(): void;
|
|
27
|
+
abstract serialize(): SerializedDrawingTool;
|
|
27
28
|
protected abstract _update(): void;
|
|
28
29
|
}
|
|
29
30
|
declare const areaSeries: SeriesDefinition<"Area">;
|
|
@@ -73,6 +74,7 @@ export declare class ArrowTool extends DrawingToolBase {
|
|
|
73
74
|
getPoints(): ArrowPoint[];
|
|
74
75
|
addPoint(point: ArrowPoint): void;
|
|
75
76
|
isVisible(): boolean;
|
|
77
|
+
serialize(): SerializedDrawingTool;
|
|
76
78
|
private _requestUpdate;
|
|
77
79
|
protected _update(): void;
|
|
78
80
|
remove(): void;
|
|
@@ -119,6 +121,7 @@ export declare class BrushTool extends DrawingToolBase {
|
|
|
119
121
|
stopDrag(): void;
|
|
120
122
|
updateDrag(time: Time, price: number): void;
|
|
121
123
|
isVisible(): boolean;
|
|
124
|
+
serialize(): SerializedDrawingTool;
|
|
122
125
|
private _requestUpdate;
|
|
123
126
|
protected _update(): void;
|
|
124
127
|
remove(): void;
|
|
@@ -153,6 +156,7 @@ export declare class CircleTool extends DrawingToolBase {
|
|
|
153
156
|
stopDrag(): void;
|
|
154
157
|
updateDrag(time: Time, price: number): void;
|
|
155
158
|
isVisible(): boolean;
|
|
159
|
+
serialize(): SerializedDrawingTool;
|
|
156
160
|
private _requestUpdate;
|
|
157
161
|
protected _update(): void;
|
|
158
162
|
remove(): void;
|
|
@@ -283,6 +287,27 @@ export declare class DrawingToolsManager {
|
|
|
283
287
|
* Check if a tool is selected
|
|
284
288
|
*/
|
|
285
289
|
isToolSelected(id: string): boolean;
|
|
290
|
+
/**
|
|
291
|
+
* Serialize all managed tools into a JSON-safe array
|
|
292
|
+
*/
|
|
293
|
+
serializeAll(): SerializedDrawingTool[];
|
|
294
|
+
/**
|
|
295
|
+
* Restore a single tool from serialized data
|
|
296
|
+
*/
|
|
297
|
+
restoreTool(context: DrawingContext, data: SerializedDrawingTool): DrawingToolBase;
|
|
298
|
+
/**
|
|
299
|
+
* Restore all tools from a serialized array, optionally clearing existing tools first
|
|
300
|
+
*/
|
|
301
|
+
restoreAll(context: DrawingContext, tools: SerializedDrawingTool[], clearExisting?: boolean): void;
|
|
302
|
+
/**
|
|
303
|
+
* Create a tool instance from serialized data (static helper).
|
|
304
|
+
*
|
|
305
|
+
* IMPORTANT: Uses bracket notation (`p['time']`, `p['price']`) when reading
|
|
306
|
+
* from serialized JSON data. This prevents the build-time property mangler
|
|
307
|
+
* from rewriting these accesses to `p._internal_time` / `p._internal_price`,
|
|
308
|
+
* which would fail on plain JSON objects that have literal `time`/`price` keys.
|
|
309
|
+
*/
|
|
310
|
+
private static _createToolFromData;
|
|
286
311
|
/**
|
|
287
312
|
* Destroy the manager and cleanup
|
|
288
313
|
*/
|
|
@@ -378,6 +403,7 @@ export declare class FibonacciExtensionTool extends DrawingToolBase {
|
|
|
378
403
|
}>;
|
|
379
404
|
drawToCanvas(ctx: CanvasRenderingContext2D, horizontalPixelRatio: number, verticalPixelRatio: number): void;
|
|
380
405
|
isVisible(): boolean;
|
|
406
|
+
serialize(): SerializedDrawingTool;
|
|
381
407
|
private _requestUpdate;
|
|
382
408
|
protected _update(): void;
|
|
383
409
|
remove(): void;
|
|
@@ -413,6 +439,7 @@ export declare class FibonacciFanTool extends DrawingToolBase {
|
|
|
413
439
|
stopDrag(): void;
|
|
414
440
|
updateDrag(time: Time, price: number): void;
|
|
415
441
|
isVisible(): boolean;
|
|
442
|
+
serialize(): SerializedDrawingTool;
|
|
416
443
|
private _requestUpdate;
|
|
417
444
|
protected _update(): void;
|
|
418
445
|
remove(): void;
|
|
@@ -445,6 +472,7 @@ export declare class FibonacciTool extends DrawingToolBase {
|
|
|
445
472
|
getMetrics(): FibonacciMetrics | null;
|
|
446
473
|
getLevels(): FibonacciLevel[];
|
|
447
474
|
isVisible(): boolean;
|
|
475
|
+
serialize(): SerializedDrawingTool;
|
|
448
476
|
useExtendedLevels(extended: boolean): void;
|
|
449
477
|
private _initializeInteractiveMode;
|
|
450
478
|
private _drawPreview;
|
|
@@ -486,6 +514,7 @@ export declare class GanttTool extends DrawingToolBase {
|
|
|
486
514
|
setHovered(hovered: boolean): void;
|
|
487
515
|
hitTest(x: number, y: number): boolean;
|
|
488
516
|
isVisible(): boolean;
|
|
517
|
+
serialize(): SerializedDrawingTool;
|
|
489
518
|
private _requestUpdate;
|
|
490
519
|
protected _update(): void;
|
|
491
520
|
remove(): void;
|
|
@@ -514,6 +543,7 @@ export declare class HorizontalLineTool extends DrawingToolBase {
|
|
|
514
543
|
setPrice(price: number): void;
|
|
515
544
|
setLabel(text: string): void;
|
|
516
545
|
isVisible(): boolean;
|
|
546
|
+
serialize(): SerializedDrawingTool;
|
|
517
547
|
private _requestUpdate;
|
|
518
548
|
protected _update(): void;
|
|
519
549
|
remove(): void;
|
|
@@ -698,6 +728,7 @@ export declare class PositionTool extends DrawingToolBase {
|
|
|
698
728
|
* Set entry price
|
|
699
729
|
*/
|
|
700
730
|
setEntryPrice(price: number): void;
|
|
731
|
+
serialize(): SerializedDrawingTool;
|
|
701
732
|
setSelected(selected: boolean): void;
|
|
702
733
|
isSelected(): boolean;
|
|
703
734
|
setHovered(hovered: boolean): void;
|
|
@@ -743,6 +774,7 @@ export declare class RectangleTool extends DrawingToolBase {
|
|
|
743
774
|
stopDrag(): void;
|
|
744
775
|
updateDrag(time: Time, price: number): void;
|
|
745
776
|
isVisible(): boolean;
|
|
777
|
+
serialize(): SerializedDrawingTool;
|
|
746
778
|
private _requestUpdate;
|
|
747
779
|
protected _update(): void;
|
|
748
780
|
remove(): void;
|
|
@@ -835,6 +867,7 @@ export declare class RulerTool extends DrawingToolBase {
|
|
|
835
867
|
hitTestEndpoint(x: number, y: number): "point1" | "point2" | null;
|
|
836
868
|
private _requestUpdate;
|
|
837
869
|
protected _update(): void;
|
|
870
|
+
serialize(): SerializedDrawingTool;
|
|
838
871
|
setSelected(selected: boolean): void;
|
|
839
872
|
isSelected(): boolean;
|
|
840
873
|
isComplete(): boolean;
|
|
@@ -882,6 +915,7 @@ export declare class TextTool extends DrawingToolBase {
|
|
|
882
915
|
updateDrag(time: Time, price: number): void;
|
|
883
916
|
drawToCanvas(ctx: CanvasRenderingContext2D, horizontalPixelRatio: number, verticalPixelRatio: number): void;
|
|
884
917
|
private _hexToRgba;
|
|
918
|
+
serialize(): SerializedDrawingTool;
|
|
885
919
|
remove(): void;
|
|
886
920
|
}
|
|
887
921
|
export declare class TradingSessionsIndicator {
|
|
@@ -943,6 +977,7 @@ export declare class TrendLineTool extends DrawingToolBase {
|
|
|
943
977
|
stopDrag(): void;
|
|
944
978
|
updateDrag(time: Time, price: number): void;
|
|
945
979
|
isVisible(): boolean;
|
|
980
|
+
serialize(): SerializedDrawingTool;
|
|
946
981
|
private _requestUpdate;
|
|
947
982
|
protected _update(): void;
|
|
948
983
|
remove(): void;
|
|
@@ -971,6 +1006,7 @@ export declare class VerticalLineTool extends DrawingToolBase {
|
|
|
971
1006
|
setTime(time: Time): void;
|
|
972
1007
|
setLabel(text: string): void;
|
|
973
1008
|
isVisible(): boolean;
|
|
1009
|
+
serialize(): SerializedDrawingTool;
|
|
974
1010
|
private _requestUpdate;
|
|
975
1011
|
protected _update(): void;
|
|
976
1012
|
remove(): void;
|
|
@@ -3180,6 +3216,7 @@ export interface IDrawingTool {
|
|
|
3180
3216
|
isLocked(): boolean;
|
|
3181
3217
|
isVisible(): boolean;
|
|
3182
3218
|
getState(): DrawingToolState;
|
|
3219
|
+
serialize(): SerializedDrawingTool;
|
|
3183
3220
|
}
|
|
3184
3221
|
/**
|
|
3185
3222
|
* Class interface for Horizontal scale behavior
|
|
@@ -5231,6 +5268,19 @@ export interface SMAOptions {
|
|
|
5231
5268
|
color?: string;
|
|
5232
5269
|
lineWidth?: number;
|
|
5233
5270
|
}
|
|
5271
|
+
/**
|
|
5272
|
+
* Serialized drawing tool data — plain JSON-safe object
|
|
5273
|
+
* with everything needed to recreate a tool.
|
|
5274
|
+
*/
|
|
5275
|
+
export interface SerializedDrawingTool {
|
|
5276
|
+
type: string;
|
|
5277
|
+
points: Array<{
|
|
5278
|
+
price: number;
|
|
5279
|
+
time: Time | null;
|
|
5280
|
+
}>;
|
|
5281
|
+
style: Record<string, any>;
|
|
5282
|
+
extra?: Record<string, any>;
|
|
5283
|
+
}
|
|
5234
5284
|
/**
|
|
5235
5285
|
* Object containing references to the chart and series instances, and a requestUpdate method for triggering
|
|
5236
5286
|
* a refresh of the chart.
|
package/package.json
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"version": "1.1.2",
|
|
2
|
+
"version": "1.2.0",
|
|
4
3
|
"name": "@pipsend/charts",
|
|
5
4
|
"author": "Pipsend",
|
|
6
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -54,88 +53,7 @@
|
|
|
54
53
|
"bollinger-bands",
|
|
55
54
|
"financial-analysis"
|
|
56
55
|
],
|
|
57
|
-
"engines": {
|
|
58
|
-
"node": ">=22.3"
|
|
59
|
-
},
|
|
60
56
|
"dependencies": {
|
|
61
57
|
"fancy-canvas": "2.1.0"
|
|
62
|
-
},
|
|
63
|
-
"devDependencies": {
|
|
64
|
-
"@juggle/resize-observer": "3.4.0",
|
|
65
|
-
"@rollup/plugin-node-resolve": "16.0.1",
|
|
66
|
-
"@rollup/plugin-replace": "6.0.2",
|
|
67
|
-
"@rollup/plugin-terser": "0.4.4",
|
|
68
|
-
"@size-limit/file": "11.2.0",
|
|
69
|
-
"@size-limit/webpack": "11.2.0",
|
|
70
|
-
"@types/chai": "5.2.1",
|
|
71
|
-
"@types/express": "5.0.1",
|
|
72
|
-
"@types/glob": "8.1.0",
|
|
73
|
-
"@types/node": "22",
|
|
74
|
-
"@types/pixelmatch": "5.2.6",
|
|
75
|
-
"@types/pngjs": "6.0.5",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
77
|
-
"@typescript-eslint/eslint-plugin-tslint": "7.0.2",
|
|
78
|
-
"@typescript-eslint/parser": "7.18.0",
|
|
79
|
-
"ajv": "7.2.4",
|
|
80
|
-
"bytes": "3.1.2",
|
|
81
|
-
"chai": "5.2.0",
|
|
82
|
-
"chai-exclude": "3.0.1",
|
|
83
|
-
"cross-env": "7.0.3",
|
|
84
|
-
"dts-bundle-generator": "9.5.1",
|
|
85
|
-
"eslint": "8",
|
|
86
|
-
"eslint-formatter-unix": "8.40.0",
|
|
87
|
-
"eslint-plugin-deprecation": "3.0.0",
|
|
88
|
-
"eslint-plugin-import": "2.31.0",
|
|
89
|
-
"eslint-plugin-unicorn": "56.0.1",
|
|
90
|
-
"esno": "4.8.0",
|
|
91
|
-
"glob": "11.0.1",
|
|
92
|
-
"markdown-it": "14.1.0",
|
|
93
|
-
"markdown-it-anchor": "9.2.0",
|
|
94
|
-
"markdownlint-cli": "0.44.0",
|
|
95
|
-
"npm-run-all": "4.1.5",
|
|
96
|
-
"rimraf": "6.0.1",
|
|
97
|
-
"rollup": "4.40.0",
|
|
98
|
-
"size-limit": "11.2.0",
|
|
99
|
-
"ts-node": "10.9.2",
|
|
100
|
-
"ts-patch": "3.3.0",
|
|
101
|
-
"ts-transformer-properties-rename": "0.17.0",
|
|
102
|
-
"ts-transformer-strip-const-enums": "2.0.0",
|
|
103
|
-
"tslib": "2.8.1",
|
|
104
|
-
"tslint": "6.1.3",
|
|
105
|
-
"tslint-eslint-rules": "5.4.0",
|
|
106
|
-
"tslint-microsoft-contrib": "6.2.0",
|
|
107
|
-
"tsx": "4.19.3",
|
|
108
|
-
"typescript": "5.5.4",
|
|
109
|
-
"yargs": "17.7.2"
|
|
110
|
-
},
|
|
111
|
-
"scripts": {
|
|
112
|
-
"prepare": "node scripts/githooks/install.js || true",
|
|
113
|
-
"clean": "rimraf lib/ dist/",
|
|
114
|
-
"bundle-dts": "dts-bundle-generator --config dts-config.json",
|
|
115
|
-
"tsc": "tspc -p tsconfig.prod.json",
|
|
116
|
-
"tsc-watch": "npm run tsc -- --watch --preserveWatchOutput",
|
|
117
|
-
"tsc-verify": "node website/scripts/generate-versions-dts.js && tsc -b tsconfig.composite.json",
|
|
118
|
-
"lint": "npm-run-all -p lint:**",
|
|
119
|
-
"lint:eslint": "eslint --format=unix ./",
|
|
120
|
-
"lint:md": "markdownlint -i \"**/node_modules/**\" -i \"**/website/docs/api/**\" -i \"**/website/versioned_docs/**/api/**\" -i \"**/*.mdx\" \"**/*.md\"",
|
|
121
|
-
"check-dts-docs": "npm-run-all -p check-dts-docs-duplicates check-dts-docs-eslint",
|
|
122
|
-
"check-dts-docs-duplicates": "node ./scripts/check-typings-for-duplicates.js ./dist/typings.d.ts",
|
|
123
|
-
"check-dts-docs-eslint": "eslint --format=unix ./dist/typings.d.ts --no-ignore",
|
|
124
|
-
"check-markdown-links": "node scripts/check-markdown-links.js",
|
|
125
|
-
"rollup": "rollup -c rollup.config.js",
|
|
126
|
-
"rollup-watch": "npm run rollup -- --watch",
|
|
127
|
-
"build": "npm-run-all tsc rollup bundle-dts",
|
|
128
|
-
"build:watch": "npm-run-all tsc -p tsc-watch rollup-watch",
|
|
129
|
-
"build:prod": "cross-env NODE_ENV=production npm run build",
|
|
130
|
-
"build:release": "cross-env BUILD_TAG=release npm run build:prod",
|
|
131
|
-
"prepare-release": "npm-run-all clean build:release && npm run prepare-package-json-for-release",
|
|
132
|
-
"prepare-package-json-for-release": "node ./scripts/clean-package-json.js",
|
|
133
|
-
"size-limit": "size-limit",
|
|
134
|
-
"verify": "npm-run-all clean -p build:prod check-markdown-links -p lint check-dts-docs tsc-verify test size-limit -p type-tests",
|
|
135
|
-
"test": "esno --import ./tests/unittests/setup.units.mjs --test './tests/unittests/**/*.spec.ts'",
|
|
136
|
-
"type-tests": "tsc -b ./src/tsconfig.composite.json && tsc -p ./tests/type-checks/tsconfig.composite.json --noEmit",
|
|
137
|
-
"e2e:coverage": "esno ./tests/e2e/coverage/runner.ts ./dist/pipsend-charts.standalone.development.js",
|
|
138
|
-
"e2e:interactions": "esno ./tests/e2e/interactions/runner.ts ./dist/pipsend-charts.standalone.development.js",
|
|
139
|
-
"e2e:memleaks": "esno ./tests/e2e/memleaks/runner.ts ./dist/pipsend-charts.standalone.development.js"
|
|
140
58
|
}
|
|
141
59
|
}
|