@trdrs/quickcharts 5.1.0 → 5.1.1

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
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.1.1
6
+
7
+ Range presets reconcile overlapping history pages with streamed bars and preserve a newer navigation while a page is pending.
8
+
5
9
  ## 5.1.0
6
10
 
7
11
  Charts open live subscriptions alongside history, frame the first arriving data, and retain newer streamed prices when history arrives later. A snapshot with `backfill: true` adds missing history without replacing bars already held.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.1.0",
2
+ "version": "5.1.1",
3
3
  "styles": [
4
4
  {
5
5
  "id": "candles",
package/dist/index.js CHANGED
@@ -23043,17 +23043,22 @@ function createChartInstance(deps) {
23043
23043
  if (short <= 0) return;
23044
23044
  paging = true;
23045
23045
  const myEpoch = epoch;
23046
+ const myNavigation = navigationEpoch;
23046
23047
  const oldest = bars[0].t;
23047
23048
  void fetchOlder(oldest - 1, short).then(({ olderBars, end }) => {
23048
23049
  if (disposed || myEpoch !== epoch) return;
23049
23050
  if (end) noMoreHistory = true;
23050
- const older = olderBars.filter((bar) => bar.t < oldest);
23051
- if (older.length === 0) return;
23052
- bars = [...older, ...bars];
23053
- paintAll();
23054
- refreshMarks();
23055
- frameRange(chart, anchor, span, spanTf);
23051
+ const merged2 = mergeBarSnapshot(bars, olderBars.filter((bar) => bar.t < oldest), true);
23052
+ if (merged2.length > bars.length) {
23053
+ maintainTimeline(() => {
23054
+ bars = merged2;
23055
+ paintAll();
23056
+ });
23057
+ refreshMarks();
23058
+ }
23059
+ if (myNavigation === navigationEpoch) frameRange(chart, anchor, span, spanTf);
23056
23060
  }).catch(() => {
23061
+ if (!disposed && myEpoch === epoch && myNavigation === navigationEpoch) frameRange(chart, anchor, span, spanTf);
23057
23062
  }).finally(() => {
23058
23063
  if (myEpoch === epoch) paging = false;
23059
23064
  });