@baron1996/klinecharts-runtime 0.1.1 → 0.2.2
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/README.md +8 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime.d.ts +11 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +62 -7
- package/dist/toolbar/standard-toolbar-styles.d.ts.map +1 -1
- package/dist/toolbar/standard-toolbar-styles.js +34 -0
- package/dist/toolbar/standard-toolbar.d.ts.map +1 -1
- package/dist/toolbar/standard-toolbar.js +114 -2
- package/dist/toolbar/toolbar-icons.d.ts +30 -0
- package/dist/toolbar/toolbar-icons.d.ts.map +1 -1
- package/dist/toolbar/toolbar-icons.js +7 -0
- package/dist/toolbar/toolbar-tools.d.ts +5 -2
- package/dist/toolbar/toolbar-tools.d.ts.map +1 -1
- package/dist/toolbar/toolbar-tools.js +6 -0
- package/dist/types.d.ts +48 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Browser editing runtime and standard annotation toolbar for deterministic KLineC
|
|
|
4
4
|
ChartScene files.
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
|
-
npm install --save-exact @baron1996/kline-scene-schema@0.
|
|
7
|
+
npm install --save-exact @baron1996/kline-scene-schema@0.2.2 @baron1996/klinecharts-runtime@0.2.2
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
```ts
|
|
@@ -15,6 +15,9 @@ import { createKLineSceneRuntime } from '@baron1996/klinecharts-runtime';
|
|
|
15
15
|
const scene = parseChartScene(chartSceneInput);
|
|
16
16
|
let runtime = await createKLineSceneRuntime(container, scene);
|
|
17
17
|
|
|
18
|
+
await runtime.setPriceScale('linear');
|
|
19
|
+
runtime.startOverlayDrawing('priceMeasurement');
|
|
20
|
+
|
|
18
21
|
const overlayId = runtime.startOverlayDrawing('horizontalStraightLine');
|
|
19
22
|
const drawingCompleted = new Promise<void>((resolve) => {
|
|
20
23
|
const unsubscribe = runtime.subscribe((event) => {
|
|
@@ -38,3 +41,7 @@ runtime = await createKLineSceneRuntime(
|
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
The runtime does not provide undo or redo and does not fetch market data.
|
|
44
|
+
Runtime `0.2.0` events are structured-cloneable pure data with
|
|
45
|
+
`sceneVersion: 1` and `runtimeVersion: '0.2.0'`. Measurement scenes persist only
|
|
46
|
+
their two data-coordinate endpoints, styles, and opaque metadata; displayed absolute
|
|
47
|
+
and percentage changes are derived.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Web Runtime npm 包版本;ChartScene runtimeVersion 是独立的数据契约版本。 */
|
|
2
|
-
export declare const WEB_RUNTIME_PACKAGE_VERSION: "0.
|
|
2
|
+
export declare const WEB_RUNTIME_PACKAGE_VERSION: "0.2.2";
|
|
3
3
|
export { SUPPORTED_OVERLAYS } from '@baron1996/klinecharts-adapter';
|
|
4
4
|
export * from './runtime.js';
|
|
5
5
|
export * from './toolbar/standard-toolbar.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Web Runtime npm 包版本;ChartScene runtimeVersion 是独立的数据契约版本。 */
|
|
2
|
-
export const WEB_RUNTIME_PACKAGE_VERSION = '0.
|
|
2
|
+
export const WEB_RUNTIME_PACKAGE_VERSION = '0.2.2';
|
|
3
3
|
export { SUPPORTED_OVERLAYS } from '@baron1996/klinecharts-adapter';
|
|
4
4
|
export * from './runtime.js';
|
|
5
5
|
export * from './toolbar/standard-toolbar.js';
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ChartScene, SceneOverlay } from '@baron1996/kline-scene-schema';
|
|
2
|
-
import
|
|
2
|
+
import { type OverlayHitResult, type PixelCoordinate } from '@baron1996/klinecharts-adapter';
|
|
3
|
+
import type { KLineSceneRuntimeListener, KLineSceneRuntimeOptions, PriceScale, StartOverlayDrawingOptions, SupportedOverlayType } from './types.js';
|
|
3
4
|
export declare const DEFAULT_OVERLAY_STYLES: SceneOverlay['styles'];
|
|
4
5
|
/**
|
|
5
6
|
* 面向 Web、离线 HTML 和测试渲染器的纯场景 Runtime。
|
|
@@ -11,10 +12,19 @@ export declare class KLineSceneRuntime {
|
|
|
11
12
|
static create(container: HTMLElement, value: unknown, options?: KLineSceneRuntimeOptions): Promise<KLineSceneRuntime>;
|
|
12
13
|
getScene(): ChartScene;
|
|
13
14
|
exportScene(): ChartScene;
|
|
15
|
+
setPriceScale(scale: PriceScale): Promise<ChartScene>;
|
|
16
|
+
projectPoint(point: {
|
|
17
|
+
readonly timestamp: number;
|
|
18
|
+
readonly value: number;
|
|
19
|
+
}, paneId?: string): PixelCoordinate;
|
|
20
|
+
hitTestOverlay(point: PixelCoordinate): OverlayHitResult | null;
|
|
14
21
|
startOverlayDrawing(type: SupportedOverlayType, options?: StartOverlayDrawingOptions): string;
|
|
15
22
|
addOverlay(overlay: SceneOverlay): SceneOverlay;
|
|
16
23
|
updateOverlay(overlay: SceneOverlay): SceneOverlay;
|
|
24
|
+
updateOverlayStyles(id: string, styles: SceneOverlay['styles']): SceneOverlay;
|
|
17
25
|
removeOverlay(id: string): boolean;
|
|
26
|
+
requestOverlayDelete(id: string): void;
|
|
27
|
+
requestHostAction(actionId: string, overlayId?: string | null): void;
|
|
18
28
|
getOverlay(id: string): SceneOverlay | undefined;
|
|
19
29
|
listOverlays(): readonly SceneOverlay[];
|
|
20
30
|
getSelectedOverlayId(): string | undefined;
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,YAAY,EACZ,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"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AAM,GAAG,IAAI;IAatC,iBAAiB,CACvB,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,MAAM,GAAG,IAA8B,GAChD,IAAI;IAqBA,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAMhD,YAAY,IAAI,SAAS,YAAY,EAAE;IAKvC,oBAAoB,IAAI,MAAM,GAAG,SAAS;IAK1C,SAAS,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI;IAK1D,OAAO,IAAI,IAAI;CAUtB;AAED,wBAAsB,uBAAuB,CAC5C,SAAS,EAAE,WAAW,EACtB,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,wBAA6B,GACpC,OAAO,CAAC,iBAAiB,CAAC,CAE5B"}
|
package/dist/runtime.js
CHANGED
|
@@ -21,7 +21,11 @@ export const DEFAULT_OVERLAY_STYLES = {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
function toRuntimeEvent(event) {
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
...structuredClone(event),
|
|
26
|
+
sceneVersion: 1,
|
|
27
|
+
runtimeVersion: '0.2.0',
|
|
28
|
+
};
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* 面向 Web、离线 HTML 和测试渲染器的纯场景 Runtime。
|
|
@@ -35,7 +39,7 @@ export class KLineSceneRuntime {
|
|
|
35
39
|
/** Adapter 事件解绑函数。 */
|
|
36
40
|
#unsubscribeAdapter;
|
|
37
41
|
/** 当前选中标注的稳定 ID。 */
|
|
38
|
-
#selectedOverlayId;
|
|
42
|
+
#selectedOverlayId = null;
|
|
39
43
|
/** 确定性标注 ID 递增序号。 */
|
|
40
44
|
#overlaySequence = 0;
|
|
41
45
|
/** 防止销毁后的 API 继续访问引擎。 */
|
|
@@ -46,12 +50,12 @@ export class KLineSceneRuntime {
|
|
|
46
50
|
this.#events.subscribe(options.onEvent);
|
|
47
51
|
}
|
|
48
52
|
this.#unsubscribeAdapter = adapter.subscribe((event) => {
|
|
49
|
-
if (event.type === 'overlay-
|
|
53
|
+
if (event.type === 'overlay-selection-changed') {
|
|
50
54
|
this.#selectedOverlayId = event.id;
|
|
51
55
|
}
|
|
52
56
|
if (event.type === 'overlay-removed' &&
|
|
53
57
|
this.#selectedOverlayId === event.id) {
|
|
54
|
-
this.#selectedOverlayId =
|
|
58
|
+
this.#selectedOverlayId = null;
|
|
55
59
|
}
|
|
56
60
|
this.#events.emit(toRuntimeEvent(event));
|
|
57
61
|
});
|
|
@@ -61,7 +65,12 @@ export class KLineSceneRuntime {
|
|
|
61
65
|
const scene = parseChartScene(value);
|
|
62
66
|
const adapter = await KLineChartsSceneAdapter.create(container, scene);
|
|
63
67
|
const runtime = new KLineSceneRuntime(adapter, options);
|
|
64
|
-
runtime.#events.emit({
|
|
68
|
+
runtime.#events.emit({
|
|
69
|
+
type: 'scene-ready',
|
|
70
|
+
scene: runtime.getScene(),
|
|
71
|
+
sceneVersion: 1,
|
|
72
|
+
runtimeVersion: '0.2.0',
|
|
73
|
+
});
|
|
65
74
|
return runtime;
|
|
66
75
|
}
|
|
67
76
|
catch (error) {
|
|
@@ -69,6 +78,8 @@ export class KLineSceneRuntime {
|
|
|
69
78
|
options.onEvent({
|
|
70
79
|
type: 'scene-error',
|
|
71
80
|
issues: structuredClone(error.issues),
|
|
81
|
+
sceneVersion: 1,
|
|
82
|
+
runtimeVersion: '0.2.0',
|
|
72
83
|
});
|
|
73
84
|
}
|
|
74
85
|
throw error;
|
|
@@ -95,6 +106,18 @@ export class KLineSceneRuntime {
|
|
|
95
106
|
exportScene() {
|
|
96
107
|
return this.getScene();
|
|
97
108
|
}
|
|
109
|
+
async setPriceScale(scale) {
|
|
110
|
+
this.#assertActive();
|
|
111
|
+
return structuredClone(await this.#adapter.setPriceScale(scale));
|
|
112
|
+
}
|
|
113
|
+
projectPoint(point, paneId) {
|
|
114
|
+
this.#assertActive();
|
|
115
|
+
return structuredClone(this.#adapter.projectPoint(point, paneId));
|
|
116
|
+
}
|
|
117
|
+
hitTestOverlay(point) {
|
|
118
|
+
this.#assertActive();
|
|
119
|
+
return structuredClone(this.#adapter.hitTestOverlay(point));
|
|
120
|
+
}
|
|
98
121
|
startOverlayDrawing(type, options = {}) {
|
|
99
122
|
this.#assertActive();
|
|
100
123
|
const scene = this.#adapter.exportScene();
|
|
@@ -129,10 +152,42 @@ export class KLineSceneRuntime {
|
|
|
129
152
|
this.#assertActive();
|
|
130
153
|
return structuredClone(this.#adapter.updateOverlay(structuredClone(overlay)));
|
|
131
154
|
}
|
|
155
|
+
updateOverlayStyles(id, styles) {
|
|
156
|
+
this.#assertActive();
|
|
157
|
+
return structuredClone(this.#adapter.updateOverlayStyles(id, structuredClone(styles)));
|
|
158
|
+
}
|
|
132
159
|
removeOverlay(id) {
|
|
133
160
|
this.#assertActive();
|
|
134
161
|
return this.#adapter.removeOverlay(id);
|
|
135
162
|
}
|
|
163
|
+
requestOverlayDelete(id) {
|
|
164
|
+
this.#assertActive();
|
|
165
|
+
if (this.#adapter.getOverlay(id) === undefined) {
|
|
166
|
+
throw new SceneError('INVALID_REFERENCE', '/overlays', `Overlay ${id} does not exist.`);
|
|
167
|
+
}
|
|
168
|
+
this.#events.emit({
|
|
169
|
+
type: 'overlay-delete-requested',
|
|
170
|
+
overlayId: id,
|
|
171
|
+
sceneVersion: 1,
|
|
172
|
+
runtimeVersion: '0.2.0',
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
requestHostAction(actionId, overlayId = this.#selectedOverlayId) {
|
|
176
|
+
this.#assertActive();
|
|
177
|
+
if (actionId.length === 0) {
|
|
178
|
+
throw new SceneError('SCENE_SCHEMA_INVALID', '/actionId', 'Host actionId must be non-empty.');
|
|
179
|
+
}
|
|
180
|
+
if (overlayId !== null && this.#adapter.getOverlay(overlayId) === undefined) {
|
|
181
|
+
throw new SceneError('INVALID_REFERENCE', '/overlayId', `Overlay ${overlayId} does not exist.`);
|
|
182
|
+
}
|
|
183
|
+
this.#events.emit({
|
|
184
|
+
type: 'host-action-requested',
|
|
185
|
+
actionId,
|
|
186
|
+
overlayId,
|
|
187
|
+
sceneVersion: 1,
|
|
188
|
+
runtimeVersion: '0.2.0',
|
|
189
|
+
});
|
|
190
|
+
}
|
|
136
191
|
getOverlay(id) {
|
|
137
192
|
this.#assertActive();
|
|
138
193
|
const overlay = this.#adapter.getOverlay(id);
|
|
@@ -144,7 +199,7 @@ export class KLineSceneRuntime {
|
|
|
144
199
|
}
|
|
145
200
|
getSelectedOverlayId() {
|
|
146
201
|
this.#assertActive();
|
|
147
|
-
return this.#selectedOverlayId;
|
|
202
|
+
return this.#selectedOverlayId ?? undefined;
|
|
148
203
|
}
|
|
149
204
|
subscribe(listener) {
|
|
150
205
|
this.#assertActive();
|
|
@@ -156,9 +211,9 @@ export class KLineSceneRuntime {
|
|
|
156
211
|
}
|
|
157
212
|
this.#destroyed = true;
|
|
158
213
|
runRuntimeTeardowns(this);
|
|
214
|
+
this.#adapter.dispose();
|
|
159
215
|
this.#unsubscribeAdapter();
|
|
160
216
|
this.#events.clear();
|
|
161
|
-
this.#adapter.dispose();
|
|
162
217
|
}
|
|
163
218
|
}
|
|
164
219
|
export async function createKLineSceneRuntime(container, scene, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-toolbar-styles.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar-styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"standard-toolbar-styles.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar-styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,QA4PnC,CAAC"}
|
|
@@ -54,6 +54,40 @@ export const STANDARD_TOOLBAR_STYLES = String.raw `
|
|
|
54
54
|
border-left: 1px solid rgba(217, 220, 227, 1);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
.baron-kline-toolbar__control {
|
|
58
|
+
display: grid;
|
|
59
|
+
flex: 0 0 auto;
|
|
60
|
+
gap: 2px;
|
|
61
|
+
color: rgba(76, 82, 96, 1);
|
|
62
|
+
font-size: 9px;
|
|
63
|
+
line-height: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.baron-kline-toolbar__control select,
|
|
67
|
+
.baron-kline-toolbar__control input {
|
|
68
|
+
width: 78px;
|
|
69
|
+
height: 24px;
|
|
70
|
+
padding: 0 5px;
|
|
71
|
+
color: rgba(32, 35, 42, 1);
|
|
72
|
+
background: rgba(248, 249, 251, 1);
|
|
73
|
+
border: 1px solid rgba(217, 220, 227, 1);
|
|
74
|
+
border-radius: 5px;
|
|
75
|
+
font: inherit;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.baron-kline-toolbar__control input[type="color"] {
|
|
79
|
+
width: 38px;
|
|
80
|
+
padding: 2px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.baron-kline-toolbar__host-action {
|
|
84
|
+
width: auto;
|
|
85
|
+
min-width: 34px;
|
|
86
|
+
padding: 0 9px;
|
|
87
|
+
font: inherit;
|
|
88
|
+
font-size: 11px;
|
|
89
|
+
}
|
|
90
|
+
|
|
57
91
|
.baron-kline-toolbar__button {
|
|
58
92
|
position: relative;
|
|
59
93
|
display: grid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EACX,eAAe,EACf,sBAAsB,EAEtB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"standard-toolbar.d.ts","sourceRoot":"","sources":["../../src/toolbar/standard-toolbar.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EACX,eAAe,EACf,sBAAsB,EAEtB,MAAM,aAAa,CAAC;AA8NrB,2BAA2B;AAC3B,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,sBAA2B,GAClC,eAAe,CA4NjB"}
|
|
@@ -5,6 +5,17 @@ import { createToolbarIcon } from './toolbar-icons.js';
|
|
|
5
5
|
import { STANDARD_TOOLBAR_STYLES } from './standard-toolbar-styles.js';
|
|
6
6
|
import { OVERLAY_TOOL_PRESENTATIONS, TEXT_OVERLAY_TYPES, TOOLBAR_ACTIONS, TOOLBAR_GROUPS, } from './toolbar-tools.js';
|
|
7
7
|
let nextToolbarId = 1;
|
|
8
|
+
/** 将 HTML color 控件的 #RRGGBB 边界值归一化为 Scene v1 唯一的 rgba 表示。 */
|
|
9
|
+
function htmlHexColorToSceneRgba(value) {
|
|
10
|
+
const match = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(value);
|
|
11
|
+
if (match === null) {
|
|
12
|
+
throw new TypeError(`Invalid HTML color value: ${value}`);
|
|
13
|
+
}
|
|
14
|
+
const red = Number.parseInt(match[1], 16);
|
|
15
|
+
const green = Number.parseInt(match[2], 16);
|
|
16
|
+
const blue = Number.parseInt(match[3], 16);
|
|
17
|
+
return `rgba(${red}, ${green}, ${blue}, 1)`;
|
|
18
|
+
}
|
|
8
19
|
function createIconButton(presentation, action) {
|
|
9
20
|
const element = document.createElement('button');
|
|
10
21
|
element.type = 'button';
|
|
@@ -111,6 +122,35 @@ function setActiveOverlayButton(buttons, activeButton) {
|
|
|
111
122
|
button.setAttribute('aria-pressed', String(button === activeButton));
|
|
112
123
|
}
|
|
113
124
|
}
|
|
125
|
+
function createSelectControl(labelText, action, values) {
|
|
126
|
+
const label = document.createElement('label');
|
|
127
|
+
label.className = 'baron-kline-toolbar__control';
|
|
128
|
+
const text = document.createElement('span');
|
|
129
|
+
text.textContent = labelText;
|
|
130
|
+
const select = document.createElement('select');
|
|
131
|
+
select.dataset.action = action;
|
|
132
|
+
select.setAttribute('aria-label', labelText);
|
|
133
|
+
for (const value of values) {
|
|
134
|
+
const option = document.createElement('option');
|
|
135
|
+
option.value = value.value;
|
|
136
|
+
option.textContent = value.label;
|
|
137
|
+
select.append(option);
|
|
138
|
+
}
|
|
139
|
+
label.append(text, select);
|
|
140
|
+
return { label, select };
|
|
141
|
+
}
|
|
142
|
+
function createInputControl(labelText, action, type) {
|
|
143
|
+
const label = document.createElement('label');
|
|
144
|
+
label.className = 'baron-kline-toolbar__control';
|
|
145
|
+
const text = document.createElement('span');
|
|
146
|
+
text.textContent = labelText;
|
|
147
|
+
const input = document.createElement('input');
|
|
148
|
+
input.type = type;
|
|
149
|
+
input.dataset.action = action;
|
|
150
|
+
input.setAttribute('aria-label', labelText);
|
|
151
|
+
label.append(text, input);
|
|
152
|
+
return { label, input };
|
|
153
|
+
}
|
|
114
154
|
/** 创建不含撤销/重做的标准离线编辑工具栏。 */
|
|
115
155
|
export function createStandardToolbar(container, runtime, options = {}) {
|
|
116
156
|
const toolbarId = nextToolbarId++;
|
|
@@ -136,13 +176,68 @@ export function createStandardToolbar(container, runtime, options = {}) {
|
|
|
136
176
|
textInput.dataset.action = 'overlay-text';
|
|
137
177
|
textInput.setAttribute('aria-label', '标注文本');
|
|
138
178
|
textInput.placeholder = '输入标注文本';
|
|
179
|
+
const scaleControl = createSelectControl('价格轴', 'price-scale', [
|
|
180
|
+
{ value: 'linear', label: '线性' },
|
|
181
|
+
{ value: 'logarithmic', label: '对数' },
|
|
182
|
+
]);
|
|
183
|
+
const lineStyleControl = createSelectControl('线型', 'line-style', [
|
|
184
|
+
{ value: 'solid', label: '实线' },
|
|
185
|
+
{ value: 'dashed', label: '虚线' },
|
|
186
|
+
]);
|
|
187
|
+
const lineSizeControl = createInputControl('线宽', 'line-size', 'number');
|
|
188
|
+
lineSizeControl.input.min = '0.5';
|
|
189
|
+
lineSizeControl.input.max = '10';
|
|
190
|
+
lineSizeControl.input.step = '0.5';
|
|
191
|
+
lineSizeControl.input.value = '1';
|
|
192
|
+
const lineColorControl = createInputControl('线色', 'line-color', 'color');
|
|
193
|
+
lineColorControl.input.value = '#2962ff';
|
|
194
|
+
const primaryAxis = runtime.getScene().panes
|
|
195
|
+
.find((pane) => pane.kind === 'candle')
|
|
196
|
+
?.yAxes.find((axis) => axis.role === 'primary');
|
|
197
|
+
scaleControl.select.value = primaryAxis?.scale ?? 'linear';
|
|
198
|
+
const applySelectedLineStyle = (change) => {
|
|
199
|
+
const id = runtime.getSelectedOverlayId();
|
|
200
|
+
const overlay = id === undefined ? undefined : runtime.getOverlay(id);
|
|
201
|
+
if (id === undefined || overlay === undefined) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
runtime.updateOverlayStyles(id, {
|
|
205
|
+
...structuredClone(overlay.styles),
|
|
206
|
+
line: {
|
|
207
|
+
...structuredClone(overlay.styles.line),
|
|
208
|
+
...change,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
const handleScaleChange = async () => {
|
|
213
|
+
await runtime.setPriceScale(scaleControl.select.value);
|
|
214
|
+
};
|
|
215
|
+
const handleLineStyleChange = () => {
|
|
216
|
+
applySelectedLineStyle({
|
|
217
|
+
style: lineStyleControl.select.value,
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
const handleLineSizeChange = () => {
|
|
221
|
+
applySelectedLineStyle({ size: lineSizeControl.input.valueAsNumber });
|
|
222
|
+
};
|
|
223
|
+
const handleLineColorChange = () => {
|
|
224
|
+
applySelectedLineStyle({ color: htmlHexColorToSceneRgba(lineColorControl.input.value) });
|
|
225
|
+
};
|
|
226
|
+
scaleControl.select.addEventListener('change', handleScaleChange);
|
|
227
|
+
lineStyleControl.select.addEventListener('change', handleLineStyleChange);
|
|
228
|
+
lineSizeControl.input.addEventListener('change', handleLineSizeChange);
|
|
229
|
+
lineColorControl.input.addEventListener('change', handleLineColorChange);
|
|
230
|
+
cleanupCallbacks.push(() => scaleControl.select.removeEventListener('change', handleScaleChange), () => lineStyleControl.select.removeEventListener('change', handleLineStyleChange), () => lineSizeControl.input.removeEventListener('change', handleLineSizeChange), () => lineColorControl.input.removeEventListener('change', handleLineColorChange));
|
|
139
231
|
for (const group of TOOLBAR_GROUPS) {
|
|
140
232
|
const groupElement = document.createElement('div');
|
|
141
233
|
groupElement.className = 'baron-kline-toolbar__group';
|
|
142
234
|
groupElement.dataset.toolbarGroup = group.id;
|
|
143
235
|
groupElement.setAttribute('role', 'group');
|
|
144
236
|
groupElement.setAttribute('aria-label', group.label);
|
|
145
|
-
if (group.id === '
|
|
237
|
+
if (group.id === 'edit') {
|
|
238
|
+
groupElement.append(scaleControl.label, lineStyleControl.label, lineSizeControl.label, lineColorControl.label);
|
|
239
|
+
}
|
|
240
|
+
else if (group.id === 'action') {
|
|
146
241
|
for (const presentation of TOOLBAR_ACTIONS) {
|
|
147
242
|
const action = presentation.action === 'delete'
|
|
148
243
|
? () => {
|
|
@@ -152,7 +247,12 @@ export function createStandardToolbar(container, runtime, options = {}) {
|
|
|
152
247
|
}
|
|
153
248
|
const overlay = runtime.getOverlay(id);
|
|
154
249
|
if (overlay !== undefined && !overlay.locked) {
|
|
155
|
-
|
|
250
|
+
if ((options.deleteBehavior ?? 'direct') === 'request') {
|
|
251
|
+
runtime.requestOverlayDelete(id);
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
runtime.removeOverlay(id);
|
|
255
|
+
}
|
|
156
256
|
}
|
|
157
257
|
}
|
|
158
258
|
: () => {
|
|
@@ -163,6 +263,18 @@ export function createStandardToolbar(container, runtime, options = {}) {
|
|
|
163
263
|
groupElement.append(button.element);
|
|
164
264
|
cleanupCallbacks.push(button.cleanup, tooltip.bind(button.element, presentation.label, presentation.action));
|
|
165
265
|
}
|
|
266
|
+
for (const hostAction of options.hostActions ?? []) {
|
|
267
|
+
const button = document.createElement('button');
|
|
268
|
+
button.type = 'button';
|
|
269
|
+
button.className = 'baron-kline-toolbar__button baron-kline-toolbar__host-action';
|
|
270
|
+
button.dataset.hostAction = hostAction.actionId;
|
|
271
|
+
button.textContent = hostAction.label;
|
|
272
|
+
button.setAttribute('aria-label', hostAction.label);
|
|
273
|
+
const action = () => runtime.requestHostAction(hostAction.actionId, runtime.getSelectedOverlayId() ?? null);
|
|
274
|
+
button.addEventListener('click', action);
|
|
275
|
+
groupElement.append(button);
|
|
276
|
+
cleanupCallbacks.push(() => button.removeEventListener('click', action));
|
|
277
|
+
}
|
|
166
278
|
}
|
|
167
279
|
else {
|
|
168
280
|
for (const overlayType of SUPPORTED_OVERLAYS) {
|
|
@@ -263,6 +263,36 @@ declare const ICON_SPECS: {
|
|
|
263
263
|
readonly d: "M5 4l14 17";
|
|
264
264
|
};
|
|
265
265
|
}];
|
|
266
|
+
readonly measurement: readonly [{
|
|
267
|
+
readonly name: "path";
|
|
268
|
+
readonly attributes: {
|
|
269
|
+
readonly d: "M4 19l15 -15";
|
|
270
|
+
};
|
|
271
|
+
}, {
|
|
272
|
+
readonly name: "circle";
|
|
273
|
+
readonly attributes: {
|
|
274
|
+
readonly cx: "4";
|
|
275
|
+
readonly cy: "19";
|
|
276
|
+
readonly r: "2";
|
|
277
|
+
};
|
|
278
|
+
}, {
|
|
279
|
+
readonly name: "circle";
|
|
280
|
+
readonly attributes: {
|
|
281
|
+
readonly cx: "19";
|
|
282
|
+
readonly cy: "4";
|
|
283
|
+
readonly r: "2";
|
|
284
|
+
};
|
|
285
|
+
}, {
|
|
286
|
+
readonly name: "path";
|
|
287
|
+
readonly attributes: {
|
|
288
|
+
readonly d: "M7 8h9";
|
|
289
|
+
};
|
|
290
|
+
}, {
|
|
291
|
+
readonly name: "path";
|
|
292
|
+
readonly attributes: {
|
|
293
|
+
readonly d: "M12 5v6";
|
|
294
|
+
};
|
|
295
|
+
}];
|
|
266
296
|
readonly brush: readonly [{
|
|
267
297
|
readonly name: "path";
|
|
268
298
|
readonly attributes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar-icons.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-icons.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"toolbar-icons.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-icons.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwK2C,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,UAAU,CAAC;AAEtD,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,GAAG,aAAa,CAoBtE"}
|
|
@@ -78,6 +78,13 @@ const ICON_SPECS = {
|
|
|
78
78
|
{ name: 'path', attributes: { d: 'M4 21h16' } },
|
|
79
79
|
{ name: 'path', attributes: { d: 'M5 4l14 17' } },
|
|
80
80
|
],
|
|
81
|
+
measurement: [
|
|
82
|
+
{ name: 'path', attributes: { d: 'M4 19l15 -15' } },
|
|
83
|
+
{ name: 'circle', attributes: { cx: '4', cy: '19', r: '2' } },
|
|
84
|
+
{ name: 'circle', attributes: { cx: '19', cy: '4', r: '2' } },
|
|
85
|
+
{ name: 'path', attributes: { d: 'M7 8h9' } },
|
|
86
|
+
{ name: 'path', attributes: { d: 'M12 5v6' } },
|
|
87
|
+
],
|
|
81
88
|
brush: [
|
|
82
89
|
{ name: 'path', attributes: { d: 'M3 21v-4a4 4 0 1 1 4 4h-4' } },
|
|
83
90
|
{ name: 'path', attributes: { d: 'M21 3a16 16 0 0 0 -12.8 10.2' } },
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { SupportedOverlayType } from '../types.js';
|
|
2
2
|
import type { ToolbarIconName } from './toolbar-icons.js';
|
|
3
|
-
export type ToolbarGroupId = 'horizontal' | 'vertical' | 'trend' | 'analysis' | 'annotation' | 'shape' | 'action';
|
|
3
|
+
export type ToolbarGroupId = 'horizontal' | 'vertical' | 'trend' | 'analysis' | 'annotation' | 'shape' | 'edit' | 'action';
|
|
4
4
|
export interface ToolbarGroup {
|
|
5
5
|
readonly id: ToolbarGroupId;
|
|
6
6
|
readonly label: string;
|
|
7
7
|
}
|
|
8
8
|
export interface ToolbarToolPresentation {
|
|
9
9
|
readonly label: string;
|
|
10
|
-
readonly group: Exclude<ToolbarGroupId, 'action'>;
|
|
10
|
+
readonly group: Exclude<ToolbarGroupId, 'action' | 'edit'>;
|
|
11
11
|
readonly icon: ToolbarIconName;
|
|
12
12
|
}
|
|
13
13
|
export interface ToolbarActionPresentation {
|
|
@@ -35,6 +35,9 @@ export declare const TOOLBAR_GROUPS: readonly [{
|
|
|
35
35
|
}, {
|
|
36
36
|
readonly id: "shape";
|
|
37
37
|
readonly label: "形状与文本";
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "edit";
|
|
40
|
+
readonly label: "坐标与样式";
|
|
38
41
|
}, {
|
|
39
42
|
readonly id: "action";
|
|
40
43
|
readonly label: "操作";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar-tools.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,UAAU,GACV,OAAO,GACP,UAAU,GACV,YAAY,GACZ,OAAO,GACP,QAAQ,CAAC;AAEZ,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbar-tools.d.ts","sourceRoot":"","sources":["../../src/toolbar/toolbar-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,cAAc,GACvB,YAAY,GACZ,UAAU,GACV,OAAO,GACP,UAAU,GACV,YAAY,GACZ,OAAO,GACP,MAAM,GACN,QAAQ,CAAC;AAEZ,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,CAAC;IAC3D,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAC/B;AAED,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;CAC/B;AAED,4BAA4B;AAC5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EASiB,CAAC;AAE7C,qCAAqC;AACrC,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAChD,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAgHrD,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;EAa6B,CAAC;AAE1D,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,oBAAoB,CAK/D,CAAC"}
|
|
@@ -6,6 +6,7 @@ export const TOOLBAR_GROUPS = [
|
|
|
6
6
|
{ id: 'analysis', label: '价格与分析' },
|
|
7
7
|
{ id: 'annotation', label: '标注' },
|
|
8
8
|
{ id: 'shape', label: '形状与文本' },
|
|
9
|
+
{ id: 'edit', label: '坐标与样式' },
|
|
9
10
|
{ id: 'action', label: '操作' },
|
|
10
11
|
];
|
|
11
12
|
/** 每个已注册 Overlay 都必须具备唯一且完整的图标语义。 */
|
|
@@ -75,6 +76,11 @@ export const OVERLAY_TOOL_PRESENTATIONS = {
|
|
|
75
76
|
group: 'analysis',
|
|
76
77
|
icon: 'fibonacci',
|
|
77
78
|
},
|
|
79
|
+
priceMeasurement: {
|
|
80
|
+
label: '价格量度',
|
|
81
|
+
group: 'analysis',
|
|
82
|
+
icon: 'measurement',
|
|
83
|
+
},
|
|
78
84
|
brush: {
|
|
79
85
|
label: '画笔',
|
|
80
86
|
group: 'annotation',
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import type { ChartScene, JsonObject, SceneIssue, SceneOverlay } from '@baron1996/kline-scene-schema';
|
|
2
2
|
import type { SUPPORTED_OVERLAYS } from '@baron1996/klinecharts-adapter';
|
|
3
3
|
export type SupportedOverlayType = (typeof SUPPORTED_OVERLAYS)[number];
|
|
4
|
-
export
|
|
4
|
+
export interface KLineSceneRuntimeEventEnvelope {
|
|
5
|
+
readonly sceneVersion: 1;
|
|
6
|
+
readonly runtimeVersion: '0.2.0';
|
|
7
|
+
}
|
|
8
|
+
export type OverlayDragTarget = 'body' | 'anchor';
|
|
9
|
+
export type OverlayDragCancelReason = 'escape' | 'pointer-cancel' | 'window-blur' | 'destroy' | 'validation-error';
|
|
10
|
+
export type PriceScale = 'linear' | 'logarithmic';
|
|
11
|
+
interface OverlayDragEventIdentity {
|
|
12
|
+
readonly interactionId: string;
|
|
13
|
+
readonly overlayId: string;
|
|
14
|
+
readonly target: OverlayDragTarget;
|
|
15
|
+
readonly anchorIndex: number | null;
|
|
16
|
+
readonly before: SceneOverlay;
|
|
17
|
+
}
|
|
18
|
+
type KLineSceneRuntimeEventPayload = {
|
|
5
19
|
readonly type: 'scene-ready';
|
|
6
20
|
readonly scene: ChartScene;
|
|
7
21
|
} | {
|
|
@@ -10,16 +24,43 @@ export type KLineSceneRuntimeEvent = {
|
|
|
10
24
|
} | {
|
|
11
25
|
readonly type: 'overlay-updated';
|
|
12
26
|
readonly overlay: SceneOverlay;
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: 'overlay-style-changed';
|
|
29
|
+
readonly before: SceneOverlay;
|
|
30
|
+
readonly overlay: SceneOverlay;
|
|
13
31
|
} | {
|
|
14
32
|
readonly type: 'overlay-removed';
|
|
15
33
|
readonly id: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly type: 'overlay-selection-changed';
|
|
36
|
+
readonly previousId: string | null;
|
|
37
|
+
readonly id: string | null;
|
|
16
38
|
} | {
|
|
17
39
|
readonly type: 'overlay-selected';
|
|
18
40
|
readonly id: string;
|
|
41
|
+
} | ({
|
|
42
|
+
readonly type: 'overlay-drag-started';
|
|
43
|
+
} & OverlayDragEventIdentity) | ({
|
|
44
|
+
readonly type: 'overlay-dragging';
|
|
45
|
+
readonly candidate: SceneOverlay;
|
|
46
|
+
} & OverlayDragEventIdentity) | ({
|
|
47
|
+
readonly type: 'overlay-drag-committed';
|
|
48
|
+
readonly overlay: SceneOverlay;
|
|
49
|
+
} & OverlayDragEventIdentity) | ({
|
|
50
|
+
readonly type: 'overlay-drag-cancelled';
|
|
51
|
+
readonly reason: OverlayDragCancelReason;
|
|
52
|
+
} & OverlayDragEventIdentity) | {
|
|
53
|
+
readonly type: 'overlay-delete-requested';
|
|
54
|
+
readonly overlayId: string;
|
|
55
|
+
} | {
|
|
56
|
+
readonly type: 'host-action-requested';
|
|
57
|
+
readonly actionId: string;
|
|
58
|
+
readonly overlayId: string | null;
|
|
19
59
|
} | {
|
|
20
60
|
readonly type: 'scene-error';
|
|
21
61
|
readonly issues: readonly SceneIssue[];
|
|
22
62
|
};
|
|
63
|
+
export type KLineSceneRuntimeEvent = KLineSceneRuntimeEventPayload & KLineSceneRuntimeEventEnvelope;
|
|
23
64
|
export type KLineSceneRuntimeListener = (event: KLineSceneRuntimeEvent) => void;
|
|
24
65
|
export interface KLineSceneRuntimeOptions {
|
|
25
66
|
readonly onEvent?: KLineSceneRuntimeListener;
|
|
@@ -38,9 +79,15 @@ export interface StartOverlayDrawingOptions {
|
|
|
38
79
|
}
|
|
39
80
|
export interface StandardToolbarOptions {
|
|
40
81
|
readonly downloadFileName?: string;
|
|
82
|
+
readonly deleteBehavior?: 'direct' | 'request';
|
|
83
|
+
readonly hostActions?: readonly {
|
|
84
|
+
readonly actionId: string;
|
|
85
|
+
readonly label: string;
|
|
86
|
+
}[];
|
|
41
87
|
}
|
|
42
88
|
export interface StandardToolbar {
|
|
43
89
|
readonly element: HTMLElement;
|
|
44
90
|
destroy(): void;
|
|
45
91
|
}
|
|
92
|
+
export {};
|
|
46
93
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,MAAM,WAAW,8BAA8B;IAC9C,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,uBAAuB,GAChC,QAAQ,GACR,gBAAgB,GAChB,aAAa,GACb,SAAS,GACT,kBAAkB,CAAC;AACtB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,aAAa,CAAC;AAElD,UAAU,wBAAwB;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC9B;AAED,KAAK,6BAA6B,GAC/B;IAAE,QAAQ,C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;IACtC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/C,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS;QAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;CACJ;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,OAAO,IAAI,IAAI,CAAC;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baron1996/klinecharts-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Web runtime for deterministic KLineCharts scenes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@baron1996/kline-scene-schema": "0.
|
|
43
|
-
"@baron1996/klinecharts-adapter": "0.
|
|
42
|
+
"@baron1996/kline-scene-schema": "0.2.2",
|
|
43
|
+
"@baron1996/klinecharts-adapter": "0.2.2"
|
|
44
44
|
}
|
|
45
45
|
}
|