mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-06-08 22:21:56 -07:00
website: safari fixes
This commit is contained in:
@@ -4938,7 +4938,7 @@ function createRatioPattern2(client, acc) {
|
||||
* @extends BrkClientBase
|
||||
*/
|
||||
class BrkClient extends BrkClientBase {
|
||||
VERSION = "v0.1.4";
|
||||
VERSION = "v0.1.5";
|
||||
|
||||
INDEXES = /** @type {const} */ ([
|
||||
"dateindex",
|
||||
|
||||
@@ -34,5 +34,5 @@
|
||||
"url": "git+https://github.com/bitcoinresearchkit/brk.git"
|
||||
},
|
||||
"type": "module",
|
||||
"version": "0.1.4"
|
||||
"version": "0.1.5"
|
||||
}
|
||||
|
||||
@@ -4368,7 +4368,7 @@ class MetricsTree:
|
||||
class BrkClient(BrkClientBase):
|
||||
"""Main BRK client with metrics tree and API methods."""
|
||||
|
||||
VERSION = "v0.1.4"
|
||||
VERSION = "v0.1.5"
|
||||
|
||||
INDEXES = [
|
||||
"dateindex",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "brk-client"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
description = "Python client for the Bitcoin Research Kit"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9"
|
||||
|
||||
@@ -196,7 +196,6 @@ export function createChart({ parent, id: chartId, brk, fitContent }) {
|
||||
timeScale: {
|
||||
borderVisible: false,
|
||||
enableConflation: true,
|
||||
// conflationThresholdFactor: 8,
|
||||
...(fitContent
|
||||
? {
|
||||
minBarSpacing: 0.001,
|
||||
@@ -680,27 +679,31 @@ export function createChart({ parent, id: chartId, brk, fitContent }) {
|
||||
/** @type {number} */ (data.at(-1)?.time) ?? -Infinity;
|
||||
|
||||
// Restore saved range or use defaults
|
||||
const savedRange = getRange();
|
||||
if (savedRange) {
|
||||
ichart.timeScale().setVisibleLogicalRange({
|
||||
from: savedRange.from,
|
||||
to: savedRange.to,
|
||||
});
|
||||
} else if (fitContent) {
|
||||
ichart.timeScale().fitContent();
|
||||
} else if (
|
||||
(minBarSpacingByIndex[idx] ?? 0) >=
|
||||
/** @type {number} */ (minBarSpacingByIndex.quarterindex)
|
||||
) {
|
||||
ichart
|
||||
.timeScale()
|
||||
.setVisibleLogicalRange({ from: -1, to: data.length });
|
||||
}
|
||||
// Delay until chart has applied the range
|
||||
// RAF for Safari compatibility
|
||||
requestAnimationFrame(() => {
|
||||
if (seriesGeneration !== generation) return;
|
||||
initialLoadComplete = true;
|
||||
blueprints.onDataLoaded?.();
|
||||
const savedRange = getRange();
|
||||
if (savedRange) {
|
||||
ichart.timeScale().setVisibleLogicalRange({
|
||||
from: savedRange.from,
|
||||
to: savedRange.to,
|
||||
});
|
||||
} else if (fitContent) {
|
||||
ichart.timeScale().fitContent();
|
||||
} else if (
|
||||
(minBarSpacingByIndex[idx] ?? 0) >=
|
||||
/** @type {number} */ (minBarSpacingByIndex.quarterindex)
|
||||
) {
|
||||
ichart
|
||||
.timeScale()
|
||||
.setVisibleLogicalRange({ from: -1, to: data.length });
|
||||
}
|
||||
// Delay until chart has applied the range
|
||||
requestAnimationFrame(() => {
|
||||
if (seriesGeneration !== generation) return;
|
||||
initialLoadComplete = true;
|
||||
blueprints.onDataLoaded?.();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Incremental update: only process new data points
|
||||
|
||||
@@ -109,7 +109,6 @@ export const colors = {
|
||||
p3: [palette.sky, palette.avocado],
|
||||
},
|
||||
|
||||
|
||||
// Cointime economics
|
||||
liveliness: palette.pink,
|
||||
vaulted: palette.lime,
|
||||
|
||||
Reference in New Issue
Block a user