@kumo-charts/core 1.0.0-beta.6 → 1.0.0-beta.7
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/LICENSE +201 -201
- package/NOTICE +11 -11
- package/README.md +23 -23
- package/dist/{aggregator-CsTcgTRK.js → aggregator-DFCDVoFt.js} +3 -3
- package/dist/{alert-book-DNP68WX7.js → alert-book-KgUNJ1Pm.js} +5 -4
- package/dist/alert-engine.d.ts +5 -5
- package/dist/alert-engine.js +10 -10
- package/dist/{alerts-Bv5u4-99.js → alerts-sN1NVz-X.js} +19 -7
- package/dist/alerts.d.ts +1 -1
- package/dist/alerts.js +1 -1
- package/dist/all.d.ts +9 -9
- package/dist/all.js +9 -9
- package/dist/{api-BxS-GfYB.d.ts → api-BWC_Cce5.d.ts} +15 -1
- package/dist/{api-BlJUtij_.d.ts → api-DgviKlaI.d.ts} +1 -1
- package/dist/{bar-store-B_NkvUnA.js → bar-store-B4HFH1h6.js} +21 -3
- package/dist/{calendar-BkI9B9A5.js → calendar-xZYfA5bX.js} +4 -4
- package/dist/{chart-types-pzeZDEp9.js → chart-types-DtRsOwjT.js} +3 -3
- package/dist/chart-types.d.ts +1 -1
- package/dist/chart-types.js +1 -1
- package/dist/collection-RZyV3hnM.js +71 -0
- package/dist/{color-1Osbv2TE.js → color-AsBx5M66.js} +1 -1
- package/dist/{data-B75gRyuP.d.ts → data-RRHroFqK.d.ts} +34 -2
- package/dist/{drawings-DMRwbLsg.js → drawings-C-jyagJI.js} +137 -125
- package/dist/drawings.d.ts +3 -3
- package/dist/drawings.js +1 -1
- package/dist/{frame-Bt85Ejw7.js → frame-790ompHn.js} +5 -6
- package/dist/{index-Bfi0g81h.d.ts → index-B5nL4-fG.d.ts} +4 -2
- package/dist/{index-D12U6YKZ.d.ts → index-BMRUiN6F.d.ts} +2 -2
- package/dist/{index-SSXLg0b-.d.ts → index-Bgl-FJT3.d.ts} +3 -3
- package/dist/{index-BoRy0gWB.d.ts → index-Bp1gL2SV.d.ts} +1 -1
- package/dist/{index-DTrnOP7Q.d.ts → index-CsFnU-ko.d.ts} +1 -1
- package/dist/{index-BpyqTH6i.d.ts → index-D5fdjNJv.d.ts} +14 -2
- package/dist/{index-DvbA0QtQ.d.ts → index-cuDsywlB.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +280 -107
- package/dist/{indicator-store-CSNYNv-H.js → indicator-store-Cj8FkdLe.js} +11 -5
- package/dist/{indicators-7G1DqNSH.js → indicators-KKeZmC6g.js} +30 -9
- package/dist/indicators.d.ts +2 -2
- package/dist/indicators.js +2 -2
- package/dist/kumo-charts.iife.js +7 -7
- package/dist/{module-DxdViSuj.d.ts → module-ma1-rklb.d.ts} +2 -2
- package/dist/{modules-RlaXjRWe.js → modules-D_E0wmaT.js} +1 -1
- package/dist/{price-line-BPw9VyW3.js → price-line-Ctf8YIXI.js} +77 -89
- package/dist/{price-line-CdM5YNlZ.d.ts → price-line-exqgokHI.d.ts} +3 -1
- package/dist/{price-lines-CaLOO6qa.js → price-lines-C9xony-Z.js} +1 -1
- package/dist/{registry-f-A949ov.js → registry-DpycnxXe.js} +8 -4
- package/dist/{replay-_1IoxPdh.js → replay-BglWO-Se.js} +3 -3
- package/dist/replay.d.ts +1 -1
- package/dist/replay.js +1 -1
- package/dist/{series-store-Brd46VuC.js → series-store-DwvvS42F.js} +3 -3
- package/dist/{time-BN0L-hLy.js → time-QUqwrKFO.js} +1 -1
- package/dist/{trading-CjKK5irF.js → trading-BY4NVox9.js} +38 -17
- package/dist/trading.d.ts +1 -1
- package/dist/trading.js +1 -1
- package/dist/{transforms-CtdsqwVk.js → transforms-D07qL7UT.js} +3 -3
- package/dist/{types-Bgjeo6w6.js → types-CEVVGcR9.js} +6 -2
- package/dist/{types-uoxTaiGv.js → types-CgerhCJ3.js} +3 -1
- package/dist/{types-xV6t4aad.d.ts → types-CrxgaGh5.d.ts} +14 -2
- package/dist/{validate-YdhjgZ6g.js → validate-B_z8rO0I.js} +4 -1
- package/dist/{value-format-BieuAeNK.js → value-format-DwSqOZkc.js} +6 -6
- package/dist/{values-Cw8XKIVE.js → values-CIb5EJ5-.js} +18 -10
- package/dist/{values-CtBpceAo.js → values-Hk0_RbLE.js} +5 -5
- package/dist/{volume-profile-ZWM9N-I-.js → volume-profile-Ci-AGdvp.js} +5 -8
- package/dist/volume-profile.d.ts +1 -1
- package/dist/volume-profile.js +1 -1
- package/dist/{watermark-qCkQw950.js → watermark--TmdUE3C.js} +3 -3
- package/dist/watermark.d.ts +1 -1
- package/dist/watermark.js +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as formatPaneValue } from "./frame-
|
|
3
|
-
import { i as withAlpha } from "./color-
|
|
4
|
-
import {
|
|
5
|
-
import { c as typicalInterval, o as
|
|
6
|
-
import { n as createDefaultOptions, t as Registry } from "./registry-
|
|
1
|
+
import { c as checkOneOf, d as fieldsOf, l as checkString, m as fail, n as checkBoolean, o as checkNumber, r as checkFields, s as checkObject, t as checkArray } from "./validate-B_z8rO0I.js";
|
|
2
|
+
import { n as formatPaneValue } from "./frame-790ompHn.js";
|
|
3
|
+
import { i as withAlpha } from "./color-AsBx5M66.js";
|
|
4
|
+
import { o as sameData } from "./types-CgerhCJ3.js";
|
|
5
|
+
import { c as logicalTime, l as typicalInterval, o as barIndex, s as logicalIndex, t as BarStore } from "./bar-store-B4HFH1h6.js";
|
|
6
|
+
import { n as createDefaultOptions, t as Registry } from "./registry-DpycnxXe.js";
|
|
7
7
|
import { a as font, i as drawLabel, n as applyStroke, o as isolated } from "./canvas-BFRISb50.js";
|
|
8
|
-
import { a as paletteColor } from "./value-format-
|
|
8
|
+
import { a as paletteColor } from "./value-format-DwSqOZkc.js";
|
|
9
9
|
import { t as LruCache } from "./lru-cache-DUUNVfYO.js";
|
|
10
|
-
import { n as
|
|
11
|
-
import {
|
|
12
|
-
import { n as
|
|
10
|
+
import { i as timeToX, n as exactTimeToX, r as paneOf, t as HitPriority } from "./types-CEVVGcR9.js";
|
|
11
|
+
import { n as defineModule } from "./modules-D_E0wmaT.js";
|
|
12
|
+
import { _ as checkStyle, a as LINEAR_SCALE, b as typeStyle, c as levelValue, d as checkPointCount, f as checkTextValue, g as WAVE_DEGREES, h as DEFAULT_FIELDS, i as drawingTexts, l as DrawingHistory, m as shownAt, n as DRAWING_OPTIONS, o as LOG_SCALE, p as parsePoints, r as drawingOptions, s as levelContext, t as drawingValues, u as DrawingStore, v as resolveStyle, y as textFont } from "./values-Hk0_RbLE.js";
|
|
13
13
|
//#region src/drawings/api.ts
|
|
14
14
|
const UPDATE_OPTION_FIELDS = fieldsOf({ merge: true });
|
|
15
15
|
function validateDefinition(definition) {
|
|
@@ -193,13 +193,28 @@ function constrainAngle(pivot, point) {
|
|
|
193
193
|
function placeable(anchor) {
|
|
194
194
|
return Number.isFinite(anchor.time) && Number.isFinite(anchor.price);
|
|
195
195
|
}
|
|
196
|
-
/**
|
|
197
|
-
|
|
196
|
+
/**
|
|
197
|
+
* Plot-relative position of an anchor in `pane`: on the center of the bar its time falls in,
|
|
198
|
+
* whichever interval it was placed on, or with `exact`, as a stroke drawn by hand has it, where
|
|
199
|
+
* its time is between the bars.
|
|
200
|
+
*/
|
|
201
|
+
function anchorPosition(context, pane, anchor, exact = false) {
|
|
198
202
|
return {
|
|
199
|
-
x: timeToX(context, anchor.time),
|
|
203
|
+
x: exact ? exactTimeToX(context, anchor.time) : timeToX(context, anchor.time),
|
|
200
204
|
y: pane.scale.valueToY(anchor.price)
|
|
201
205
|
};
|
|
202
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* An anchor as the bars show it: its time moved to the start of the bar it falls in, so that a
|
|
209
|
+
* drawing placed on 15-minute bars stands on the daily bar of its time, not between two of them.
|
|
210
|
+
*/
|
|
211
|
+
function anchorOnBars(bars, anchor) {
|
|
212
|
+
const time = bars.timeOfLogicalIndex(bars.barIndexOf(anchor.time));
|
|
213
|
+
return Number.isFinite(time) ? {
|
|
214
|
+
time,
|
|
215
|
+
price: anchor.price
|
|
216
|
+
} : anchor;
|
|
217
|
+
}
|
|
203
218
|
/** The anchor right under a plot-relative point, between bars too: a stroke drawn by hand. */
|
|
204
219
|
function freeAnchorAt(context, pane, local) {
|
|
205
220
|
return {
|
|
@@ -391,12 +406,15 @@ function moveHandle$1(definition, anchors, handle, to, space, style) {
|
|
|
391
406
|
return anchors.map((anchor, index) => String(index) === handle ? to : anchor);
|
|
392
407
|
}
|
|
393
408
|
/**
|
|
394
|
-
* The
|
|
395
|
-
*
|
|
409
|
+
* The point that `Shift` constrains a dragged handle against, as placing the anchor did. For a
|
|
410
|
+
* handle that is an anchor itself (`0`, `1`, … of the anchors) it is its neighbour. A drawing's own
|
|
411
|
+
* handles are left free unless its `pivotOf()` names one, as the end of the parallel line of a
|
|
412
|
+
* channel, which moves more than one anchor but still runs in a direction.
|
|
396
413
|
*/
|
|
397
|
-
function pivotFor(definition, anchors, handle) {
|
|
398
|
-
|
|
399
|
-
|
|
414
|
+
function pivotFor(definition, anchors, handle, space, style) {
|
|
415
|
+
const index = /^\d+$/.test(handle) ? Number(handle) : -1;
|
|
416
|
+
if (index < 0 || index >= anchors.length) return definition.pivotOf?.(anchors, handle, space, style) ?? null;
|
|
417
|
+
if (anchors.length < 2) return null;
|
|
400
418
|
return anchors[index - 1] ?? anchors[index + 1] ?? null;
|
|
401
419
|
}
|
|
402
420
|
/**
|
|
@@ -491,7 +509,7 @@ function paintAxisMarks(context, pane, marks, color, formatValue, labelsOnly) {
|
|
|
491
509
|
});
|
|
492
510
|
}
|
|
493
511
|
const timeAxis = frame.layout.timeAxis;
|
|
494
|
-
const xs = marks.times.map((time) =>
|
|
512
|
+
const xs = marks.times.map((time) => exactTimeToX(context, time));
|
|
495
513
|
const shownXs = xs.filter((x) => Number.isFinite(x));
|
|
496
514
|
if (!timeAxis || shownXs.length === 0) return;
|
|
497
515
|
if (!labelsOnly && shownXs.length > 1) {
|
|
@@ -748,9 +766,11 @@ function paneShowing(context, entry) {
|
|
|
748
766
|
function geometryOf(context, host, entry, points, pane) {
|
|
749
767
|
const style = styleOf(context, entry);
|
|
750
768
|
const textFontValue = textFont(style, context.options.font.family);
|
|
769
|
+
const exact = entry.definition.freehand === true;
|
|
770
|
+
const anchors = exact ? points : points.map((point) => anchorOnBars(context.bars, point));
|
|
751
771
|
return {
|
|
752
|
-
points:
|
|
753
|
-
anchors
|
|
772
|
+
points: anchors.map((point) => anchorPosition(context, pane, point, exact)),
|
|
773
|
+
anchors,
|
|
754
774
|
width: pane.plot.width,
|
|
755
775
|
height: pane.plot.height,
|
|
756
776
|
style,
|
|
@@ -760,7 +780,7 @@ function geometryOf(context, host, entry, points, pane) {
|
|
|
760
780
|
textFont: textFontValue,
|
|
761
781
|
valueToY: (value) => pane.scale.valueToY(value),
|
|
762
782
|
yToValue: (y) => pane.scale.yToValue(y),
|
|
763
|
-
timeToX: (time) =>
|
|
783
|
+
timeToX: (time) => exactTimeToX(context, time),
|
|
764
784
|
barIndex: (time) => context.bars.logicalIndexOf(time),
|
|
765
785
|
bars: context.displayed,
|
|
766
786
|
source: context.source,
|
|
@@ -977,12 +997,12 @@ function spaceOf({ bars, timeScale }, pane) {
|
|
|
977
997
|
* start is kept on the bars, not on the screen, so that a drawing dragged as the view scrolls or
|
|
978
998
|
* zooms stays under the pointer.
|
|
979
999
|
*/
|
|
980
|
-
function translated(context, pane, original, start, position) {
|
|
1000
|
+
function translated(context, pane, original, start, position, exact) {
|
|
981
1001
|
const { timeScale, bars } = context;
|
|
982
1002
|
const steps = Math.round(timeScale.xToIndex(position.x) - start.index);
|
|
983
1003
|
const shift = pane.scale.yToScale(position.y) - start.value;
|
|
984
1004
|
return original.map((anchor) => ({
|
|
985
|
-
time: bars.timeOfLogicalIndex(bars.logicalIndexOf(anchor.time) + steps),
|
|
1005
|
+
time: bars.timeOfLogicalIndex((exact ? bars.logicalIndexOf(anchor.time) : bars.barIndexOf(anchor.time)) + steps),
|
|
986
1006
|
price: pane.scale.fromScale((pane.scale.toScale(anchor.price) ?? NaN) + shift)
|
|
987
1007
|
}));
|
|
988
1008
|
}
|
|
@@ -1032,10 +1052,12 @@ function beginDrawingDrag(host, context, target, point, modifiers) {
|
|
|
1032
1052
|
const pane = paneOf(current.frame, entry.pane);
|
|
1033
1053
|
if (!pane || !dragged()) return;
|
|
1034
1054
|
const position = local(pane, next);
|
|
1035
|
-
const
|
|
1055
|
+
const space = spaceOf(current, pane);
|
|
1056
|
+
const style = styleOf(current, entry);
|
|
1057
|
+
const points = handle === null ? translated(current, pane, original, start, position, entry.definition.freehand === true) : moveHandle$1(entry.definition, original, handle, anchorAt(current, pane, position, {
|
|
1036
1058
|
magnet: magnetFor(drawingOptions(current.options).magnet, held),
|
|
1037
|
-
pivot: held.shift ? pivotFor(entry.definition, original, handle) : null
|
|
1038
|
-
}),
|
|
1059
|
+
pivot: held.shift ? pivotFor(entry.definition, original, handle, space, style) : null
|
|
1060
|
+
}), space, style);
|
|
1039
1061
|
if (!points.every(placeable)) return;
|
|
1040
1062
|
store.setPoints(entry.id, points);
|
|
1041
1063
|
moved = true;
|
|
@@ -1885,6 +1907,7 @@ function drawings(definitions = []) {
|
|
|
1885
1907
|
}
|
|
1886
1908
|
//#endregion
|
|
1887
1909
|
//#region src/drawings/tools/shared.ts
|
|
1910
|
+
/** A hit on a drawing's content: its text, the box of a label, a mark painted solid; never a fill. */
|
|
1888
1911
|
const bodyHit = {
|
|
1889
1912
|
part: "body",
|
|
1890
1913
|
distance: 0
|
|
@@ -1936,13 +1959,6 @@ function segmentsHit(point, segments, tolerance) {
|
|
|
1936
1959
|
} : null;
|
|
1937
1960
|
}
|
|
1938
1961
|
/**
|
|
1939
|
-
* A `line` hit on one of `lines`, else a `body` hit inside the `area` polygon where it is
|
|
1940
|
-
* `filled`: an area painted with nothing is not there to hit.
|
|
1941
|
-
*/
|
|
1942
|
-
function shapeHit(point, lines, area, tolerance, filled) {
|
|
1943
|
-
return segmentsHit(point, lines, tolerance) ?? (filled && insidePolygon(point, area) ? bodyHit : null);
|
|
1944
|
-
}
|
|
1945
|
-
/**
|
|
1946
1962
|
* The levels that show, in their order, each in its own color, else the drawing's; with a
|
|
1947
1963
|
* `palette`, as Fibonacci ratios and Gann boxes color them: the drawing's color for 0 and 1 and
|
|
1948
1964
|
* the palette's in turn for the others, hidden ones counted.
|
|
@@ -2575,6 +2591,20 @@ function boxHandles(geometry) {
|
|
|
2575
2591
|
}
|
|
2576
2592
|
];
|
|
2577
2593
|
}
|
|
2594
|
+
/** What `Shift` keeps a dragged corner of a box in line with: the corner across from it. */
|
|
2595
|
+
function boxPivot([a, b], handle) {
|
|
2596
|
+
switch (handle) {
|
|
2597
|
+
case "ab": return {
|
|
2598
|
+
time: b.time,
|
|
2599
|
+
price: a.price
|
|
2600
|
+
};
|
|
2601
|
+
case "ba": return {
|
|
2602
|
+
time: a.time,
|
|
2603
|
+
price: b.price
|
|
2604
|
+
};
|
|
2605
|
+
default: return null;
|
|
2606
|
+
}
|
|
2607
|
+
}
|
|
2578
2608
|
function moveBoxHandle([a, b], handle, to) {
|
|
2579
2609
|
switch (handle) {
|
|
2580
2610
|
case "0": return [to, b];
|
|
@@ -2648,12 +2678,12 @@ const rectangle = {
|
|
|
2648
2678
|
paintBoxText(context, first, second);
|
|
2649
2679
|
},
|
|
2650
2680
|
hitTest: (geometry, point, tolerance) => {
|
|
2651
|
-
|
|
2652
|
-
return shapeHit(point, box.border, box.area, tolerance, geometry.style.fill);
|
|
2681
|
+
return segmentsHit(point, extendedBox(geometry).border, tolerance);
|
|
2653
2682
|
},
|
|
2654
2683
|
bounds: (geometry) => boundsOf(extendedBox(geometry).area),
|
|
2655
2684
|
handles: boxHandles,
|
|
2656
2685
|
moveHandle: moveBoxHandle,
|
|
2686
|
+
pivotOf: boxPivot,
|
|
2657
2687
|
levels: (anchors, _scale, style) => boxLevels$1(anchors, style)
|
|
2658
2688
|
};
|
|
2659
2689
|
/** The shift moving the base line through `through`: vertical, or horizontal for a vertical base. */
|
|
@@ -2733,20 +2763,34 @@ function channelHandles(geometry) {
|
|
|
2733
2763
|
];
|
|
2734
2764
|
}
|
|
2735
2765
|
/**
|
|
2736
|
-
*
|
|
2737
|
-
* the
|
|
2738
|
-
*
|
|
2766
|
+
* The channel in the space it is drawn in: the height of the base line at a bar position, the
|
|
2767
|
+
* distance of the parallel from it (the third anchor sits at the time of the first) and a point
|
|
2768
|
+
* moved up or down by an offset.
|
|
2739
2769
|
*/
|
|
2740
|
-
function
|
|
2770
|
+
function channelFrame([start, end, through], space) {
|
|
2741
2771
|
const x = (point) => space.barIndex(point.time);
|
|
2742
2772
|
const y = (point) => space.toScale(point.price);
|
|
2743
|
-
/** The base line's height at bar position `at`. */
|
|
2744
2773
|
const base = (at) => x(start) === x(end) ? y(start) : y(start) + (at - x(start)) / (x(end) - x(start)) * (y(end) - y(start));
|
|
2745
2774
|
const raised = (point, offset) => ({
|
|
2746
2775
|
time: point.time,
|
|
2747
2776
|
price: space.fromScale(y(point) + offset)
|
|
2748
2777
|
});
|
|
2749
|
-
|
|
2778
|
+
return {
|
|
2779
|
+
base,
|
|
2780
|
+
height: y(through) - base(x(through)),
|
|
2781
|
+
raised
|
|
2782
|
+
};
|
|
2783
|
+
}
|
|
2784
|
+
/**
|
|
2785
|
+
* Applies a channel handle in the space the channel is drawn in, so that the handle ends under
|
|
2786
|
+
* the pointer on a logarithmic scale and across gaps between bars too. The third anchor is kept at
|
|
2787
|
+
* the time of the first, so the height is exactly its distance from the base line there.
|
|
2788
|
+
*/
|
|
2789
|
+
function moveChannelHandle(anchors, handle, to, space) {
|
|
2790
|
+
const [start, end] = anchors;
|
|
2791
|
+
const { base, height, raised } = channelFrame(anchors, space);
|
|
2792
|
+
const x = (point) => space.barIndex(point.time);
|
|
2793
|
+
const y = (point) => space.toScale(point.price);
|
|
2750
2794
|
const channel = (from, until, offset) => [
|
|
2751
2795
|
from,
|
|
2752
2796
|
until,
|
|
@@ -2765,6 +2809,16 @@ function moveChannelHandle([start, end, through], handle, to, space) {
|
|
|
2765
2809
|
default: return channel(start, end, y(to) - base(x(to)));
|
|
2766
2810
|
}
|
|
2767
2811
|
}
|
|
2812
|
+
/**
|
|
2813
|
+
* What `Shift` keeps a dragged end of the parallel line in line with: the other end of that line.
|
|
2814
|
+
* The ends of the base line are anchors, constrained against each other as any two anchors are.
|
|
2815
|
+
*/
|
|
2816
|
+
function channelPivot(anchors, handle, space) {
|
|
2817
|
+
if (handle !== "p0" && handle !== "p1") return null;
|
|
2818
|
+
const [start, end] = anchors;
|
|
2819
|
+
const { height, raised } = channelFrame(anchors, space);
|
|
2820
|
+
return raised(handle === "p0" ? end : start, height);
|
|
2821
|
+
}
|
|
2768
2822
|
const parallelChannel = {
|
|
2769
2823
|
type: "parallel-channel",
|
|
2770
2824
|
points: 3,
|
|
@@ -2783,12 +2837,12 @@ const parallelChannel = {
|
|
|
2783
2837
|
}, { lineStyle: "dashed" });
|
|
2784
2838
|
},
|
|
2785
2839
|
hitTest: (geometry, point, tolerance) => {
|
|
2786
|
-
|
|
2787
|
-
return shapeHit(point, channel.lines, channel.area, tolerance, geometry.style.fill);
|
|
2840
|
+
return segmentsHit(point, channelOf$1(geometry, true).lines, tolerance);
|
|
2788
2841
|
},
|
|
2789
2842
|
bounds: (geometry) => boundsOf(channelOf$1(geometry, true).area),
|
|
2790
2843
|
handles: channelHandles,
|
|
2791
2844
|
moveHandle: moveChannelHandle,
|
|
2845
|
+
pivotOf: channelPivot,
|
|
2792
2846
|
levels: ([start, end, through], scale, style, { barIndex }) => {
|
|
2793
2847
|
const share = through.time === start.time ? 0 : (barIndex(through.time) - barIndex(start.time)) / (barIndex(end.time) - barIndex(start.time));
|
|
2794
2848
|
const from = scale.toScale(start.price);
|
|
@@ -3131,16 +3185,7 @@ function fibType(type, kind) {
|
|
|
3131
3185
|
});
|
|
3132
3186
|
},
|
|
3133
3187
|
hitTest: (geometry, point, tolerance) => {
|
|
3134
|
-
|
|
3135
|
-
const first = ladder.levels[0];
|
|
3136
|
-
const last = ladder.levels.at(-1);
|
|
3137
|
-
return segmentsHit(point, levelLines(ladder), tolerance) ?? (geometry.style.fill && first && last && insideRect(point, {
|
|
3138
|
-
x: ladder.left,
|
|
3139
|
-
y: first.y
|
|
3140
|
-
}, {
|
|
3141
|
-
x: ladder.right,
|
|
3142
|
-
y: last.y
|
|
3143
|
-
}) ? bodyHit : null);
|
|
3188
|
+
return segmentsHit(point, levelLines(ladderOf(geometry, kind)), tolerance);
|
|
3144
3189
|
},
|
|
3145
3190
|
bounds: (geometry) => ladderBounds(geometry, ladderOf(geometry, kind))
|
|
3146
3191
|
};
|
|
@@ -3249,14 +3294,7 @@ const fibChannel = {
|
|
|
3249
3294
|
}));
|
|
3250
3295
|
},
|
|
3251
3296
|
hitTest: (geometry, point, tolerance) => {
|
|
3252
|
-
|
|
3253
|
-
const first = levels[0]?.line;
|
|
3254
|
-
const last = levels.at(-1)?.line;
|
|
3255
|
-
return segmentsHit(point, levels.map(({ line }) => line), tolerance) ?? (geometry.style.fill && first && last && insidePolygon(point, [
|
|
3256
|
-
...first,
|
|
3257
|
-
last[1],
|
|
3258
|
-
last[0]
|
|
3259
|
-
]) ? bodyHit : null);
|
|
3297
|
+
return segmentsHit(point, channelLevels(geometry).map(({ line }) => line), tolerance);
|
|
3260
3298
|
},
|
|
3261
3299
|
levels: ([first, second, third], scale, style, { barIndex, timeAt }) => {
|
|
3262
3300
|
const bars = barIndex(third.time) - barIndex(first.time);
|
|
@@ -3326,14 +3364,13 @@ const fibTimeZone = {
|
|
|
3326
3364
|
hitTest: (geometry, point, tolerance) => {
|
|
3327
3365
|
const zones = zonesOf(geometry);
|
|
3328
3366
|
const [first, second] = geometry.points;
|
|
3329
|
-
const xs = zones.map(({ x }) => x);
|
|
3330
3367
|
return segmentsHit(point, [[first, second], ...zones.map(({ x }) => [{
|
|
3331
3368
|
x,
|
|
3332
3369
|
y: 0
|
|
3333
3370
|
}, {
|
|
3334
3371
|
x,
|
|
3335
3372
|
y: geometry.height
|
|
3336
|
-
}])], tolerance)
|
|
3373
|
+
}])], tolerance);
|
|
3337
3374
|
},
|
|
3338
3375
|
bounds: (geometry) => boundsOf([...geometry.points, ...zonesOf(geometry).flatMap(({ count, x }) => [{
|
|
3339
3376
|
x,
|
|
@@ -3413,7 +3450,7 @@ const brush = {
|
|
|
3413
3450
|
if (style.startArrow) paintArrowHead(ctx, points[0], endAngle(points, false, reach), style);
|
|
3414
3451
|
if (style.endArrow) paintArrowHead(ctx, last(points), endAngle(points, true, reach), style);
|
|
3415
3452
|
},
|
|
3416
|
-
hitTest: (geometry, point, tolerance) => segmentsHit(point, segmentsOf(geometry.points, false), tolerance)
|
|
3453
|
+
hitTest: (geometry, point, tolerance) => segmentsHit(point, segmentsOf(geometry.points, false), tolerance),
|
|
3417
3454
|
handles: () => [],
|
|
3418
3455
|
bounds: (geometry) => boundsOf(geometry.points),
|
|
3419
3456
|
axisMarks: strokeMarks
|
|
@@ -3579,21 +3616,20 @@ function paintOval(context, oval) {
|
|
|
3579
3616
|
}, lines, center.x, center.y - (lines.length - 1) * lineHeight / 2, 0, geometry.style.textColor);
|
|
3580
3617
|
}
|
|
3581
3618
|
}
|
|
3582
|
-
/** A `line` hit on the oval's outline
|
|
3583
|
-
function ovalHit(oval, point, tolerance
|
|
3619
|
+
/** A `line` hit on the oval's outline: its inside is a fill, never hit. */
|
|
3620
|
+
function ovalHit(oval, point, tolerance) {
|
|
3584
3621
|
const { center, radiusX, radiusY, rotation } = oval;
|
|
3585
3622
|
if (radiusX <= 0 || radiusY <= 0) return null;
|
|
3586
3623
|
const dx = point.x - center.x;
|
|
3587
3624
|
const dy = point.y - center.y;
|
|
3588
3625
|
const along = (dx * Math.cos(rotation) + dy * Math.sin(rotation)) / radiusX;
|
|
3589
3626
|
const across = (-dx * Math.sin(rotation) + dy * Math.cos(rotation)) / radiusY;
|
|
3590
|
-
const
|
|
3591
|
-
const distance = Math.abs(reach - 1) * Math.min(radiusX, radiusY);
|
|
3627
|
+
const distance = Math.abs(Math.hypot(along, across) - 1) * Math.min(radiusX, radiusY);
|
|
3592
3628
|
if (distance <= tolerance) return {
|
|
3593
3629
|
part: "line",
|
|
3594
3630
|
distance
|
|
3595
3631
|
};
|
|
3596
|
-
return
|
|
3632
|
+
return null;
|
|
3597
3633
|
}
|
|
3598
3634
|
function ovalBounds({ center, radiusX, radiusY, rotation }) {
|
|
3599
3635
|
const cos = Math.cos(rotation);
|
|
@@ -3629,7 +3665,7 @@ const circle = {
|
|
|
3629
3665
|
paint: (context) => {
|
|
3630
3666
|
paintOval(context, circleOf(context.geometry));
|
|
3631
3667
|
},
|
|
3632
|
-
hitTest: (geometry, point, tolerance) => ovalHit(circleOf(geometry), point, tolerance
|
|
3668
|
+
hitTest: (geometry, point, tolerance) => ovalHit(circleOf(geometry), point, tolerance),
|
|
3633
3669
|
bounds: (geometry) => ovalBounds(circleOf(geometry)),
|
|
3634
3670
|
axisMarks: ([center]) => ({
|
|
3635
3671
|
prices: [center.price],
|
|
@@ -3679,7 +3715,7 @@ const ellipse = {
|
|
|
3679
3715
|
},
|
|
3680
3716
|
hitTest: (geometry, point, tolerance) => {
|
|
3681
3717
|
const oval = ellipseOf(geometry);
|
|
3682
|
-
return oval ? ovalHit(oval, point, tolerance
|
|
3718
|
+
return oval ? ovalHit(oval, point, tolerance) : null;
|
|
3683
3719
|
},
|
|
3684
3720
|
handles: (geometry) => {
|
|
3685
3721
|
const [start, end] = geometry.points;
|
|
@@ -3732,7 +3768,7 @@ const triangle = {
|
|
|
3732
3768
|
tracePath(ctx, points, true);
|
|
3733
3769
|
});
|
|
3734
3770
|
},
|
|
3735
|
-
hitTest: (geometry, point, tolerance) =>
|
|
3771
|
+
hitTest: (geometry, point, tolerance) => segmentsHit(point, segmentsOf(geometry.points, true), tolerance),
|
|
3736
3772
|
bounds: (geometry) => boundsOf(geometry.points)
|
|
3737
3773
|
};
|
|
3738
3774
|
/** Half the width of a rotated rectangle: how far `c` is from its middle line through `a` and `b`. */
|
|
@@ -3786,8 +3822,7 @@ const rotatedRectangle = {
|
|
|
3786
3822
|
});
|
|
3787
3823
|
},
|
|
3788
3824
|
hitTest: (geometry, point, tolerance) => {
|
|
3789
|
-
|
|
3790
|
-
return shapeHit(point, segmentsOf(corners, true), corners, tolerance, geometry.style.fill);
|
|
3825
|
+
return segmentsHit(point, segmentsOf(rotatedCorners(geometry.points), true), tolerance);
|
|
3791
3826
|
},
|
|
3792
3827
|
bounds: (geometry) => boundsOf(rotatedCorners(geometry.points)),
|
|
3793
3828
|
handles: (geometry) => {
|
|
@@ -3833,6 +3868,7 @@ const rotatedRectangle = {
|
|
|
3833
3868
|
c
|
|
3834
3869
|
];
|
|
3835
3870
|
},
|
|
3871
|
+
pivotOf: ([, b], handle) => handle.startsWith("corner-") ? b : null,
|
|
3836
3872
|
axisMarks: ([a, b]) => ({
|
|
3837
3873
|
prices: [a.price, b.price],
|
|
3838
3874
|
times: [a.time, b.time]
|
|
@@ -4053,8 +4089,7 @@ const gannBox = {
|
|
|
4053
4089
|
paintBoxLabels(ctx, geometry, sidesOf(first, second), prices, times);
|
|
4054
4090
|
},
|
|
4055
4091
|
hitTest: (geometry, point, tolerance) => {
|
|
4056
|
-
|
|
4057
|
-
return shapeHit(point, gannLines(box).map(({ line }) => line), corners(box.first, box.second), tolerance, geometry.style.fill);
|
|
4092
|
+
return segmentsHit(point, gannLines(gannBoxOf(geometry)).map(({ line }) => line), tolerance);
|
|
4058
4093
|
},
|
|
4059
4094
|
bounds: (geometry) => {
|
|
4060
4095
|
const box = gannBoxOf(geometry);
|
|
@@ -4062,6 +4097,7 @@ const gannBox = {
|
|
|
4062
4097
|
},
|
|
4063
4098
|
handles: boxHandles,
|
|
4064
4099
|
moveHandle: moveBoxHandle,
|
|
4100
|
+
pivotOf: boxPivot,
|
|
4065
4101
|
levels: ([first, second], scale, style) => {
|
|
4066
4102
|
const from = scale.toScale(first.price);
|
|
4067
4103
|
const to = scale.toScale(second.price);
|
|
@@ -4178,8 +4214,7 @@ const fibSpeedFan = {
|
|
|
4178
4214
|
},
|
|
4179
4215
|
hitTest: (geometry, point, tolerance) => {
|
|
4180
4216
|
const fan = fanOf(geometry);
|
|
4181
|
-
|
|
4182
|
-
return segmentsHit(point, [...raysOf(fan), ...gridOf(fan)], tolerance) ?? (geometry.style.fill && wedges.some(({ area }) => insidePolygon(point, area)) ? bodyHit : null);
|
|
4217
|
+
return segmentsHit(point, [...raysOf(fan), ...gridOf(fan)], tolerance);
|
|
4183
4218
|
},
|
|
4184
4219
|
bounds: (geometry) => {
|
|
4185
4220
|
const fan = fanOf(geometry);
|
|
@@ -4327,17 +4362,7 @@ const gannFan = {
|
|
|
4327
4362
|
}
|
|
4328
4363
|
},
|
|
4329
4364
|
hitTest: (geometry, point, tolerance) => {
|
|
4330
|
-
|
|
4331
|
-
const [origin] = geometry.points;
|
|
4332
|
-
const wedges = angles.flatMap(({ ray }, index) => {
|
|
4333
|
-
const next = angles[index + 1];
|
|
4334
|
-
return next ? [[
|
|
4335
|
-
origin,
|
|
4336
|
-
ray[1],
|
|
4337
|
-
next.ray[1]
|
|
4338
|
-
]] : [];
|
|
4339
|
-
});
|
|
4340
|
-
return segmentsHit(point, angles.map(({ ray }) => ray), tolerance) ?? (geometry.style.fill && wedges.some((area) => insidePolygon(point, area)) ? bodyHit : null);
|
|
4365
|
+
return segmentsHit(point, gannFanOf(geometry).map(({ ray }) => ray), tolerance);
|
|
4341
4366
|
},
|
|
4342
4367
|
bounds: (geometry) => boundsOf([...geometry.points, ...gannFanOf(geometry).flatMap(({ ray }) => ray)]),
|
|
4343
4368
|
levels: ([origin, corner], scale, style, { barIndex, timeAt }) => {
|
|
@@ -4445,11 +4470,11 @@ function rangeType(kind) {
|
|
|
4445
4470
|
hitTest: (geometry, point, tolerance) => {
|
|
4446
4471
|
const range = rangeOf(geometry, kind);
|
|
4447
4472
|
const { label } = range;
|
|
4448
|
-
const
|
|
4473
|
+
const onLabel = insideRect(point, label, {
|
|
4449
4474
|
x: label.x + label.width,
|
|
4450
4475
|
y: label.y + label.height
|
|
4451
|
-
})
|
|
4452
|
-
return segmentsHit(point, range.arrows, tolerance) ?? (
|
|
4476
|
+
});
|
|
4477
|
+
return segmentsHit(point, range.arrows, tolerance) ?? (onLabel ? bodyHit : null);
|
|
4453
4478
|
},
|
|
4454
4479
|
bounds: (geometry) => {
|
|
4455
4480
|
const { start, end, label } = rangeOf(geometry, kind);
|
|
@@ -5055,16 +5080,7 @@ const xabcdPattern = {
|
|
|
5055
5080
|
for (const [label, at, before, after] of labelled) paintPointLabel(context, label, at, isTop(at, before, after));
|
|
5056
5081
|
},
|
|
5057
5082
|
hitTest: (geometry, point, tolerance) => {
|
|
5058
|
-
|
|
5059
|
-
return segmentsHit(point, segmentsOf(geometry.points, false), tolerance) ?? (geometry.style.fill && (insidePolygon(point, [
|
|
5060
|
-
x,
|
|
5061
|
-
a,
|
|
5062
|
-
b
|
|
5063
|
-
]) || insidePolygon(point, [
|
|
5064
|
-
b,
|
|
5065
|
-
c,
|
|
5066
|
-
d
|
|
5067
|
-
])) ? bodyHit : null);
|
|
5083
|
+
return segmentsHit(point, segmentsOf(geometry.points, false), tolerance);
|
|
5068
5084
|
},
|
|
5069
5085
|
bounds: (geometry) => labelledPoints(geometry, geometry.points, XABCD)
|
|
5070
5086
|
};
|
|
@@ -5246,7 +5262,7 @@ const headAndShoulders = {
|
|
|
5246
5262
|
},
|
|
5247
5263
|
hitTest: (geometry, point, tolerance) => {
|
|
5248
5264
|
const pattern = headAndShouldersOf(geometry);
|
|
5249
|
-
return segmentsHit(point, [...segmentsOf(pattern.points, false), pattern.neckline], tolerance)
|
|
5265
|
+
return segmentsHit(point, [...segmentsOf(pattern.points, false), pattern.neckline], tolerance);
|
|
5250
5266
|
},
|
|
5251
5267
|
bounds: (geometry) => {
|
|
5252
5268
|
const pattern = headAndShouldersOf(geometry);
|
|
@@ -5430,7 +5446,7 @@ function pitchforkType(type, from) {
|
|
|
5430
5446
|
hitTest: (geometry, point, tolerance) => {
|
|
5431
5447
|
const fork = forkOf(geometry, from);
|
|
5432
5448
|
if (!fork) return null;
|
|
5433
|
-
return segmentsHit(point, linesOf(fork), tolerance)
|
|
5449
|
+
return segmentsHit(point, linesOf(fork), tolerance);
|
|
5434
5450
|
},
|
|
5435
5451
|
bounds: (geometry) => {
|
|
5436
5452
|
const fork = forkOf(geometry, from);
|
|
@@ -5778,8 +5794,14 @@ function position(type, long) {
|
|
|
5778
5794
|
hitTest: (geometry, point, tolerance) => {
|
|
5779
5795
|
const box = boxOf(geometry);
|
|
5780
5796
|
if (!box) return null;
|
|
5781
|
-
const
|
|
5782
|
-
|
|
5797
|
+
const entry = [{
|
|
5798
|
+
x: box.left,
|
|
5799
|
+
y: box.entry
|
|
5800
|
+
}, {
|
|
5801
|
+
x: box.right,
|
|
5802
|
+
y: box.entry
|
|
5803
|
+
}];
|
|
5804
|
+
return segmentsHit(point, [...segmentsOf(rect(box.left, box.right, box.target, box.stop), true), entry], tolerance);
|
|
5783
5805
|
},
|
|
5784
5806
|
bounds: (geometry) => {
|
|
5785
5807
|
const box = boxOf(geometry);
|
|
@@ -5890,17 +5912,6 @@ function channelOf(geometry) {
|
|
|
5890
5912
|
ends: from.time <= to.time ? [at(0, fit.first), at(0, fit.last)] : [at(0, fit.last), at(0, fit.first)]
|
|
5891
5913
|
};
|
|
5892
5914
|
}
|
|
5893
|
-
/** The area between the highest and the lowest line. */
|
|
5894
|
-
function areaOf(channel) {
|
|
5895
|
-
const top = channel.lines[0]?.line;
|
|
5896
|
-
const bottom = channel.lines.at(-1)?.line;
|
|
5897
|
-
return top && bottom ? [
|
|
5898
|
-
top[0],
|
|
5899
|
-
top[1],
|
|
5900
|
-
bottom[1],
|
|
5901
|
-
bottom[0]
|
|
5902
|
-
] : [];
|
|
5903
|
-
}
|
|
5904
5915
|
/**
|
|
5905
5916
|
* A linear regression channel of the bars between two times: the base line fits the
|
|
5906
5917
|
* closes (or another `source`) by least squares, and the lines `levels` standard deviations away,
|
|
@@ -5957,7 +5968,7 @@ const regressionTrend = {
|
|
|
5957
5968
|
},
|
|
5958
5969
|
hitTest: (geometry, point, tolerance) => {
|
|
5959
5970
|
const channel = channelOf(geometry);
|
|
5960
|
-
return channel ?
|
|
5971
|
+
return channel ? segmentsHit(point, channel.lines.map(({ line }) => line), tolerance) : null;
|
|
5961
5972
|
},
|
|
5962
5973
|
handles: (geometry) => (channelOf(geometry)?.ends ?? []).map((end, index) => ({
|
|
5963
5974
|
id: String(index),
|
|
@@ -6139,9 +6150,7 @@ const anchoredVwap = {
|
|
|
6139
6150
|
hitTest: (geometry, point, tolerance) => {
|
|
6140
6151
|
const lines = linesOf(geometry);
|
|
6141
6152
|
if (!lines) return null;
|
|
6142
|
-
|
|
6143
|
-
const inside = geometry.style.fill && lines.bands.some((band) => insidePolygon(point, bandArea(band)));
|
|
6144
|
-
return segmentsHit(point, curves.flatMap((curve) => segmentsOf(curve, false)), tolerance) ?? (inside ? bodyHit : null);
|
|
6153
|
+
return segmentsHit(point, [lines.vwap, ...lines.bands.flatMap((band) => [band.upper, band.lower])].flatMap((curve) => segmentsOf(curve, false)), tolerance);
|
|
6145
6154
|
},
|
|
6146
6155
|
handles: (geometry) => {
|
|
6147
6156
|
const [anchor] = geometry.anchors;
|
|
@@ -6279,6 +6288,7 @@ function positionsOf(bars) {
|
|
|
6279
6288
|
const { interval } = entry;
|
|
6280
6289
|
return {
|
|
6281
6290
|
logicalIndexOf: (time) => logicalIndex(bars, interval, time),
|
|
6291
|
+
barIndexOf: (time) => barIndex(bars, interval, time),
|
|
6282
6292
|
timeOfLogicalIndex: (logical) => logicalTime(bars, interval, logical)
|
|
6283
6293
|
};
|
|
6284
6294
|
}
|
|
@@ -6292,10 +6302,12 @@ function positionsOf(bars) {
|
|
|
6292
6302
|
function drawingLevels(definition, drawing, bars = emptyBars(), options = {}) {
|
|
6293
6303
|
validateDefinition(definition);
|
|
6294
6304
|
checkObject("drawing", drawing);
|
|
6295
|
-
const
|
|
6296
|
-
checkPointCount(definition,
|
|
6305
|
+
const placed = parsePoints(drawing.points, "drawing.points");
|
|
6306
|
+
checkPointCount(definition, placed, definition.type);
|
|
6307
|
+
const positions = positionsOf(bars);
|
|
6308
|
+
const points = placed.map((point) => anchorOnBars(positions, point));
|
|
6297
6309
|
const style = resolveStyle(defaultOptions(), definition, checkStyle(drawing.style ?? {}));
|
|
6298
|
-
return [...definition.levels?.(points, scaleOf(options), style, levelContext(bars,
|
|
6310
|
+
return [...definition.levels?.(points, scaleOf(options), style, levelContext(bars, positions)) ?? []];
|
|
6299
6311
|
}
|
|
6300
6312
|
/**
|
|
6301
6313
|
* The value of a line of {@link drawingLevels} at the time of a bar, as an alert reads it on a
|
package/dist/drawings.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as TextAlign, D as WaveDegree, E as TupleOf, S as Positions, T as TimeframeRange, _ as DrawingTexts, a as DrawingField, b as LevelContext, c as DrawingHit, d as DrawingLevelStyle, f as DrawingPaintContext, g as DrawingStyle, h as DrawingSpace, i as DrawingBounds, l as DrawingInput, m as DrawingPointInput, n as Drawing, o as DrawingGeometry, p as DrawingPoint, r as DrawingAxisMarks, s as DrawingHandle, t as Anchors, u as DrawingLevel, v as DrawingTimeframes, w as TextPosition, x as LevelScale, y as DrawingTypeDefinition } from "./types-
|
|
2
|
-
import { n as DrawingsApi, r as ToolOptions, t as DrawingUpdateOptions } from "./api-
|
|
3
|
-
import { $ as ray, A as gannBox, B as fibChannel, C as xabcdPattern, D as priceLabel, E as flagMark, F as rotatedRectangle, G as path, H as fibRetracement, I as triangle, J as arrow, K as rectangle, L as callout, M as cyclicLines, N as circle, O as infoLine, P as ellipse, Q as horizontalRay, R as brush, S as headAndShoulders, T as arrowMarkUp, U as fibTimeZone, V as fibExtension, W as parallelChannel, X as extendedLine, Y as crossLine, Z as horizontalLine, _ as elliottCorrection, a as drawingLevels, at as DrawingsEventMap, b as elliottTriangle, c as datePriceRange, ct as drawings, d as longPosition, dt as DrawingsChangeReason, et as trendAngle, f as shortPosition, g as abcdPattern, h as schiffPitchfork, i as drawingLevelValue, it as DrawingsChangeEvent, j as gannFan, k as fibSpeedFan, l as dateRange, lt as DrawingOptions, m as pitchfork, n as DrawingLevelsOptions, nt as verticalLine, o as anchoredVwap, ot as DrawingsModule, p as modifiedSchiffPitchfork, q as text, r as computeDrawingLevels, rt as allDrawings, s as regressionTrend, st as ToolEndEvent, t as DrawingLevelsInput, tt as trendLine, u as priceRange, ut as MagnetMode, v as elliottDoubleCombo, w as arrowMarkDown, x as elliottTripleCombo, y as elliottImpulse, z as highlighter } from "./index-
|
|
1
|
+
import { C as TextAlign, D as WaveDegree, E as TupleOf, S as Positions, T as TimeframeRange, _ as DrawingTexts, a as DrawingField, b as LevelContext, c as DrawingHit, d as DrawingLevelStyle, f as DrawingPaintContext, g as DrawingStyle, h as DrawingSpace, i as DrawingBounds, l as DrawingInput, m as DrawingPointInput, n as Drawing, o as DrawingGeometry, p as DrawingPoint, r as DrawingAxisMarks, s as DrawingHandle, t as Anchors, u as DrawingLevel, v as DrawingTimeframes, w as TextPosition, x as LevelScale, y as DrawingTypeDefinition } from "./types-CrxgaGh5.js";
|
|
2
|
+
import { n as DrawingsApi, r as ToolOptions, t as DrawingUpdateOptions } from "./api-DgviKlaI.js";
|
|
3
|
+
import { $ as ray, A as gannBox, B as fibChannel, C as xabcdPattern, D as priceLabel, E as flagMark, F as rotatedRectangle, G as path, H as fibRetracement, I as triangle, J as arrow, K as rectangle, L as callout, M as cyclicLines, N as circle, O as infoLine, P as ellipse, Q as horizontalRay, R as brush, S as headAndShoulders, T as arrowMarkUp, U as fibTimeZone, V as fibExtension, W as parallelChannel, X as extendedLine, Y as crossLine, Z as horizontalLine, _ as elliottCorrection, a as drawingLevels, at as DrawingsEventMap, b as elliottTriangle, c as datePriceRange, ct as drawings, d as longPosition, dt as DrawingsChangeReason, et as trendAngle, f as shortPosition, g as abcdPattern, h as schiffPitchfork, i as drawingLevelValue, it as DrawingsChangeEvent, j as gannFan, k as fibSpeedFan, l as dateRange, lt as DrawingOptions, m as pitchfork, n as DrawingLevelsOptions, nt as verticalLine, o as anchoredVwap, ot as DrawingsModule, p as modifiedSchiffPitchfork, q as text, r as computeDrawingLevels, rt as allDrawings, s as regressionTrend, st as ToolEndEvent, t as DrawingLevelsInput, tt as trendLine, u as priceRange, ut as MagnetMode, v as elliottDoubleCombo, w as arrowMarkDown, x as elliottTripleCombo, y as elliottImpulse, z as highlighter } from "./index-Bgl-FJT3.js";
|
|
4
4
|
export { type Anchors, type Drawing, type DrawingAxisMarks, type DrawingBounds, type DrawingField, type DrawingGeometry, type DrawingHandle, type DrawingHit, type DrawingInput, type DrawingLevel, type DrawingLevelStyle, type DrawingLevelsInput, type DrawingLevelsOptions, type DrawingOptions, type DrawingPaintContext, type DrawingPoint, type DrawingPointInput, type DrawingSpace, type DrawingStyle, type DrawingTexts, type DrawingTimeframes, type DrawingTypeDefinition, type DrawingUpdateOptions, type DrawingsApi, type DrawingsChangeEvent, type DrawingsChangeReason, type DrawingsEventMap, type DrawingsModule, type LevelContext, type LevelScale, type MagnetMode, type Positions, type TextAlign, type TextPosition, type TimeframeRange, type ToolEndEvent, type ToolOptions, type TupleOf, type WaveDegree, abcdPattern, allDrawings, anchoredVwap, arrow, arrowMarkDown, arrowMarkUp, brush, callout, circle, computeDrawingLevels, crossLine, cyclicLines, datePriceRange, dateRange, drawingLevelValue, drawingLevels, drawings, elliottCorrection, elliottDoubleCombo, elliottImpulse, elliottTriangle, elliottTripleCombo, ellipse, extendedLine, fibChannel, fibExtension, fibRetracement, fibSpeedFan, fibTimeZone, flagMark, gannBox, gannFan, headAndShoulders, highlighter, horizontalLine, horizontalRay, infoLine, longPosition, modifiedSchiffPitchfork, parallelChannel, path, pitchfork, priceLabel, priceRange, ray, rectangle, regressionTrend, rotatedRectangle, schiffPitchfork, shortPosition, text, trendAngle, trendLine, triangle, verticalLine, xabcdPattern };
|
package/dist/drawings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as abcdPattern, i as allDrawings, a as anchoredVwap, q as arrow, b as arrowMarkDown, x as arrowMarkUp, L as brush, I as callout, M as circle, t as computeDrawingLevels, J as crossLine, j as cyclicLines, T as datePriceRange, E as dateRange, n as drawingLevelValue, r as drawingLevels, nt as drawings, p as elliottCorrection, m as elliottDoubleCombo, h as elliottImpulse, g as elliottTriangle, _ as elliottTripleCombo, N as ellipse, Y as extendedLine, z as fibChannel, B as fibExtension, V as fibRetracement, O as fibSpeedFan, H as fibTimeZone, S as flagMark, k as gannBox, A as gannFan, v as headAndShoulders, R as highlighter, X as horizontalLine, Z as horizontalRay, w as infoLine, s as longPosition, l as modifiedSchiffPitchfork, U as parallelChannel, W as path, u as pitchfork, C as priceLabel, D as priceRange, Q as ray, G as rectangle, o as regressionTrend, P as rotatedRectangle, d as schiffPitchfork, c as shortPosition, K as text, $ as trendAngle, et as trendLine, F as triangle, tt as verticalLine, y as xabcdPattern } from "./drawings-
|
|
1
|
+
export { f as abcdPattern, i as allDrawings, a as anchoredVwap, q as arrow, b as arrowMarkDown, x as arrowMarkUp, L as brush, I as callout, M as circle, t as computeDrawingLevels, J as crossLine, j as cyclicLines, T as datePriceRange, E as dateRange, n as drawingLevelValue, r as drawingLevels, nt as drawings, p as elliottCorrection, m as elliottDoubleCombo, h as elliottImpulse, g as elliottTriangle, _ as elliottTripleCombo, N as ellipse, Y as extendedLine, z as fibChannel, B as fibExtension, V as fibRetracement, O as fibSpeedFan, H as fibTimeZone, S as flagMark, k as gannBox, A as gannFan, v as headAndShoulders, R as highlighter, X as horizontalLine, Z as horizontalRay, w as infoLine, s as longPosition, l as modifiedSchiffPitchfork, U as parallelChannel, W as path, u as pitchfork, C as priceLabel, D as priceRange, Q as ray, G as rectangle, o as regressionTrend, P as rotatedRectangle, d as schiffPitchfork, c as shortPosition, K as text, $ as trendAngle, et as trendLine, F as triangle, tt as verticalLine, y as xabcdPattern } from "./drawings-C-jyagJI.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as LEFT_SCALE, o as MAIN_PANE_ID, t as blend, u as emptyExtents } from "./color-
|
|
3
|
-
import { i as collectContributors, n as formatValue, t as finerFormat } from "./value-format-
|
|
1
|
+
import { m as fail } from "./validate-B_z8rO0I.js";
|
|
2
|
+
import { a as LEFT_SCALE, o as MAIN_PANE_ID, t as blend, u as emptyExtents } from "./color-AsBx5M66.js";
|
|
3
|
+
import { i as collectContributors, n as formatValue, t as finerFormat } from "./value-format-DwSqOZkc.js";
|
|
4
4
|
//#region src/layout/layout.ts
|
|
5
5
|
/**
|
|
6
6
|
* Heights of the fixed panes within `budget`: as requested while they fit, else shrunk in
|
|
@@ -471,14 +471,13 @@ function buildPass(sources, size, axes, priceFormat, pool) {
|
|
|
471
471
|
const scale = scales.get(contributor.scale) ?? entry.scale;
|
|
472
472
|
contributor.emit(scale, jobs);
|
|
473
473
|
const side = contributor.scale === "right" ? "right" : contributor.scale === "left" ? "left" : null;
|
|
474
|
-
|
|
475
|
-
if (side && latest) {
|
|
474
|
+
if (side) {
|
|
476
475
|
const pane = {
|
|
477
476
|
id: entry.id,
|
|
478
477
|
scale,
|
|
479
478
|
format: contributor.format
|
|
480
479
|
};
|
|
481
|
-
marks.push({
|
|
480
|
+
for (const latest of contributor.latest?.() ?? []) marks.push({
|
|
482
481
|
side,
|
|
483
482
|
y: scale.valueToY(latest.value),
|
|
484
483
|
text: formatPaneValue(sources, pane, latest.value),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as IndicatorDefinition, c as IndicatorInput, l as IndicatorOutput, p as IndicatorReference, t as IndicatorsApi, u as IndicatorOutputStyle, v as ParamValues } from "./api-
|
|
1
|
+
import { En as Bar, On as BarInput, St as Calendar, jn as PriceSource, l as ChartModule, yn as IntervalInput } from "./data-RRHroFqK.js";
|
|
2
|
+
import { a as IndicatorDefinition, c as IndicatorInput, l as IndicatorOutput, p as IndicatorReference, t as IndicatorsApi, u as IndicatorOutputStyle, v as ParamValues } from "./api-BWC_Cce5.js";
|
|
3
3
|
//#region src/indicators/chart-indicators.d.ts
|
|
4
4
|
/** An indicator as a chart state keeps it. */
|
|
5
5
|
interface SavedIndicator {
|
|
@@ -13,6 +13,8 @@ interface SavedIndicator {
|
|
|
13
13
|
/** The timeframe it is computed in, such as `1h`; absent for the chart's bars. */
|
|
14
14
|
readonly timeframe?: string;
|
|
15
15
|
readonly visible: boolean;
|
|
16
|
+
/** Its latest values are marked on the price axis; absent for not. */
|
|
17
|
+
readonly lastValueLabel?: boolean;
|
|
16
18
|
readonly colors: Readonly<Record<string, string>>;
|
|
17
19
|
readonly styles?: Readonly<Record<string, IndicatorOutputStyle>>;
|
|
18
20
|
/** Reference lines in place of the type's; absent for the type's. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Anchors, y as DrawingTypeDefinition } from "./types-
|
|
1
|
+
import { On as BarInput, kn as BarsView, l as ChartModule } from "./data-RRHroFqK.js";
|
|
2
|
+
import { t as Anchors, y as DrawingTypeDefinition } from "./types-CrxgaGh5.js";
|
|
3
3
|
//#region src/volume-profile/types.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* - `visible`: one profile of the bars in view, along an edge of the plot.
|