lightweight-charts-drawing 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2 (28/09/2026)
4
+
5
+ ### Changed
6
+
7
+ - Shift gestures follow TradingView Desktop 3.4.1 (new `tv/interact/shift.ts`):
8
+ - 45° snap = TV `snapPoint45Degree`: horizontal keeps the bar and takes
9
+ the reference price, vertical keeps the price and takes the reference
10
+ bar, a diagonal is rounded to a whole bar.
11
+ - New Shift rules: arrow marker, fib circles, fib speed resistance fan,
12
+ price note, note, rotated rectangle (45°); parallel channel, flat
13
+ top/bottom, disjoint channel (2nd point / anchor 1 only); ellipse (circle,
14
+ finished after 2 clicks); rectangle (square rounded to a bar, the preview
15
+ too, and the middle anchors); Gann box (fixed increments, was a square);
16
+ Gann square anchor drag (keeps the price-per-bar ratio).
17
+ - Shift + body drag moves only horizontally or vertically (past 10 px).
18
+ - Removed Shift rules TV does not have: pitchfork family, pitchfan,
19
+ triangle, trend-based fib extension (45°), bar pattern and fixed range
20
+ volume profile (square).
21
+ - Runtime magnet: Shift turns it off only after the first point or while
22
+ dragging an anchor.
23
+ - Ellipse anchor 0 / 1 drag keeps the minor radius (TV).
24
+
25
+ ## 0.2.1 (26/09/2026)
26
+
27
+ ### Fixed
28
+
29
+ - `DrawingManager.on(...)`: the first call in a TypeScript file failed with
30
+ TS2590 ("Expression produces a union type that is too complex to
31
+ represent"), also with the published 0.2.0 types. `on` now has one
32
+ overload per event.
33
+ - Pin: a press on its anchor (the marker tip) missed about half of the time
34
+ (the tip is on the edge of the marker box). The anchor is now hit first,
35
+ as for the comment and note tools.
36
+
37
+ ### Demo
38
+
39
+ - TradingView-style left toolbar with the tools under TradingView's groups
40
+ and sections (generated with docs/TOOLS.md by `docs/tools_md.py`), an
41
+ emoji group for the font icon, magnet (weak / strong), keep drawing and
42
+ remove all; a selection bar (Anchor drawing, remove); an inline editor for
43
+ text tools and table cells; export / import as JSON files (the export
44
+ wrote to localStorage before); no event log panel.
45
+
3
46
  ## 0.2.0 (26/09/2026)
4
47
 
5
48
  A new library built on a shared drawing core (`src/tv`) that is also used by
package/dist/index.d.ts CHANGED
@@ -200,7 +200,15 @@ export declare class DrawingManager {
200
200
  private savedScroll;
201
201
  private readonly off;
202
202
  constructor(chart: IChartApi, series: ISeriesApi<SeriesType>, opts?: DrawingManagerOptions);
203
- on<K extends keyof DrawingManagerEvents>(event: K, cb: DrawingManagerEvents[K]): () => void;
203
+ on(event: "change", cb: DrawingManagerEvents["change"]): () => void;
204
+ on(event: "add", cb: DrawingManagerEvents["add"]): () => void;
205
+ on(event: "update", cb: DrawingManagerEvents["update"]): () => void;
206
+ on(event: "remove", cb: DrawingManagerEvents["remove"]): () => void;
207
+ on(event: "selection", cb: DrawingManagerEvents["selection"]): () => void;
208
+ on(event: "tool", cb: DrawingManagerEvents["tool"]): () => void;
209
+ on(event: "textEdit", cb: DrawingManagerEvents["textEdit"]): () => void;
210
+ on(event: "gestureEnd", cb: DrawingManagerEvents["gestureEnd"]): () => void;
211
+ on(event: "tableEdit", cb: DrawingManagerEvents["tableEdit"]): () => void;
204
212
  /** Arm a tool (a DrawingKind of the core specs) or disarm (null). `glyph`:
205
213
  * the font-icon glyph to place. */
206
214
  setTool(kind: DrawingKind | null, o?: {
@@ -1350,7 +1358,7 @@ declare type UnitVisibility = {
1350
1358
  to: number;
1351
1359
  };
1352
1360
 
1353
- export declare const VERSION = "0.2.0";
1361
+ export declare const VERSION = "0.2.1";
1354
1362
 
1355
1363
  declare type WithId<T> = T & {
1356
1364
  id: string;