@milaboratories/pl-model-common 1.25.1 → 1.25.3

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.
Files changed (288) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/author_marker.d.ts +9 -6
  3. package/dist/base32_encode.cjs +40 -46
  4. package/dist/base32_encode.cjs.map +1 -1
  5. package/dist/base32_encode.js +40 -45
  6. package/dist/base32_encode.js.map +1 -1
  7. package/dist/base64.cjs +5 -4
  8. package/dist/base64.cjs.map +1 -1
  9. package/dist/base64.d.ts +10 -6
  10. package/dist/base64.js +5 -3
  11. package/dist/base64.js.map +1 -1
  12. package/dist/block_state.d.ts +21 -23
  13. package/dist/bmodel/block_config.cjs +9 -10
  14. package/dist/bmodel/block_config.cjs.map +1 -1
  15. package/dist/bmodel/block_config.d.ts +53 -72
  16. package/dist/bmodel/block_config.js +9 -9
  17. package/dist/bmodel/block_config.js.map +1 -1
  18. package/dist/bmodel/code.cjs +7 -6
  19. package/dist/bmodel/code.cjs.map +1 -1
  20. package/dist/bmodel/code.d.ts +17 -13
  21. package/dist/bmodel/code.js +6 -4
  22. package/dist/bmodel/code.js.map +1 -1
  23. package/dist/bmodel/container.d.ts +46 -44
  24. package/dist/bmodel/index.cjs +3 -0
  25. package/dist/bmodel/index.d.ts +5 -6
  26. package/dist/bmodel/index.js +3 -0
  27. package/dist/bmodel/normalization.cjs +90 -106
  28. package/dist/bmodel/normalization.cjs.map +1 -1
  29. package/dist/bmodel/normalization.d.ts +7 -3
  30. package/dist/bmodel/normalization.js +90 -105
  31. package/dist/bmodel/normalization.js.map +1 -1
  32. package/dist/bmodel/types.d.ts +4 -1
  33. package/dist/branding.d.ts +5 -5
  34. package/dist/common_types.d.ts +19 -15
  35. package/dist/driver_kit.d.ts +25 -17
  36. package/dist/drivers/ChunkedStreamReader.cjs +168 -203
  37. package/dist/drivers/ChunkedStreamReader.cjs.map +1 -1
  38. package/dist/drivers/ChunkedStreamReader.d.ts +104 -100
  39. package/dist/drivers/ChunkedStreamReader.js +168 -202
  40. package/dist/drivers/ChunkedStreamReader.js.map +1 -1
  41. package/dist/drivers/blob.cjs +15 -17
  42. package/dist/drivers/blob.cjs.map +1 -1
  43. package/dist/drivers/blob.d.ts +35 -35
  44. package/dist/drivers/blob.js +14 -15
  45. package/dist/drivers/blob.js.map +1 -1
  46. package/dist/drivers/index.cjs +18 -0
  47. package/dist/drivers/index.d.ts +29 -9
  48. package/dist/drivers/index.js +18 -0
  49. package/dist/drivers/interfaces.d.ts +17 -14
  50. package/dist/drivers/log.cjs +4 -3
  51. package/dist/drivers/log.cjs.map +1 -1
  52. package/dist/drivers/log.d.ts +52 -49
  53. package/dist/drivers/log.js +4 -2
  54. package/dist/drivers/log.js.map +1 -1
  55. package/dist/drivers/ls.cjs +16 -19
  56. package/dist/drivers/ls.cjs.map +1 -1
  57. package/dist/drivers/ls.d.ts +73 -76
  58. package/dist/drivers/ls.js +16 -17
  59. package/dist/drivers/ls.js.map +1 -1
  60. package/dist/drivers/pframe/column_filter.d.ts +19 -15
  61. package/dist/drivers/pframe/data_info.cjs +201 -252
  62. package/dist/drivers/pframe/data_info.cjs.map +1 -1
  63. package/dist/drivers/pframe/data_info.d.ts +84 -109
  64. package/dist/drivers/pframe/data_info.js +201 -250
  65. package/dist/drivers/pframe/data_info.js.map +1 -1
  66. package/dist/drivers/pframe/data_types.cjs +38 -63
  67. package/dist/drivers/pframe/data_types.cjs.map +1 -1
  68. package/dist/drivers/pframe/data_types.d.ts +91 -93
  69. package/dist/drivers/pframe/data_types.js +38 -61
  70. package/dist/drivers/pframe/data_types.js.map +1 -1
  71. package/dist/drivers/pframe/driver.cjs +7 -0
  72. package/dist/drivers/pframe/driver.cjs.map +1 -0
  73. package/dist/drivers/pframe/driver.d.ts +50 -45
  74. package/dist/drivers/pframe/driver.js +6 -0
  75. package/dist/drivers/pframe/driver.js.map +1 -0
  76. package/dist/drivers/pframe/filter_spec.d.ts +127 -123
  77. package/dist/drivers/pframe/find_columns.d.ts +21 -17
  78. package/dist/drivers/pframe/index.cjs +15 -0
  79. package/dist/drivers/pframe/index.d.ts +23 -16
  80. package/dist/drivers/pframe/index.js +15 -0
  81. package/dist/drivers/pframe/linker_columns.cjs +184 -238
  82. package/dist/drivers/pframe/linker_columns.cjs.map +1 -1
  83. package/dist/drivers/pframe/linker_columns.d.ts +45 -38
  84. package/dist/drivers/pframe/linker_columns.js +184 -236
  85. package/dist/drivers/pframe/linker_columns.js.map +1 -1
  86. package/dist/drivers/pframe/pframe.d.ts +26 -21
  87. package/dist/drivers/pframe/query/index.cjs +1 -0
  88. package/dist/drivers/pframe/query/index.d.ts +3 -4
  89. package/dist/drivers/pframe/query/index.js +1 -0
  90. package/dist/drivers/pframe/query/query_common.d.ts +205 -247
  91. package/dist/drivers/pframe/query/query_data.d.ts +25 -23
  92. package/dist/drivers/pframe/query/query_spec.d.ts +30 -29
  93. package/dist/drivers/pframe/query/utils.cjs +164 -183
  94. package/dist/drivers/pframe/query/utils.cjs.map +1 -1
  95. package/dist/drivers/pframe/query/utils.d.ts +13 -12
  96. package/dist/drivers/pframe/query/utils.js +164 -181
  97. package/dist/drivers/pframe/query/utils.js.map +1 -1
  98. package/dist/drivers/pframe/spec/anchored.cjs +178 -216
  99. package/dist/drivers/pframe/spec/anchored.cjs.map +1 -1
  100. package/dist/drivers/pframe/spec/anchored.d.ts +53 -49
  101. package/dist/drivers/pframe/spec/anchored.js +176 -214
  102. package/dist/drivers/pframe/spec/anchored.js.map +1 -1
  103. package/dist/drivers/pframe/spec/filtered_column.cjs +8 -7
  104. package/dist/drivers/pframe/spec/filtered_column.cjs.map +1 -1
  105. package/dist/drivers/pframe/spec/filtered_column.d.ts +20 -17
  106. package/dist/drivers/pframe/spec/filtered_column.js +8 -6
  107. package/dist/drivers/pframe/spec/filtered_column.js.map +1 -1
  108. package/dist/drivers/pframe/spec/ids.cjs +16 -14
  109. package/dist/drivers/pframe/spec/ids.cjs.map +1 -1
  110. package/dist/drivers/pframe/spec/ids.d.ts +13 -8
  111. package/dist/drivers/pframe/spec/ids.js +14 -12
  112. package/dist/drivers/pframe/spec/ids.js.map +1 -1
  113. package/dist/drivers/pframe/spec/index.cjs +6 -0
  114. package/dist/drivers/pframe/spec/index.d.ts +6 -7
  115. package/dist/drivers/pframe/spec/index.js +6 -0
  116. package/dist/drivers/pframe/spec/native_id.cjs +16 -16
  117. package/dist/drivers/pframe/spec/native_id.cjs.map +1 -1
  118. package/dist/drivers/pframe/spec/native_id.d.ts +9 -4
  119. package/dist/drivers/pframe/spec/native_id.js +13 -13
  120. package/dist/drivers/pframe/spec/native_id.js.map +1 -1
  121. package/dist/drivers/pframe/spec/selectors.cjs +72 -112
  122. package/dist/drivers/pframe/spec/selectors.cjs.map +1 -1
  123. package/dist/drivers/pframe/spec/selectors.d.ts +99 -94
  124. package/dist/drivers/pframe/spec/selectors.js +72 -110
  125. package/dist/drivers/pframe/spec/selectors.js.map +1 -1
  126. package/dist/drivers/pframe/spec/spec.cjs +282 -324
  127. package/dist/drivers/pframe/spec/spec.cjs.map +1 -1
  128. package/dist/drivers/pframe/spec/spec.d.ts +263 -272
  129. package/dist/drivers/pframe/spec/spec.js +281 -322
  130. package/dist/drivers/pframe/spec/spec.js.map +1 -1
  131. package/dist/drivers/pframe/table.d.ts +28 -24
  132. package/dist/drivers/pframe/table_calculate.cjs +117 -147
  133. package/dist/drivers/pframe/table_calculate.cjs.map +1 -1
  134. package/dist/drivers/pframe/table_calculate.d.ts +219 -220
  135. package/dist/drivers/pframe/table_calculate.js +117 -145
  136. package/dist/drivers/pframe/table_calculate.js.map +1 -1
  137. package/dist/drivers/pframe/table_common.cjs +13 -14
  138. package/dist/drivers/pframe/table_common.cjs.map +1 -1
  139. package/dist/drivers/pframe/table_common.d.ts +24 -19
  140. package/dist/drivers/pframe/table_common.js +13 -13
  141. package/dist/drivers/pframe/table_common.js.map +1 -1
  142. package/dist/drivers/pframe/unique_values.d.ts +23 -18
  143. package/dist/drivers/upload.d.ts +21 -18
  144. package/dist/drivers/urls.cjs +5 -6
  145. package/dist/drivers/urls.cjs.map +1 -1
  146. package/dist/drivers/urls.d.ts +12 -9
  147. package/dist/drivers/urls.js +5 -5
  148. package/dist/drivers/urls.js.map +1 -1
  149. package/dist/errors.cjs +65 -86
  150. package/dist/errors.cjs.map +1 -1
  151. package/dist/errors.d.ts +36 -33
  152. package/dist/errors.js +65 -85
  153. package/dist/errors.js.map +1 -1
  154. package/dist/flags/block_flags.cjs +7 -6
  155. package/dist/flags/block_flags.cjs.map +1 -1
  156. package/dist/flags/block_flags.d.ts +12 -8
  157. package/dist/flags/block_flags.js +7 -5
  158. package/dist/flags/block_flags.js.map +1 -1
  159. package/dist/flags/flag_utils.cjs +69 -108
  160. package/dist/flags/flag_utils.cjs.map +1 -1
  161. package/dist/flags/flag_utils.d.ts +40 -42
  162. package/dist/flags/flag_utils.js +70 -107
  163. package/dist/flags/flag_utils.js.map +1 -1
  164. package/dist/flags/type_utils.d.ts +12 -11
  165. package/dist/httpAuth.cjs +16 -20
  166. package/dist/httpAuth.cjs.map +1 -1
  167. package/dist/httpAuth.d.ts +10 -7
  168. package/dist/httpAuth.js +16 -19
  169. package/dist/httpAuth.js.map +1 -1
  170. package/dist/index.cjs +176 -179
  171. package/dist/index.d.ts +58 -20
  172. package/dist/index.js +37 -34
  173. package/dist/json.cjs +10 -8
  174. package/dist/json.cjs.map +1 -1
  175. package/dist/json.d.ts +18 -18
  176. package/dist/json.js +8 -6
  177. package/dist/json.js.map +1 -1
  178. package/dist/navigation.cjs +3 -2
  179. package/dist/navigation.cjs.map +1 -1
  180. package/dist/navigation.d.ts +18 -21
  181. package/dist/navigation.js +3 -1
  182. package/dist/navigation.js.map +1 -1
  183. package/dist/plid.cjs +16 -20
  184. package/dist/plid.cjs.map +1 -1
  185. package/dist/plid.d.ts +11 -7
  186. package/dist/plid.js +15 -18
  187. package/dist/plid.js.map +1 -1
  188. package/dist/pool/entry.d.ts +11 -11
  189. package/dist/pool/index.d.ts +3 -4
  190. package/dist/pool/query.cjs +21 -43
  191. package/dist/pool/query.cjs.map +1 -1
  192. package/dist/pool/query.d.ts +25 -20
  193. package/dist/pool/query.js +20 -40
  194. package/dist/pool/query.js.map +1 -1
  195. package/dist/pool/spec.cjs +40 -47
  196. package/dist/pool/spec.cjs.map +1 -1
  197. package/dist/pool/spec.d.ts +33 -31
  198. package/dist/pool/spec.js +40 -45
  199. package/dist/pool/spec.js.map +1 -1
  200. package/dist/ref.cjs +51 -71
  201. package/dist/ref.cjs.map +1 -1
  202. package/dist/ref.d.ts +36 -33
  203. package/dist/ref.js +50 -69
  204. package/dist/ref.js.map +1 -1
  205. package/dist/utag.d.ts +18 -14
  206. package/dist/util.cjs +8 -7
  207. package/dist/util.cjs.map +1 -1
  208. package/dist/util.d.ts +5 -2
  209. package/dist/util.js +8 -6
  210. package/dist/util.js.map +1 -1
  211. package/dist/value_or_error.cjs +7 -3
  212. package/dist/value_or_error.cjs.map +1 -1
  213. package/dist/value_or_error.d.ts +9 -6
  214. package/dist/value_or_error.js +7 -2
  215. package/dist/value_or_error.js.map +1 -1
  216. package/package.json +6 -6
  217. package/src/flags/block_flags.ts +2 -1
  218. package/src/flags/flag_utils.ts +0 -22
  219. package/dist/author_marker.d.ts.map +0 -1
  220. package/dist/base32_encode.d.ts +0 -8
  221. package/dist/base32_encode.d.ts.map +0 -1
  222. package/dist/base64.d.ts.map +0 -1
  223. package/dist/block_state.d.ts.map +0 -1
  224. package/dist/bmodel/block_config.d.ts.map +0 -1
  225. package/dist/bmodel/code.d.ts.map +0 -1
  226. package/dist/bmodel/container.d.ts.map +0 -1
  227. package/dist/bmodel/index.d.ts.map +0 -1
  228. package/dist/bmodel/normalization.d.ts.map +0 -1
  229. package/dist/bmodel/types.d.ts.map +0 -1
  230. package/dist/branding.d.ts.map +0 -1
  231. package/dist/common_types.d.ts.map +0 -1
  232. package/dist/driver_kit.d.ts.map +0 -1
  233. package/dist/drivers/ChunkedStreamReader.d.ts.map +0 -1
  234. package/dist/drivers/blob.d.ts.map +0 -1
  235. package/dist/drivers/index.d.ts.map +0 -1
  236. package/dist/drivers/interfaces.d.ts.map +0 -1
  237. package/dist/drivers/log.d.ts.map +0 -1
  238. package/dist/drivers/ls.d.ts.map +0 -1
  239. package/dist/drivers/pframe/column_filter.d.ts.map +0 -1
  240. package/dist/drivers/pframe/data_info.d.ts.map +0 -1
  241. package/dist/drivers/pframe/data_types.d.ts.map +0 -1
  242. package/dist/drivers/pframe/driver.d.ts.map +0 -1
  243. package/dist/drivers/pframe/filter_spec.d.ts.map +0 -1
  244. package/dist/drivers/pframe/find_columns.d.ts.map +0 -1
  245. package/dist/drivers/pframe/index.d.ts.map +0 -1
  246. package/dist/drivers/pframe/linker_columns.d.ts.map +0 -1
  247. package/dist/drivers/pframe/pframe.d.ts.map +0 -1
  248. package/dist/drivers/pframe/query/index.d.ts.map +0 -1
  249. package/dist/drivers/pframe/query/query_common.d.ts.map +0 -1
  250. package/dist/drivers/pframe/query/query_data.d.ts.map +0 -1
  251. package/dist/drivers/pframe/query/query_spec.d.ts.map +0 -1
  252. package/dist/drivers/pframe/query/utils.d.ts.map +0 -1
  253. package/dist/drivers/pframe/spec/anchored.d.ts.map +0 -1
  254. package/dist/drivers/pframe/spec/filtered_column.d.ts.map +0 -1
  255. package/dist/drivers/pframe/spec/ids.d.ts.map +0 -1
  256. package/dist/drivers/pframe/spec/index.d.ts.map +0 -1
  257. package/dist/drivers/pframe/spec/native_id.d.ts.map +0 -1
  258. package/dist/drivers/pframe/spec/selectors.d.ts.map +0 -1
  259. package/dist/drivers/pframe/spec/spec.d.ts.map +0 -1
  260. package/dist/drivers/pframe/table.d.ts.map +0 -1
  261. package/dist/drivers/pframe/table_calculate.d.ts.map +0 -1
  262. package/dist/drivers/pframe/table_common.d.ts.map +0 -1
  263. package/dist/drivers/pframe/type_util.d.ts +0 -5
  264. package/dist/drivers/pframe/type_util.d.ts.map +0 -1
  265. package/dist/drivers/pframe/unique_values.d.ts.map +0 -1
  266. package/dist/drivers/upload.d.ts.map +0 -1
  267. package/dist/drivers/urls.d.ts.map +0 -1
  268. package/dist/errors.d.ts.map +0 -1
  269. package/dist/flags/block_flags.d.ts.map +0 -1
  270. package/dist/flags/flag_utils.d.ts.map +0 -1
  271. package/dist/flags/index.d.ts +0 -4
  272. package/dist/flags/index.d.ts.map +0 -1
  273. package/dist/flags/type_utils.d.ts.map +0 -1
  274. package/dist/httpAuth.d.ts.map +0 -1
  275. package/dist/index.cjs.map +0 -1
  276. package/dist/index.d.ts.map +0 -1
  277. package/dist/index.js.map +0 -1
  278. package/dist/json.d.ts.map +0 -1
  279. package/dist/navigation.d.ts.map +0 -1
  280. package/dist/plid.d.ts.map +0 -1
  281. package/dist/pool/entry.d.ts.map +0 -1
  282. package/dist/pool/index.d.ts.map +0 -1
  283. package/dist/pool/query.d.ts.map +0 -1
  284. package/dist/pool/spec.d.ts.map +0 -1
  285. package/dist/ref.d.ts.map +0 -1
  286. package/dist/utag.d.ts.map +0 -1
  287. package/dist/util.d.ts.map +0 -1
  288. package/dist/value_or_error.d.ts.map +0 -1
