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
+4 -3
View File
@@ -36,15 +36,16 @@ API:
Adjectives that describe what this project is or strives to be, in no particular order:
- **Best**: Be the go to and replace Glassnode
- **Best**: Replace Glassnode as the go to
- **Diverse**: Have as many charts/datasets as possible and something for everyone
- **Transparent**: You can verify and see exactly how each dataset is computed
- **Free**: Is and always will be completely free
- **Open**: With a very permissive license
- **Transparent**: You can verify and see exactly how each dataset is computed
- **Independent**: Only one, easily swappable, dependency (Price API)
- **Timeless**: Be relevant and usable 10 years from now by being independent and not do address tagging
- **Sovereign**: Be self-hostable on accessible hardware
- **Versatile**: Many many different datasets which can be viewed in chart, dashbards or raw values
- **Accessible**: Huge free API with all the datasets
- **Accessible**: Free Website and API with all the datasets for everyone
## Milestones
@@ -1,7 +1,7 @@
import { GENESIS_DAY } from "/src/scripts/lightweightCharts/chart/whitespace";
import { ONE_DAY_IN_MS } from "/src/scripts/utils/time";
import { classPropToString } from "/src/solid/classes";
import { GENESIS_DAY } from "../../../../../scripts/lightweightCharts/whitespace";
import { Box } from "../../box";
import { Scrollable } from "../../scrollable";
-8
View File
@@ -1,8 +0,0 @@
interface PriceSeriesOptions {
placement?: "top" | "bottom";
title?: string;
id?: string;
inverseColors?: boolean;
seriesOptions?: DeepPartial<SeriesOptionsCommon>;
priceScaleOptions?: DeepPartial<PriceScaleOptions>;
}
@@ -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(
@@ -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,
@@ -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>;
@@ -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";
+24
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
>;
@@ -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";
+9 -9
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";