@dra2020/baseclient 1.0.158 → 1.0.160

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.
@@ -6,15 +6,36 @@ export interface ColorLookup {
6
6
  [key: string]: string;
7
7
  }
8
8
  export declare const ColorValues: ColorLookup;
9
- export declare const CountEthnicFewClassicColors = 4;
10
9
  export declare const EthnicFewClassicColors: string[];
11
- export declare const CountPartisanPrecinctClassicColors = 12;
12
10
  export declare const PartisanPrecinctClassicColors: string[];
13
- export declare const CountPartisanDistrictClassicColors = 12;
14
11
  export declare let PartisanDistrictClassicColors: string[];
15
- export declare const CountEthnicBackgroundColor = 16;
16
12
  export declare const EthnicBackgroundColor: string[];
17
13
  export declare const defaultDistrictsPalette = "jet_r";
18
14
  export declare function genColor(i: number, useFirstColor: boolean, palette: string): string;
19
15
  export declare function orderedColors(palette: string): string[];
20
16
  export declare function getPalette(palette: string): string[];
17
+ /**** These helpers are now in data_tools/make_colortable.py which generates colortable.ts (9/15/2025) ****
18
+ function toHexColor(r: number, g: number, b: number): string
19
+ {
20
+ return `#${Util.toHex(r)}${Util.toHex(g)}${Util.toHex(b)}`;
21
+ }
22
+
23
+ function jscolormap(name: string, shades: number): string[]
24
+ {
25
+ let result: string[] = [];
26
+ for (let i = 0; i < shades; i++)
27
+ {
28
+ const rgb: number[] = partial(name)((i + 0.5) / shades);
29
+ result.push(toHexColor(rgb[0], rgb[1], rgb[2]));
30
+ }
31
+ return result;
32
+ }
33
+
34
+ function evaluate_cmap(x: number, name: string, reverse: boolean) {
35
+ /**
36
+ * Evaluate colormap `name` at some value `x`.
37
+ * @param {number} x - The value (between 0 and 1) at which to evaluate the colormap.
38
+ * @param {string} name - The name of the colormap (see matplotlib documentation).
39
+ * @reverse {boolean} reverse - Whether or not to reverse the colormap.
40
+ * @return {list} - A 3-tuple (R, G, B) containing the color assigned to `x`.
41
+ */
@@ -0,0 +1,3 @@
1
+ export declare var ColorTable: {
2
+ [key: string]: string[];
3
+ };
@@ -0,0 +1,3 @@
1
+ export declare var ColorTable: {
2
+ [key: string]: string[];
3
+ };
@@ -0,0 +1,3 @@
1
+ export declare var ColorTable: {
2
+ [key: string]: string[];
3
+ };