@@ -1,231 +1,193 @@
1
- import canonicalize from 'canonicalize';
2
- import { stringifyColumnId } from './ids.js';
3
- import { getAxisId, matchAxisId } from './spec.js';
1
+ import { getAxisId, matchAxisId } from "./spec.js";
2
+ import { stringifyColumnId } from "./ids.js";
3
+ import canonicalize from "canonicalize";
4
4
 
5
- //
6
- // Helper functions
7
- //
5
+ //#region src/drivers/pframe/spec/anchored.ts
8
6
  function axisKey(axis) {
9
- return canonicalize(getAxisId(axis));
7
+ return canonicalize(getAxisId(axis));
10
8
  }
11
9
  function domainKey(key, value) {
12
- return JSON.stringify([key, value]);
10
+ return JSON.stringify([key, value]);
13
11
  }
14
12
  /**
15
- * Context for resolving and generating anchored references to columns and axes
16
- * Maintains maps of known domain values and axes that can be referenced by anchors
17
- */
18
- class AnchoredIdDeriver {
19
- anchors;
20
- domains = new Map();
21
- axes = new Map();
22
- /**
23
- * Domain packs are used to group domain keys that can be anchored to the same anchor
24
- * This is used to optimize the lookup of domain anchors
25
- */
26
- domainPacks = [];
27
- /**
28
- * Maps domain packs to anchors
29
- */
30
- domainPackToAnchor = new Map();
31
- /**
32
- * Creates a new anchor context from a set of anchor column specifications
33
- * @param anchors Record of anchor column specifications indexed by anchor ID
34
- */
35
- constructor(anchors) {
36
- this.anchors = anchors;
37
- const anchorEntries = Object.entries(anchors);
38
- anchorEntries.sort((a, b) => a[0].localeCompare(b[0]));
39
- for (const [anchorId, spec] of anchorEntries) {
40
- for (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {
41
- const axis = spec.axesSpec[axisIdx];
42
- const key = axisKey(axis);
43
- this.axes.set(key, { anchor: anchorId, idx: axisIdx });
44
- }
45
- if (spec.domain !== undefined) {
46
- const domainEntries = Object.entries(spec.domain);
47
- domainEntries.sort((a, b) => a[0].localeCompare(b[0]));
48
- this.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);
49
- this.domainPacks.push(domainEntries.map(([dKey]) => dKey));
50
- for (const [dKey, dValue] of domainEntries) {
51
- const key = domainKey(dKey, dValue);
52
- this.domains.set(key, anchorId);
53
- }
54
- }
55
- }
56
- }
57
- /**
58
- * Implementation of derive method
59
- */
60
- derive(spec, axisFilters) {
61
- const result = {
62
- name: spec.name,
63
- axes: [],
64
- };
65
- let skipDomains = undefined;
66
- if (spec.domain !== undefined) {
67
- outer: for (const domainPack of this.domainPacks) {
68
- const dAnchor = [];
69
- for (const domainKey of domainPack) {
70
- const dValue = spec.domain[domainKey];
71
- if (dValue !== undefined)
72
- dAnchor.push([domainKey, dValue]);
73
- else
74
- break outer;
75
- }
76
- const domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));
77
- if (domainAnchor !== undefined) {
78
- result.domainAnchor = domainAnchor;
79
- skipDomains = new Set(domainPack);
80
- break;
81
- }
82
- }
83
- }
84
- for (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {
85
- if (skipDomains !== undefined && skipDomains.has(dKey))
86
- continue;
87
- const key = domainKey(dKey, dValue);
88
- const anchorId = this.domains.get(key);
89
- result.domain ??= {};
90
- result.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;
91
- }
92
- result.axes = spec.axesSpec.map((axis) => {
93
- const key = axisKey(axis);
94
- const anchorAxisRef = this.axes.get(key);
95
- if (anchorAxisRef === undefined)
96
- return getAxisId(axis);
97
- else
98
- return anchorAxisRef;
99
- });
100
- // If no axis filters are provided, return the anchored ID as is
101
- if (!axisFilters || axisFilters.length === 0) {
102
- return result;
103
- }
104
- // Process axis filters and create a sliced column ID
105
- const resolvedFilters = [];
106
- for (const filter of axisFilters) {
107
- const [axisIdOrIndex, value] = filter;
108
- // If it's already a numeric index, validate it
109
- if (typeof axisIdOrIndex === "number") {
110
- if (axisIdOrIndex < 0 || axisIdOrIndex >= spec.axesSpec.length) {
111
- throw new Error(`Axis index ${axisIdOrIndex} is out of bounds (0-${spec.axesSpec.length - 1})`);
112
- }
113
- resolvedFilters.push([axisIdOrIndex, value]);
114
- }
115
- else {
116
- // If it's a string (axis name), resolve it to an index
117
- const axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);
118
- if (axisIndex === -1) {
119
- throw new Error(`Axis with name "${axisIdOrIndex}" not found in the column specification`);
120
- }
121
- resolvedFilters.push([axisIndex, value]);
122
- }
123
- }
124
- // Sort filters by axis index to ensure consistency
125
- resolvedFilters.sort((a, b) => a[0] - b[0]);
126
- return {
127
- source: result,
128
- axisFilters: resolvedFilters,
129
- };
130
- }
131
- /**
132
- * Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column
133
- * @param spec Column specification to anchor
134
- * @param axisFilters Optional axis filters to apply to the column
135
- * @returns A canonicalized string representation of the anchored column identifier
136
- */
137
- deriveS(spec, axisFilters) {
138
- return stringifyColumnId(this.derive(spec, axisFilters));
139
- }
140
- }
13
+ * Context for resolving and generating anchored references to columns and axes
14
+ * Maintains maps of known domain values and axes that can be referenced by anchors
15
+ */
16
+ var AnchoredIdDeriver = class {
17
+ domains = /* @__PURE__ */ new Map();
18
+ axes = /* @__PURE__ */ new Map();
19
+ /**
20
+ * Domain packs are used to group domain keys that can be anchored to the same anchor
21
+ * This is used to optimize the lookup of domain anchors
22
+ */
23
+ domainPacks = [];
24
+ /**
25
+ * Maps domain packs to anchors
26
+ */
27
+ domainPackToAnchor = /* @__PURE__ */ new Map();
28
+ /**
29
+ * Creates a new anchor context from a set of anchor column specifications
30
+ * @param anchors Record of anchor column specifications indexed by anchor ID
31
+ */
32
+ constructor(anchors) {
33
+ this.anchors = anchors;
34
+ const anchorEntries = Object.entries(anchors);
35
+ anchorEntries.sort((a, b) => a[0].localeCompare(b[0]));
36
+ for (const [anchorId, spec] of anchorEntries) {
37
+ for (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {
38
+ const axis = spec.axesSpec[axisIdx];
39
+ const key = axisKey(axis);
40
+ this.axes.set(key, {
41
+ anchor: anchorId,
42
+ idx: axisIdx
43
+ });
44
+ }
45
+ if (spec.domain !== void 0) {
46
+ const domainEntries = Object.entries(spec.domain);
47
+ domainEntries.sort((a, b) => a[0].localeCompare(b[0]));
48
+ this.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);
49
+ this.domainPacks.push(domainEntries.map(([dKey]) => dKey));
50
+ for (const [dKey, dValue] of domainEntries) {
51
+ const key = domainKey(dKey, dValue);
52
+ this.domains.set(key, anchorId);
53
+ }
54
+ }
55
+ }
56
+ }
57
+ /**
58
+ * Implementation of derive method
59
+ */
60
+ derive(spec, axisFilters) {
61
+ const result = {
62
+ name: spec.name,
63
+ axes: []
64
+ };
65
+ let skipDomains = void 0;
66
+ if (spec.domain !== void 0) outer: for (const domainPack of this.domainPacks) {
67
+ const dAnchor = [];
68
+ for (const domainKey of domainPack) {
69
+ const dValue = spec.domain[domainKey];
70
+ if (dValue !== void 0) dAnchor.push([domainKey, dValue]);
71
+ else break outer;
72
+ }
73
+ const domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));
74
+ if (domainAnchor !== void 0) {
75
+ result.domainAnchor = domainAnchor;
76
+ skipDomains = new Set(domainPack);
77
+ break;
78
+ }
79
+ }
80
+ for (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {
81
+ if (skipDomains !== void 0 && skipDomains.has(dKey)) continue;
82
+ const key = domainKey(dKey, dValue);
83
+ const anchorId = this.domains.get(key);
84
+ result.domain ??= {};
85
+ result.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;
86
+ }
87
+ result.axes = spec.axesSpec.map((axis) => {
88
+ const key = axisKey(axis);
89
+ const anchorAxisRef = this.axes.get(key);
90
+ if (anchorAxisRef === void 0) return getAxisId(axis);
91
+ else return anchorAxisRef;
92
+ });
93
+ if (!axisFilters || axisFilters.length === 0) return result;
94
+ const resolvedFilters = [];
95
+ for (const filter of axisFilters) {
96
+ const [axisIdOrIndex, value] = filter;
97
+ if (typeof axisIdOrIndex === "number") {
98
+ if (axisIdOrIndex < 0 || axisIdOrIndex >= spec.axesSpec.length) throw new Error(`Axis index ${axisIdOrIndex} is out of bounds (0-${spec.axesSpec.length - 1})`);
99
+ resolvedFilters.push([axisIdOrIndex, value]);
100
+ } else {
101
+ const axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);
102
+ if (axisIndex === -1) throw new Error(`Axis with name "${axisIdOrIndex}" not found in the column specification`);
103
+ resolvedFilters.push([axisIndex, value]);
104
+ }
105
+ }
106
+ resolvedFilters.sort((a, b) => a[0] - b[0]);
107
+ return {
108
+ source: result,
109
+ axisFilters: resolvedFilters
110
+ };
111
+ }
112
+ /**
113
+ * Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column
114
+ * @param spec Column specification to anchor
115
+ * @param axisFilters Optional axis filters to apply to the column
116
+ * @returns A canonicalized string representation of the anchored column identifier
117
+ */
118
+ deriveS(spec, axisFilters) {
119
+ return stringifyColumnId(this.derive(spec, axisFilters));
120
+ }
121
+ };
141
122
  /**
142
- * Resolves anchored references in a column matcher to create a non-anchored matcher.
143
- * Doing an opposite operation to {@link AnchorIdDeriver.derive()}.
144
- *
145
- * @param anchors - Record of anchor column specifications indexed by anchor id
146
- * @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved
147
- * @param options - Options for resolving anchors
148
- * @returns A non-anchored column matcher with all references resolved to actual values
149
- */
123
+ * Resolves anchored references in a column matcher to create a non-anchored matcher.
124
+ * Doing an opposite operation to {@link AnchorIdDeriver.derive()}.
125
+ *
126
+ * @param anchors - Record of anchor column specifications indexed by anchor id
127
+ * @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved
128
+ * @param options - Options for resolving anchors
129
+ * @returns A non-anchored column matcher with all references resolved to actual values
130
+ */
150
131
  function resolveAnchors(anchors, matcher, options) {
151
- const result = { ...matcher };
152
- const ignoreMissingDomains = options?.ignoreMissingDomains ?? false;
153
- if (result.domainAnchor !== undefined) {
154
- const anchorSpec = anchors[result.domainAnchor];
155
- if (!anchorSpec)
156
- throw new Error(`Anchor "${result.domainAnchor}" not found`);
157
- const anchorDomains = anchorSpec.domain || {};
158
- result.domain = { ...anchorDomains, ...result.domain };
159
- delete result.domainAnchor;
160
- }
161
- if (result.domain) {
162
- const resolvedDomain = {};
163
- for (const [key, value] of Object.entries(result.domain)) {
164
- if (typeof value === "string") {
165
- resolvedDomain[key] = value;
166
- }
167
- else {
168
- // It's an AnchorDomainRef
169
- const anchorSpec = anchors[value.anchor];
170
- if (!anchorSpec)
171
- throw new Error(`Anchor "${value.anchor}" not found for domain key "${key}"`);
172
- if (!anchorSpec.domain || anchorSpec.domain[key] === undefined) {
173
- if (!ignoreMissingDomains)
174
- throw new Error(`Domain key "${key}" not found in anchor "${value.anchor}"`);
175
- continue;
176
- }
177
- resolvedDomain[key] = anchorSpec.domain[key];
178
- }
179
- }
180
- result.domain = resolvedDomain;
181
- }
182
- if (result.axes)
183
- result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));
184
- return result;
132
+ const result = { ...matcher };
133
+ const ignoreMissingDomains = options?.ignoreMissingDomains ?? false;
134
+ if (result.domainAnchor !== void 0) {
135
+ const anchorSpec = anchors[result.domainAnchor];
136
+ if (!anchorSpec) throw new Error(`Anchor "${result.domainAnchor}" not found`);
137
+ result.domain = {
138
+ ...anchorSpec.domain || {},
139
+ ...result.domain
140
+ };
141
+ delete result.domainAnchor;
142
+ }
143
+ if (result.domain) {
144
+ const resolvedDomain = {};
145
+ for (const [key, value] of Object.entries(result.domain)) if (typeof value === "string") resolvedDomain[key] = value;
146
+ else {
147
+ const anchorSpec = anchors[value.anchor];
148
+ if (!anchorSpec) throw new Error(`Anchor "${value.anchor}" not found for domain key "${key}"`);
149
+ if (!anchorSpec.domain || anchorSpec.domain[key] === void 0) {
150
+ if (!ignoreMissingDomains) throw new Error(`Domain key "${key}" not found in anchor "${value.anchor}"`);
151
+ continue;
152
+ }
153
+ resolvedDomain[key] = anchorSpec.domain[key];
154
+ }
155
+ result.domain = resolvedDomain;
156
+ }
157
+ if (result.axes) result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));
158
+ return result;
185
159
  }
