@trdrs/quickcharts 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @trdrs/quickcharts
2
2
 
3
+ ## 2.1.0
4
+
5
+ Long press for the crosshair, and emoji artwork that loads the first time the chart draws an emoji. No public name changes.
6
+
7
+ A finger held still on the plot is the crosshair's: the crosshair stands at the finger and follows it until the next tap, and the chart does not pan meanwhile. Held on a price scale or the time scale, it raises the chart's context menu, as a right-click does.
8
+
9
+ The bundled emoji artwork is a chunk of its own, which the chart imports the first time it draws an emoji, so a chart that never shows one never loads it, and the main bundle does not carry it. Until it arrives an emoji draws as text, then takes its artwork in place, in the glyph picker and on the chart. A chart given an `assets.glyphSource` never loads it.
10
+
11
+ ## 2.0.1
12
+
13
+ Drawing by touch, and handles that stay on their drawings. No public name changes.
14
+
15
+ A finger draws, selects and moves drawings as surely as a pointer does. A touch takes a drawing it lands within a thumb's reach of and grabs a handle from a thumb's width away; a tap that wobbles stays a tap; a drawing a touch presses moves once the finger clearly sets off; the second touch of a placement brings its live point to the finger at once; and the crosshair stands on the point a finger places or drags, its lines and scale labels clear of the finger. A touch the drawing layer takes is claimed from the page's scroll as it begins, and a gesture the browser takes away ends where it stands. A mouse and a pen keep their behavior.
16
+
17
+ Every handle stands where its drawing paints what the handle moves, so none stays behind as the drawing's other handles move it: a long or short position's stop on the box's far edge beside the target, a flat top/bottom's flat side at that side's end, a fib wedge's third handle at the end of its second ray, and an ellipse's third handle on the ellipse at its centre.
18
+
3
19
  ## 2.0.0
4
20
 
5
21
  A major version may rename or remove public names, and its upgrading guide lists each one, old to new, with how saved state carries over. 2.0 names everything a host writes against in the chart's own words: the stylesheet's cascade layers, the data source a symbol search row names, timeframe for every timeframe, indicator for every indicator, the drawing toolbar's models and the context menu's row builder. Saved state is read under the 2.0 names alone, and the guide lists what 1.x saved that opens at its default.
@@ -80,6 +96,8 @@ Saved state is read under the 2.0 names alone. What 1.x saved under these names
80
96
  - each drawing toolbar group's remembered tool, stored as `railTools` in the drawing preference record `quickcharts.drawingPrefs.v1`: the group's first tool;
81
97
  - the replay update timeframe, stored under `quickcharts.replayIv.v1`: `preferences.replayTimeframe`, else `auto`.
82
98
 
99
+ 2.0 stores the replay update timeframe under `quickcharts.replayTf.v1`. A `ChartStorage` that routes keys by name, to keep some per device for example, routes `quickcharts.replayTf.v1` where it routed `quickcharts.replayIv.v1`.
100
+
83
101
  Hosts that keep templates by kind file them under `indicator`: the chart asks `templates('indicator')`, and the REST adapter asks `/templates/indicator`.
84
102
 
85
103
  A `RecentsPort` of yours that stores rows stores `dataSource`, the field the source cell reads.
package/README.md CHANGED
@@ -2628,8 +2628,10 @@ The image and glyph tools reach your host through `ChartWidgetOptions.assets`. `
2628
2628
  turns a picked file into a payload within the caps and answers a refusal as a code the chart
2629
2629
  resolves through its own catalog; `glyphSource` answers the artwork URL an emoji or sticker draws
2630
2630
  with, or null to draw the glyph as text. Emoji artwork from Twemoji is bundled and works without
2631
- an asset port or external requests. Omit `glyphSource` to use it. Without the port the image tool
2632
- does not open. Keep the Twemoji credit in `THIRD-PARTY-NOTICES.md` accessible in your product.
2631
+ an asset port or external requests. Omit `glyphSource` to use it. It is a chunk of its own, which
2632
+ the chart imports the first time it draws an emoji, so a chart that never shows one never loads
2633
+ it; until it arrives an emoji draws as text, then takes its artwork in place. A chart given a
2634
+ `glyphSource` never loads it. Without the port the image tool does not open. Keep the Twemoji credit in `THIRD-PARTY-NOTICES.md` accessible in your product.
2633
2635
 
2634
2636
  The layer is also mountable on its own lightweight-charts pair, without the widget:
2635
2637
 
@@ -10,8 +10,8 @@ The emoji SVG graphics are from [Twemoji](https://github.com/jdecked/twemoji), c
10
10
 
11
11
  | Package | Version | License | Reached through |
12
12
  |---|---|---|---|
13
- | `fancy-canvas` | 2.1.0 | MIT | `lightweight-charts@5.2.0` |
14
- | `lightweight-charts` | 5.2.0 | Apache-2.0 | peer dependency |
13
+ | `fancy-canvas` | 2.1.0 | MIT | `lightweight-charts@5.2.1` |
14
+ | `lightweight-charts` | 5.2.1 | Apache-2.0 | peer dependency |
15
15
 
16
16
  ## fancy-canvas 2.1.0
17
17
 
@@ -43,7 +43,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
43
  SOFTWARE.
44
44
  ```
