mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 15:19:58 -07:00
websites: default: snapshot
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
|
||||
/**
|
||||
* @import { Option, PartialChartOption, ChartOption, AnyPartialOption, ProcessedOptionAddons, OptionsTree, SimulationOption, AnySeriesBlueprint, ChartableIndex,CreatePriceLineOptions, CreatePriceLine } from "./options"
|
||||
* @import {Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple} from "../packages/lightweight-charts/wrapper"
|
||||
* @import { Valued, SingleValueData, CandlestickData, ChartData, OHLCTuple, Series } from "../packages/lightweight-charts/wrapper"
|
||||
* @import * as _ from "../packages/ufuzzy/v1.0.18/types"
|
||||
* @import { createChart as CreateClassicChart, LineStyleOptions, DeepPartial, ChartOptions, IChartApi, IHorzScaleBehavior, WhitespaceData, ISeriesApi, Time, LineData, LogicalRange, BaselineStyleOptions, SeriesOptionsCommon, BaselineData, CandlestickStyleOptions } from "../packages/lightweight-charts/v5.0.7-treeshaked/types"
|
||||
* @import { SignalOptions } from "../packages/solid-signals/v0.3.2-treeshaked/types/core/core"
|
||||
* @import {Signal, Signals} from "../packages/solid-signals/types";
|
||||
* @import { getOwner as GetOwner, onCleanup as OnCleanup, Owner } from "../packages/solid-signals/v0.3.2-treeshaked/types/core/owner"
|
||||
* @import { createEffect as CreateEffect, Accessor, Setter, createMemo as CreateMemo } from "../packages/solid-signals/v0.3.2-treeshaked/types/signals";
|
||||
* @import {DateIndex, DecadeIndex, DifficultyEpoch, Index, HalvingEpoch, Height, MonthIndex, P2PK33Index, P2PK65Index, P2PKHIndex, P2SHIndex, P2MSIndex, P2AIndex, P2TRIndex, P2WPKHIndex, P2WSHIndex, TxIndex, InputIndex, OutputIndex, VecId, WeekIndex, YearIndex, VecIdToIndexes, QuarterIndex, EmptyOutputIndex, OpReturnIndex, UnknownOutputIndex} from "./vecid-to-indexes"
|
||||
* @import { DateIndex, DecadeIndex, DifficultyEpoch, Index, HalvingEpoch, Height, MonthIndex, P2PK33Index, P2PK65Index, P2PKHIndex, P2SHIndex, P2MSIndex, P2AIndex, P2TRIndex, P2WPKHIndex, P2WSHIndex, TxIndex, InputIndex, OutputIndex, VecId, WeekIndex, YearIndex, VecIdToIndexes, QuarterIndex, EmptyOutputIndex, OpReturnIndex, UnknownOutputIndex } from "./vecid-to-indexes"
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,11 @@ function createUtils() {
|
||||
sorted,
|
||||
}) {
|
||||
const choices = sorted
|
||||
? /** @type {T} */ (/** @type {any} */ (unsortedChoices.toSorted()))
|
||||
? /** @type {T} */ (
|
||||
/** @type {any} */ (
|
||||
unsortedChoices.toSorted((a, b) => a.localeCompare(b))
|
||||
)
|
||||
)
|
||||
: unsortedChoices;
|
||||
|
||||
/** @type {Signal<T[number]>} */
|
||||
@@ -389,7 +393,9 @@ function createUtils() {
|
||||
key,
|
||||
},
|
||||
});
|
||||
|
||||
if (!choices.includes(selected())) {
|
||||
console.log(choices, "don't include", selected());
|
||||
selected.set(() => defaultValue);
|
||||
}
|
||||
|
||||
@@ -424,15 +430,14 @@ function createUtils() {
|
||||
return { field, selected };
|
||||
},
|
||||
/**
|
||||
* @param {Object} args
|
||||
* @param {1 | 2 | 3} [args.level]
|
||||
* @param {string} [args.title]
|
||||
* @param {string} [title]
|
||||
* @param {1 | 2 | 3} [level]
|
||||
*/
|
||||
createHeader({ title, level = 1 }) {
|
||||
createHeader(title = "", level = 1) {
|
||||
const headerElement = window.document.createElement("header");
|
||||
|
||||
const headingElement = window.document.createElement(`h${level}`);
|
||||
headingElement.innerHTML = title || "";
|
||||
headingElement.innerHTML = title;
|
||||
headerElement.append(headingElement);
|
||||
headingElement.style.display = "block";
|
||||
|
||||
|
||||
@@ -391,9 +391,7 @@ export function init({
|
||||
};
|
||||
|
||||
parametersElement.append(
|
||||
utils.dom.createHeader({
|
||||
title: "Save in Bitcoin",
|
||||
}).headerElement,
|
||||
utils.dom.createHeader("Save in Bitcoin").headerElement,
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -698,7 +696,11 @@ export function init({
|
||||
},
|
||||
);
|
||||
|
||||
const index = () => /** @type {DateIndex} */ (0);
|
||||
|
||||
lightweightCharts.createChartElement({
|
||||
index,
|
||||
owner,
|
||||
parent: resultsElement,
|
||||
signals,
|
||||
colors,
|
||||
@@ -743,6 +745,8 @@ export function init({
|
||||
});
|
||||
|
||||
lightweightCharts.createChartElement({
|
||||
index,
|
||||
owner,
|
||||
parent: resultsElement,
|
||||
signals,
|
||||
colors,
|
||||
@@ -767,6 +771,8 @@ export function init({
|
||||
});
|
||||
|
||||
lightweightCharts.createChartElement({
|
||||
index,
|
||||
owner,
|
||||
parent: resultsElement,
|
||||
signals,
|
||||
colors,
|
||||
@@ -797,6 +803,8 @@ export function init({
|
||||
});
|
||||
|
||||
lightweightCharts.createChartElement({
|
||||
index,
|
||||
owner,
|
||||
parent: resultsElement,
|
||||
signals,
|
||||
colors,
|
||||
@@ -805,7 +813,6 @@ export function init({
|
||||
fitContentOnResize: true,
|
||||
utils,
|
||||
elements,
|
||||
|
||||
config: [
|
||||
{
|
||||
unit: "USD",
|
||||
@@ -821,6 +828,7 @@ export function init({
|
||||
});
|
||||
|
||||
lightweightCharts.createChartElement({
|
||||
index,
|
||||
parent: resultsElement,
|
||||
signals,
|
||||
colors,
|
||||
|
||||
@@ -29,11 +29,11 @@ function createTable({
|
||||
keyPrefix: "table",
|
||||
key: "index",
|
||||
},
|
||||
}
|
||||
},
|
||||
)
|
||||
);
|
||||
const index = signals.createMemo(() =>
|
||||
serializedIndexToIndex(serializedIndex())
|
||||
serializedIndexToIndex(serializedIndex()),
|
||||
);
|
||||
|
||||
const table = window.document.createElement("table");
|
||||
@@ -73,7 +73,7 @@ function createTable({
|
||||
table.append(tbody);
|
||||
|
||||
const rowElements = signals.createSignal(
|
||||
/** @type {HTMLTableRowElement[]} */ ([])
|
||||
/** @type {HTMLTableRowElement[]} */ ([]),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -197,7 +197,7 @@ function createTable({
|
||||
});
|
||||
|
||||
signals.createEffect(vecIdOption, (vecIdOption) => {
|
||||
select.style.width = `${30 + 8.5 * vecIdOption.name.length}px`;
|
||||
select.style.width = `${21 + 7.25 * vecIdOption.name.length}px`;
|
||||
});
|
||||
|
||||
if (_colIndex === columns().length) {
|
||||
@@ -323,7 +323,7 @@ function createTable({
|
||||
});
|
||||
|
||||
return () => vecId;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -368,9 +368,7 @@ export function init({
|
||||
vecIdToIndexes,
|
||||
}) {
|
||||
const parent = elements.table;
|
||||
const { headerElement } = utils.dom.createHeader({
|
||||
title: "Table",
|
||||
});
|
||||
const { headerElement } = utils.dom.createHeader("Table");
|
||||
parent.append(headerElement);
|
||||
|
||||
const div = window.document.createElement("div");
|
||||
@@ -394,7 +392,7 @@ export function init({
|
||||
},
|
||||
inside: span,
|
||||
title: "Click or tap to add a column to the table",
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -499,7 +497,7 @@ function createIndexToVecIds(vecIdToIndexes) {
|
||||
});
|
||||
return arr;
|
||||
},
|
||||
/** @type {VecId[][]} */ (new Array(24))
|
||||
/** @type {VecId[][]} */ (new Array(24)),
|
||||
);
|
||||
indexToVecIds.forEach((arr) => {
|
||||
arr.sort();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// File auto-generated, any modifications will be overwritten
|
||||
//
|
||||
|
||||
export const VERSION = "v0.0.47";
|
||||
export const VERSION = "v0.0.48";
|
||||
|
||||
/** @typedef {0} DateIndex */
|
||||
/** @typedef {1} DecadeIndex */
|
||||
|
||||
Reference in New Issue
Block a user