charts-core 1.1.61 → 1.1.62
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 +57 -57
- package/dist/charts-core.css +1 -1
- package/dist/charts-core.js +98 -86
- package/dist/charts-core.js.map +1 -1
- package/dist/charts-core.umd.cjs +3 -3
- package/dist/charts-core.umd.cjs.map +1 -1
- package/package.json +48 -48
package/README.md
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
# ChartsCore Library
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npm i charts-core
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Don't forget to connect CSS styles to the project. Project styles should be connected later and have priority for convenient override.
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
import 'charts-core/style.css'
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Quick start
|
|
16
|
-
|
|
17
|
-
### Line chart
|
|
18
|
-
|
|
19
|
-
[See full Line chart documentation](./src/docs/line-chart.md)
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
// to create new instance of chart
|
|
23
|
-
const chart = createLineChart('#line-chart', {
|
|
24
|
-
chartId: 'some-chart',
|
|
25
|
-
data: [
|
|
26
|
-
{ date: '2025-02-02T00:00:00.000Z', value: 2800 },
|
|
27
|
-
{ date: '2025-02-16T00:00:00.000Z', value: 2970 },
|
|
28
|
-
{ date: '2025-03-02T00:00:00.000Z', value: 4120 },
|
|
29
|
-
{ date: '2025-03-16T00:00:00.000Z', value: 4260 },
|
|
30
|
-
{ date: '2025-04-02T00:00:00.000Z', value: 4120 },
|
|
31
|
-
],
|
|
32
|
-
config: {
|
|
33
|
-
margin: {
|
|
34
|
-
right: 50,
|
|
35
|
-
},
|
|
36
|
-
yAxis: {
|
|
37
|
-
customTicks: true,
|
|
38
|
-
ticks: [8, 'd'],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
// to update it
|
|
44
|
-
chart.update({
|
|
45
|
-
data: newData,
|
|
46
|
-
config: {
|
|
47
|
-
theme: 'dark',
|
|
48
|
-
},
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
// or destroy
|
|
52
|
-
chart.destroy()
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Candlestick chart
|
|
56
|
-
|
|
57
|
-
[See full Candlestick chart documentation](./src/docs/candlestick.md)
|
|
1
|
+
# ChartsCore Library
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i charts-core
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Don't forget to connect CSS styles to the project. Project styles should be connected later and have priority for convenient override.
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import 'charts-core/style.css'
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
### Line chart
|
|
18
|
+
|
|
19
|
+
[See full Line chart documentation](./src/docs/line-chart.md)
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// to create new instance of chart
|
|
23
|
+
const chart = createLineChart('#line-chart', {
|
|
24
|
+
chartId: 'some-chart',
|
|
25
|
+
data: [
|
|
26
|
+
{ date: '2025-02-02T00:00:00.000Z', value: 2800 },
|
|
27
|
+
{ date: '2025-02-16T00:00:00.000Z', value: 2970 },
|
|
28
|
+
{ date: '2025-03-02T00:00:00.000Z', value: 4120 },
|
|
29
|
+
{ date: '2025-03-16T00:00:00.000Z', value: 4260 },
|
|
30
|
+
{ date: '2025-04-02T00:00:00.000Z', value: 4120 },
|
|
31
|
+
],
|
|
32
|
+
config: {
|
|
33
|
+
margin: {
|
|
34
|
+
right: 50,
|
|
35
|
+
},
|
|
36
|
+
yAxis: {
|
|
37
|
+
customTicks: true,
|
|
38
|
+
ticks: [8, 'd'],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// to update it
|
|
44
|
+
chart.update({
|
|
45
|
+
data: newData,
|
|
46
|
+
config: {
|
|
47
|
+
theme: 'dark',
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
// or destroy
|
|
52
|
+
chart.destroy()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Candlestick chart
|
|
56
|
+
|
|
57
|
+
[See full Candlestick chart documentation](./src/docs/candlestick.md)
|
package/dist/charts-core.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.sc-charts{--sc-color-main-line: #007aff;--sc-color-hover-circle-fill: #007aff;--sc-color-hover-circle-stroke: #ffffff;--sc-color-range-circle-stroke: #ffffff;--sc-color-selection-up: #56b683;--sc-color-selection-up-tooltip-text: #56b683;--sc-color-selection-down: #f18169;--sc-color-selection-down-tooltip-text: #e8674b;--sc-color-text-secondary: #8e8e93;--sc-size-axis-text: 12px;--sc-color-below-zero-line: #e8674b;--sc-color-hover-circles: #56b683;--sc-color-hover-circles_hover: #aed6bf;color:var(--sc-color-text-base);position:relative}.sc-charts__light{--sc-color-bg: #ffffff;--sc-color-axis-text: #ababae;--sc-color-axis-zero-line: #ededed;--sc-color-selection-down-tooltip-bg: #fdf5f3;--sc-color-selection-down-tooltip-border: #fde8e3;--sc-color-selection-up-tooltip-bg: #f3f9f5;--sc-color-selection-up-tooltip-border: #d9eee0;--sc-color-text-base: #1c2026;--sc-color-main-line-muted: #d9ebff;--sc-color-main-line-selected-muted: #ededed;--sc-color-hover-line: #c7c7c9;--sc-color-hover-tooltip-border: #ededed;--sc-color-hover-tooltip-bg: #ffffff;--sc-shadow-range-tooltip-up: 0px 2px 20px 0px #d9f2e166;--sc-shadow-range-tooltip-down: 0px 2px 20px 0px #fde8e366;--sc-shadow-hover-tooltip: 0px 2px 20px 0px #d1d1d166}.sc-charts__dark{--sc-color-bg: #101213;--sc-color-axis-text: #8e8e93;--sc-color-axis-zero-line: #3d3d3d;--sc-color-selection-down-tooltip-bg: #2d1915;--sc-color-selection-down-tooltip-border: #6c3a2f;--sc-color-selection-up-tooltip-bg: #192b23;--sc-color-selection-up-tooltip-border: #254034;--sc-color-text-base: #ffffff;--sc-color-main-line-muted: #0e2236;--sc-color-main-line-selected-muted: #292929;--sc-color-hover-line: #ffffff;--sc-color-hover-tooltip-border: #343b46;--sc-color-hover-tooltip-bg: #1c2026;--sc-shadow-range-tooltip-up: 0px 2px 20px 0px #316a4b66;--sc-shadow-range-tooltip-down: 0px 2px 20px 0px #6c3a2f66;--sc-shadow-hover-tooltip: 0px 2px 20px 0px #343b4666}.sc-charts__main-line{stroke:var(--sc-color-main-line);stroke-width:2;fill:none;transition:all .3s;stroke-linecap:round;stroke-linejoin:round}.sc-charts__main-line_muted{stroke:var(--sc-color-main-line-muted);transition:all .3s}.sc-charts__main-line_selected-muted{stroke:var(--sc-color-main-line-selected-muted);transition:all .3s}.sc-charts__range-tooltip{overflow:visible;-webkit-user-select:none;user-select:none;font-family:inherit;font-weight:400;font-size:14px}.sc-charts__range-tooltip-container{display:inline-block;white-space:nowrap;padding:8px 12px;border:1px solid;border-radius:8px}.sc-charts__range-tooltip-sum{font-weight:600;margin-bottom:2px;display:flex;align-items:center;gap:8px}.sc-charts__range-tooltip-sum-icon{display:flex;align-items:center;justify-items:center}.sc-charts__range-tooltip_down .sc-charts__range-tooltip-sum-icon{transform:rotate(180deg)}.sc-charts__range-tooltip_up .sc-charts__range-tooltip-container{background-color:var(--sc-color-selection-up-tooltip-bg);border-color:var(--sc-color-selection-up-tooltip-border);box-shadow:var(--sc-shadow-range-tooltip-up)}.sc-charts__range-tooltip_up .sc-charts__range-tooltip-sum{color:var(--sc-color-selection-up-tooltip-text)}.sc-charts__range-tooltip_down .sc-charts__range-tooltip-container{background-color:var(--sc-color-selection-down-tooltip-bg);border-color:var(--sc-color-selection-down-tooltip-border);box-shadow:var(--sc-shadow-range-tooltip-down)}.sc-charts__range-tooltip_down .sc-charts__range-tooltip-sum{color:var(--sc-color-selection-down-tooltip-text)}.sc-charts__hover-circle{stroke:var(--sc-color-hover-circle-stroke);fill:var(--sc-color-hover-circle-fill);stroke-width:2}.sc-charts__range-circle-left,.sc-charts__range-circle-right{stroke:var(--sc-color-range-circle-stroke);stroke-width:2}.sc-charts__range-circle-left_up,.sc-charts__range-circle-right_up{fill:var(--sc-color-selection-up)}.sc-charts__range-circle-left_down,.sc-charts__range-circle-right_down{fill:var(--sc-color-selection-down)}.sc-charts__range-line{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;opacity:1}.sc-charts__range-line_hidden{opacity:0}.sc-charts__range-line_up{stroke:var(--sc-color-selection-up)}.sc-charts__range-line_down{stroke:var(--sc-color-selection-down)}.sc-charts__border-range-line{stroke-width:1}.sc-charts__border-range-line_up{stroke:url(#gradient-range-borders-up)}.sc-charts__border-range-line_down{stroke:url(#gradient-range-borders-down)}.sc-charts__hover-line{stroke:url(#hover-line-gradient);stroke-width:1}.sc-charts__highlight-line{stroke-width:2;fill:none;stroke:var(--sc-color-main-line);stroke-linecap:round;stroke-linejoin:round;opacity:1;transition:all .3s}.sc-charts__highlight-line_hidden{opacity:0;transition:all .3s}.sc-charts__hover-tooltip{overflow:visible;-webkit-user-select:none;user-select:none;font-family:inherit;font-weight:400;font-size:14px}.sc-charts__hover-tooltip-container{display:inline-block;white-space:nowrap;padding:8px 12px;border-style:solid;border-width:1px;border-color:var(--sc-color-hover-tooltip-border);background-color:var(--sc-color-hover-tooltip-bg);border-radius:8px;box-shadow:var(--sc-shadow-hover-tooltip)}.sc-charts__hover-tooltip-sum{font-weight:600;margin-bottom:2px;padding-left:6px;position:relative}.sc-charts__hover-tooltip-sum:before{content:"";display:block;position:absolute;top:50%;transform:translateY(-50%);border-radius:2px;left:0;width:1.5px;background-color:var(--sc-color-main-line);height:14px}.sc-charts__hover-tooltip-time{color:var(--sc-color-text-secondary)}.sc-charts__x-axis-tick,.sc-charts__y-axis-tick{color:var(--sc-color-axis-text);font-size:var(--sc-size-axis-text);line-height:var(--sc-size-axis-text)}.sc-charts__main-line-area{fill:url(#main-line-area-gradient);opacity:.15;transition:all .3s}.sc-charts__main-line-area_hidden{opacity:0;transition:all .3s}.sc-charts__range-line-area{opacity:.15;transition:all .3s;fill:none}.sc-charts__range-line-area_hidden{opacity:0}.sc-charts__range-line-area_up{fill:url(#range-line-area-gradient_up)}.sc-charts__range-line-area_down{fill:url(#range-line-area-gradient_down)}.sc-charts__below-zero-line{transition:all .3s;opacity:1;stroke-width:2;stroke:var(--sc-color-below-zero-line);fill:none}.sc-charts__below-zero-line_hidden{transition:all .3s;opacity:0}.sc-charts__hovered-circles-tooltip-container{pointer-events:none;position:absolute;bottom:26px;filter:drop-shadow(0 2px 6px rgba(0,0,0,.15));overflow:visible}.sc-charts__hovered-circles-tooltip{bottom:0;position:absolute}.sc-charts__hovered-circles-tooltip-arrow{position:absolute;transform:translate(-50%);bottom:4px}.sc-charts__hovered-circles-tooltip-arrow path{fill:#fff}.sc-charts__hovered-circles{fill:var(--sc-color-hover-circles);transition:all .3s}.sc-charts__hovered-circles_add{fill:transparent}.sc-charts__hovered-circles:hover{fill:var(--sc-color-hover-circles_hover);transition:all .3s}.sc-charts__extreme-point-circle{fill:var(--sc-color-main-line);pointer-events:none}.sc-charts__extreme-point-label{fill:var(--sc-color-text-base);font-size:12px}.sc-charts-cs__add-field{width:100%;height:40px;flex-shrink:0;position:relative}.sc-charts-cs__add-field-input{width:100%;font-size:14px;font-weight:500;padding:0 40px 0 12px;height:100%;border:none;box-sizing:border-box}.sc-charts-cs__add-field-input::placeholder{color:#8e8e93}.sc-charts-cs__add-field-input:hover{background-color:#fafafa}.sc-charts-cs__add-field-input:focus{outline:none}.sc-charts-cs__add-field-input:focus+button{color:#007aff}.sc-charts-cs__add-field-btn{border:none;position:absolute;z-index:3;height:40px;width:40px;color:#c3c3c5;background-color:transparent;cursor:pointer;right:0;top:0;display:flex;align-items:center;justify-content:center}.sc-charts-cs__add-field-btn:disabled{cursor:not-allowed}.sc-charts-cs__add-field-btn:focus{color:#007aff;outline:none;background-color:#ededed}.sc-charts-cs__list-tooltip-add-input{border-radius:0 0 12px 12px;border-top:1px solid #ededed}.sc-charts-cs__list-tooltip-add-input:focus{border-top:1px solid #007aff}.sc-charts-cs__list-tooltip-add-btn{border-radius:0 0 12px}.sc-charts-cs__comment-actions{border:1px solid #ededed;border-radius:12px;visibility:hidden;opacity:0;z-index:5;pointer-events:all;width:max-content;background-color:#fff;box-shadow:0 4px 24px #9badff40;transition:opacity .2s;display:flex;flex-direction:column;gap:4px;padding:8px;min-width:103px;position:absolute}.sc-charts-cs__comment-actions button{border-radius:6px;padding:8px;font-size:14px;font-weight:500;display:flex;justify-content:start;align-items:center;background-color:transparent;border:none;cursor:pointer}.sc-charts-cs__comment-actions button:hover{background-color:#ededed}.sc-charts-cs__comment-actions-delete{color:#f18169}.sc-charts-cs__comment-actions-delete:hover{background-color:#fcebe9}.sc-charts-cs__comment-list-text-wrap{display:flex;align-items:start}.sc-charts-cs__comment-list-action-trigger{background-color:transparent;cursor:pointer;width:20px;height:20px;flex-shrink:0;border:none;display:flex;justify-content:center;align-items:center;color:#1c2026;padding:0}.sc-charts-cs__comments-context{width:100%;height:100%;position:absolute;top:0;left:0;pointer-events:none}.sc-charts-cs__comments-context-menu{width:280px;height:fit-content;position:absolute;pointer-events:all;box-shadow:0 4px 24px #9badff40;border-radius:12px}.sc-charts-cs__comments-context-pointer{background-color:#007aff;border:2px solid white;box-sizing:content-box;width:10px;height:10px;border-radius:50%;position:absolute;transform:translate(-50%,-50%)}.sc-charts-cs__context-add{border-radius:12px}.sc-charts-cs__context-add-input{border-radius:12px;border:1px solid #ededed}.sc-charts-cs__context-add-input:focus{border:1px solid #007aff}.sc-charts-cs__comments-edit{display:flex;flex-direction:column;gap:4px;align-items:end}.sc-charts-cs__comments-edit-input{resize:none;width:100%;box-sizing:border-box;padding:4px 8px;border-radius:10px;border:1px solid #ededed;height:60px;font-size:14px;font-weight:500}.sc-charts-cs__comments-edit-input:focus{border:1px solid #007aff;outline:none}.sc-charts-cs__comments-edit-btn-container{display:flex;gap:4px}.sc-charts-cs__comments-edit-btn-container button{cursor:pointer;width:28px;height:28px;border-radius:8px;display:flex;justify-content:center;align-items:center}.sc-charts-cs__comments-edit-btn-container button:focus{outline:none}.sc-charts-cs__comments-edit-save-btn{background-color:#007aff;border:1px solid #007aff;color:#fff}.sc-charts-cs__comments-edit-save-btn:hover{background-color:#1d89fc}.sc-charts-cs__comments-edit-save-btn:focus{background-color:#1d89fc}.sc-charts-cs__comments-edit-save-btn:disabled{cursor:not-allowed;background-color:#8e8e93;border-color:#8e8e93}.sc-charts-cs__comments-edit-cancel-btn{border:1px solid #ededed;background-color:transparent;color:#8e8e93}.sc-charts-cs__comments-edit-cancel-btn:focus{border:1px solid #007aff}.sc-charts-cs__comments-edit-cancel-btn:hover{background-color:#fafafa}.sc-charts-cs__comment-box{position:absolute;overflow:visible}.sc-charts-cs__comment-context-menu-pointer{top:0;left:0}.sc-charts-cs__comments-pointer{width:10px;height:10px;background-color:#007aff;border-radius:50%;border:2px solid white;cursor:pointer;box-sizing:content-box;position:absolute;box-shadow:0 2px 22px #d1d1d166;transform:translate(-50%,-50%);visibility:hidden;opacity:0;transition:opacity .2s}.sc-charts-cs__comment-box-anchor{width:24px;height:24px;border-radius:50% 50% 50% 0;cursor:pointer;position:absolute;pointer-events:all;transform:translate(-50%,-100%);display:flex;align-items:center;justify-content:center;transition:opacity .2s}.sc-charts-cs__comment-list{list-style:none;margin:0;display:flex;flex-direction:column;gap:16px;padding:12px;overflow-y:scroll;max-height:100%}.sc-charts-cs__comment-list-text{color:#1c2026;font-size:14px;font-weight:400;flex-grow:1;word-break:break-word}.sc-charts-cs__comment-list-created-at{color:#8e8e93;font-size:12px;font-weight:500;margin-top:4px}.sc-charts-cs__comment-context-menu{position:absolute;visibility:hidden;opacity:0;z-index:2;pointer-events:all;width:max-content;min-width:280px;background-color:transparent;border-radius:12px;box-shadow:0 4px 24px #9badff40}.sc-charts-cs__list-tooltip{border:1px solid #ededed;border-radius:12px 0 12px 12px;position:absolute;visibility:hidden;opacity:0;z-index:2;pointer-events:all;background-color:#fff;box-shadow:0 4px 24px #9badff40;min-width:180px;transition:opacity .2s;width:280px;display:flex;flex-direction:column}.sc-charts-cs__guides-marker{position:absolute;background-color:#000;color:#fff;padding:6px 4px;line-height:12px;font-size:10px;font-weight:600;white-space:nowrap;border-radius:4px}.sc-charts-cs__guides-marker-h{transform:translate(-50%)}.sc-charts-cs__guides-marker-v{transform:translateY(-50%)}.sc-charts-cs__dom-trade{width:100%;height:100%}.sc-charts-cs__canvas-trade-markers-item{position:absolute;background-color:#777;color:#fff;padding:4px 6px;line-height:12px;font-size:10px;font-weight:600;white-space:nowrap;border-radius:4px}.sc-charts-cs__trade-label-tooltip{padding:12px;background-color:#fff;border-radius:16px;border:1px solid #ededed;font-size:12px;opacity:0;visibility:hidden;transition:opacity .2s;min-width:180px;max-width:240px;box-shadow:0 3.43px 37.78px #d1d1d166;position:absolute;z-index:1;pointer-events:all}.sc-charts-cs__trade-label-tooltip-title{color:#8e8e93;border-bottom:1px solid #ededed;padding-bottom:8px;display:none;margin-bottom:8px}.sc-charts-cs__trade-label-tooltip-box_many{display:flex;flex-direction:column;gap:8px}.sc-charts-cs__trade-label-tooltip-box_many>div{border-top:1px solid #ededed;display:flex;flex-direction:column;padding-top:8px;gap:8px}.sc-charts-cs__trade-label-tooltip-box_many>div:first-child{border-top:none;padding-top:0}.sc-charts-cs__trade-label-tooltip-box_one{display:flex;flex-direction:column;gap:8px}.sc-charts-cs__trade-label-tooltip-line{display:flex;align-items:center;justify-content:space-between}.sc-charts-cs__trade-label-tooltip-line strong{font-weight:500}.sc-charts-cs__dom-user-markers{width:100%;height:100%;top:0;left:0;position:absolute;pointer-events:none}.sc-charts-cs__user-markers-item{position:absolute;background-color:#000;color:#fff;padding:4px 6px;line-height:12px;font-size:10px;font-weight:600;white-space:nowrap;border-radius:4px}.sc-charts-cs{color:#000;width:100%;height:100%;position:relative;overflow:hidden}.sc-charts-cs__canvas-main{pointer-events:all}.sc-charts-cs__canvas{width:100%;height:100%;position:absolute;top:0;left:0}.sc-charts-cs__canvas-additional{background:transparent;pointer-events:none}.sc-charts-cs__dom-elements{width:100%;height:100%;top:0;left:0;position:absolute;pointer-events:none}.sc-charts-cs__candles-no-data{position:absolute;background-color:#8e8e93;color:#fff;padding:3px 4px;border-radius:4px;font-size:12px;pointer-events:none;white-space:nowrap;transform:translateY(-100%);align-items:center;gap:3px;z-index:1}.sc-charts-cs__candles-no-data p{margin:0}.sc-charts-cs__candles-limiter{position:absolute;transform:translate(-100%,-50%);display:flex;justify-content:center;align-items:center}
|
|
1
|
+
.sc-charts{--sc-color-main-line: #007aff;--sc-color-hover-circle-fill: #007aff;--sc-color-hover-circle-stroke: #ffffff;--sc-color-range-circle-stroke: #ffffff;--sc-color-selection-up: #56b683;--sc-color-selection-up-tooltip-text: #56b683;--sc-color-selection-down: #f18169;--sc-color-selection-down-tooltip-text: #e8674b;--sc-color-text-secondary: #8e8e93;--sc-size-axis-text: 12px;--sc-color-below-zero-line: #e8674b;--sc-color-hover-circles: #56b683;--sc-color-hover-circles_hover: #aed6bf;color:var(--sc-color-text-base);position:relative}.sc-charts__light{--sc-color-bg: #ffffff;--sc-color-axis-text: #ababae;--sc-color-axis-zero-line: #ededed;--sc-color-selection-down-tooltip-bg: #fdf5f3;--sc-color-selection-down-tooltip-border: #fde8e3;--sc-color-selection-up-tooltip-bg: #f3f9f5;--sc-color-selection-up-tooltip-border: #d9eee0;--sc-color-text-base: #1c2026;--sc-color-main-line-muted: #d9ebff;--sc-color-main-line-selected-muted: #ededed;--sc-color-hover-line: #c7c7c9;--sc-color-hover-tooltip-border: #ededed;--sc-color-hover-tooltip-bg: #ffffff;--sc-shadow-range-tooltip-up: 0px 2px 20px 0px #d9f2e166;--sc-shadow-range-tooltip-down: 0px 2px 20px 0px #fde8e366;--sc-shadow-hover-tooltip: 0px 2px 20px 0px #d1d1d166}.sc-charts__dark{--sc-color-bg: #101213;--sc-color-axis-text: #8e8e93;--sc-color-axis-zero-line: #3d3d3d;--sc-color-selection-down-tooltip-bg: #2d1915;--sc-color-selection-down-tooltip-border: #6c3a2f;--sc-color-selection-up-tooltip-bg: #192b23;--sc-color-selection-up-tooltip-border: #254034;--sc-color-text-base: #ffffff;--sc-color-main-line-muted: #0e2236;--sc-color-main-line-selected-muted: #292929;--sc-color-hover-line: #ffffff;--sc-color-hover-tooltip-border: #343b46;--sc-color-hover-tooltip-bg: #1c2026;--sc-shadow-range-tooltip-up: 0px 2px 20px 0px #316a4b66;--sc-shadow-range-tooltip-down: 0px 2px 20px 0px #6c3a2f66;--sc-shadow-hover-tooltip: 0px 2px 20px 0px #343b4666}.sc-charts__main-line{stroke:var(--sc-color-main-line);stroke-width:2;fill:none;transition:all .3s;stroke-linecap:round;stroke-linejoin:round}.sc-charts__main-line_muted{stroke:var(--sc-color-main-line-muted);transition:all .3s}.sc-charts__main-line_selected-muted{stroke:var(--sc-color-main-line-selected-muted);transition:all .3s}.sc-charts__range-tooltip{overflow:visible;-webkit-user-select:none;user-select:none;font-family:inherit;font-weight:400;font-size:14px}.sc-charts__range-tooltip-container{display:inline-block;white-space:nowrap;padding:8px 12px;border:1px solid;border-radius:8px}.sc-charts__range-tooltip-sum{font-weight:600;margin-bottom:2px;display:flex;align-items:center;gap:8px}.sc-charts__range-tooltip-sum-icon{display:flex;align-items:center;justify-items:center}.sc-charts__range-tooltip_down .sc-charts__range-tooltip-sum-icon{transform:rotate(180deg)}.sc-charts__range-tooltip_up .sc-charts__range-tooltip-container{background-color:var(--sc-color-selection-up-tooltip-bg);border-color:var(--sc-color-selection-up-tooltip-border);box-shadow:var(--sc-shadow-range-tooltip-up)}.sc-charts__range-tooltip_up .sc-charts__range-tooltip-sum{color:var(--sc-color-selection-up-tooltip-text)}.sc-charts__range-tooltip_down .sc-charts__range-tooltip-container{background-color:var(--sc-color-selection-down-tooltip-bg);border-color:var(--sc-color-selection-down-tooltip-border);box-shadow:var(--sc-shadow-range-tooltip-down)}.sc-charts__range-tooltip_down .sc-charts__range-tooltip-sum{color:var(--sc-color-selection-down-tooltip-text)}.sc-charts__hover-circle{stroke:var(--sc-color-hover-circle-stroke);fill:var(--sc-color-hover-circle-fill);stroke-width:2}.sc-charts__range-circle-left,.sc-charts__range-circle-right{stroke:var(--sc-color-range-circle-stroke);stroke-width:2}.sc-charts__range-circle-left_up,.sc-charts__range-circle-right_up{fill:var(--sc-color-selection-up)}.sc-charts__range-circle-left_down,.sc-charts__range-circle-right_down{fill:var(--sc-color-selection-down)}.sc-charts__range-line{fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;opacity:1}.sc-charts__range-line_hidden{opacity:0}.sc-charts__range-line_up{stroke:var(--sc-color-selection-up)}.sc-charts__range-line_down{stroke:var(--sc-color-selection-down)}.sc-charts__border-range-line{stroke-width:1}.sc-charts__border-range-line_up{stroke:url(#gradient-range-borders-up)}.sc-charts__border-range-line_down{stroke:url(#gradient-range-borders-down)}.sc-charts__hover-line{stroke:url(#hover-line-gradient);stroke-width:1}.sc-charts__highlight-line{stroke-width:2;fill:none;stroke:var(--sc-color-main-line);stroke-linecap:round;stroke-linejoin:round;opacity:1;transition:all .3s}.sc-charts__highlight-line_hidden{opacity:0;transition:all .3s}.sc-charts__hover-tooltip{overflow:visible;-webkit-user-select:none;user-select:none;font-family:inherit;font-weight:400;font-size:14px}.sc-charts__hover-tooltip-container{display:inline-block;white-space:nowrap;padding:8px 12px;border-style:solid;border-width:1px;border-color:var(--sc-color-hover-tooltip-border);background-color:var(--sc-color-hover-tooltip-bg);border-radius:8px;box-shadow:var(--sc-shadow-hover-tooltip)}.sc-charts__hover-tooltip-sum{font-weight:600;margin-bottom:2px;padding-left:6px;position:relative}.sc-charts__hover-tooltip-sum:before{content:"";display:block;position:absolute;top:50%;transform:translateY(-50%);border-radius:2px;left:0;width:1.5px;background-color:var(--sc-color-main-line);height:14px}.sc-charts__hover-tooltip-time{color:var(--sc-color-text-secondary)}.sc-charts__x-axis-tick,.sc-charts__y-axis-tick{color:var(--sc-color-axis-text);font-size:var(--sc-size-axis-text);line-height:var(--sc-size-axis-text)}.sc-charts__main-line-area{fill:url(#main-line-area-gradient);opacity:.15;transition:all .3s}.sc-charts__main-line-area_hidden{opacity:0;transition:all .3s}.sc-charts__range-line-area{opacity:.15;transition:all .3s;fill:none}.sc-charts__range-line-area_hidden{opacity:0}.sc-charts__range-line-area_up{fill:url(#range-line-area-gradient_up)}.sc-charts__range-line-area_down{fill:url(#range-line-area-gradient_down)}.sc-charts__below-zero-line{transition:all .3s;opacity:1;stroke-width:2;stroke:var(--sc-color-below-zero-line);fill:none}.sc-charts__below-zero-line_hidden{transition:all .3s;opacity:0}.sc-charts__hovered-circles-tooltip-container{pointer-events:none;position:absolute;bottom:26px;filter:drop-shadow(0 2px 6px rgba(0,0,0,.15));overflow:visible}.sc-charts__hovered-circles-tooltip{bottom:0;position:absolute}.sc-charts__hovered-circles-tooltip-arrow{position:absolute;transform:translate(-50%);bottom:4px;display:none}.sc-charts__hovered-circles-tooltip-arrow path{fill:transparent}.sc-charts__hovered-circles{fill:var(--sc-color-hover-circles);transition:all .3s}.sc-charts__hovered-circles_add{fill:transparent}.sc-charts__hovered-circles:hover{fill:var(--sc-color-hover-circles_hover);transition:all .3s}.sc-charts__extreme-point-circle{fill:var(--sc-color-main-line);pointer-events:none}.sc-charts__extreme-point-label{fill:var(--sc-color-text-base);font-size:12px}.sc-charts-cs__add-field{width:100%;height:40px;flex-shrink:0;position:relative}.sc-charts-cs__add-field-input{width:100%;font-size:14px;font-weight:500;padding:0 40px 0 12px;height:100%;border:none;box-sizing:border-box}.sc-charts-cs__add-field-input::placeholder{color:#8e8e93}.sc-charts-cs__add-field-input:hover{background-color:#fafafa}.sc-charts-cs__add-field-input:focus{outline:none}.sc-charts-cs__add-field-input:focus+button{color:#007aff}.sc-charts-cs__add-field-btn{border:none;position:absolute;z-index:3;height:40px;width:40px;color:#c3c3c5;background-color:transparent;cursor:pointer;right:0;top:0;display:flex;align-items:center;justify-content:center}.sc-charts-cs__add-field-btn:disabled{cursor:not-allowed}.sc-charts-cs__add-field-btn:focus{color:#007aff;outline:none;background-color:#ededed}.sc-charts-cs__list-tooltip-add-input{border-radius:0 0 12px 12px;border-top:1px solid #ededed}.sc-charts-cs__list-tooltip-add-input:focus{border-top:1px solid #007aff}.sc-charts-cs__list-tooltip-add-btn{border-radius:0 0 12px}.sc-charts-cs__comment-actions{border:1px solid #ededed;border-radius:12px;visibility:hidden;opacity:0;z-index:5;pointer-events:all;width:max-content;background-color:#fff;box-shadow:0 4px 24px #9badff40;transition:opacity .2s;display:flex;flex-direction:column;gap:4px;padding:8px;min-width:103px;position:absolute}.sc-charts-cs__comment-actions button{border-radius:6px;padding:8px;font-size:14px;font-weight:500;display:flex;justify-content:start;align-items:center;background-color:transparent;border:none;cursor:pointer}.sc-charts-cs__comment-actions button:hover{background-color:#ededed}.sc-charts-cs__comment-actions-delete{color:#f18169}.sc-charts-cs__comment-actions-delete:hover{background-color:#fcebe9}.sc-charts-cs__comment-list-text-wrap{display:flex;align-items:start}.sc-charts-cs__comment-list-action-trigger{background-color:transparent;cursor:pointer;width:20px;height:20px;flex-shrink:0;border:none;display:flex;justify-content:center;align-items:center;color:#1c2026;padding:0}.sc-charts-cs__comments-context{width:100%;height:100%;position:absolute;top:0;left:0;pointer-events:none}.sc-charts-cs__comments-context-menu{width:280px;height:fit-content;position:absolute;pointer-events:all;box-shadow:0 4px 24px #9badff40;border-radius:12px}.sc-charts-cs__comments-context-pointer{background-color:#007aff;border:2px solid white;box-sizing:content-box;width:10px;height:10px;border-radius:50%;position:absolute;transform:translate(-50%,-50%)}.sc-charts-cs__context-add{border-radius:12px}.sc-charts-cs__context-add-input{border-radius:12px;border:1px solid #ededed}.sc-charts-cs__context-add-input:focus{border:1px solid #007aff}.sc-charts-cs__comments-edit{display:flex;flex-direction:column;gap:4px;align-items:end}.sc-charts-cs__comments-edit-input{resize:none;width:100%;box-sizing:border-box;padding:4px 8px;border-radius:10px;border:1px solid #ededed;height:60px;font-size:14px;font-weight:500}.sc-charts-cs__comments-edit-input:focus{border:1px solid #007aff;outline:none}.sc-charts-cs__comments-edit-btn-container{display:flex;gap:4px}.sc-charts-cs__comments-edit-btn-container button{cursor:pointer;width:28px;height:28px;border-radius:8px;display:flex;justify-content:center;align-items:center}.sc-charts-cs__comments-edit-btn-container button:focus{outline:none}.sc-charts-cs__comments-edit-save-btn{background-color:#007aff;border:1px solid #007aff;color:#fff}.sc-charts-cs__comments-edit-save-btn:hover{background-color:#1d89fc}.sc-charts-cs__comments-edit-save-btn:focus{background-color:#1d89fc}.sc-charts-cs__comments-edit-save-btn:disabled{cursor:not-allowed;background-color:#8e8e93;border-color:#8e8e93}.sc-charts-cs__comments-edit-cancel-btn{border:1px solid #ededed;background-color:transparent;color:#8e8e93}.sc-charts-cs__comments-edit-cancel-btn:focus{border:1px solid #007aff}.sc-charts-cs__comments-edit-cancel-btn:hover{background-color:#fafafa}.sc-charts-cs__comment-box{position:absolute;overflow:visible}.sc-charts-cs__comment-context-menu-pointer{top:0;left:0}.sc-charts-cs__comments-pointer{width:10px;height:10px;background-color:#007aff;border-radius:50%;border:2px solid white;cursor:pointer;box-sizing:content-box;position:absolute;box-shadow:0 2px 22px #d1d1d166;transform:translate(-50%,-50%);visibility:hidden;opacity:0;transition:opacity .2s}.sc-charts-cs__comment-box-anchor{width:24px;height:24px;border-radius:50% 50% 50% 0;cursor:pointer;position:absolute;pointer-events:all;transform:translate(-50%,-100%);display:flex;align-items:center;justify-content:center;transition:opacity .2s}.sc-charts-cs__comment-list{list-style:none;margin:0;display:flex;flex-direction:column;gap:16px;padding:12px;overflow-y:scroll;max-height:100%}.sc-charts-cs__comment-list-text{color:#1c2026;font-size:14px;font-weight:400;flex-grow:1;word-break:break-word}.sc-charts-cs__comment-list-created-at{color:#8e8e93;font-size:12px;font-weight:500;margin-top:4px}.sc-charts-cs__comment-context-menu{position:absolute;visibility:hidden;opacity:0;z-index:2;pointer-events:all;width:max-content;min-width:280px;background-color:transparent;border-radius:12px;box-shadow:0 4px 24px #9badff40}.sc-charts-cs__list-tooltip{border:1px solid #ededed;border-radius:12px 0 12px 12px;position:absolute;visibility:hidden;opacity:0;z-index:2;pointer-events:all;background-color:#fff;box-shadow:0 4px 24px #9badff40;min-width:180px;transition:opacity .2s;width:280px;display:flex;flex-direction:column}.sc-charts-cs__guides-marker{position:absolute;background-color:#000;color:#fff;padding:6px 4px;line-height:12px;font-size:10px;font-weight:600;white-space:nowrap;border-radius:4px}.sc-charts-cs__guides-marker-h{transform:translate(-50%)}.sc-charts-cs__guides-marker-v{transform:translateY(-50%)}.sc-charts-cs__dom-trade{width:100%;height:100%}.sc-charts-cs__canvas-trade-markers-item{position:absolute;background-color:#777;color:#fff;padding:4px 6px;line-height:12px;font-size:10px;font-weight:600;white-space:nowrap;border-radius:4px}.sc-charts-cs__trade-label-tooltip{padding:12px;background-color:#fff;border-radius:16px;border:1px solid #ededed;font-size:12px;opacity:0;visibility:hidden;transition:opacity .2s;min-width:180px;max-width:240px;box-shadow:0 3.43px 37.78px #d1d1d166;position:absolute;z-index:1;pointer-events:all}.sc-charts-cs__trade-label-tooltip-title{color:#8e8e93;border-bottom:1px solid #ededed;padding-bottom:8px;display:none;margin-bottom:8px}.sc-charts-cs__trade-label-tooltip-box_many{display:flex;flex-direction:column;gap:8px}.sc-charts-cs__trade-label-tooltip-box_many>div{border-top:1px solid #ededed;display:flex;flex-direction:column;padding-top:8px;gap:8px}.sc-charts-cs__trade-label-tooltip-box_many>div:first-child{border-top:none;padding-top:0}.sc-charts-cs__trade-label-tooltip-box_one{display:flex;flex-direction:column;gap:8px}.sc-charts-cs__trade-label-tooltip-line{display:flex;align-items:center;justify-content:space-between}.sc-charts-cs__trade-label-tooltip-line strong{font-weight:500}.sc-charts-cs__dom-user-markers{width:100%;height:100%;top:0;left:0;position:absolute;pointer-events:none}.sc-charts-cs__user-markers-item{position:absolute;background-color:#000;color:#fff;padding:4px 6px;line-height:12px;font-size:10px;font-weight:600;white-space:nowrap;border-radius:4px}.sc-charts-cs{color:#000;width:100%;height:100%;position:relative;overflow:hidden}.sc-charts-cs__canvas-main{pointer-events:all}.sc-charts-cs__canvas{width:100%;height:100%;position:absolute;top:0;left:0}.sc-charts-cs__canvas-additional{background:transparent;pointer-events:none}.sc-charts-cs__dom-elements{width:100%;height:100%;top:0;left:0;position:absolute;pointer-events:none}.sc-charts-cs__candles-no-data{position:absolute;background-color:#8e8e93;color:#fff;padding:3px 4px;border-radius:4px;font-size:12px;pointer-events:none;white-space:nowrap;transform:translateY(-100%);align-items:center;gap:3px;z-index:1}.sc-charts-cs__candles-no-data p{margin:0}.sc-charts-cs__candles-limiter{position:absolute;transform:translate(-100%,-50%);display:flex;justify-content:center;align-items:center}
|
package/dist/charts-core.js
CHANGED
|
@@ -102,7 +102,7 @@ const ti = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
102
102
|
ti(t, { x1: v, x2: b, y1: m, y2: m });
|
|
103
103
|
const { tooltipContainer: w, tooltip: x, tooltipArrow: y } = Os(o), C = (M) => {
|
|
104
104
|
if (!d) return;
|
|
105
|
-
bi(x), w.style.display = "block", x.append(d({ date: M.date, value: M.value }));
|
|
105
|
+
bi(x), w.style.display = "block", x.append(d({ date: M.date, value: M.value, meta: M.meta }));
|
|
106
106
|
const D = x.getBoundingClientRect(), I = zs(
|
|
107
107
|
D,
|
|
108
108
|
s(M.date),
|
|
@@ -117,8 +117,8 @@ const ti = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
117
117
|
show: (M) => C(M),
|
|
118
118
|
hide: A
|
|
119
119
|
} : null, r.forEach((M, D) => {
|
|
120
|
-
const I = s(M.date),
|
|
121
|
-
et || ti(t, { x1: I, x2: I, y1:
|
|
120
|
+
const I = s(M.date), V = n(M.value), j = r[D - 1], et = D > 0 && j && M.value === j.value;
|
|
121
|
+
et || ti(t, { x1: I, x2: I, y1: V, y2: m });
|
|
122
122
|
const K = Ps(t, et, {
|
|
123
123
|
x: I,
|
|
124
124
|
y: m,
|
|
@@ -126,8 +126,8 @@ const ti = (i, { x1: t, x2: e, y1: s, y2: n }) => i.append("line").attr("x1", t)
|
|
|
126
126
|
hr: _
|
|
127
127
|
});
|
|
128
128
|
d && K.on("mouseover", function() {
|
|
129
|
-
var O,
|
|
130
|
-
(
|
|
129
|
+
var O, W;
|
|
130
|
+
(W = (O = i.onGridCircleHoverRef) == null ? void 0 : O.current) == null || W.call(O, { date: M.date, value: M.value }), C({ date: M.date, value: et ? null : M.value, meta: M.meta });
|
|
131
131
|
}).on("mouseout", function() {
|
|
132
132
|
A();
|
|
133
133
|
});
|
|
@@ -294,8 +294,8 @@ const Gs = (i) => {
|
|
|
294
294
|
_ ? w = _({ left: n.date, right: a.date, direction: v }) : w = `${si(n.date)} to ${si(a.date)}`, e.textContent = b, s.textContent = w, requestAnimationFrame(() => {
|
|
295
295
|
const x = t.getBoundingClientRect(), y = i.wrapperNode.getBoundingClientRect(), C = i.x(n.date), A = i.x(a.date);
|
|
296
296
|
let D = (C + A) / 2 - x.width / 2;
|
|
297
|
-
const I = 0,
|
|
298
|
-
D < I && (D = I), D >
|
|
297
|
+
const I = 0, V = y.width - x.width;
|
|
298
|
+
D < I && (D = I), D > V && (D = V), t.style.left = `${D}px`, t.style.top = `${o}px`;
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
c !== void 0 && (t.style.display = c ? "none" : "block");
|
|
@@ -334,7 +334,9 @@ const Ks = (i) => {
|
|
|
334
334
|
}
|
|
335
335
|
if (r) {
|
|
336
336
|
const { sumFormatter: o, timeFormatter: c, tooltipNode: h } = i.config.hover;
|
|
337
|
-
h ? (bi(t), t.appendChild(
|
|
337
|
+
h ? (bi(t), t.appendChild(
|
|
338
|
+
h({ date: r.date, value: r.value, meta: r.meta })
|
|
339
|
+
)) : (n(), e.textContent = o ? o(r.value) : qs(r.value), s.textContent = c ? c(r.date) : Zs(r.date)), requestAnimationFrame(() => {
|
|
338
340
|
const d = t.getBoundingClientRect(), g = Qs(
|
|
339
341
|
d,
|
|
340
342
|
i.x(r.date),
|
|
@@ -685,7 +687,7 @@ const Ks = (i) => {
|
|
|
685
687
|
n.highlightLine.update({ hidden: !0 }), n.mainLine.className("remove", "_muted"), (h = n.belowZeroLine) == null || h.update({
|
|
686
688
|
clip: ke(i)
|
|
687
689
|
});
|
|
688
|
-
(d = i.gridHoverTooltip) == null || d.show({ date: t.date, value: t.value });
|
|
690
|
+
(d = i.gridHoverTooltip) == null || d.show({ date: t.date, value: t.value, meta: t.meta });
|
|
689
691
|
}, Me = (i) => {
|
|
690
692
|
var e, s;
|
|
691
693
|
const { elements: t } = i;
|
|
@@ -808,7 +810,17 @@ const Ks = (i) => {
|
|
|
808
810
|
t.disabledResize || window.addEventListener("resize", d);
|
|
809
811
|
const g = (_, m = !1) => {
|
|
810
812
|
m && _.config && (c = ei(c, _.config)), m && _.data && (h = _.data);
|
|
811
|
-
const v = h.map((M) =>
|
|
813
|
+
const v = h.map((M) => {
|
|
814
|
+
const { date: D, value: I, meta: V, ...j } = M;
|
|
815
|
+
return {
|
|
816
|
+
date: new Date(String(D)),
|
|
817
|
+
value: Number(I),
|
|
818
|
+
meta: {
|
|
819
|
+
...V ?? {},
|
|
820
|
+
...j
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
}).sort((M, D) => M.date.getTime() - D.date.getTime()), b = un(v, c, r), w = fn(v, c, o);
|
|
812
824
|
s.attr("class", `sc-charts sc-charts__${c.theme}`), n.attr("preserveAspectRatio", "xMinYMin meet").attr("viewBox", `0 0 ${r} ${o}`).style("width", "100%").style("height", "100%").selectAll("*").remove();
|
|
813
825
|
const x = s.node(), y = n.node();
|
|
814
826
|
Array.from(x.children).forEach((M) => {
|
|
@@ -850,16 +862,16 @@ var Dt = { exports: {} };
|
|
|
850
862
|
Dt.exports;
|
|
851
863
|
var ai;
|
|
852
864
|
function mn() {
|
|
853
|
-
return ai || (ai = 1, function(i, t) {
|
|
854
|
-
var e = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", d = "[object Boolean]", g = "[object Date]", _ = "[object Error]", m = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", w = "[object Number]", x = "[object Null]", y = "[object Object]", C = "[object Proxy]", A = "[object RegExp]", M = "[object Set]", D = "[object String]", I = "[object Undefined]",
|
|
855
|
-
F[K] = F[O] = F[
|
|
856
|
-
var Rt = typeof Gt == "object" && Gt && Gt.Object === Object && Gt, ne = typeof self == "object" && self && self.Object === Object && self, z = Rt || ne || Function("return this")(), tt = t && !t.nodeType && t, Y = tt && !0 && i && !i.nodeType && i,
|
|
865
|
+
return ai || (ai = 1, (function(i, t) {
|
|
866
|
+
var e = 200, s = "__lodash_hash_undefined__", n = 800, a = 16, r = 9007199254740991, o = "[object Arguments]", c = "[object Array]", h = "[object AsyncFunction]", d = "[object Boolean]", g = "[object Date]", _ = "[object Error]", m = "[object Function]", v = "[object GeneratorFunction]", b = "[object Map]", w = "[object Number]", x = "[object Null]", y = "[object Object]", C = "[object Proxy]", A = "[object RegExp]", M = "[object Set]", D = "[object String]", I = "[object Undefined]", V = "[object WeakMap]", j = "[object ArrayBuffer]", et = "[object DataView]", K = "[object Float32Array]", O = "[object Float64Array]", W = "[object Int8Array]", P = "[object Int16Array]", ot = "[object Int32Array]", se = "[object Uint8Array]", lt = "[object Uint8ClampedArray]", bt = "[object Uint16Array]", yt = "[object Uint32Array]", Ht = /[\\^$.*+?()[\]{}|]/g, It = /^\[object .+?Constructor\]$/, Bt = /^(?:0|[1-9]\d*)$/, F = {};
|
|
867
|
+
F[K] = F[O] = F[W] = F[P] = F[ot] = F[se] = F[lt] = F[bt] = F[yt] = !0, F[o] = F[c] = F[j] = F[d] = F[et] = F[g] = F[_] = F[m] = F[b] = F[w] = F[y] = F[A] = F[M] = F[D] = F[V] = !1;
|
|
868
|
+
var Rt = typeof Gt == "object" && Gt && Gt.Object === Object && Gt, ne = typeof self == "object" && self && self.Object === Object && self, z = Rt || ne || Function("return this")(), tt = t && !t.nodeType && t, Y = tt && !0 && i && !i.nodeType && i, X = Y && Y.exports === tt, mt = X && Rt.process, wt = (function() {
|
|
857
869
|
try {
|
|
858
870
|
var l = Y && Y.require && Y.require("util").types;
|
|
859
871
|
return l || mt && mt.binding && mt.binding("util");
|
|
860
872
|
} catch {
|
|
861
873
|
}
|
|
862
|
-
}(), xt = wt && wt.isTypedArray;
|
|
874
|
+
})(), xt = wt && wt.isTypedArray;
|
|
863
875
|
function $t(l, u, p) {
|
|
864
876
|
switch (p.length) {
|
|
865
877
|
case 0:
|
|
@@ -891,20 +903,20 @@ function mn() {
|
|
|
891
903
|
return l(u(p));
|
|
892
904
|
};
|
|
893
905
|
}
|
|
894
|
-
var Ct = Array.prototype, Ai = Function.prototype, Pt = Object.prototype, re = z["__core-js_shared__"], zt = Ai.toString, at = Pt.hasOwnProperty, Be = function() {
|
|
906
|
+
var Ct = Array.prototype, Ai = Function.prototype, Pt = Object.prototype, re = z["__core-js_shared__"], zt = Ai.toString, at = Pt.hasOwnProperty, Be = (function() {
|
|
895
907
|
var l = /[^.]+$/.exec(re && re.keys && re.keys.IE_PROTO || "");
|
|
896
908
|
return l ? "Symbol(src)_1." + l : "";
|
|
897
|
-
}(), Re = Pt.toString, Di = zt.call(Object), Ei = RegExp(
|
|
909
|
+
})(), Re = Pt.toString, Di = zt.call(Object), Ei = RegExp(
|
|
898
910
|
"^" + zt.call(at).replace(Ht, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
899
|
-
), Vt =
|
|
911
|
+
), Vt = X ? z.Buffer : void 0, $e = z.Symbol, Oe = z.Uint8Array;
|
|
900
912
|
Vt && Vt.allocUnsafe;
|
|
901
|
-
var Pe = ae(Object.getPrototypeOf, Object), ze = Object.create, Li = Pt.propertyIsEnumerable, ki = Ct.splice, dt = $e ? $e.toStringTag : void 0, Wt = function() {
|
|
913
|
+
var Pe = ae(Object.getPrototypeOf, Object), ze = Object.create, Li = Pt.propertyIsEnumerable, ki = Ct.splice, dt = $e ? $e.toStringTag : void 0, Wt = (function() {
|
|
902
914
|
try {
|
|
903
915
|
var l = ce(Object, "defineProperty");
|
|
904
916
|
return l({}, "", {}), l;
|
|
905
917
|
} catch {
|
|
906
918
|
}
|
|
907
|
-
}(), Ni = Vt ? Vt.isBuffer : void 0, Ve = Math.max, Fi = Date.now, We = ce(z, "Map"), Tt = ce(Object, "create"), Hi = /* @__PURE__ */ function() {
|
|
919
|
+
})(), Ni = Vt ? Vt.isBuffer : void 0, Ve = Math.max, Fi = Date.now, We = ce(z, "Map"), Tt = ce(Object, "create"), Hi = /* @__PURE__ */ (function() {
|
|
908
920
|
function l() {
|
|
909
921
|
}
|
|
910
922
|
return function(u) {
|
|
@@ -916,7 +928,7 @@ function mn() {
|
|
|
916
928
|
var p = new l();
|
|
917
929
|
return l.prototype = void 0, p;
|
|
918
930
|
};
|
|
919
|
-
}();
|
|
931
|
+
})();
|
|
920
932
|
function ut(l) {
|
|
921
933
|
var u = -1, p = l == null ? 0 : l.length;
|
|
922
934
|
for (this.clear(); ++u < p; ) {
|
|
@@ -1105,12 +1117,12 @@ function mn() {
|
|
|
1105
1117
|
oe(l, p, q);
|
|
1106
1118
|
return;
|
|
1107
1119
|
}
|
|
1108
|
-
var
|
|
1120
|
+
var U = H ? H(N, R, p + "", l, u, B) : void 0, Mt = U === void 0;
|
|
1109
1121
|
if (Mt) {
|
|
1110
1122
|
var me = ue(R), _e = !me && Ge(R), Ke = !me && !_e && qe(R);
|
|
1111
|
-
|
|
1123
|
+
U = R, me || _e || Ke ? ue(N) ? U = N : Ds(N) ? U = fs(N) : _e ? (Mt = !1, U = hs(R)) : Ke ? (Mt = !1, U = us(R)) : U = [] : Es(R) || de(R) ? (U = N, de(N) ? U = Ls(N) : (!ft(N) || ge(N)) && (U = vs(R))) : Mt = !1;
|
|
1112
1124
|
}
|
|
1113
|
-
Mt && (B.set(R,
|
|
1125
|
+
Mt && (B.set(R, U), E(U, R, T, H, B), B.delete(R)), oe(l, p, U);
|
|
1114
1126
|
}
|
|
1115
1127
|
function ls(l, u) {
|
|
1116
1128
|
return Ss(Ts(l, u, Qe), l + "");
|
|
@@ -1264,9 +1276,9 @@ function mn() {
|
|
|
1264
1276
|
function Ut(l, u) {
|
|
1265
1277
|
return l === u || l !== l && u !== u;
|
|
1266
1278
|
}
|
|
1267
|
-
var de = Ye(/* @__PURE__ */ function() {
|
|
1279
|
+
var de = Ye(/* @__PURE__ */ (function() {
|
|
1268
1280
|
return arguments;
|
|
1269
|
-
}()) ? Ye : function(l) {
|
|
1281
|
+
})()) ? Ye : function(l) {
|
|
1270
1282
|
return St(l) && at.call(l, "callee") && !Li.call(l, "callee");
|
|
1271
1283
|
}, ue = Array.isArray;
|
|
1272
1284
|
function fe(l) {
|
|
@@ -1323,7 +1335,7 @@ function mn() {
|
|
|
1323
1335
|
return !1;
|
|
1324
1336
|
}
|
|
1325
1337
|
i.exports = ks;
|
|
1326
|
-
}(Dt, Dt.exports)), Dt.exports;
|
|
1338
|
+
})(Dt, Dt.exports)), Dt.exports;
|
|
1327
1339
|
}
|
|
1328
1340
|
var _n = mn();
|
|
1329
1341
|
const Jt = /* @__PURE__ */ gn(_n), ri = 12, pn = {
|
|
@@ -1427,7 +1439,7 @@ class vn {
|
|
|
1427
1439
|
return this._logo;
|
|
1428
1440
|
}
|
|
1429
1441
|
}
|
|
1430
|
-
class
|
|
1442
|
+
class Z {
|
|
1431
1443
|
constructor(t) {
|
|
1432
1444
|
f(this, "x");
|
|
1433
1445
|
f(this, "y");
|
|
@@ -1470,32 +1482,32 @@ class G {
|
|
|
1470
1482
|
}
|
|
1471
1483
|
class bn {
|
|
1472
1484
|
constructor(t, e) {
|
|
1473
|
-
f(this, "_chart", new
|
|
1474
|
-
f(this, "_area", new
|
|
1475
|
-
f(this, "_xAxis", new
|
|
1476
|
-
f(this, "_yAxis", new
|
|
1477
|
-
f(this, "_axisIntersection", new
|
|
1485
|
+
f(this, "_chart", new Z());
|
|
1486
|
+
f(this, "_area", new Z());
|
|
1487
|
+
f(this, "_xAxis", new Z());
|
|
1488
|
+
f(this, "_yAxis", new Z());
|
|
1489
|
+
f(this, "_axisIntersection", new Z());
|
|
1478
1490
|
const { xAxis: s, yAxis: n } = e;
|
|
1479
|
-
this._chart = new
|
|
1491
|
+
this._chart = new Z(t), this._calc(s, n);
|
|
1480
1492
|
}
|
|
1481
1493
|
_calc(t, e) {
|
|
1482
1494
|
const s = t.isShow ? t.height : 0, n = e.isShow ? e.width : 0, a = this._chart.height - s, r = this._chart.width - n;
|
|
1483
|
-
this._area = new
|
|
1495
|
+
this._area = new Z({
|
|
1484
1496
|
x: e.position === "left" ? n : 0,
|
|
1485
1497
|
y: t.position === "top" ? s : 0,
|
|
1486
1498
|
width: r,
|
|
1487
1499
|
height: a
|
|
1488
|
-
}), this._xAxis = new
|
|
1500
|
+
}), this._xAxis = new Z({
|
|
1489
1501
|
y: t.position === "top" ? 0 : a,
|
|
1490
1502
|
x: e.position === "left" ? n : 0,
|
|
1491
1503
|
height: s,
|
|
1492
1504
|
width: r
|
|
1493
|
-
}), this._yAxis = new
|
|
1505
|
+
}), this._yAxis = new Z({
|
|
1494
1506
|
y: t.position === "top" ? s : 0,
|
|
1495
1507
|
x: e.position === "left" ? 0 : r,
|
|
1496
1508
|
width: n,
|
|
1497
1509
|
height: a
|
|
1498
|
-
}), this._axisIntersection = new
|
|
1510
|
+
}), this._axisIntersection = new Z({
|
|
1499
1511
|
y: t.position === "top" ? 0 : a,
|
|
1500
1512
|
x: e.position === "left" ? 0 : r,
|
|
1501
1513
|
width: n,
|
|
@@ -1508,7 +1520,7 @@ class bn {
|
|
|
1508
1520
|
}
|
|
1509
1521
|
update(t) {
|
|
1510
1522
|
const { xAxis: e, yAxis: s } = t.config;
|
|
1511
|
-
this._chart = new
|
|
1523
|
+
this._chart = new Z(t.container), this._calc(e, s);
|
|
1512
1524
|
}
|
|
1513
1525
|
get area() {
|
|
1514
1526
|
return this._area;
|
|
@@ -2941,7 +2953,7 @@ function $(i, t) {
|
|
|
2941
2953
|
function ie(i) {
|
|
2942
2954
|
return Math.min(1, Math.max(0, i));
|
|
2943
2955
|
}
|
|
2944
|
-
function
|
|
2956
|
+
function G(i) {
|
|
2945
2957
|
return parseInt(i, 16);
|
|
2946
2958
|
}
|
|
2947
2959
|
function ha(i) {
|
|
@@ -2960,9 +2972,9 @@ function Ci(i) {
|
|
|
2960
2972
|
return Math.round(parseFloat(i) * 255).toString(16);
|
|
2961
2973
|
}
|
|
2962
2974
|
function mi(i) {
|
|
2963
|
-
return
|
|
2975
|
+
return G(i) / 255;
|
|
2964
2976
|
}
|
|
2965
|
-
var J = function() {
|
|
2977
|
+
var J = (function() {
|
|
2966
2978
|
var i = "[-\\+]?\\d+%?", t = "[-\\+]?\\d*\\.\\d+%?", e = "(?:" + t + ")|(?:" + i + ")", s = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", n = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
|
|
2967
2979
|
return {
|
|
2968
2980
|
CSS_UNIT: new RegExp(e),
|
|
@@ -2977,7 +2989,7 @@ var J = function() {
|
|
|
2977
2989
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
2978
2990
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
2979
2991
|
};
|
|
2980
|
-
}();
|
|
2992
|
+
})();
|
|
2981
2993
|
function st(i) {
|
|
2982
2994
|
return !!J.CSS_UNIT.exec(i);
|
|
2983
2995
|
}
|
|
@@ -3023,26 +3035,26 @@ function ua(i) {
|
|
|
3023
3035
|
v: e[3],
|
|
3024
3036
|
a: e[4]
|
|
3025
3037
|
} : (e = J.hex8.exec(i)) ? {
|
|
3026
|
-
r:
|
|
3027
|
-
g:
|
|
3028
|
-
b:
|
|
3038
|
+
r: G(e[1]),
|
|
3039
|
+
g: G(e[2]),
|
|
3040
|
+
b: G(e[3]),
|
|
3029
3041
|
a: mi(e[4]),
|
|
3030
3042
|
format: t ? "name" : "hex8"
|
|
3031
3043
|
} : (e = J.hex6.exec(i)) ? {
|
|
3032
|
-
r:
|
|
3033
|
-
g:
|
|
3034
|
-
b:
|
|
3044
|
+
r: G(e[1]),
|
|
3045
|
+
g: G(e[2]),
|
|
3046
|
+
b: G(e[3]),
|
|
3035
3047
|
format: t ? "name" : "hex"
|
|
3036
3048
|
} : (e = J.hex4.exec(i)) ? {
|
|
3037
|
-
r:
|
|
3038
|
-
g:
|
|
3039
|
-
b:
|
|
3049
|
+
r: G(e[1] + "" + e[1]),
|
|
3050
|
+
g: G(e[2] + "" + e[2]),
|
|
3051
|
+
b: G(e[3] + "" + e[3]),
|
|
3040
3052
|
a: mi(e[4] + "" + e[4]),
|
|
3041
3053
|
format: t ? "name" : "hex8"
|
|
3042
3054
|
} : (e = J.hex3.exec(i)) ? {
|
|
3043
|
-
r:
|
|
3044
|
-
g:
|
|
3045
|
-
b:
|
|
3055
|
+
r: G(e[1] + "" + e[1]),
|
|
3056
|
+
g: G(e[2] + "" + e[2]),
|
|
3057
|
+
b: G(e[3] + "" + e[3]),
|
|
3046
3058
|
format: t ? "name" : "hex"
|
|
3047
3059
|
} : !1;
|
|
3048
3060
|
}
|
|
@@ -3174,7 +3186,7 @@ function va(i) {
|
|
|
3174
3186
|
return s.length ? s.join(" ") : "0s";
|
|
3175
3187
|
}
|
|
3176
3188
|
const ba = 10, ya = 6, wa = 4, xa = 12, Ca = (i, t) => {
|
|
3177
|
-
var
|
|
3189
|
+
var W;
|
|
3178
3190
|
const {
|
|
3179
3191
|
scales: { x: e, y: s },
|
|
3180
3192
|
trade: { entries: n, exits: a, holdTime: r },
|
|
@@ -3190,12 +3202,12 @@ const ba = 10, ya = 6, wa = 4, xa = 12, Ca = (i, t) => {
|
|
|
3190
3202
|
if (!_ || !m) return;
|
|
3191
3203
|
const v = (P) => P ? P instanceof Date ? P : new Date(P) : null, b = v(d == null ? void 0 : d[0]) || _.candle.open_time, w = v(d == null ? void 0 : d[1]) || m.candle.close_time, x = e.convert(v(d == null ? void 0 : d[0]) || _.candle.open_time), y = e.convert(v(d == null ? void 0 : d[1]) || m.candle.open_time), C = t.candles.allData.filter(
|
|
3192
3204
|
(P) => P.open_time <= w && P.close_time >= b
|
|
3193
|
-
), A = C.length > 0 ? C.reduce((P, ot) => ot.low < P ? ot.low : P, C[0].low) : ((
|
|
3205
|
+
), A = C.length > 0 ? C.reduce((P, ot) => ot.low < P ? ot.low : P, C[0].low) : ((W = n.at(0)) == null ? void 0 : W.price) ?? 0, M = s.convert(g || A);
|
|
3194
3206
|
i.beginPath(), i.setLineDash([4, 4]), i.strokeStyle = o.main, i.moveTo(x, M), i.lineTo(y, M), i.stroke(), i.setLineDash([]);
|
|
3195
|
-
const D = (x + y) / 2, I = h || `Hold: ${va(r)}`,
|
|
3207
|
+
const D = (x + y) / 2, I = h || `Hold: ${va(r)}`, j = getComputedStyle(
|
|
3196
3208
|
document.querySelector(".sc-charts-cs") || document.body
|
|
3197
3209
|
).font.replace(/^\s*\S+/, "").trim();
|
|
3198
|
-
i.font = `600 ${ba}px ${
|
|
3210
|
+
i.font = `600 ${ba}px ${j}`;
|
|
3199
3211
|
const K = i.measureText(I).width + ya * 2, O = xa + wa * 2;
|
|
3200
3212
|
Ti(i, {
|
|
3201
3213
|
radius: 4,
|
|
@@ -3320,7 +3332,7 @@ class Sa extends nt {
|
|
|
3320
3332
|
}), this.oneBox = new L({
|
|
3321
3333
|
tag: "div",
|
|
3322
3334
|
className: this.clsx("box_one")
|
|
3323
|
-
}), e.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent:
|
|
3335
|
+
}), e.dom.append(this.title.node, this.oneBox.node, this.manyBox.node), this.state = { isShow: !1, x: 0, y: 0, parent: Z.empty() };
|
|
3324
3336
|
}
|
|
3325
3337
|
_createLineNodes(e, s) {
|
|
3326
3338
|
const n = [];
|
|
@@ -3986,7 +3998,7 @@ class Qa extends nt {
|
|
|
3986
3998
|
super({ className: e });
|
|
3987
3999
|
f(this, "_isFirstShow", !1);
|
|
3988
4000
|
const s = new L({ tag: "p" });
|
|
3989
|
-
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent:
|
|
4001
|
+
s.node.textContent = "No data from broker", this.append(s.node), this.state = { isShow: !1, x: 0, y: 0, parent: Z.empty() }, this.render();
|
|
3990
4002
|
}
|
|
3991
4003
|
render() {
|
|
3992
4004
|
const { isShow: e, x: s, y: n, parent: a } = this.state;
|
|
@@ -4177,9 +4189,9 @@ class sr {
|
|
|
4177
4189
|
this._model = t, this._view = e, this._enableLogging = !1, this._logger = new ir(["scale_event"]);
|
|
4178
4190
|
}
|
|
4179
4191
|
subscribeWithLogging(t, e) {
|
|
4180
|
-
const s = (n) => {
|
|
4192
|
+
const s = ((n) => {
|
|
4181
4193
|
this._enableLogging && this._logger.log(t, n), e(n);
|
|
4182
|
-
};
|
|
4194
|
+
});
|
|
4183
4195
|
this._model.subscribe(t, s);
|
|
4184
4196
|
}
|
|
4185
4197
|
// [TODO]: optimize renderers, call only the necessary ones. Get rid of this._view.renderAll
|
|
@@ -4889,15 +4901,15 @@ class yr {
|
|
|
4889
4901
|
if (m.length === 0) return;
|
|
4890
4902
|
t.font = `500 ${d}px Geist, Arial, sans-serif`;
|
|
4891
4903
|
const b = o ? "#878788" : "#8E8E93", w = o ? "#FAFAFA" : "#1C2026", x = m.reduce((M, D) => {
|
|
4892
|
-
const I = t.measureText(D.label).width,
|
|
4893
|
-
return M + I + g +
|
|
4904
|
+
const I = t.measureText(D.label).width, V = t.measureText(D.value).width;
|
|
4905
|
+
return M + I + g + V;
|
|
4894
4906
|
}, 0), y = s - h * 2, C = m.length > 1 ? (y - x) / (m.length - 1) : 0;
|
|
4895
4907
|
let A = h;
|
|
4896
4908
|
m.forEach((M) => {
|
|
4897
4909
|
const D = t.measureText(M.label).width, I = t.measureText(M.value).width;
|
|
4898
4910
|
t.fillStyle = b, t.fillText(M.label, A, v);
|
|
4899
|
-
const
|
|
4900
|
-
t.fillStyle = M.valueColor || w, t.fillText(M.value,
|
|
4911
|
+
const V = A + D + g;
|
|
4912
|
+
t.fillStyle = M.valueColor || w, t.fillText(M.value, V, v), A += D + g + I + C;
|
|
4901
4913
|
});
|
|
4902
4914
|
}
|
|
4903
4915
|
getChartState() {
|
|
@@ -4926,34 +4938,34 @@ class yr {
|
|
|
4926
4938
|
return;
|
|
4927
4939
|
}
|
|
4928
4940
|
const b = 1440, w = 900, x = 48, y = 20, C = c ? 32 : 0, A = w - x - y - C, M = b, D = _ / m, I = M / A;
|
|
4929
|
-
let
|
|
4930
|
-
D > I ? (
|
|
4931
|
-
const O = window.devicePixelRatio || 1,
|
|
4932
|
-
|
|
4933
|
-
const P =
|
|
4941
|
+
let V, j, et = 0, K = 0;
|
|
4942
|
+
D > I ? (j = A, V = j * D, et = 0, K = 0) : (V = M, j = V / D, K = (A - j) / 2);
|
|
4943
|
+
const O = window.devicePixelRatio || 1, W = document.createElement("canvas");
|
|
4944
|
+
W.width = b * O, W.height = w * O;
|
|
4945
|
+
const P = W.getContext("2d");
|
|
4934
4946
|
if (!P) {
|
|
4935
4947
|
console.error("Failed to get 2D context for merged canvas");
|
|
4936
4948
|
return;
|
|
4937
4949
|
}
|
|
4938
|
-
P.fillStyle = h ? "#101011" : "#ffffff", P.fillRect(0, 0,
|
|
4950
|
+
P.fillStyle = h ? "#101011" : "#ffffff", P.fillRect(0, 0, W.width, W.height);
|
|
4939
4951
|
const ot = x * O, se = y * O, lt = A * O, bt = M * O, yt = ot + se;
|
|
4940
|
-
await this._drawHeader(P,
|
|
4952
|
+
await this._drawHeader(P, W.width, O, h), this._drawHeaderSecondLine(
|
|
4941
4953
|
P,
|
|
4942
4954
|
r,
|
|
4943
4955
|
o,
|
|
4944
|
-
|
|
4956
|
+
W.width,
|
|
4945
4957
|
ot,
|
|
4946
4958
|
O,
|
|
4947
4959
|
h
|
|
4948
4960
|
);
|
|
4949
4961
|
const Ht = this._view.mainCanvas;
|
|
4950
|
-
Ht.background && (P.fillStyle = Ht.background, P.fillRect(0, yt,
|
|
4951
|
-
const It =
|
|
4962
|
+
Ht.background && (P.fillStyle = Ht.background, P.fillRect(0, yt, W.width, lt));
|
|
4963
|
+
const It = V * O, Bt = j * O, F = et * O, Rt = K * O;
|
|
4952
4964
|
v.forEach((z) => {
|
|
4953
|
-
let tt = 0, Y = 0,
|
|
4965
|
+
let tt = 0, Y = 0, X = z.width, mt = z.height, wt = It, xt = Bt, $t = F, Ot = Rt;
|
|
4954
4966
|
if (D > I) {
|
|
4955
4967
|
const ct = Bt / z.height, ht = z.width * ct;
|
|
4956
|
-
ht > bt && (tt = (ht - bt) / ct,
|
|
4968
|
+
ht > bt && (tt = (ht - bt) / ct, X = z.width - tt, wt = bt, $t = 0);
|
|
4957
4969
|
} else {
|
|
4958
4970
|
const ct = It / z.width, ht = z.height * ct;
|
|
4959
4971
|
if (ht > lt) {
|
|
@@ -4965,7 +4977,7 @@ class yr {
|
|
|
4965
4977
|
z,
|
|
4966
4978
|
tt,
|
|
4967
4979
|
Y,
|
|
4968
|
-
|
|
4980
|
+
X,
|
|
4969
4981
|
mt,
|
|
4970
4982
|
$t,
|
|
4971
4983
|
yt + Ot,
|
|
@@ -4975,18 +4987,18 @@ class yr {
|
|
|
4975
4987
|
}), c && this._drawFooter(
|
|
4976
4988
|
P,
|
|
4977
4989
|
c,
|
|
4978
|
-
|
|
4990
|
+
W.width,
|
|
4979
4991
|
yt,
|
|
4980
4992
|
lt,
|
|
4981
4993
|
O,
|
|
4982
4994
|
h
|
|
4983
4995
|
);
|
|
4984
4996
|
const ne = (z, tt) => {
|
|
4985
|
-
const Y = URL.createObjectURL(z),
|
|
4986
|
-
|
|
4997
|
+
const Y = URL.createObjectURL(z), X = document.createElement("a");
|
|
4998
|
+
X.href = Y, X.download = tt, document.body.appendChild(X), X.click(), document.body.removeChild(X), URL.revokeObjectURL(Y);
|
|
4987
4999
|
};
|
|
4988
5000
|
return new Promise((z, tt) => {
|
|
4989
|
-
|
|
5001
|
+
W.toBlob(
|
|
4990
5002
|
async (Y) => {
|
|
4991
5003
|
if (!Y) {
|
|
4992
5004
|
tt(new Error("Failed to create blob from canvas"));
|
|
@@ -4997,8 +5009,8 @@ class yr {
|
|
|
4997
5009
|
else
|
|
4998
5010
|
try {
|
|
4999
5011
|
await navigator.clipboard.write([new ClipboardItem({ "image/png": Y })]);
|
|
5000
|
-
} catch (
|
|
5001
|
-
console.error("Failed to copy to clipboard:",
|
|
5012
|
+
} catch (X) {
|
|
5013
|
+
console.error("Failed to copy to clipboard:", X);
|
|
5002
5014
|
}
|
|
5003
5015
|
a.returnBlob ? z(Y) : z();
|
|
5004
5016
|
},
|