mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-22 15:54:47 -07:00
websites: default: snapshot
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -99,12 +99,12 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
index === /** @satisfies {MonthIndex} */ (7)
|
||||
? 1
|
||||
: index === /** @satisfies {QuarterIndex} */ (19)
|
||||
? 3
|
||||
: index === /** @satisfies {YearIndex} */ (23)
|
||||
? 12
|
||||
: index === /** @satisfies {DecadeIndex} */ (1)
|
||||
? 120
|
||||
: undefined,
|
||||
? 3
|
||||
: index === /** @satisfies {YearIndex} */ (23)
|
||||
? 12
|
||||
: index === /** @satisfies {DecadeIndex} */ (1)
|
||||
? 120
|
||||
: undefined,
|
||||
},
|
||||
crosshair: {
|
||||
horzLine: {
|
||||
@@ -118,7 +118,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
mode: 3,
|
||||
},
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return chart;
|
||||
@@ -178,7 +178,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
|
||||
if (fitContentOnResize) {
|
||||
new ResizeObserver(() => ichart?.timeScale().fitContent()).observe(
|
||||
chartDiv,
|
||||
chartDiv
|
||||
);
|
||||
}
|
||||
|
||||
@@ -217,27 +217,34 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
const time = indexes[i];
|
||||
if (prevTime === time) {
|
||||
const sameTime = prevTime === time;
|
||||
if (sameTime) {
|
||||
offset += 1;
|
||||
}
|
||||
const v = ohlcs[i];
|
||||
const offsetedI = i - offset;
|
||||
if (v === null) {
|
||||
data[i - offset] = {
|
||||
data[offsetedI] = {
|
||||
time,
|
||||
value: NaN,
|
||||
};
|
||||
} else if (typeof v === "number") {
|
||||
data[i - offset] = {
|
||||
data[offsetedI] = {
|
||||
time,
|
||||
value: v,
|
||||
};
|
||||
} else {
|
||||
data[i - offset] = {
|
||||
if (sameTime) {
|
||||
console.log(data[offsetedI]);
|
||||
}
|
||||
// const prev = sameTime ? data[offsetedI] : undefined;
|
||||
let [open, high, low, close] = v;
|
||||
data[offsetedI] = {
|
||||
time,
|
||||
open: v[0],
|
||||
high: v[1],
|
||||
low: v[2],
|
||||
close: v[3],
|
||||
open: sameTime ? data[offsetedI].open : open,
|
||||
high: sameTime ? Math.max(data[offsetedI].high, high) : high,
|
||||
low: sameTime ? Math.min(data[offsetedI].low, low) : low,
|
||||
close,
|
||||
};
|
||||
}
|
||||
prevTime = time;
|
||||
@@ -259,8 +266,8 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
}
|
||||
});
|
||||
timeScaleSet = true;
|
||||
},
|
||||
),
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -271,7 +278,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
activeResources.forEach((v) => {
|
||||
v.fetch();
|
||||
});
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
const chart = {
|
||||
@@ -291,7 +298,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
vecIndex,
|
||||
vecIndex === /** @satisfies {Height} */ (5)
|
||||
? "timestamp-fixed"
|
||||
: "timestamp",
|
||||
: "timestamp"
|
||||
);
|
||||
timeResource.fetch();
|
||||
|
||||
@@ -349,7 +356,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
borderVisible: false,
|
||||
visible: defaultActive !== false,
|
||||
},
|
||||
paneIndex,
|
||||
paneIndex
|
||||
);
|
||||
|
||||
let url = /** @type {string | undefined} */ (undefined);
|
||||
@@ -365,7 +372,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
signals.runWithOwner(owner, () =>
|
||||
signals.createEffect(data, (data) => {
|
||||
series.setData(data);
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -429,7 +436,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
color: color(),
|
||||
...options,
|
||||
},
|
||||
paneIndex,
|
||||
paneIndex
|
||||
);
|
||||
|
||||
const priceLineOptions = options?.createPriceLine;
|
||||
@@ -452,7 +459,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
ichart
|
||||
?.timeScale()
|
||||
.setVisibleLogicalRange({ from: -1, to: data.length });
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -521,7 +528,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
topFillColor2: "transparent",
|
||||
lineVisible: true,
|
||||
},
|
||||
paneIndex,
|
||||
paneIndex
|
||||
);
|
||||
|
||||
const priceLineOptions = options?.createPriceLine;
|
||||
@@ -545,7 +552,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
ichart
|
||||
?.timeScale()
|
||||
.setVisibleLogicalRange({ from: -1, to: data.length });
|
||||
}),
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -638,7 +645,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
Array.from(parent.childNodes).filter(
|
||||
(element) =>
|
||||
/** @type {HTMLElement} */ (element).dataset.position ===
|
||||
position,
|
||||
position
|
||||
).length
|
||||
) {
|
||||
return;
|
||||
@@ -657,7 +664,7 @@ export default import("./v5.0.7-treeshaked/script.js").then((lc) => {
|
||||
|
||||
fieldset.append(createChild({ owner, pane }));
|
||||
},
|
||||
paneIndex ? 50 : 0,
|
||||
paneIndex ? 50 : 0
|
||||
);
|
||||
},
|
||||
/**
|
||||
@@ -730,7 +737,7 @@ function createLegend({ parent, signals, utils, paneIndex }) {
|
||||
parent.append(legendElement);
|
||||
|
||||
const hovered = signals.createSignal(
|
||||
/** @type {ISeriesApi<SeriesType> | null} */ (null),
|
||||
/** @type {ISeriesApi<SeriesType> | null} */ (null)
|
||||
);
|
||||
|
||||
return {
|
||||
@@ -823,7 +830,7 @@ function createLegend({ parent, signals, utils, paneIndex }) {
|
||||
} else {
|
||||
spanColor.style.backgroundColor = tameColor(color);
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
@@ -899,7 +906,7 @@ function createOklchToRGBA() {
|
||||
return rgb.map((c) =>
|
||||
Math.abs(c) > 0.0031308
|
||||
? (c < 0 ? -1 : 1) * (1.055 * Math.abs(c) ** (1 / 2.4) - 0.055)
|
||||
: 12.92 * c,
|
||||
: 12.92 * c
|
||||
);
|
||||
}
|
||||
/**
|
||||
@@ -911,7 +918,7 @@ function createOklchToRGBA() {
|
||||
1, 0.3963377773761749, 0.2158037573099136, 1, -0.1055613458156586,
|
||||
-0.0638541728258133, 1, -0.0894841775298119, -1.2914855480194092,
|
||||
]),
|
||||
lab,
|
||||
lab
|
||||
);
|
||||
const LMS = /** @type {[number, number, number]} */ (
|
||||
LMSg.map((val) => val ** 3)
|
||||
@@ -922,7 +929,7 @@ function createOklchToRGBA() {
|
||||
-0.0405757452148008, 1.112286803280317, -0.0717110580655164,
|
||||
-0.0763729366746601, -0.4214933324022432, 1.5869240198367816,
|
||||
]),
|
||||
LMS,
|
||||
LMS
|
||||
);
|
||||
}
|
||||
/**
|
||||
@@ -935,7 +942,7 @@ function createOklchToRGBA() {
|
||||
-0.9692436362808796, 1.8759675015077202, 0.04155505740717559,
|
||||
0.05563007969699366, -0.20397695888897652, 1.0569715142428786,
|
||||
],
|
||||
xyz,
|
||||
xyz
|
||||
);
|
||||
}
|
||||
|
||||
@@ -958,8 +965,8 @@ function createOklchToRGBA() {
|
||||
});
|
||||
const rgb = srgbLinear2rgb(
|
||||
xyz2rgbLinear(
|
||||
oklab2xyz(oklch2oklab(/** @type {[number, number, number]} */ (lch))),
|
||||
),
|
||||
oklab2xyz(oklch2oklab(/** @type {[number, number, number]} */ (lch)))
|
||||
)
|
||||
).map((v) => {
|
||||
return Math.max(Math.min(Math.round(v * 255), 255), 0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user