@instruments/materialgraph 0.5.0 → 0.6.0
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/colour-aggregate-types.d.ts +16 -4
- package/colours-client.d.ts +7 -0
- package/colours-client.js +7 -0
- package/package.json +1 -1
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
* widened so a new server value still type-checks.
|
|
9
9
|
*/
|
|
10
10
|
import type { OpenEnum } from "./types.js";
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Which taxonomy tier a colour profile's `categoryKey` names — or `"merged"`,
|
|
13
|
+
* where the key is a composite over a caller-defined key set rather than a
|
|
14
|
+
* taxonomy node.
|
|
15
|
+
*/
|
|
16
|
+
export type CategoryTier = OpenEnum<"group" | "type" | "merged">;
|
|
13
17
|
/** How the endpoint picks which colours to keep. */
|
|
14
18
|
export type ColourProfileSelect = OpenEnum<"frequency" | "diverse">;
|
|
15
19
|
/** One representative colour bucket of a category. */
|
|
@@ -29,6 +33,11 @@ export interface CategoryColourProfile {
|
|
|
29
33
|
level: CategoryTier;
|
|
30
34
|
name: string;
|
|
31
35
|
path: string;
|
|
36
|
+
/**
|
|
37
|
+
* Under `groupBy: "merged"`, the requested keys in composite-key order, so
|
|
38
|
+
* `categoryKey` never has to be split. Absent on a single-category profile.
|
|
39
|
+
*/
|
|
40
|
+
members?: string[];
|
|
32
41
|
variantCount: number;
|
|
33
42
|
avgLightness: number;
|
|
34
43
|
avgChroma: number;
|
|
@@ -51,8 +60,11 @@ export interface CategoryColourProfilesResponse {
|
|
|
51
60
|
export interface ColourProfilesParams {
|
|
52
61
|
/** 1–8 category keys, at the tier named by `groupBy`. */
|
|
53
62
|
productTypeIds: readonly string[];
|
|
54
|
-
/**
|
|
55
|
-
|
|
63
|
+
/**
|
|
64
|
+
* `"group"` merges each group's leaf product types into one palette;
|
|
65
|
+
* `"merged"` merges EVERY key's leaves into a single combined palette.
|
|
66
|
+
*/
|
|
67
|
+
groupBy?: "group" | "type" | "merged";
|
|
56
68
|
/** Representative colours per category, 1–64. */
|
|
57
69
|
topN?: number;
|
|
58
70
|
/** `"diverse"` maximises visual distinctness instead of frequency. */
|
package/colours-client.d.ts
CHANGED
|
@@ -42,6 +42,13 @@ export declare class ColoursClient {
|
|
|
42
42
|
* cannot recover that spread from a truncated frequency list, which is why it
|
|
43
43
|
* is a server mode rather than a local sort.
|
|
44
44
|
*
|
|
45
|
+
* `groupBy: "merged"` merges across the KEYS as well and returns ONE profile
|
|
46
|
+
* over the union of their leaves — the palette of a caller-defined facet such
|
|
47
|
+
* as "Wood" (`wood_surface` + `wood_flooring`) that the taxonomy holds no
|
|
48
|
+
* single node for, and that no combination of per-key responses reconstructs.
|
|
49
|
+
* Its keys may sit at either tier, `categoryKey` is those keys sorted and
|
|
50
|
+
* joined with `+`, and `members` hands them back so nothing has to split it.
|
|
51
|
+
*
|
|
45
52
|
* A selected category with no colour data comes back as a zero-count profile,
|
|
46
53
|
* not a missing key.
|
|
47
54
|
*/
|
package/colours-client.js
CHANGED
|
@@ -15,6 +15,13 @@ export class ColoursClient {
|
|
|
15
15
|
* cannot recover that spread from a truncated frequency list, which is why it
|
|
16
16
|
* is a server mode rather than a local sort.
|
|
17
17
|
*
|
|
18
|
+
* `groupBy: "merged"` merges across the KEYS as well and returns ONE profile
|
|
19
|
+
* over the union of their leaves — the palette of a caller-defined facet such
|
|
20
|
+
* as "Wood" (`wood_surface` + `wood_flooring`) that the taxonomy holds no
|
|
21
|
+
* single node for, and that no combination of per-key responses reconstructs.
|
|
22
|
+
* Its keys may sit at either tier, `categoryKey` is those keys sorted and
|
|
23
|
+
* joined with `+`, and `members` hands them back so nothing has to split it.
|
|
24
|
+
*
|
|
18
25
|
* A selected category with no colour data comes back as a zero-count profile,
|
|
19
26
|
* not a missing key.
|
|
20
27
|
*/
|