mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-01 01:50:00 -07:00
global: snapshot
This commit is contained in:
@@ -8,6 +8,9 @@ import { ios, canShare } from "../../utils/env.js";
|
||||
import { serdeChartableIndex, serdeOptNumber } from "../../utils/serde.js";
|
||||
import { throttle } from "../../utils/timing.js";
|
||||
import { Unit } from "../../utils/units.js";
|
||||
import signals from "../../signals.js";
|
||||
import { createChartElement } from "../../chart/index.js";
|
||||
import { webSockets } from "../../utils/ws.js";
|
||||
|
||||
const keyPrefix = "chart";
|
||||
const ONE_BTC_IN_SATS = 100_000_000;
|
||||
@@ -22,20 +25,12 @@ const CANDLE = "candle";
|
||||
/**
|
||||
* @param {Object} args
|
||||
* @param {Colors} args.colors
|
||||
* @param {CreateChartElement} args.createChartElement
|
||||
* @param {Accessor<ChartOption>} args.option
|
||||
* @param {Signals} args.signals
|
||||
* @param {WebSockets} args.webSockets
|
||||
* @param {Resources} args.resources
|
||||
* @param {BrkClient} args.brk
|
||||
*/
|
||||
export function init({
|
||||
colors,
|
||||
createChartElement,
|
||||
option,
|
||||
signals,
|
||||
webSockets,
|
||||
resources,
|
||||
brk,
|
||||
}) {
|
||||
chartElement.append(createShadow("left"));
|
||||
@@ -44,10 +39,7 @@ export function init({
|
||||
const { headerElement, headingElement } = createHeader();
|
||||
chartElement.append(headerElement);
|
||||
|
||||
const { index, fieldset } = createIndexSelector({
|
||||
option,
|
||||
signals,
|
||||
});
|
||||
const { index, fieldset } = createIndexSelector(option);
|
||||
|
||||
const TIMERANGE_LS_KEY = signals.createMemo(
|
||||
() => `chart-timerange-${index()}`,
|
||||
@@ -77,7 +69,6 @@ export function init({
|
||||
signals,
|
||||
colors,
|
||||
id: "charts",
|
||||
resources,
|
||||
brk,
|
||||
index,
|
||||
timeScaleSetCallback: (unknownTimeScaleCallback) => {
|
||||
@@ -525,11 +516,9 @@ export function init({
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} args
|
||||
* @param {Accessor<ChartOption>} args.option
|
||||
* @param {Signals} args.signals
|
||||
* @param {Accessor<ChartOption>} option
|
||||
*/
|
||||
function createIndexSelector({ option, signals }) {
|
||||
function createIndexSelector(option) {
|
||||
const choices_ = /** @satisfies {ChartableIndexName[]} */ ([
|
||||
"timestamp",
|
||||
"date",
|
||||
|
||||
@@ -1,25 +1,7 @@
|
||||
import { randomFromArray } from "../utils/array.js";
|
||||
import { explorerElement } from "../utils/elements.js";
|
||||
|
||||
/**
|
||||
* @param {Object} args
|
||||
* @param {Colors} args.colors
|
||||
* @param {CreateChartElement} args.createChartElement
|
||||
* @param {Accessor<ChartOption>} args.option
|
||||
* @param {Signals} args.signals
|
||||
* @param {WebSockets} args.webSockets
|
||||
* @param {Resources} args.resources
|
||||
* @param {BrkClient} args.brk
|
||||
*/
|
||||
export function init({
|
||||
colors: _colors,
|
||||
createChartElement: _createChartElement,
|
||||
option: _option,
|
||||
signals: _signals,
|
||||
webSockets: _webSockets,
|
||||
resources: _resources,
|
||||
brk: _brk,
|
||||
}) {
|
||||
export function init() {
|
||||
const chain = window.document.createElement("div");
|
||||
chain.id = "chain";
|
||||
explorerElement.append(chain);
|
||||
|
||||
@@ -18,15 +18,15 @@ import {
|
||||
numberToUSNumber,
|
||||
} from "../utils/format.js";
|
||||
import { serdeDate, serdeOptDate, serdeOptNumber } from "../utils/serde.js";
|
||||
import signals from "../signals.js";
|
||||
import { createChartElement } from "../chart/index.js";
|
||||
import { resources } from "../resources.js";
|
||||
|
||||
/**
|
||||
* @param {Object} args
|
||||
* @param {Colors} args.colors
|
||||
* @param {CreateChartElement} args.createChartElement
|
||||
* @param {Signals} args.signals
|
||||
* @param {Resources} args.resources
|
||||
*/
|
||||
export function init({ colors, createChartElement, signals, resources }) {
|
||||
export function init({ colors }) {
|
||||
/**
|
||||
* @typedef {Object} Frequency
|
||||
* @property {string} name
|
||||
|
||||
@@ -6,14 +6,7 @@ import { tableElement } from "../utils/elements.js";
|
||||
import { serdeMetrics, serdeString } from "../utils/serde.js";
|
||||
import { resetParams } from "../utils/url.js";
|
||||
|
||||
/**
|
||||
* @param {Object} args
|
||||
* @param {Signals} args.signals
|
||||
* @param {Option} args.option
|
||||
* @param {Resources} args.resources
|
||||
* @param {BrkClient} args.brk
|
||||
*/
|
||||
export function init({ signals, option, resources, brk }) {
|
||||
export function init() {
|
||||
tableElement.innerHTML = "wip, will hopefuly be back soon, sorry !";
|
||||
|
||||
// const parent = tableElement;
|
||||
|
||||
Reference in New Issue
Block a user