186
160
  /**
187
- * Resolves an anchored axis reference to a concrete AxisId
188
- */
161
+ * Resolves an anchored axis reference to a concrete AxisId
162
+ */
189
163
  function resolveAxisReference(anchors, axisRef) {
190
- if (!isAnchorAxisRef(axisRef))
191
- return axisRef;
192
- // It's an anchored reference
193
- const anchorId = axisRef.anchor;
194
- const anchorSpec = anchors[anchorId];
195
- if (!anchorSpec)
196
- throw new Error(`Anchor "${anchorId}" not found for axis reference`);
197
- if ("idx" in axisRef) {
198
- // AnchorAxisRefByIdx
199
- if (axisRef.idx < 0 || axisRef.idx >= anchorSpec.axesSpec.length)
200
- throw new Error(`Axis index ${axisRef.idx} out of bounds for anchor "${anchorId}"`);
201
- return anchorSpec.axesSpec[axisRef.idx];
202
- }
203
- else if ("name" in axisRef) {
204
- // AnchorAxisRefByName
205
- const matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);
206
- if (matches.length > 1)
207
- throw new Error(`Multiple axes with name "${axisRef.name}" found in anchor "${anchorId}"`);
208
- if (matches.length === 0)
209
- throw new Error(`Axis with name "${axisRef.name}" not found in anchor "${anchorId}"`);
210
- return matches[0];
211
- }
212
- else if ("id" in axisRef) {
213
- // AnchorAxisRefByMatcher
214
- const matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));
215
- if (matches.length > 1)
216
- throw new Error(`Multiple matching axes found for matcher in anchor "${anchorId}"`);
217
- if (matches.length === 0)
218
- throw new Error(`No matching axis found for matcher in anchor "${anchorId}"`);
219
- return matches[0];
220
- }
221
- throw new Error(`Unsupported axis reference type`);
164
+ if (!isAnchorAxisRef(axisRef)) return axisRef;
165
+ const anchorId = axisRef.anchor;
166
+ const anchorSpec = anchors[anchorId];
167
+ if (!anchorSpec) throw new Error(`Anchor "${anchorId}" not found for axis reference`);
168
+ if ("idx" in axisRef) {
169
+ if (axisRef.idx < 0 || axisRef.idx >= anchorSpec.axesSpec.length) throw new Error(`Axis index ${axisRef.idx} out of bounds for anchor "${anchorId}"`);
170
+ return anchorSpec.axesSpec[axisRef.idx];
171
+ } else if ("name" in axisRef) {
172
+ const matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);
173
+ if (matches.length > 1) throw new Error(`Multiple axes with name "${axisRef.name}" found in anchor "${anchorId}"`);
174
+ if (matches.length === 0) throw new Error(`Axis with name "${axisRef.name}" not found in anchor "${anchorId}"`);
175
+ return matches[0];
176
+ } else if ("id" in axisRef) {
177
+ const matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));
178
+ if (matches.length > 1) throw new Error(`Multiple matching axes found for matcher in anchor "${anchorId}"`);
179
+ if (matches.length === 0) throw new Error(`No matching axis found for matcher in anchor "${anchorId}"`);
180
+ return matches[0];
181
+ }
182
+ throw new Error(`Unsupported axis reference type`);
222
183
  }
