mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-27 08:09:58 -07:00
global: MASSIVE snapshot
This commit is contained in:
32
websites/bitview/scripts/options/context.js
Normal file
32
websites/bitview/scripts/options/context.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { s, fromBlockCount, fromBitcoin, fromBlockSize } from "./series.js";
|
||||
import { createPriceLine, createPriceLines, line } from "./constants.js";
|
||||
|
||||
/**
|
||||
* Create a context object with all dependencies for building partial options
|
||||
* @param {Object} args
|
||||
* @param {Colors} args.colors
|
||||
* @param {BrkClient} args.brk
|
||||
* @returns {PartialContext}
|
||||
*/
|
||||
export function createContext({ colors, brk }) {
|
||||
const constants = brk.tree.computed.constants;
|
||||
|
||||
return {
|
||||
colors,
|
||||
brk,
|
||||
|
||||
// Series helpers
|
||||
s,
|
||||
fromBlockCount: (pattern, title, color) =>
|
||||
fromBlockCount(colors, pattern, title, color),
|
||||
fromBitcoin: (pattern, title, color) =>
|
||||
fromBitcoin(colors, pattern, title, color),
|
||||
fromBlockSize: (pattern, title, color) =>
|
||||
fromBlockSize(colors, pattern, title, color),
|
||||
|
||||
createPriceLine: (args) => createPriceLine({ constants, colors, ...args }),
|
||||
createPriceLines: (args) =>
|
||||
createPriceLines({ constants, colors, ...args }),
|
||||
line: (args) => line({ colors, ...args }),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user