mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 14:49:58 -07:00
website: snapshot
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
/** Constant helpers for creating price lines and reference lines */
|
||||
|
||||
import { colors } from "../utils/colors.js";
|
||||
import { brk } from "../client.js";
|
||||
import { line } from "./series.js";
|
||||
|
||||
/**
|
||||
@@ -23,14 +25,14 @@ export function getConstant(constants, num) {
|
||||
|
||||
/**
|
||||
* Create a price line series (horizontal reference line)
|
||||
* @param {{ ctx: PartialContext, number?: number, name?: string } & Omit<(Parameters<typeof line>)[0], 'name' | 'metric'>} args
|
||||
* @param {{ number?: number, name?: string } & Omit<(Parameters<typeof line>)[0], 'name' | 'metric'>} args
|
||||
*/
|
||||
export function priceLine(args) {
|
||||
return line({
|
||||
...args,
|
||||
metric: getConstant(args.ctx.brk.metrics.constants, args.number || 0),
|
||||
metric: getConstant(brk.metrics.constants, args.number || 0),
|
||||
name: args.name || `${args.number ?? 0}`,
|
||||
color: args.color ?? args.ctx.colors.gray,
|
||||
color: args.color ?? colors.gray,
|
||||
options: {
|
||||
lineStyle: args.style ?? 4,
|
||||
lastValueVisible: false,
|
||||
|
||||
Reference in New Issue
Block a user