223
184
  /**
224
- * Type guard to check if a value is an anchored axis reference
225
- */
185
+ * Type guard to check if a value is an anchored axis reference
186
+ */
226
187
  function isAnchorAxisRef(value) {
227
- return typeof value === "object" && "anchor" in value;
188
+ return typeof value === "object" && "anchor" in value;
228
189
  }
229
190
 
191
+ //#endregion
230
192
  export { AnchoredIdDeriver, resolveAnchors };
231
- //# sourceMappingURL=anchored.js.map
193
+ //# sourceMappingURL=anchored.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anchored.js","sources":["../../../../src/drivers/pframe/spec/anchored.ts"],"sourcesContent":["import canonicalize from \"canonicalize\";\nimport type { AxisFilter, AxisFilterValue } from \"./filtered_column\";\nimport type { SUniversalPColumnId, UniversalPColumnId } from \"./ids\";\nimport { stringifyColumnId } from \"./ids\";\nimport type {\n AAxisSelector,\n AnchorAxisRef,\n AnchorAxisRefByIdx,\n AnchoredPColumnId,\n AnchoredPColumnSelector,\n AxisSelector,\n PColumnSelector,\n} from \"./selectors\";\nimport type { AxisId, PColumnSpec } from \"./spec\";\nimport { getAxisId, matchAxisId } from \"./spec\";\n\n//\n// Helper functions\n//\n\nfunction axisKey(axis: AxisId): string {\n return canonicalize(getAxisId(axis))!;\n}\n\nfunction domainKey(key: string, value: string): string {\n return JSON.stringify([key, value]);\n}\n\n/**\n * Context for resolving and generating anchored references to columns and axes\n * Maintains maps of known domain values and axes that can be referenced by anchors\n */\nexport class AnchoredIdDeriver {\n private readonly domains = new Map<string, string>();\n private readonly axes = new Map<string, AnchorAxisRefByIdx>();\n /**\n * Domain packs are used to group domain keys that can be anchored to the same anchor\n * This is used to optimize the lookup of domain anchors\n */\n private readonly domainPacks: string[][] = [];\n /**\n * Maps domain packs to anchors\n */\n private readonly domainPackToAnchor = new Map<string, string>();\n\n /**\n * Creates a new anchor context from a set of anchor column specifications\n * @param anchors Record of anchor column specifications indexed by anchor ID\n */\n constructor(public readonly anchors: Record<string, PColumnSpec>) {\n const anchorEntries = Object.entries(anchors);\n anchorEntries.sort((a, b) => a[0].localeCompare(b[0]));\n for (const [anchorId, spec] of anchorEntries) {\n for (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {\n const axis = spec.axesSpec[axisIdx];\n const key = axisKey(axis);\n this.axes.set(key, { anchor: anchorId, idx: axisIdx });\n }\n if (spec.domain !== undefined) {\n const domainEntries = Object.entries(spec.domain);\n domainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\n this.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);\n this.domainPacks.push(domainEntries.map(([dKey]) => dKey));\n\n for (const [dKey, dValue] of domainEntries) {\n const key = domainKey(dKey, dValue);\n this.domains.set(key, anchorId);\n }\n }\n }\n }\n\n /**\n * Derives an anchored column identifier from a column specification\n * @param spec Column specification to anchor\n * @returns An anchored column identifier that can be used to identify columns similar to the input specification\n */\n derive(spec: PColumnSpec): AnchoredPColumnId;\n\n /**\n * Derives an anchored column identifier from a column specification\n * @param spec Column specification to anchor\n * @param axisFilters Axis filters to apply to the column\n * @returns An anchored and sliced column identifier that can be used to identify columns similar to the input specification\n */\n derive(spec: PColumnSpec, axisFilters?: AxisFilter[]): UniversalPColumnId;\n\n /**\n * Implementation of derive method\n */\n derive(spec: PColumnSpec, axisFilters?: AxisFilter[]): UniversalPColumnId {\n const result: AnchoredPColumnId = {\n name: spec.name,\n axes: [],\n };\n\n let skipDomains: Set<string> | undefined = undefined;\n if (spec.domain !== undefined) {\n outer: for (const domainPack of this.domainPacks) {\n const dAnchor: string[][] = [];\n for (const domainKey of domainPack) {\n const dValue = spec.domain[domainKey];\n if (dValue !== undefined) dAnchor.push([domainKey, dValue]);\n else break outer;\n }\n const domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));\n if (domainAnchor !== undefined) {\n result.domainAnchor = domainAnchor;\n skipDomains = new Set(domainPack);\n break;\n }\n }\n }\n\n for (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {\n if (skipDomains !== undefined && skipDomains.has(dKey)) continue;\n const key = domainKey(dKey, dValue);\n const anchorId = this.domains.get(key);\n result.domain ??= {};\n result.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n }\n\n result.axes = spec.axesSpec.map((axis) => {\n const key = axisKey(axis);\n const anchorAxisRef = this.axes.get(key);\n if (anchorAxisRef === undefined) return getAxisId(axis);\n else return anchorAxisRef;\n });\n\n // If no axis filters are provided, return the anchored ID as is\n if (!axisFilters || axisFilters.length === 0) {\n return result;\n }\n\n // Process axis filters and create a sliced column ID\n const resolvedFilters: [number, AxisFilterValue][] = [];\n\n for (const filter of axisFilters) {\n const [axisIdOrIndex, value] = filter;\n\n // If it's already a numeric index, validate it\n if (typeof axisIdOrIndex === \"number\") {\n if (axisIdOrIndex < 0 || axisIdOrIndex >= spec.axesSpec.length) {\n throw new Error(\n `Axis index ${axisIdOrIndex} is out of bounds (0-${spec.axesSpec.length - 1})`,\n );\n }\n resolvedFilters.push([axisIdOrIndex, value]);\n } else {\n // If it's a string (axis name), resolve it to an index\n const axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);\n if (axisIndex === -1) {\n throw new Error(\n `Axis with name \"${axisIdOrIndex}\" not found in the column specification`,\n );\n }\n resolvedFilters.push([axisIndex, value]);\n }\n }\n\n // Sort filters by axis index to ensure consistency\n resolvedFilters.sort((a, b) => a[0] - b[0]);\n\n return {\n source: result,\n axisFilters: resolvedFilters,\n };\n }\n\n /**\n * Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column\n * @param spec Column specification to anchor\n * @param axisFilters Optional axis filters to apply to the column\n * @returns A canonicalized string representation of the anchored column identifier\n */\n deriveS(spec: PColumnSpec, axisFilters?: AxisFilter[]): SUniversalPColumnId {\n return stringifyColumnId(this.derive(spec, axisFilters));\n }\n}\n\n/**\n * Options for the resolveAnchors function\n */\nexport type ResolveAnchorsOptions = {\n /**\n * If true, missing domain keys in anchors will be ignored.\n * If false (default), an error will be thrown.\n */\n ignoreMissingDomains?: boolean;\n};\n\n/**\n * Resolves anchored references in a column matcher to create a non-anchored matcher.\n * Doing an opposite operation to {@link AnchorIdDeriver.derive()}.\n *\n * @param anchors - Record of anchor column specifications indexed by anchor id\n * @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved\n * @param options - Options for resolving anchors\n * @returns A non-anchored column matcher with all references resolved to actual values\n */\nexport function resolveAnchors(\n anchors: Record<string, PColumnSpec>,\n matcher: AnchoredPColumnSelector,\n options?: ResolveAnchorsOptions,\n): PColumnSelector {\n const result = { ...matcher };\n const ignoreMissingDomains = options?.ignoreMissingDomains ?? false;\n\n if (result.domainAnchor !== undefined) {\n const anchorSpec = anchors[result.domainAnchor];\n if (!anchorSpec) throw new Error(`Anchor \"${result.domainAnchor}\" not found`);\n\n const anchorDomains = anchorSpec.domain || {};\n result.domain = { ...anchorDomains, ...result.domain };\n delete result.domainAnchor;\n }\n\n if (result.domain) {\n const resolvedDomain: Record<string, string> = {};\n for (const [key, value] of Object.entries(result.domain)) {\n if (typeof value === \"string\") {\n resolvedDomain[key] = value;\n } else {\n // It's an AnchorDomainRef\n const anchorSpec = anchors[value.anchor];\n if (!anchorSpec)\n throw new Error(`Anchor \"${value.anchor}\" not found for domain key \"${key}\"`);\n\n if (!anchorSpec.domain || anchorSpec.domain[key] === undefined) {\n if (!ignoreMissingDomains)\n throw new Error(`Domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n continue;\n }\n\n resolvedDomain[key] = anchorSpec.domain[key];\n }\n }\n result.domain = resolvedDomain;\n }\n\n if (result.axes) result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));\n\n return result as PColumnSelector;\n}\n\n/**\n * Resolves an anchored axis reference to a concrete AxisId\n */\nfunction resolveAxisReference(\n anchors: Record<string, PColumnSpec>,\n axisRef: AAxisSelector,\n): AxisSelector {\n if (!isAnchorAxisRef(axisRef)) return axisRef;\n\n // It's an anchored reference\n const anchorId = axisRef.anchor;\n const anchorSpec = anchors[anchorId];\n if (!anchorSpec) throw new Error(`Anchor \"${anchorId}\" not found for axis reference`);\n\n if (\"idx\" in axisRef) {\n // AnchorAxisRefByIdx\n if (axisRef.idx < 0 || axisRef.idx >= anchorSpec.axesSpec.length)\n throw new Error(`Axis index ${axisRef.idx} out of bounds for anchor \"${anchorId}\"`);\n return anchorSpec.axesSpec[axisRef.idx];\n } else if (\"name\" in axisRef) {\n // AnchorAxisRefByName\n const matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);\n if (matches.length > 1)\n throw new Error(`Multiple axes with name \"${axisRef.name}\" found in anchor \"${anchorId}\"`);\n if (matches.length === 0)\n throw new Error(`Axis with name \"${axisRef.name}\" not found in anchor \"${anchorId}\"`);\n return matches[0];\n } else if (\"id\" in axisRef) {\n // AnchorAxisRefByMatcher\n const matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));\n if (matches.length > 1)\n throw new Error(`Multiple matching axes found for matcher in anchor \"${anchorId}\"`);\n if (matches.length === 0)\n throw new Error(`No matching axis found for matcher in anchor \"${anchorId}\"`);\n return matches[0];\n }\n\n throw new Error(`Unsupported axis reference type`);\n}\n\n/**\n * Type guard to check if a value is an anchored axis reference\n */\nfunction isAnchorAxisRef(value: AAxisSelector): value is AnchorAxisRef {\n return typeof value === \"object\" && \"anchor\" in value;\n}\n"],"names":[],"mappings":";;;;AAgBA;AACA;AACA;AAEA,SAAS,OAAO,CAAC,IAAY,EAAA;AAC3B,IAAA,OAAO,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,CAAE;AACvC;AAEA,SAAS,SAAS,CAAC,GAAW,EAAE,KAAa,EAAA;IAC3C,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACrC;AAEA;;;AAGG;MACU,iBAAiB,CAAA;AAiBA,IAAA,OAAA;AAhBX,IAAA,OAAO,GAAG,IAAI,GAAG,EAAkB;AACnC,IAAA,IAAI,G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YACtB,MAAM,IAAI,KAAK,CAAC,CAAA,gBAAA,EAAmB,OAAO,CAAC,IAAI,CAAA,uBAAA,EAA0B,QAAQ,CAAA,CAAA,CAAG,CAAC;AACvF,QAAA,OAAO,OAAO,CAAC,CAAC,CAAC;IACnB;AAAO,SAAA,IAAI,IAAI,IAAI,OAAO,EAAE;;QAE1B,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9F,QAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;AACpB,YAAA,MAAM,IAAI,KAAK,CAAC,uDAAuD,QAAQ,CAAA,CAAA,CAAG,CAAC;AACrF,QAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AACtB,YAAA,MAAM,IAAI,KAAK,CAAC,iDAAiD,QAAQ,CAAA,CAAA,CAAG,CAAC;AAC/E,QAAA,OAAO,OAAO,CAAC,CAAC,CAAC;IACnB;AAEA,IAAA,MAAM,IAAI,KAAK,CAAC,CAAA,+BAAA,CAAiC,CAAC;AACpD;AAEA;;AAEG;AACH,SAAS,eAAe,CAAC,KAAoB,EAAA;IAC3C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,IAAI,KAAK;AACvD;;;;"}
1
+ {"version":3,"file":"anchored.js","names":[],"sources":["../../../../src/drivers/pframe/spec/anchored.ts"],"sourcesContent":["import canonicalize from \"canonicalize\";\nimport type { AxisFilter, AxisFilterValue } from \"./filtered_column\";\nimport type { SUniversalPColumnId, UniversalPColumnId } from \"./ids\";\nimport { stringifyColumnId } from \"./ids\";\nimport type {\n AAxisSelector,\n AnchorAxisRef,\n AnchorAxisRefByIdx,\n AnchoredPColumnId,\n AnchoredPColumnSelector,\n AxisSelector,\n PColumnSelector,\n} from \"./selectors\";\nimport type { AxisId, PColumnSpec } from \"./spec\";\nimport { getAxisId, matchAxisId } from \"./spec\";\n\n//\n// Helper functions\n//\n\nfunction axisKey(axis: AxisId): string {\n return canonicalize(getAxisId(axis))!;\n}\n\nfunction domainKey(key: string, value: string): string {\n return JSON.stringify([key, value]);\n}\n\n/**\n * Context for resolving and generating anchored references to columns and axes\n * Maintains maps of known domain values and axes that can be referenced by anchors\n */\nexport class AnchoredIdDeriver {\n private readonly domains = new Map<string, string>();\n private readonly axes = new Map<string, AnchorAxisRefByIdx>();\n /**\n * Domain packs are used to group domain keys that can be anchored to the same anchor\n * This is used to optimize the lookup of domain anchors\n */\n private readonly domainPacks: string[][] = [];\n /**\n * Maps domain packs to anchors\n */\n private readonly domainPackToAnchor = new Map<string, string>();\n\n /**\n * Creates a new anchor context from a set of anchor column specifications\n * @param anchors Record of anchor column specifications indexed by anchor ID\n */\n constructor(public readonly anchors: Record<string, PColumnSpec>) {\n const anchorEntries = Object.entries(anchors);\n anchorEntries.sort((a, b) => a[0].localeCompare(b[0]));\n for (const [anchorId, spec] of anchorEntries) {\n for (let axisIdx = 0; axisIdx < spec.axesSpec.length; axisIdx++) {\n const axis = spec.axesSpec[axisIdx];\n const key = axisKey(axis);\n this.axes.set(key, { anchor: anchorId, idx: axisIdx });\n }\n if (spec.domain !== undefined) {\n const domainEntries = Object.entries(spec.domain);\n domainEntries.sort((a, b) => a[0].localeCompare(b[0]));\n\n this.domainPackToAnchor.set(JSON.stringify(domainEntries), anchorId);\n this.domainPacks.push(domainEntries.map(([dKey]) => dKey));\n\n for (const [dKey, dValue] of domainEntries) {\n const key = domainKey(dKey, dValue);\n this.domains.set(key, anchorId);\n }\n }\n }\n }\n\n /**\n * Derives an anchored column identifier from a column specification\n * @param spec Column specification to anchor\n * @returns An anchored column identifier that can be used to identify columns similar to the input specification\n */\n derive(spec: PColumnSpec): AnchoredPColumnId;\n\n /**\n * Derives an anchored column identifier from a column specification\n * @param spec Column specification to anchor\n * @param axisFilters Axis filters to apply to the column\n * @returns An anchored and sliced column identifier that can be used to identify columns similar to the input specification\n */\n derive(spec: PColumnSpec, axisFilters?: AxisFilter[]): UniversalPColumnId;\n\n /**\n * Implementation of derive method\n */\n derive(spec: PColumnSpec, axisFilters?: AxisFilter[]): UniversalPColumnId {\n const result: AnchoredPColumnId = {\n name: spec.name,\n axes: [],\n };\n\n let skipDomains: Set<string> | undefined = undefined;\n if (spec.domain !== undefined) {\n outer: for (const domainPack of this.domainPacks) {\n const dAnchor: string[][] = [];\n for (const domainKey of domainPack) {\n const dValue = spec.domain[domainKey];\n if (dValue !== undefined) dAnchor.push([domainKey, dValue]);\n else break outer;\n }\n const domainAnchor = this.domainPackToAnchor.get(JSON.stringify(dAnchor));\n if (domainAnchor !== undefined) {\n result.domainAnchor = domainAnchor;\n skipDomains = new Set(domainPack);\n break;\n }\n }\n }\n\n for (const [dKey, dValue] of Object.entries(spec.domain ?? {})) {\n if (skipDomains !== undefined && skipDomains.has(dKey)) continue;\n const key = domainKey(dKey, dValue);\n const anchorId = this.domains.get(key);\n result.domain ??= {};\n result.domain[dKey] = anchorId ? { anchor: anchorId } : dValue;\n }\n\n result.axes = spec.axesSpec.map((axis) => {\n const key = axisKey(axis);\n const anchorAxisRef = this.axes.get(key);\n if (anchorAxisRef === undefined) return getAxisId(axis);\n else return anchorAxisRef;\n });\n\n // If no axis filters are provided, return the anchored ID as is\n if (!axisFilters || axisFilters.length === 0) {\n return result;\n }\n\n // Process axis filters and create a sliced column ID\n const resolvedFilters: [number, AxisFilterValue][] = [];\n\n for (const filter of axisFilters) {\n const [axisIdOrIndex, value] = filter;\n\n // If it's already a numeric index, validate it\n if (typeof axisIdOrIndex === \"number\") {\n if (axisIdOrIndex < 0 || axisIdOrIndex >= spec.axesSpec.length) {\n throw new Error(\n `Axis index ${axisIdOrIndex} is out of bounds (0-${spec.axesSpec.length - 1})`,\n );\n }\n resolvedFilters.push([axisIdOrIndex, value]);\n } else {\n // If it's a string (axis name), resolve it to an index\n const axisIndex = spec.axesSpec.findIndex((axis) => axis.name === axisIdOrIndex);\n if (axisIndex === -1) {\n throw new Error(\n `Axis with name \"${axisIdOrIndex}\" not found in the column specification`,\n );\n }\n resolvedFilters.push([axisIndex, value]);\n }\n }\n\n // Sort filters by axis index to ensure consistency\n resolvedFilters.sort((a, b) => a[0] - b[0]);\n\n return {\n source: result,\n axisFilters: resolvedFilters,\n };\n }\n\n /**\n * Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column\n * @param spec Column specification to anchor\n * @param axisFilters Optional axis filters to apply to the column\n * @returns A canonicalized string representation of the anchored column identifier\n */\n deriveS(spec: PColumnSpec, axisFilters?: AxisFilter[]): SUniversalPColumnId {\n return stringifyColumnId(this.derive(spec, axisFilters));\n }\n}\n\n/**\n * Options for the resolveAnchors function\n */\nexport type ResolveAnchorsOptions = {\n /**\n * If true, missing domain keys in anchors will be ignored.\n * If false (default), an error will be thrown.\n */\n ignoreMissingDomains?: boolean;\n};\n\n/**\n * Resolves anchored references in a column matcher to create a non-anchored matcher.\n * Doing an opposite operation to {@link AnchorIdDeriver.derive()}.\n *\n * @param anchors - Record of anchor column specifications indexed by anchor id\n * @param matcher - An anchored column matcher (or id, which is subtype of it) containing references that need to be resolved\n * @param options - Options for resolving anchors\n * @returns A non-anchored column matcher with all references resolved to actual values\n */\nexport function resolveAnchors(\n anchors: Record<string, PColumnSpec>,\n matcher: AnchoredPColumnSelector,\n options?: ResolveAnchorsOptions,\n): PColumnSelector {\n const result = { ...matcher };\n const ignoreMissingDomains = options?.ignoreMissingDomains ?? false;\n\n if (result.domainAnchor !== undefined) {\n const anchorSpec = anchors[result.domainAnchor];\n if (!anchorSpec) throw new Error(`Anchor \"${result.domainAnchor}\" not found`);\n\n const anchorDomains = anchorSpec.domain || {};\n result.domain = { ...anchorDomains, ...result.domain };\n delete result.domainAnchor;\n }\n\n if (result.domain) {\n const resolvedDomain: Record<string, string> = {};\n for (const [key, value] of Object.entries(result.domain)) {\n if (typeof value === \"string\") {\n resolvedDomain[key] = value;\n } else {\n // It's an AnchorDomainRef\n const anchorSpec = anchors[value.anchor];\n if (!anchorSpec)\n throw new Error(`Anchor \"${value.anchor}\" not found for domain key \"${key}\"`);\n\n if (!anchorSpec.domain || anchorSpec.domain[key] === undefined) {\n if (!ignoreMissingDomains)\n throw new Error(`Domain key \"${key}\" not found in anchor \"${value.anchor}\"`);\n continue;\n }\n\n resolvedDomain[key] = anchorSpec.domain[key];\n }\n }\n result.domain = resolvedDomain;\n }\n\n if (result.axes) result.axes = result.axes.map((axis) => resolveAxisReference(anchors, axis));\n\n return result as PColumnSelector;\n}\n\n/**\n * Resolves an anchored axis reference to a concrete AxisId\n */\nfunction resolveAxisReference(\n anchors: Record<string, PColumnSpec>,\n axisRef: AAxisSelector,\n): AxisSelector {\n if (!isAnchorAxisRef(axisRef)) return axisRef;\n\n // It's an anchored reference\n const anchorId = axisRef.anchor;\n const anchorSpec = anchors[anchorId];\n if (!anchorSpec) throw new Error(`Anchor \"${anchorId}\" not found for axis reference`);\n\n if (\"idx\" in axisRef) {\n // AnchorAxisRefByIdx\n if (axisRef.idx < 0 || axisRef.idx >= anchorSpec.axesSpec.length)\n throw new Error(`Axis index ${axisRef.idx} out of bounds for anchor \"${anchorId}\"`);\n return anchorSpec.axesSpec[axisRef.idx];\n } else if (\"name\" in axisRef) {\n // AnchorAxisRefByName\n const matches = anchorSpec.axesSpec.filter((axis) => axis.name === axisRef.name);\n if (matches.length > 1)\n throw new Error(`Multiple axes with name \"${axisRef.name}\" found in anchor \"${anchorId}\"`);\n if (matches.length === 0)\n throw new Error(`Axis with name \"${axisRef.name}\" not found in anchor \"${anchorId}\"`);\n return matches[0];\n } else if (\"id\" in axisRef) {\n // AnchorAxisRefByMatcher\n const matches = anchorSpec.axesSpec.filter((axis) => matchAxisId(axisRef.id, getAxisId(axis)));\n if (matches.length > 1)\n throw new Error(`Multiple matching axes found for matcher in anchor \"${anchorId}\"`);\n if (matches.length === 0)\n throw new Error(`No matching axis found for matcher in anchor \"${anchorId}\"`);\n return matches[0];\n }\n\n throw new Error(`Unsupported axis reference type`);\n}\n\n/**\n * Type guard to check if a value is an anchored axis reference\n */\nfunction isAnchorAxisRef(value: AAxisSelector): value is AnchorAxisRef {\n return typeof value === \"object\" && \"anchor\" in value;\n}\n"],"mappings":";;;;;AAoBA,SAAS,QAAQ,MAAsB;AACrC,QAAO,aAAa,UAAU,KAAK,CAAC;;AAGtC,SAAS,UAAU,KAAa,OAAuB;AACrD,QAAO,KAAK,UAAU,CAAC,KAAK,MAAM,CAAC;;;;;;AAOrC,IAAa,oBAAb,MAA+B;CAC7B,AAAiB,0BAAU,IAAI,KAAqB;CACpD,AAAiB,uBAAO,IAAI,KAAiC;;;;;CAK7D,AAAiB,cAA0B,EAAE;;;;CAI7C,AAAiB,qCAAqB,IAAI,KAAqB;;;;;CAM/D,YAAY,AAAgB,SAAsC;EAAtC;EAC1B,MAAM,gBAAgB,OAAO,QAAQ,QAAQ;AAC7C,gBAAc,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC;AACtD,OAAK,MAAM,CAAC,UAAU,SAAS,eAAe;AAC5C,QAAK,IAAI,UAAU,GAAG,UAAU,KAAK,SAAS,QAAQ,WAAW;IAC/D,MAAM,OAAO,KAAK,SAAS;IAC3B,MAAM,MAAM,QAAQ,KAAK;AACzB,SAAK,KAAK,IAAI,KAAK;KAAE,QAAQ;KAAU,KAAK;KAAS,CAAC;;AAExD,OAAI,KAAK,WAAW,QAAW;IAC7B,MAAM,gBAAgB,OAAO,QAAQ,KAAK,OAAO;AACjD,kBAAc,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,CAAC;AAEtD,SAAK,mBAAmB,IAAI,KAAK,UAAU,cAAc,EAAE,SAAS;AACpE,SAAK,YAAY,KAAK,cAAc,KAAK,CAAC,UAAU,KAAK,CAAC;AAE1D,SAAK,MAAM,CAAC,MAAM,WAAW,eAAe;KAC1C,MAAM,MAAM,UAAU,MAAM,OAAO;AACnC,UAAK,QAAQ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/spec/filtered_column.ts
3
3
  /**
4
- * Checks if a given value is a FilteredPColumn
5
- * @param id - The value to check
6
- * @returns True if the value is a FilteredPColumn, false otherwise
7
- */
4
+ * Checks if a given value is a FilteredPColumn
5
+ * @param id - The value to check
6
+ * @returns True if the value is a FilteredPColumn, false otherwise
7
+ */
8
8
  function isFilteredPColumn(id) {
9
- return typeof id === "object" && id !== null && "source" in id && "axisFilters" in id;
9
+ return typeof id === "object" && id !== null && "source" in id && "axisFilters" in id;
10
10
  }
11
11
 
12
+ //#endregion
12
13
  exports.isFilteredPColumn = isFilteredPColumn;
13
- //# sourceMappingURL=filtered_column.cjs.map
14
+ //# sourceMappingURL=filtered_column.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"filtered_column.cjs","sources":["../../../../src/drivers/pframe/spec/filtered_column.ts"],"sourcesContent":["import type { AnchoredPColumnId } from \"./selectors\";\n\n/** Value of an axis filter */\nexport type AxisFilterValue = number | string;\n\n/** Axis filter by index */\nexport type AxisFilterByIdx = [number, AxisFilterValue];\n\n/** Axis filter by name */\nexport type AxisFilterByName = [string, AxisFilterValue];\n\n/** Axis filter */\nexport type AxisFilter = AxisFilterByIdx | AxisFilterByName;\n\n/**\n * Identifies a column derived from a CanonicalPColumnId by fixing values on certain axes,\n * thus effectively reducing the dimensionality of the original column.\n */\nexport type FilteredPColumn<CID = AnchoredPColumnId, AFI = AxisFilter> = {\n /** The original column identifier */\n source: CID;\n\n /**\n * List of fixed axes and their corresponding values.\n * Each entry fixes one axis to a specific value, creating a slice of the multidimensional data.\n * This effectively reduces the dimensionality by one for each fixed axis.\n * Ordered by the axis index in canonical case.\n */\n axisFilters: AFI[];\n};\n\nexport type FilteredPColumnId = FilteredPColumn<AnchoredPColumnId, AxisFilterByIdx>;\n\n/**\n * Checks if a given value is a FilteredPColumn\n * @param id - The value to check\n * @returns True if the value is a FilteredPColumn, false otherwise\n */\nexport function isFilteredPColumn(id: unknown): id is FilteredPColumn {\n return typeof id === \"object\" && id !== null && \"source\" in id && \"axisFilters\" in id;\n}\n"],"names":[],"mappings":";;AAiCA;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,EAAW,EAAA;AAC3C,IAAA,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,QAAQ,IAAI,EAAE,IAAI,aAAa,IAAI,EAAE;AACvF;;;;"}
1
+ {"version":3,"file":"filtered_column.cjs","names":[],"sources":["../../../../src/drivers/pframe/spec/filtered_column.ts"],"sourcesContent":["import type { AnchoredPColumnId } from \"./selectors\";\n\n/** Value of an axis filter */\nexport type AxisFilterValue = number | string;\n\n/** Axis filter by index */\nexport type AxisFilterByIdx = [number, AxisFilterValue];\n\n/** Axis filter by name */\nexport type AxisFilterByName = [string, AxisFilterValue];\n\n/** Axis filter */\nexport type AxisFilter = AxisFilterByIdx | AxisFilterByName;\n\n/**\n * Identifies a column derived from a CanonicalPColumnId by fixing values on certain axes,\n * thus effectively reducing the dimensionality of the original column.\n */\nexport type FilteredPColumn<CID = AnchoredPColumnId, AFI = AxisFilter> = {\n /** The original column identifier */\n source: CID;\n\n /**\n * List of fixed axes and their corresponding values.\n * Each entry fixes one axis to a specific value, creating a slice of the multidimensional data.\n * This effectively reduces the dimensionality by one for each fixed axis.\n * Ordered by the axis index in canonical case.\n */\n axisFilters: AFI[];\n};\n\nexport type FilteredPColumnId = FilteredPColumn<AnchoredPColumnId, AxisFilterByIdx>;\n\n/**\n * Checks if a given value is a FilteredPColumn\n * @param id - The value to check\n * @returns True if the value is a FilteredPColumn, false otherwise\n */\nexport function isFilteredPColumn(id: unknown): id is FilteredPColumn {\n return typeof id === \"object\" && id !== null && \"source\" in id && \"axisFilters\" in id;\n}\n"],"mappings":";;;;;;;AAsCA,SAAgB,kBAAkB,IAAoC;AACpE,QAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,YAAY,MAAM,iBAAiB"}
@@ -1,32 +1,35 @@
1
- import type { AnchoredPColumnId } from "./selectors";
1
+ import { AnchoredPColumnId } from "./selectors.js";
2
+
3
+ //#region src/drivers/pframe/spec/filtered_column.d.ts
2
4
  /** Value of an axis filter */
3
- export type AxisFilterValue = number | string;
5
+ type AxisFilterValue = number | string;
4
6
  /** Axis filter by index */
5
- export type AxisFilterByIdx = [number, AxisFilterValue];
7
+ type AxisFilterByIdx = [number, AxisFilterValue];
6
8
  /** Axis filter by name */
7
- export type AxisFilterByName = [string, AxisFilterValue];
9
+ type AxisFilterByName = [string, AxisFilterValue];
8
10
  /** Axis filter */
9
- export type AxisFilter = AxisFilterByIdx | AxisFilterByName;
11
+ type AxisFilter = AxisFilterByIdx | AxisFilterByName;
10
12
  /**
11
13
  * Identifies a column derived from a CanonicalPColumnId by fixing values on certain axes,
12
14
  * thus effectively reducing the dimensionality of the original column.
13
15
  */
14
- export type FilteredPColumn<CID = AnchoredPColumnId, AFI = AxisFilter> = {
15
- /** The original column identifier */
16
- source: CID;
17
- /**
18
- * List of fixed axes and their corresponding values.
19
- * Each entry fixes one axis to a specific value, creating a slice of the multidimensional data.
20
- * This effectively reduces the dimensionality by one for each fixed axis.
21
- * Ordered by the axis index in canonical case.
22
- */
23
- axisFilters: AFI[];
16
+ type FilteredPColumn<CID = AnchoredPColumnId, AFI = AxisFilter> = {
17
+ /** The original column identifier */source: CID;
18
+ /**
19
+ * List of fixed axes and their corresponding values.
20
+ * Each entry fixes one axis to a specific value, creating a slice of the multidimensional data.
21
+ * This effectively reduces the dimensionality by one for each fixed axis.
22
+ * Ordered by the axis index in canonical case.
23
+ */
24
+ axisFilters: AFI[];
24
25
  };
25
- export type FilteredPColumnId = FilteredPColumn<AnchoredPColumnId, AxisFilterByIdx>;
26
+ type FilteredPColumnId = FilteredPColumn<AnchoredPColumnId, AxisFilterByIdx>;
26
27
  /**
27
28
  * Checks if a given value is a FilteredPColumn
28
29
  * @param id - The value to check
29
30
  * @returns True if the value is a FilteredPColumn, false otherwise
30
31
  */
31
- export declare function isFilteredPColumn(id: unknown): id is FilteredPColumn;
32
+ declare function isFilteredPColumn(id: unknown): id is FilteredPColumn;
33
+ //#endregion
34
+ export { AxisFilter, AxisFilterByIdx, AxisFilterByName, AxisFilterValue, FilteredPColumn, FilteredPColumnId, isFilteredPColumn };
32
35
  //# sourceMappingURL=filtered_column.d.ts.map
@@ -1,11 +1,13 @@
1
+ //#region src/drivers/pframe/spec/filtered_column.ts
1
2
  /**
2
- * Checks if a given value is a FilteredPColumn
3
- * @param id - The value to check
4
- * @returns True if the value is a FilteredPColumn, false otherwise
5
- */
3
+ * Checks if a given value is a FilteredPColumn
4
+ * @param id - The value to check
5
+ * @returns True if the value is a FilteredPColumn, false otherwise
6
+ */
6
7
  function isFilteredPColumn(id) {
7
- return typeof id === "object" && id !== null && "source" in id && "axisFilters" in id;
8
+ return typeof id === "object" && id !== null && "source" in id && "axisFilters" in id;
8
9
  }
9
10
 
11
+ //#endregion
10
12
  export { isFilteredPColumn };
11
- //# sourceMappingURL=filtered_column.js.map
13
+ //# sourceMappingURL=filtered_column.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filtered_column.js","sources":["../../../../src/drivers/pframe/spec/filtered_column.ts"],"sourcesContent":["import type { AnchoredPColumnId } from \"./selectors\";\n\n/** Value of an axis filter */\nexport type AxisFilterValue = number | string;\n\n/** Axis filter by index */\nexport type AxisFilterByIdx = [number, AxisFilterValue];\n\n/** Axis filter by name */\nexport type AxisFilterByName = [string, AxisFilterValue];\n\n/** Axis filter */\nexport type AxisFilter = AxisFilterByIdx | AxisFilterByName;\n\n/**\n * Identifies a column derived from a CanonicalPColumnId by fixing values on certain axes,\n * thus effectively reducing the dimensionality of the original column.\n */\nexport type FilteredPColumn<CID = AnchoredPColumnId, AFI = AxisFilter> = {\n /** The original column identifier */\n source: CID;\n\n /**\n * List of fixed axes and their corresponding values.\n * Each entry fixes one axis to a specific value, creating a slice of the multidimensional data.\n * This effectively reduces the dimensionality by one for each fixed axis.\n * Ordered by the axis index in canonical case.\n */\n axisFilters: AFI[];\n};\n\nexport type FilteredPColumnId = FilteredPColumn<AnchoredPColumnId, AxisFilterByIdx>;\n\n/**\n * Checks if a given value is a FilteredPColumn\n * @param id - The value to check\n * @returns True if the value is a FilteredPColumn, false otherwise\n */\nexport function isFilteredPColumn(id: unknown): id is FilteredPColumn {\n return typeof id === \"object\" && id !== null && \"source\" in id && \"axisFilters\" in id;\n}\n"],"names":[],"mappings":"AAiCA;;;;AAIG;AACG,SAAU,iBAAiB,CAAC,EAAW,EAAA;AAC3C,IAAA,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,QAAQ,IAAI,EAAE,IAAI,aAAa,IAAI,EAAE;AACvF;;;;"}
1
+ {"version":3,"file":"filtered_column.js","names":[],"sources":["../../../../src/drivers/pframe/spec/filtered_column.ts"],"sourcesContent":["import type { AnchoredPColumnId } from \"./selectors\";\n\n/** Value of an axis filter */\nexport type AxisFilterValue = number | string;\n\n/** Axis filter by index */\nexport type AxisFilterByIdx = [number, AxisFilterValue];\n\n/** Axis filter by name */\nexport type AxisFilterByName = [string, AxisFilterValue];\n\n/** Axis filter */\nexport type AxisFilter = AxisFilterByIdx | AxisFilterByName;\n\n/**\n * Identifies a column derived from a CanonicalPColumnId by fixing values on certain axes,\n * thus effectively reducing the dimensionality of the original column.\n */\nexport type FilteredPColumn<CID = AnchoredPColumnId, AFI = AxisFilter> = {\n /** The original column identifier */\n source: CID;\n\n /**\n * List of fixed axes and their corresponding values.\n * Each entry fixes one axis to a specific value, creating a slice of the multidimensional data.\n * This effectively reduces the dimensionality by one for each fixed axis.\n * Ordered by the axis index in canonical case.\n */\n axisFilters: AFI[];\n};\n\nexport type FilteredPColumnId = FilteredPColumn<AnchoredPColumnId, AxisFilterByIdx>;\n\n/**\n * Checks if a given value is a FilteredPColumn\n * @param id - The value to check\n * @returns True if the value is a FilteredPColumn, false otherwise\n */\nexport function isFilteredPColumn(id: unknown): id is FilteredPColumn {\n return typeof id === \"object\" && id !== null && \"source\" in id && \"axisFilters\" in id;\n}\n"],"mappings":";;;;;;AAsCA,SAAgB,kBAAkB,IAAoC;AACpE,QAAO,OAAO,OAAO,YAAY,OAAO,QAAQ,YAAY,MAAM,iBAAiB"}