app: flatten lightweight-chart scripts

This commit is contained in:
k
2024-07-06 12:05:11 +02:00
parent 9d2d4b7d5f
commit 80ea12ed48
18 changed files with 46 additions and 42 deletions

View File

@@ -1,8 +0,0 @@
interface PriceSeriesOptions {
placement?: "top" | "bottom";
title?: string;
id?: string;
inverseColors?: boolean;
seriesOptions?: DeepPartial<SeriesOptionsCommon>;
priceScaleOptions?: DeepPartial<PriceScaleOptions>;
}

View File

@@ -4,8 +4,8 @@ import {
CrosshairMode,
} from "lightweight-charts";
import { colors } from "../../utils/colors";
import { valueToString } from "../../utils/locale";
import { colors } from "../utils/colors";
import { valueToString } from "../utils/locale";
import { HorzScaleBehaviorHeight } from "./horzScaleBehavior";
export function createChart(

View File

@@ -1,6 +1,6 @@
import { colors } from "/src/scripts/utils/colors";
import { chunkIdToIndex } from "../../datasets/resource";
import { chunkIdToIndex } from "../datasets/resource";
export function setMinMaxMarkers({
scale,

View File

@@ -1,13 +0,0 @@
interface BaselineSeriesOptions {
color?: string;
topColor?: string;
topLineColor?: string;
bottomColor?: string;
bottomLineColor?: string;
lineColor?: string;
base?: number;
options?: DeepPartialBaselineOptions;
title?: string;
}
type SeriesLegend = ReturnType<typeof import("./legend").createSeriesLegend>;

View File

@@ -1,6 +1,6 @@
import { HEIGHT_CHUNK_SIZE } from "../../datasets";
import { debounce } from "../../utils/debounce";
import { writeURLParam } from "../../utils/urlParams";
import { HEIGHT_CHUNK_SIZE } from "../datasets";
import { debounce } from "../utils/debounce";
import { writeURLParam } from "../utils/urlParams";
const LOCAL_STORAGE_RANGE_KEY = "chart-range";
const URL_PARAMS_RANGE_FROM_KEY = "from";

View File

@@ -0,0 +1,24 @@
interface PriceSeriesOptions {
placement?: "top" | "bottom";
title?: string;
id?: string;
inverseColors?: boolean;
seriesOptions?: DeepPartial<SeriesOptionsCommon>;
priceScaleOptions?: DeepPartial<PriceScaleOptions>;
}
interface BaselineSeriesOptions {
color?: string;
topColor?: string;
topLineColor?: string;
bottomColor?: string;
bottomLineColor?: string;
lineColor?: string;
base?: number;
options?: DeepPartialBaselineOptions;
title?: string;
}
type SeriesLegend = ReturnType<
typeof import("../../chart/legend").createSeriesLegend
>;

View File

@@ -1,5 +1,5 @@
import { dateToString, getNumberOfDaysBetweenTwoDates } from "../../utils/date";
import { createLineSeries } from "../series/creators/line";
import { dateToString, getNumberOfDaysBetweenTwoDates } from "../utils/date";
import { createLineSeries } from "./line";
export const GENESIS_DAY = "2009-01-03";

View File

@@ -1,18 +1,18 @@
import { createRWS } from "/src/solid/rws";
import { chunkIdToIndex } from "../datasets/resource";
import { createChart } from "../lightweightCharts/chart/create";
import { setMinMaxMarkers } from "../lightweightCharts/chart/markers";
import { initTimeScale } from "../lightweightCharts/chart/time";
import { setWhitespace } from "../lightweightCharts/chart/whitespace";
import {
createBaseLineSeries,
DEFAULT_BASELINE_COLORS,
} from "../lightweightCharts/series/creators/baseLine";
import { createCandlesticksSeries } from "../lightweightCharts/series/creators/candlesticks";
import { createHistogramSeries } from "../lightweightCharts/series/creators/histogram";
import { createSeriesLegend } from "../lightweightCharts/series/creators/legend";
import { createLineSeries } from "../lightweightCharts/series/creators/line";
} from "../lightweightCharts/baseLine";
import { createCandlesticksSeries } from "../lightweightCharts/candlesticks";
import { createChart } from "../lightweightCharts/create";
import { createHistogramSeries } from "../lightweightCharts/histogram";
import { createSeriesLegend } from "../lightweightCharts/legend";
import { createLineSeries } from "../lightweightCharts/line";
import { setMinMaxMarkers } from "../lightweightCharts/markers";
import { initTimeScale } from "../lightweightCharts/time";
import { setWhitespace } from "../lightweightCharts/whitespace";
import { colors } from "../utils/colors";
import { debounce } from "../utils/debounce";
import { stringToId } from "../utils/id";