45
45
 
46
- ## lightweight-charts 5.2.0
46
+ ## lightweight-charts 5.2.1
47
47
 
48
48
  - License: Apache-2.0
49
49
  - Repository: https://github.com/tradingview/lightweight-charts
@@ -51,7 +51,7 @@ SOFTWARE.
51
51
 
52
52
  The package README states an attribution requirement beside the license: present the text of its NOTICE file and a link to https://www.tradingview.com/ on a page of your website or application that your users can reach. The package's `attributionLogo` chart option is one documented way to satisfy the link.
53
53
 
54
- The NOTICE file of lightweight-charts 5.2.0, reproduced verbatim from https://github.com/tradingview/lightweight-charts/blob/master/NOTICE:
54
+ The NOTICE file of lightweight-charts 5.2.1, reproduced verbatim from https://github.com/tradingview/lightweight-charts/blob/master/NOTICE:
55
55
 
56
56
  ```
57
57
  TradingView Lightweight Charts™
@@ -1691,6 +1691,14 @@ var Ellipse = class extends Drawing {
1691
1691
  ctx.stroke();
1692
1692
  if (this.props.text) paintLabel(ctx, this.props.text, geo.center, this.style, { align: "center" });
1693
1693
  }
1694
+ /** The third handle stands on the ellipse at its centre's time, where the vertical radius it
1695
+ * drags meets the outline: the anchor's own time paints nothing, so a handle at it would stay
1696
+ * behind as the diameter moves. */
1697
+ getControlPoints(viewport) {
1698
+ const points = super.getControlPoints(viewport);
1699
+ const geo = this.geometry(viewport);
1700
+ return geo ? points.map((point) => point.index === 2 ? { ...point, x: geo.center.x } : point) : points;
1701
+ }
1694
1702
  testHit(point, viewport) {
1695
1703
  const geo = this.geometry(viewport);
1696
1704
  if (!geo) return false;
@@ -2676,6 +2684,14 @@ var FlatTopBottom = class extends Drawing {
2676
2684
  strokeSegment(ctx, b.flat.a, b.flat.b);
2677
2685
  if (this.props.text) paintLabel(ctx, this.props.text, { x: b.slope.a.x + 6, y: b.slope.a.y - 12 }, this.style);
2678
2686
  }
2687
+ /** The flat side's handle stands at the flat side's end under the second anchor: the flat side
2688
+ * spans the sloped side's times at the third anchor's price, and that anchor's own time paints
2689
+ * nothing, so a handle at it would drift off the side as the sloped side moves. */
2690
+ getControlPoints(viewport) {
2691
+ const points = super.getControlPoints(viewport);
2692
+ const end = points.find((point) => point.index === 1);
2693
+ return end ? points.map((point) => point.index === 2 ? { ...point, x: end.x } : point) : points;
2694
+ }
2679
2695
  testHit(point, viewport) {
2680
2696
  const b = this.boundaries(viewport);
2681
2697
  if (!b) return false;
@@ -3458,6 +3474,16 @@ var FibWedge = class extends Drawing {
3458
3474
  }
3459
3475
  }
3460
3476
  }
3477
+ /** The third handle stands at the end of the second ray: that ray runs as long as the first, at
3478
+ * the third anchor's angle, so the anchor's own distance from the apex paints nothing and a
3479
+ * handle at it would float off the ray's end as the first ray changes length. */
3480
+ getControlPoints(viewport) {
3481
+ const points = super.getControlPoints(viewport);
3482
+ const geo = this.geometry(viewport);
3483
+ if (!geo) return points;
3484
+ const end = { x: geo.apex.x + Math.cos(geo.a2) * geo.radius, y: geo.apex.y + Math.sin(geo.a2) * geo.radius };
3485
+ return points.map((point) => point.index === 2 ? { ...point, ...end } : point);
3486
+ }
3461
3487
  testHit(point, viewport) {
3462
3488
  const geo = this.geometry(viewport);
3463
3489
  if (!geo) return false;
@@ -3755,6 +3781,14 @@ var LongPosition = class extends Drawing {
3755
3781
  paintLabel(ctx, this.formatPrice(entry.price), { x: z.right + 6, y: z.entryY }, { ...this.style, textColor: this.style.lineColor });
3756
3782
  }
3757
3783
  }
3784
+ /** The stop's handle stands on the box's far edge beside the target's, where the stop's level is
3785
+ * painted: the box's edges are the entry's time and the target's, and the stop's own time paints
3786
+ * nothing, so a handle at it would stay behind as the box's width changes. */
3787
+ getControlPoints(viewport) {
3788
+ const points = super.getControlPoints(viewport);
3789
+ const edge = points.find((point) => point.index === 1);
3790
+ return edge ? points.map((point) => point.index === 2 ? { ...point, x: edge.x } : point) : points;
3791
+ }
3758
3792
  testHit(point, viewport) {
3759
3793
  const z = this.zones(viewport);
3760
3794
  if (!z) return false;
@@ -6960,4 +6994,4 @@ export {
6960
6994
  NO_DASH,
6961
6995
  INPUT_PROPS
6962
6996
  };
6963
- //# sourceMappingURL=chunk-6S6TO2N6.js.map
6997
+ //# sourceMappingURL=chunk-YR7NT5ZW.js.map