hyperprop-charting-library 0.1.141 → 0.1.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hyperprop-charting-library.cjs +58 -39
- package/dist/hyperprop-charting-library.d.ts +7 -7
- package/dist/hyperprop-charting-library.js +58 -39
- package/dist/index.cjs +58 -39
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +58 -39
- package/docs/API.md +34 -0
- package/package.json +1 -1
|
@@ -2659,44 +2659,6 @@ var compileScriptIndicator = (definition) => {
|
|
|
2659
2659
|
|
|
2660
2660
|
// src/themes.ts
|
|
2661
2661
|
var CHART_THEMES = {
|
|
2662
|
-
dark: {
|
|
2663
|
-
name: "dark",
|
|
2664
|
-
background: "#0f0f0f",
|
|
2665
|
-
upColor: "#089981",
|
|
2666
|
-
downColor: "#f23645",
|
|
2667
|
-
lineColor: "#2962ff",
|
|
2668
|
-
gridColor: "#3c3c3c",
|
|
2669
|
-
gridOpacity: 0.5,
|
|
2670
|
-
axisTextColor: "#dbdbdb",
|
|
2671
|
-
axisLineColor: "#424242",
|
|
2672
|
-
crosshairColor: "#9598a1",
|
|
2673
|
-
crosshairLabelBackground: "#3c3c3c",
|
|
2674
|
-
crosshairLabelText: "#dbdbdb",
|
|
2675
|
-
crosshairLabelBorder: "#5d5d5d",
|
|
2676
|
-
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2677
|
-
indicatorTextColor: "#b2b5be",
|
|
2678
|
-
labelTextColor: "#ffffff",
|
|
2679
|
-
labelBackground: "#1a1a1a"
|
|
2680
|
-
},
|
|
2681
|
-
light: {
|
|
2682
|
-
name: "light",
|
|
2683
|
-
background: "#ffffff",
|
|
2684
|
-
upColor: "#089981",
|
|
2685
|
-
downColor: "#f23645",
|
|
2686
|
-
lineColor: "#2962ff",
|
|
2687
|
-
gridColor: "#d5d5d5",
|
|
2688
|
-
gridOpacity: 0.9,
|
|
2689
|
-
axisTextColor: "#0f0f0f",
|
|
2690
|
-
axisLineColor: "#c3c3c3",
|
|
2691
|
-
crosshairColor: "#787b86",
|
|
2692
|
-
crosshairLabelBackground: "#4b4b4b",
|
|
2693
|
-
crosshairLabelText: "#ffffff",
|
|
2694
|
-
crosshairLabelBorder: "#878787",
|
|
2695
|
-
watermarkColor: "rgba(15,15,15,0.06)",
|
|
2696
|
-
indicatorTextColor: "#4b4b4b",
|
|
2697
|
-
labelTextColor: "#ffffff",
|
|
2698
|
-
labelBackground: "#f0f3fa"
|
|
2699
|
-
},
|
|
2700
2662
|
midnight: {
|
|
2701
2663
|
name: "midnight",
|
|
2702
2664
|
background: "#171717",
|
|
@@ -2716,6 +2678,63 @@ var CHART_THEMES = {
|
|
|
2716
2678
|
labelTextColor: "#dbeafe",
|
|
2717
2679
|
labelBackground: "#0b1220"
|
|
2718
2680
|
},
|
|
2681
|
+
light: {
|
|
2682
|
+
name: "light",
|
|
2683
|
+
background: "#ffffff",
|
|
2684
|
+
upColor: "#22ab94",
|
|
2685
|
+
downColor: "#f23645",
|
|
2686
|
+
lineColor: "#2563eb",
|
|
2687
|
+
gridColor: "#e0e3eb",
|
|
2688
|
+
gridOpacity: 0.9,
|
|
2689
|
+
axisTextColor: "#1f2430",
|
|
2690
|
+
axisLineColor: "#c8ccd6",
|
|
2691
|
+
crosshairColor: "#6b7280",
|
|
2692
|
+
crosshairLabelBackground: "#2a2e39",
|
|
2693
|
+
crosshairLabelText: "#ffffff",
|
|
2694
|
+
crosshairLabelBorder: "#6b7280",
|
|
2695
|
+
watermarkColor: "rgba(19,23,34,0.06)",
|
|
2696
|
+
indicatorTextColor: "#4b5563",
|
|
2697
|
+
labelTextColor: "#ffffff",
|
|
2698
|
+
labelBackground: "#f1f3f8"
|
|
2699
|
+
},
|
|
2700
|
+
brand: {
|
|
2701
|
+
name: "brand",
|
|
2702
|
+
background: "#0b1220",
|
|
2703
|
+
upColor: "#22ab94",
|
|
2704
|
+
downColor: "#f23645",
|
|
2705
|
+
lineColor: "#253cff",
|
|
2706
|
+
gridColor: "#1b2740",
|
|
2707
|
+
gridOpacity: 0.6,
|
|
2708
|
+
axisTextColor: "#c3cee8",
|
|
2709
|
+
axisLineColor: "#34405c",
|
|
2710
|
+
crosshairColor: "#6e85ff",
|
|
2711
|
+
crosshairLabelBackground: "#253cff",
|
|
2712
|
+
crosshairLabelText: "#ffffff",
|
|
2713
|
+
crosshairLabelBorder: "#6e85ff",
|
|
2714
|
+
watermarkColor: "rgba(37,60,255,0.08)",
|
|
2715
|
+
indicatorTextColor: "#a9b8dc",
|
|
2716
|
+
labelTextColor: "#ffffff",
|
|
2717
|
+
labelBackground: "#101a2e"
|
|
2718
|
+
},
|
|
2719
|
+
dark: {
|
|
2720
|
+
name: "dark",
|
|
2721
|
+
background: "#0f0f0f",
|
|
2722
|
+
upColor: "#089981",
|
|
2723
|
+
downColor: "#f23645",
|
|
2724
|
+
lineColor: "#2962ff",
|
|
2725
|
+
gridColor: "#3c3c3c",
|
|
2726
|
+
gridOpacity: 0.5,
|
|
2727
|
+
axisTextColor: "#dbdbdb",
|
|
2728
|
+
axisLineColor: "#424242",
|
|
2729
|
+
crosshairColor: "#9598a1",
|
|
2730
|
+
crosshairLabelBackground: "#3c3c3c",
|
|
2731
|
+
crosshairLabelText: "#dbdbdb",
|
|
2732
|
+
crosshairLabelBorder: "#5d5d5d",
|
|
2733
|
+
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2734
|
+
indicatorTextColor: "#b2b5be",
|
|
2735
|
+
labelTextColor: "#ffffff",
|
|
2736
|
+
labelBackground: "#1a1a1a"
|
|
2737
|
+
},
|
|
2719
2738
|
"high-contrast": {
|
|
2720
2739
|
name: "high-contrast",
|
|
2721
2740
|
background: "#000000",
|
|
@@ -2737,7 +2756,7 @@ var CHART_THEMES = {
|
|
|
2737
2756
|
}
|
|
2738
2757
|
};
|
|
2739
2758
|
var CHART_THEME_NAMES = Object.keys(CHART_THEMES);
|
|
2740
|
-
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.
|
|
2759
|
+
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.midnight : theme;
|
|
2741
2760
|
|
|
2742
2761
|
// src/options.ts
|
|
2743
2762
|
var DEFAULT_GRID_OPTIONS = {
|
|
@@ -635,7 +635,7 @@ interface ChartTheme {
|
|
|
635
635
|
/** Background for preview labels and pills. */
|
|
636
636
|
labelBackground: string;
|
|
637
637
|
}
|
|
638
|
-
type ChartThemeName = "
|
|
638
|
+
type ChartThemeName = "midnight" | "light" | "brand" | "dark" | "high-contrast";
|
|
639
639
|
/** Touch ergonomics. Fingers are blunter than a mouse cursor. */
|
|
640
640
|
interface TouchOptions {
|
|
641
641
|
/**
|
|
@@ -1066,12 +1066,12 @@ declare const compileScriptIndicator: (definition: ScriptIndicatorDefinition) =>
|
|
|
1066
1066
|
/**
|
|
1067
1067
|
* Built-in palettes.
|
|
1068
1068
|
*
|
|
1069
|
-
* `
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1069
|
+
* `midnight` is the long-standing default and `light` is its counterpart on a
|
|
1070
|
+
* white surface — same candle colors, so switching surfaces doesn't change how
|
|
1071
|
+
* you read the tape. `brand` tints everything toward Hyperprop blue, `dark` is
|
|
1072
|
+
* a neutral near-black for embedders who want no tint at all, and
|
|
1073
|
+
* `high-contrast` trades subtlety for legibility on projectors and for
|
|
1074
|
+
* low-vision users.
|
|
1075
1075
|
*/
|
|
1076
1076
|
declare const CHART_THEMES: Record<ChartThemeName, ChartTheme>;
|
|
1077
1077
|
declare const CHART_THEME_NAMES: ChartThemeName[];
|
|
@@ -2625,44 +2625,6 @@ var compileScriptIndicator = (definition) => {
|
|
|
2625
2625
|
|
|
2626
2626
|
// src/themes.ts
|
|
2627
2627
|
var CHART_THEMES = {
|
|
2628
|
-
dark: {
|
|
2629
|
-
name: "dark",
|
|
2630
|
-
background: "#0f0f0f",
|
|
2631
|
-
upColor: "#089981",
|
|
2632
|
-
downColor: "#f23645",
|
|
2633
|
-
lineColor: "#2962ff",
|
|
2634
|
-
gridColor: "#3c3c3c",
|
|
2635
|
-
gridOpacity: 0.5,
|
|
2636
|
-
axisTextColor: "#dbdbdb",
|
|
2637
|
-
axisLineColor: "#424242",
|
|
2638
|
-
crosshairColor: "#9598a1",
|
|
2639
|
-
crosshairLabelBackground: "#3c3c3c",
|
|
2640
|
-
crosshairLabelText: "#dbdbdb",
|
|
2641
|
-
crosshairLabelBorder: "#5d5d5d",
|
|
2642
|
-
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2643
|
-
indicatorTextColor: "#b2b5be",
|
|
2644
|
-
labelTextColor: "#ffffff",
|
|
2645
|
-
labelBackground: "#1a1a1a"
|
|
2646
|
-
},
|
|
2647
|
-
light: {
|
|
2648
|
-
name: "light",
|
|
2649
|
-
background: "#ffffff",
|
|
2650
|
-
upColor: "#089981",
|
|
2651
|
-
downColor: "#f23645",
|
|
2652
|
-
lineColor: "#2962ff",
|
|
2653
|
-
gridColor: "#d5d5d5",
|
|
2654
|
-
gridOpacity: 0.9,
|
|
2655
|
-
axisTextColor: "#0f0f0f",
|
|
2656
|
-
axisLineColor: "#c3c3c3",
|
|
2657
|
-
crosshairColor: "#787b86",
|
|
2658
|
-
crosshairLabelBackground: "#4b4b4b",
|
|
2659
|
-
crosshairLabelText: "#ffffff",
|
|
2660
|
-
crosshairLabelBorder: "#878787",
|
|
2661
|
-
watermarkColor: "rgba(15,15,15,0.06)",
|
|
2662
|
-
indicatorTextColor: "#4b4b4b",
|
|
2663
|
-
labelTextColor: "#ffffff",
|
|
2664
|
-
labelBackground: "#f0f3fa"
|
|
2665
|
-
},
|
|
2666
2628
|
midnight: {
|
|
2667
2629
|
name: "midnight",
|
|
2668
2630
|
background: "#171717",
|
|
@@ -2682,6 +2644,63 @@ var CHART_THEMES = {
|
|
|
2682
2644
|
labelTextColor: "#dbeafe",
|
|
2683
2645
|
labelBackground: "#0b1220"
|
|
2684
2646
|
},
|
|
2647
|
+
light: {
|
|
2648
|
+
name: "light",
|
|
2649
|
+
background: "#ffffff",
|
|
2650
|
+
upColor: "#22ab94",
|
|
2651
|
+
downColor: "#f23645",
|
|
2652
|
+
lineColor: "#2563eb",
|
|
2653
|
+
gridColor: "#e0e3eb",
|
|
2654
|
+
gridOpacity: 0.9,
|
|
2655
|
+
axisTextColor: "#1f2430",
|
|
2656
|
+
axisLineColor: "#c8ccd6",
|
|
2657
|
+
crosshairColor: "#6b7280",
|
|
2658
|
+
crosshairLabelBackground: "#2a2e39",
|
|
2659
|
+
crosshairLabelText: "#ffffff",
|
|
2660
|
+
crosshairLabelBorder: "#6b7280",
|
|
2661
|
+
watermarkColor: "rgba(19,23,34,0.06)",
|
|
2662
|
+
indicatorTextColor: "#4b5563",
|
|
2663
|
+
labelTextColor: "#ffffff",
|
|
2664
|
+
labelBackground: "#f1f3f8"
|
|
2665
|
+
},
|
|
2666
|
+
brand: {
|
|
2667
|
+
name: "brand",
|
|
2668
|
+
background: "#0b1220",
|
|
2669
|
+
upColor: "#22ab94",
|
|
2670
|
+
downColor: "#f23645",
|
|
2671
|
+
lineColor: "#253cff",
|
|
2672
|
+
gridColor: "#1b2740",
|
|
2673
|
+
gridOpacity: 0.6,
|
|
2674
|
+
axisTextColor: "#c3cee8",
|
|
2675
|
+
axisLineColor: "#34405c",
|
|
2676
|
+
crosshairColor: "#6e85ff",
|
|
2677
|
+
crosshairLabelBackground: "#253cff",
|
|
2678
|
+
crosshairLabelText: "#ffffff",
|
|
2679
|
+
crosshairLabelBorder: "#6e85ff",
|
|
2680
|
+
watermarkColor: "rgba(37,60,255,0.08)",
|
|
2681
|
+
indicatorTextColor: "#a9b8dc",
|
|
2682
|
+
labelTextColor: "#ffffff",
|
|
2683
|
+
labelBackground: "#101a2e"
|
|
2684
|
+
},
|
|
2685
|
+
dark: {
|
|
2686
|
+
name: "dark",
|
|
2687
|
+
background: "#0f0f0f",
|
|
2688
|
+
upColor: "#089981",
|
|
2689
|
+
downColor: "#f23645",
|
|
2690
|
+
lineColor: "#2962ff",
|
|
2691
|
+
gridColor: "#3c3c3c",
|
|
2692
|
+
gridOpacity: 0.5,
|
|
2693
|
+
axisTextColor: "#dbdbdb",
|
|
2694
|
+
axisLineColor: "#424242",
|
|
2695
|
+
crosshairColor: "#9598a1",
|
|
2696
|
+
crosshairLabelBackground: "#3c3c3c",
|
|
2697
|
+
crosshairLabelText: "#dbdbdb",
|
|
2698
|
+
crosshairLabelBorder: "#5d5d5d",
|
|
2699
|
+
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2700
|
+
indicatorTextColor: "#b2b5be",
|
|
2701
|
+
labelTextColor: "#ffffff",
|
|
2702
|
+
labelBackground: "#1a1a1a"
|
|
2703
|
+
},
|
|
2685
2704
|
"high-contrast": {
|
|
2686
2705
|
name: "high-contrast",
|
|
2687
2706
|
background: "#000000",
|
|
@@ -2703,7 +2722,7 @@ var CHART_THEMES = {
|
|
|
2703
2722
|
}
|
|
2704
2723
|
};
|
|
2705
2724
|
var CHART_THEME_NAMES = Object.keys(CHART_THEMES);
|
|
2706
|
-
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.
|
|
2725
|
+
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.midnight : theme;
|
|
2707
2726
|
|
|
2708
2727
|
// src/options.ts
|
|
2709
2728
|
var DEFAULT_GRID_OPTIONS = {
|
package/dist/index.cjs
CHANGED
|
@@ -2659,44 +2659,6 @@ var compileScriptIndicator = (definition) => {
|
|
|
2659
2659
|
|
|
2660
2660
|
// src/themes.ts
|
|
2661
2661
|
var CHART_THEMES = {
|
|
2662
|
-
dark: {
|
|
2663
|
-
name: "dark",
|
|
2664
|
-
background: "#0f0f0f",
|
|
2665
|
-
upColor: "#089981",
|
|
2666
|
-
downColor: "#f23645",
|
|
2667
|
-
lineColor: "#2962ff",
|
|
2668
|
-
gridColor: "#3c3c3c",
|
|
2669
|
-
gridOpacity: 0.5,
|
|
2670
|
-
axisTextColor: "#dbdbdb",
|
|
2671
|
-
axisLineColor: "#424242",
|
|
2672
|
-
crosshairColor: "#9598a1",
|
|
2673
|
-
crosshairLabelBackground: "#3c3c3c",
|
|
2674
|
-
crosshairLabelText: "#dbdbdb",
|
|
2675
|
-
crosshairLabelBorder: "#5d5d5d",
|
|
2676
|
-
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2677
|
-
indicatorTextColor: "#b2b5be",
|
|
2678
|
-
labelTextColor: "#ffffff",
|
|
2679
|
-
labelBackground: "#1a1a1a"
|
|
2680
|
-
},
|
|
2681
|
-
light: {
|
|
2682
|
-
name: "light",
|
|
2683
|
-
background: "#ffffff",
|
|
2684
|
-
upColor: "#089981",
|
|
2685
|
-
downColor: "#f23645",
|
|
2686
|
-
lineColor: "#2962ff",
|
|
2687
|
-
gridColor: "#d5d5d5",
|
|
2688
|
-
gridOpacity: 0.9,
|
|
2689
|
-
axisTextColor: "#0f0f0f",
|
|
2690
|
-
axisLineColor: "#c3c3c3",
|
|
2691
|
-
crosshairColor: "#787b86",
|
|
2692
|
-
crosshairLabelBackground: "#4b4b4b",
|
|
2693
|
-
crosshairLabelText: "#ffffff",
|
|
2694
|
-
crosshairLabelBorder: "#878787",
|
|
2695
|
-
watermarkColor: "rgba(15,15,15,0.06)",
|
|
2696
|
-
indicatorTextColor: "#4b4b4b",
|
|
2697
|
-
labelTextColor: "#ffffff",
|
|
2698
|
-
labelBackground: "#f0f3fa"
|
|
2699
|
-
},
|
|
2700
2662
|
midnight: {
|
|
2701
2663
|
name: "midnight",
|
|
2702
2664
|
background: "#171717",
|
|
@@ -2716,6 +2678,63 @@ var CHART_THEMES = {
|
|
|
2716
2678
|
labelTextColor: "#dbeafe",
|
|
2717
2679
|
labelBackground: "#0b1220"
|
|
2718
2680
|
},
|
|
2681
|
+
light: {
|
|
2682
|
+
name: "light",
|
|
2683
|
+
background: "#ffffff",
|
|
2684
|
+
upColor: "#22ab94",
|
|
2685
|
+
downColor: "#f23645",
|
|
2686
|
+
lineColor: "#2563eb",
|
|
2687
|
+
gridColor: "#e0e3eb",
|
|
2688
|
+
gridOpacity: 0.9,
|
|
2689
|
+
axisTextColor: "#1f2430",
|
|
2690
|
+
axisLineColor: "#c8ccd6",
|
|
2691
|
+
crosshairColor: "#6b7280",
|
|
2692
|
+
crosshairLabelBackground: "#2a2e39",
|
|
2693
|
+
crosshairLabelText: "#ffffff",
|
|
2694
|
+
crosshairLabelBorder: "#6b7280",
|
|
2695
|
+
watermarkColor: "rgba(19,23,34,0.06)",
|
|
2696
|
+
indicatorTextColor: "#4b5563",
|
|
2697
|
+
labelTextColor: "#ffffff",
|
|
2698
|
+
labelBackground: "#f1f3f8"
|
|
2699
|
+
},
|
|
2700
|
+
brand: {
|
|
2701
|
+
name: "brand",
|
|
2702
|
+
background: "#0b1220",
|
|
2703
|
+
upColor: "#22ab94",
|
|
2704
|
+
downColor: "#f23645",
|
|
2705
|
+
lineColor: "#253cff",
|
|
2706
|
+
gridColor: "#1b2740",
|
|
2707
|
+
gridOpacity: 0.6,
|
|
2708
|
+
axisTextColor: "#c3cee8",
|
|
2709
|
+
axisLineColor: "#34405c",
|
|
2710
|
+
crosshairColor: "#6e85ff",
|
|
2711
|
+
crosshairLabelBackground: "#253cff",
|
|
2712
|
+
crosshairLabelText: "#ffffff",
|
|
2713
|
+
crosshairLabelBorder: "#6e85ff",
|
|
2714
|
+
watermarkColor: "rgba(37,60,255,0.08)",
|
|
2715
|
+
indicatorTextColor: "#a9b8dc",
|
|
2716
|
+
labelTextColor: "#ffffff",
|
|
2717
|
+
labelBackground: "#101a2e"
|
|
2718
|
+
},
|
|
2719
|
+
dark: {
|
|
2720
|
+
name: "dark",
|
|
2721
|
+
background: "#0f0f0f",
|
|
2722
|
+
upColor: "#089981",
|
|
2723
|
+
downColor: "#f23645",
|
|
2724
|
+
lineColor: "#2962ff",
|
|
2725
|
+
gridColor: "#3c3c3c",
|
|
2726
|
+
gridOpacity: 0.5,
|
|
2727
|
+
axisTextColor: "#dbdbdb",
|
|
2728
|
+
axisLineColor: "#424242",
|
|
2729
|
+
crosshairColor: "#9598a1",
|
|
2730
|
+
crosshairLabelBackground: "#3c3c3c",
|
|
2731
|
+
crosshairLabelText: "#dbdbdb",
|
|
2732
|
+
crosshairLabelBorder: "#5d5d5d",
|
|
2733
|
+
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2734
|
+
indicatorTextColor: "#b2b5be",
|
|
2735
|
+
labelTextColor: "#ffffff",
|
|
2736
|
+
labelBackground: "#1a1a1a"
|
|
2737
|
+
},
|
|
2719
2738
|
"high-contrast": {
|
|
2720
2739
|
name: "high-contrast",
|
|
2721
2740
|
background: "#000000",
|
|
@@ -2737,7 +2756,7 @@ var CHART_THEMES = {
|
|
|
2737
2756
|
}
|
|
2738
2757
|
};
|
|
2739
2758
|
var CHART_THEME_NAMES = Object.keys(CHART_THEMES);
|
|
2740
|
-
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.
|
|
2759
|
+
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.midnight : theme;
|
|
2741
2760
|
|
|
2742
2761
|
// src/options.ts
|
|
2743
2762
|
var DEFAULT_GRID_OPTIONS = {
|
package/dist/index.d.cts
CHANGED
|
@@ -635,7 +635,7 @@ interface ChartTheme {
|
|
|
635
635
|
/** Background for preview labels and pills. */
|
|
636
636
|
labelBackground: string;
|
|
637
637
|
}
|
|
638
|
-
type ChartThemeName = "
|
|
638
|
+
type ChartThemeName = "midnight" | "light" | "brand" | "dark" | "high-contrast";
|
|
639
639
|
/** Touch ergonomics. Fingers are blunter than a mouse cursor. */
|
|
640
640
|
interface TouchOptions {
|
|
641
641
|
/**
|
|
@@ -1066,12 +1066,12 @@ declare const compileScriptIndicator: (definition: ScriptIndicatorDefinition) =>
|
|
|
1066
1066
|
/**
|
|
1067
1067
|
* Built-in palettes.
|
|
1068
1068
|
*
|
|
1069
|
-
* `
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1069
|
+
* `midnight` is the long-standing default and `light` is its counterpart on a
|
|
1070
|
+
* white surface — same candle colors, so switching surfaces doesn't change how
|
|
1071
|
+
* you read the tape. `brand` tints everything toward Hyperprop blue, `dark` is
|
|
1072
|
+
* a neutral near-black for embedders who want no tint at all, and
|
|
1073
|
+
* `high-contrast` trades subtlety for legibility on projectors and for
|
|
1074
|
+
* low-vision users.
|
|
1075
1075
|
*/
|
|
1076
1076
|
declare const CHART_THEMES: Record<ChartThemeName, ChartTheme>;
|
|
1077
1077
|
declare const CHART_THEME_NAMES: ChartThemeName[];
|
package/dist/index.d.ts
CHANGED
|
@@ -635,7 +635,7 @@ interface ChartTheme {
|
|
|
635
635
|
/** Background for preview labels and pills. */
|
|
636
636
|
labelBackground: string;
|
|
637
637
|
}
|
|
638
|
-
type ChartThemeName = "
|
|
638
|
+
type ChartThemeName = "midnight" | "light" | "brand" | "dark" | "high-contrast";
|
|
639
639
|
/** Touch ergonomics. Fingers are blunter than a mouse cursor. */
|
|
640
640
|
interface TouchOptions {
|
|
641
641
|
/**
|
|
@@ -1066,12 +1066,12 @@ declare const compileScriptIndicator: (definition: ScriptIndicatorDefinition) =>
|
|
|
1066
1066
|
/**
|
|
1067
1067
|
* Built-in palettes.
|
|
1068
1068
|
*
|
|
1069
|
-
* `
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1069
|
+
* `midnight` is the long-standing default and `light` is its counterpart on a
|
|
1070
|
+
* white surface — same candle colors, so switching surfaces doesn't change how
|
|
1071
|
+
* you read the tape. `brand` tints everything toward Hyperprop blue, `dark` is
|
|
1072
|
+
* a neutral near-black for embedders who want no tint at all, and
|
|
1073
|
+
* `high-contrast` trades subtlety for legibility on projectors and for
|
|
1074
|
+
* low-vision users.
|
|
1075
1075
|
*/
|
|
1076
1076
|
declare const CHART_THEMES: Record<ChartThemeName, ChartTheme>;
|
|
1077
1077
|
declare const CHART_THEME_NAMES: ChartThemeName[];
|
package/dist/index.js
CHANGED
|
@@ -2625,44 +2625,6 @@ var compileScriptIndicator = (definition) => {
|
|
|
2625
2625
|
|
|
2626
2626
|
// src/themes.ts
|
|
2627
2627
|
var CHART_THEMES = {
|
|
2628
|
-
dark: {
|
|
2629
|
-
name: "dark",
|
|
2630
|
-
background: "#0f0f0f",
|
|
2631
|
-
upColor: "#089981",
|
|
2632
|
-
downColor: "#f23645",
|
|
2633
|
-
lineColor: "#2962ff",
|
|
2634
|
-
gridColor: "#3c3c3c",
|
|
2635
|
-
gridOpacity: 0.5,
|
|
2636
|
-
axisTextColor: "#dbdbdb",
|
|
2637
|
-
axisLineColor: "#424242",
|
|
2638
|
-
crosshairColor: "#9598a1",
|
|
2639
|
-
crosshairLabelBackground: "#3c3c3c",
|
|
2640
|
-
crosshairLabelText: "#dbdbdb",
|
|
2641
|
-
crosshairLabelBorder: "#5d5d5d",
|
|
2642
|
-
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2643
|
-
indicatorTextColor: "#b2b5be",
|
|
2644
|
-
labelTextColor: "#ffffff",
|
|
2645
|
-
labelBackground: "#1a1a1a"
|
|
2646
|
-
},
|
|
2647
|
-
light: {
|
|
2648
|
-
name: "light",
|
|
2649
|
-
background: "#ffffff",
|
|
2650
|
-
upColor: "#089981",
|
|
2651
|
-
downColor: "#f23645",
|
|
2652
|
-
lineColor: "#2962ff",
|
|
2653
|
-
gridColor: "#d5d5d5",
|
|
2654
|
-
gridOpacity: 0.9,
|
|
2655
|
-
axisTextColor: "#0f0f0f",
|
|
2656
|
-
axisLineColor: "#c3c3c3",
|
|
2657
|
-
crosshairColor: "#787b86",
|
|
2658
|
-
crosshairLabelBackground: "#4b4b4b",
|
|
2659
|
-
crosshairLabelText: "#ffffff",
|
|
2660
|
-
crosshairLabelBorder: "#878787",
|
|
2661
|
-
watermarkColor: "rgba(15,15,15,0.06)",
|
|
2662
|
-
indicatorTextColor: "#4b4b4b",
|
|
2663
|
-
labelTextColor: "#ffffff",
|
|
2664
|
-
labelBackground: "#f0f3fa"
|
|
2665
|
-
},
|
|
2666
2628
|
midnight: {
|
|
2667
2629
|
name: "midnight",
|
|
2668
2630
|
background: "#171717",
|
|
@@ -2682,6 +2644,63 @@ var CHART_THEMES = {
|
|
|
2682
2644
|
labelTextColor: "#dbeafe",
|
|
2683
2645
|
labelBackground: "#0b1220"
|
|
2684
2646
|
},
|
|
2647
|
+
light: {
|
|
2648
|
+
name: "light",
|
|
2649
|
+
background: "#ffffff",
|
|
2650
|
+
upColor: "#22ab94",
|
|
2651
|
+
downColor: "#f23645",
|
|
2652
|
+
lineColor: "#2563eb",
|
|
2653
|
+
gridColor: "#e0e3eb",
|
|
2654
|
+
gridOpacity: 0.9,
|
|
2655
|
+
axisTextColor: "#1f2430",
|
|
2656
|
+
axisLineColor: "#c8ccd6",
|
|
2657
|
+
crosshairColor: "#6b7280",
|
|
2658
|
+
crosshairLabelBackground: "#2a2e39",
|
|
2659
|
+
crosshairLabelText: "#ffffff",
|
|
2660
|
+
crosshairLabelBorder: "#6b7280",
|
|
2661
|
+
watermarkColor: "rgba(19,23,34,0.06)",
|
|
2662
|
+
indicatorTextColor: "#4b5563",
|
|
2663
|
+
labelTextColor: "#ffffff",
|
|
2664
|
+
labelBackground: "#f1f3f8"
|
|
2665
|
+
},
|
|
2666
|
+
brand: {
|
|
2667
|
+
name: "brand",
|
|
2668
|
+
background: "#0b1220",
|
|
2669
|
+
upColor: "#22ab94",
|
|
2670
|
+
downColor: "#f23645",
|
|
2671
|
+
lineColor: "#253cff",
|
|
2672
|
+
gridColor: "#1b2740",
|
|
2673
|
+
gridOpacity: 0.6,
|
|
2674
|
+
axisTextColor: "#c3cee8",
|
|
2675
|
+
axisLineColor: "#34405c",
|
|
2676
|
+
crosshairColor: "#6e85ff",
|
|
2677
|
+
crosshairLabelBackground: "#253cff",
|
|
2678
|
+
crosshairLabelText: "#ffffff",
|
|
2679
|
+
crosshairLabelBorder: "#6e85ff",
|
|
2680
|
+
watermarkColor: "rgba(37,60,255,0.08)",
|
|
2681
|
+
indicatorTextColor: "#a9b8dc",
|
|
2682
|
+
labelTextColor: "#ffffff",
|
|
2683
|
+
labelBackground: "#101a2e"
|
|
2684
|
+
},
|
|
2685
|
+
dark: {
|
|
2686
|
+
name: "dark",
|
|
2687
|
+
background: "#0f0f0f",
|
|
2688
|
+
upColor: "#089981",
|
|
2689
|
+
downColor: "#f23645",
|
|
2690
|
+
lineColor: "#2962ff",
|
|
2691
|
+
gridColor: "#3c3c3c",
|
|
2692
|
+
gridOpacity: 0.5,
|
|
2693
|
+
axisTextColor: "#dbdbdb",
|
|
2694
|
+
axisLineColor: "#424242",
|
|
2695
|
+
crosshairColor: "#9598a1",
|
|
2696
|
+
crosshairLabelBackground: "#3c3c3c",
|
|
2697
|
+
crosshairLabelText: "#dbdbdb",
|
|
2698
|
+
crosshairLabelBorder: "#5d5d5d",
|
|
2699
|
+
watermarkColor: "rgba(219,219,219,0.06)",
|
|
2700
|
+
indicatorTextColor: "#b2b5be",
|
|
2701
|
+
labelTextColor: "#ffffff",
|
|
2702
|
+
labelBackground: "#1a1a1a"
|
|
2703
|
+
},
|
|
2685
2704
|
"high-contrast": {
|
|
2686
2705
|
name: "high-contrast",
|
|
2687
2706
|
background: "#000000",
|
|
@@ -2703,7 +2722,7 @@ var CHART_THEMES = {
|
|
|
2703
2722
|
}
|
|
2704
2723
|
};
|
|
2705
2724
|
var CHART_THEME_NAMES = Object.keys(CHART_THEMES);
|
|
2706
|
-
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.
|
|
2725
|
+
var resolveTheme = (theme) => typeof theme === "string" ? CHART_THEMES[theme] ?? CHART_THEMES.midnight : theme;
|
|
2707
2726
|
|
|
2708
2727
|
// src/options.ts
|
|
2709
2728
|
var DEFAULT_GRID_OPTIONS = {
|
package/docs/API.md
CHANGED
|
@@ -568,6 +568,7 @@ an up measurement, red for down.
|
|
|
568
568
|
- `cancelDrawing(): boolean` — abort an in-progress multi-click drawing (between the first click and the final point, e.g. a half-drawn trendline/ray/fib). Returns `true` if a draft was cancelled. Wire it to Escape.
|
|
569
569
|
- Hold **Shift** while drawing or dragging an endpoint of a `trendline`/`ray`/`arrow` to constrain it to the nearest 0/45/90° angle (e.g. a perfectly horizontal line).
|
|
570
570
|
- `setMagnetMode(mode): void` / `getMagnetMode()` — magnet/snap for all drawing tools. `"none"` off, `"weak"` snaps to a candle's OHLC only when the cursor is near a value, `"strong"` always snaps to the nearest OHLC of the bar under the cursor. Holding Cmd/Ctrl while drawing/dragging forces strong snapping regardless of the mode.
|
|
571
|
+
- `setTheme(theme: ChartThemeName | ChartTheme): void` / `getTheme(): string | null` — apply a whole palette at once; see "Themes" below
|
|
571
572
|
- `setDatafeed(datafeed: ChartDatafeed | null): Promise<void>` — attach a pull-based data source with lazy history; see "Datafeed" below
|
|
572
573
|
- `onLongPress(handler: ((event: ChartLongPressEvent) => void) | null): void` — touch press-and-hold inspection
|
|
573
574
|
- `setCompareSeries(series: CompareSeriesOptions[]): void` / `addCompareSeries(series)` / `removeCompareSeries(id)` / `getCompareSeries()` — overlay other instruments on the main pane; see "Compare overlays" below
|
|
@@ -613,6 +614,39 @@ link.click();
|
|
|
613
614
|
|
|
614
615
|
---
|
|
615
616
|
|
|
617
|
+
## Themes
|
|
618
|
+
|
|
619
|
+
A theme is the chart's whole palette as one object, so hosts stop setting a
|
|
620
|
+
dozen colors individually and re-pushing them on every light/dark toggle.
|
|
621
|
+
|
|
622
|
+
```ts
|
|
623
|
+
import { CHART_THEMES, createChart } from "hyperprop-charting-library";
|
|
624
|
+
|
|
625
|
+
chart.setTheme("light"); // built-in preset
|
|
626
|
+
chart.setTheme({ ...CHART_THEMES.dark, upColor: "#00c853" }); // tweak one
|
|
627
|
+
chart.getTheme(); // "light" | null when hand-set
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
Five presets ship in `CHART_THEMES`:
|
|
631
|
+
|
|
632
|
+
| Preset | Surface | Candles | For |
|
|
633
|
+
| --- | --- | --- | --- |
|
|
634
|
+
| `midnight` | `#171717` | `#22ab94` / `#f23645` | the default dark look |
|
|
635
|
+
| `light` | `#ffffff` | `#22ab94` / `#f23645` | same candles on a white surface |
|
|
636
|
+
| `brand` | `#0b1220` | `#22ab94` / `#f23645` | Hyperprop blue accents (`#253cff`) |
|
|
637
|
+
| `dark` | `#0f0f0f` | `#089981` / `#f23645` | neutral near-black, no tint |
|
|
638
|
+
| `high-contrast` | `#000000` | `#00e5a0` / `#ff4d5e` | projectors, low vision |
|
|
639
|
+
|
|
640
|
+
`setTheme` covers background, candles, the line/area series, grid (color and
|
|
641
|
+
opacity), both axes, the crosshair and its labels, the watermark, and
|
|
642
|
+
indicator legend text. It deliberately does **not** touch order-line colors or
|
|
643
|
+
drawing defaults — those are trading state, not chrome, so switching looks
|
|
644
|
+
never changes what your orders look like mid-session.
|
|
645
|
+
|
|
646
|
+
`getTheme()` returns the active preset name, or `null` once any themed color
|
|
647
|
+
is set by hand. Unrelated `updateOptions` calls (label toggles, sizing, ticker
|
|
648
|
+
line) don't clear it, so it stays a reliable "am I on a preset" signal.
|
|
649
|
+
|
|
616
650
|
## Datafeed (optional, pull-based)
|
|
617
651
|
|
|
618
652
|
By default the host pushes bars in with `setData`/`upsertBar`. Attach a
|