@platforma-sdk/model 1.79.15 → 1.79.20

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 (326) hide show
  1. package/dist/annotations/converter.cjs +0 -1
  2. package/dist/annotations/converter.cjs.map +1 -1
  3. package/dist/annotations/converter.d.ts.map +1 -1
  4. package/dist/annotations/converter.js.map +1 -1
  5. package/dist/annotations/index.cjs +2 -1
  6. package/dist/annotations/index.d.ts +2 -1
  7. package/dist/annotations/index.js +2 -1
  8. package/dist/bconfig/index.cjs +5 -2
  9. package/dist/bconfig/index.d.ts +2 -1
  10. package/dist/bconfig/index.js +3 -2
  11. package/dist/bconfig/lambdas.d.ts.map +1 -1
  12. package/dist/bconfig/normalization.cjs +0 -1
  13. package/dist/bconfig/normalization.cjs.map +1 -1
  14. package/dist/bconfig/normalization.d.ts.map +1 -1
  15. package/dist/bconfig/normalization.js.map +1 -1
  16. package/dist/bconfig/types.cjs.map +1 -1
  17. package/dist/bconfig/types.d.ts.map +1 -1
  18. package/dist/bconfig/types.js.map +1 -1
  19. package/dist/bconfig/util.d.ts.map +1 -1
  20. package/dist/bconfig/v3.d.ts.map +1 -1
  21. package/dist/block_api_v1.d.ts.map +1 -1
  22. package/dist/block_migrations.cjs +3 -0
  23. package/dist/block_migrations.cjs.map +1 -1
  24. package/dist/block_migrations.d.ts +1 -1
  25. package/dist/block_migrations.d.ts.map +1 -1
  26. package/dist/block_migrations.js +1 -1
  27. package/dist/block_migrations.js.map +1 -1
  28. package/dist/block_model.cjs +1 -1
  29. package/dist/block_model.cjs.map +1 -1
  30. package/dist/block_model.d.ts.map +1 -1
  31. package/dist/block_model.js +1 -0
  32. package/dist/block_model.js.map +1 -1
  33. package/dist/block_model_legacy.cjs +1 -1
  34. package/dist/block_model_legacy.cjs.map +1 -1
  35. package/dist/block_model_legacy.d.ts.map +1 -1
  36. package/dist/block_model_legacy.js +1 -0
  37. package/dist/block_model_legacy.js.map +1 -1
  38. package/dist/block_state_patch.d.ts.map +1 -1
  39. package/dist/block_state_util.cjs +2 -0
  40. package/dist/block_state_util.cjs.map +1 -1
  41. package/dist/block_state_util.d.ts.map +1 -1
  42. package/dist/block_state_util.js +2 -0
  43. package/dist/block_state_util.js.map +1 -1
  44. package/dist/block_storage.cjs.map +1 -1
  45. package/dist/block_storage.d.ts +1 -1
  46. package/dist/block_storage.d.ts.map +1 -1
  47. package/dist/block_storage.js.map +1 -1
  48. package/dist/block_storage_callbacks.cjs +1 -1
  49. package/dist/block_storage_callbacks.cjs.map +1 -1
  50. package/dist/block_storage_callbacks.js +1 -1
  51. package/dist/block_storage_callbacks.js.map +1 -1
  52. package/dist/block_storage_facade.cjs.map +1 -1
  53. package/dist/block_storage_facade.d.ts.map +1 -1
  54. package/dist/block_storage_facade.js.map +1 -1
  55. package/dist/columns/column_collection_builder.cjs +3 -1
  56. package/dist/columns/column_collection_builder.cjs.map +1 -1
  57. package/dist/columns/column_collection_builder.d.ts.map +1 -1
  58. package/dist/columns/column_collection_builder.js +3 -0
  59. package/dist/columns/column_collection_builder.js.map +1 -1
  60. package/dist/columns/column_selector.cjs.map +1 -1
  61. package/dist/columns/column_selector.d.ts.map +1 -1
  62. package/dist/columns/column_selector.js.map +1 -1
  63. package/dist/columns/column_snapshot.cjs.map +1 -1
  64. package/dist/columns/column_snapshot.d.ts.map +1 -1
  65. package/dist/columns/column_snapshot.js.map +1 -1
  66. package/dist/columns/column_snapshot_provider.cjs +3 -1
  67. package/dist/columns/column_snapshot_provider.cjs.map +1 -1
  68. package/dist/columns/column_snapshot_provider.d.ts.map +1 -1
  69. package/dist/columns/column_snapshot_provider.js +3 -0
  70. package/dist/columns/column_snapshot_provider.js.map +1 -1
  71. package/dist/columns/ctx_column_sources.cjs +1 -1
  72. package/dist/columns/ctx_column_sources.cjs.map +1 -1
  73. package/dist/columns/ctx_column_sources.d.ts.map +1 -1
  74. package/dist/columns/ctx_column_sources.js +1 -0
  75. package/dist/columns/ctx_column_sources.js.map +1 -1
  76. package/dist/columns/expand_by_partition.cjs +0 -1
  77. package/dist/columns/expand_by_partition.cjs.map +1 -1
  78. package/dist/columns/expand_by_partition.d.ts.map +1 -1
  79. package/dist/columns/expand_by_partition.js.map +1 -1
  80. package/dist/columns/index.cjs +20 -6
  81. package/dist/columns/index.d.ts +2 -1
  82. package/dist/columns/index.js +7 -6
  83. package/dist/components/PFrameForGraphs.cjs +3 -2
  84. package/dist/components/PFrameForGraphs.cjs.map +1 -1
  85. package/dist/components/PFrameForGraphs.d.ts +1 -1
  86. package/dist/components/PFrameForGraphs.d.ts.map +1 -1
  87. package/dist/components/PFrameForGraphs.js +2 -2
  88. package/dist/components/PFrameForGraphs.js.map +1 -1
  89. package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
  90. package/dist/components/PlAnnotations/filters_ui.cjs.map +1 -1
  91. package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
  92. package/dist/components/PlAnnotations/filters_ui.js.map +1 -1
  93. package/dist/components/PlAnnotations/index.d.ts +2 -1
  94. package/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.cjs +0 -1
  95. package/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.cjs.map +1 -1
  96. package/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.js.map +1 -1
  97. package/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.cjs +0 -1
  98. package/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.cjs.map +1 -1
  99. package/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js.map +1 -1
  100. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.cjs +0 -1
  101. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.cjs.map +1 -1
  102. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.d.ts.map +1 -1
  103. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.js.map +1 -1
  104. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs +1 -2
  105. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs.map +1 -1
  106. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.d.ts.map +1 -1
  107. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js +1 -1
  108. package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js.map +1 -1
  109. package/dist/components/PlDataTable/createPlDataTable/discoverColumns.cjs +0 -1
  110. package/dist/components/PlDataTable/createPlDataTable/discoverColumns.cjs.map +1 -1
  111. package/dist/components/PlDataTable/createPlDataTable/discoverColumns.js.map +1 -1
  112. package/dist/components/PlDataTable/createPlDataTable/index.cjs +2 -1
  113. package/dist/components/PlDataTable/createPlDataTable/index.cjs.map +1 -1
  114. package/dist/components/PlDataTable/createPlDataTable/index.d.ts +1 -1
  115. package/dist/components/PlDataTable/createPlDataTable/index.d.ts.map +1 -1
  116. package/dist/components/PlDataTable/createPlDataTable/index.js +2 -2
  117. package/dist/components/PlDataTable/createPlDataTable/index.js.map +1 -1
  118. package/dist/components/PlDataTable/createPlDataTable/utils.cjs +0 -1
  119. package/dist/components/PlDataTable/createPlDataTable/utils.cjs.map +1 -1
  120. package/dist/components/PlDataTable/createPlDataTable/utils.d.ts +1 -1
  121. package/dist/components/PlDataTable/createPlDataTable/utils.d.ts.map +1 -1
  122. package/dist/components/PlDataTable/createPlDataTable/utils.js.map +1 -1
  123. package/dist/components/PlDataTable/createPlDataTableSheet.cjs.map +1 -1
  124. package/dist/components/PlDataTable/createPlDataTableSheet.d.ts.map +1 -1
  125. package/dist/components/PlDataTable/createPlDataTableSheet.js.map +1 -1
  126. package/dist/components/PlDataTable/index.cjs +19 -7
  127. package/dist/components/PlDataTable/index.d.ts +2 -1
  128. package/dist/components/PlDataTable/index.js +8 -7
  129. package/dist/components/PlDataTable/labels.cjs +0 -1
  130. package/dist/components/PlDataTable/labels.cjs.map +1 -1
  131. package/dist/components/PlDataTable/labels.js.map +1 -1
  132. package/dist/components/PlDataTable/state-migration.cjs +0 -1
  133. package/dist/components/PlDataTable/state-migration.cjs.map +1 -1
  134. package/dist/components/PlDataTable/state-migration.d.ts.map +1 -1
  135. package/dist/components/PlDataTable/state-migration.js.map +1 -1
  136. package/dist/components/PlDataTable/typesV4.d.ts +1 -1
  137. package/dist/components/PlDataTable/typesV4.d.ts.map +1 -1
  138. package/dist/components/PlDataTable/typesV5.d.ts +1 -1
  139. package/dist/components/PlDataTable/typesV5.d.ts.map +1 -1
  140. package/dist/components/PlDataTable/typesV6.d.ts +1 -1
  141. package/dist/components/PlDataTable/typesV6.d.ts.map +1 -1
  142. package/dist/components/PlDataTable/typesV7.d.ts.map +1 -1
  143. package/dist/components/PlDatasetSelector/build_dataset_options.cjs +0 -1
  144. package/dist/components/PlDatasetSelector/build_dataset_options.cjs.map +1 -1
  145. package/dist/components/PlDatasetSelector/build_dataset_options.js.map +1 -1
  146. package/dist/components/PlDatasetSelector/dataset_selection.cjs.map +1 -1
  147. package/dist/components/PlDatasetSelector/dataset_selection.d.ts.map +1 -1
  148. package/dist/components/PlDatasetSelector/dataset_selection.js.map +1 -1
  149. package/dist/components/PlDatasetSelector/enrichment_discovery.cjs +0 -1
  150. package/dist/components/PlDatasetSelector/enrichment_discovery.cjs.map +1 -1
  151. package/dist/components/PlDatasetSelector/enrichment_discovery.js.map +1 -1
  152. package/dist/components/PlDatasetSelector/filter_discovery.cjs +1 -1
  153. package/dist/components/PlDatasetSelector/filter_discovery.cjs.map +1 -1
  154. package/dist/components/PlDatasetSelector/filter_discovery.d.ts.map +1 -1
  155. package/dist/components/PlDatasetSelector/filter_discovery.js.map +1 -1
  156. package/dist/components/PlDatasetSelector/index.cjs +9 -3
  157. package/dist/components/PlDatasetSelector/index.d.ts +2 -1
  158. package/dist/components/PlDatasetSelector/index.js +4 -3
  159. package/dist/components/PlMultiSequenceAlignment.cjs +0 -1
  160. package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
  161. package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
  162. package/dist/components/PlMultiSequenceAlignment.js.map +1 -1
  163. package/dist/components/PlSelectionModel.cjs.map +1 -1
  164. package/dist/components/PlSelectionModel.d.ts.map +1 -1
  165. package/dist/components/PlSelectionModel.js.map +1 -1
  166. package/dist/components/index.cjs +44 -15
  167. package/dist/components/index.d.ts +2 -1
  168. package/dist/components/index.js +16 -15
  169. package/dist/config/actions.cjs.map +1 -1
  170. package/dist/config/actions.d.ts.map +1 -1
  171. package/dist/config/actions.js.map +1 -1
  172. package/dist/config/actions_kinds.d.ts.map +1 -1
  173. package/dist/config/index.cjs +33 -1
  174. package/dist/config/index.d.ts +2 -1
  175. package/dist/config/index.js +2 -1
  176. package/dist/config/model.d.ts.map +1 -1
  177. package/dist/config/type_engine.d.ts.map +1 -1
  178. package/dist/config/type_util.d.ts +1 -1
  179. package/dist/config/type_util.d.ts.map +1 -1
  180. package/dist/env_value.cjs.map +1 -1
  181. package/dist/env_value.d.ts.map +1 -1
  182. package/dist/env_value.js.map +1 -1
  183. package/dist/filters/converters/filterToQuery.cjs +0 -1
  184. package/dist/filters/converters/filterToQuery.cjs.map +1 -1
  185. package/dist/filters/converters/filterToQuery.d.ts.map +1 -1
  186. package/dist/filters/converters/filterToQuery.js.map +1 -1
  187. package/dist/filters/converters/filterUiToExpressionImpl.cjs +0 -1
  188. package/dist/filters/converters/filterUiToExpressionImpl.cjs.map +1 -1
  189. package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +1 -1
  190. package/dist/filters/converters/filterUiToExpressionImpl.js.map +1 -1
  191. package/dist/filters/converters/index.cjs +5 -2
  192. package/dist/filters/converters/index.d.ts +2 -1
  193. package/dist/filters/converters/index.js +3 -2
  194. package/dist/filters/distill.cjs +1 -2
  195. package/dist/filters/distill.cjs.map +1 -1
  196. package/dist/filters/distill.d.ts.map +1 -1
  197. package/dist/filters/distill.js +1 -1
  198. package/dist/filters/distill.js.map +1 -1
  199. package/dist/filters/index.cjs +7 -3
  200. package/dist/filters/index.d.ts +2 -1
  201. package/dist/filters/index.js +4 -3
  202. package/dist/filters/traverse.cjs.map +1 -1
  203. package/dist/filters/traverse.js.map +1 -1
  204. package/dist/filters/types.d.ts.map +1 -1
  205. package/dist/index.d.ts +1 -1
  206. package/dist/internal.cjs +2 -0
  207. package/dist/internal.cjs.map +1 -1
  208. package/dist/internal.js +1 -1
  209. package/dist/internal.js.map +1 -1
  210. package/dist/labels/derive_distinct_labels.cjs +2 -3
  211. package/dist/labels/derive_distinct_labels.cjs.map +1 -1
  212. package/dist/labels/derive_distinct_labels.d.ts.map +1 -1
  213. package/dist/labels/derive_distinct_labels.js +2 -2
  214. package/dist/labels/derive_distinct_labels.js.map +1 -1
  215. package/dist/labels/derive_distinct_tooltips.cjs +0 -1
  216. package/dist/labels/derive_distinct_tooltips.cjs.map +1 -1
  217. package/dist/labels/derive_distinct_tooltips.d.ts.map +1 -1
  218. package/dist/labels/derive_distinct_tooltips.js.map +1 -1
  219. package/dist/labels/index.cjs +4 -2
  220. package/dist/labels/index.d.ts +2 -1
  221. package/dist/labels/index.js +3 -2
  222. package/dist/package.cjs +1 -1
  223. package/dist/package.js +1 -1
  224. package/dist/pframe.cjs +1 -0
  225. package/dist/pframe.cjs.map +1 -1
  226. package/dist/pframe.d.ts.map +1 -1
  227. package/dist/pframe.js +1 -0
  228. package/dist/pframe.js.map +1 -1
  229. package/dist/pframe_utils/axes.cjs +0 -1
  230. package/dist/pframe_utils/axes.cjs.map +1 -1
  231. package/dist/pframe_utils/axes.d.ts.map +1 -1
  232. package/dist/pframe_utils/axes.js.map +1 -1
  233. package/dist/pframe_utils/columns.cjs +0 -1
  234. package/dist/pframe_utils/columns.cjs.map +1 -1
  235. package/dist/pframe_utils/columns.d.ts.map +1 -1
  236. package/dist/pframe_utils/columns.js.map +1 -1
  237. package/dist/pframe_utils/index.cjs +3 -2
  238. package/dist/pframe_utils/index.cjs.map +1 -1
  239. package/dist/pframe_utils/index.d.ts +1 -1
  240. package/dist/pframe_utils/index.d.ts.map +1 -1
  241. package/dist/pframe_utils/index.js +2 -2
  242. package/dist/pframe_utils/index.js.map +1 -1
  243. package/dist/platforma.d.ts.map +1 -1
  244. package/dist/plugin_handle.cjs.map +1 -1
  245. package/dist/plugin_handle.d.ts.map +1 -1
  246. package/dist/plugin_handle.js.map +1 -1
  247. package/dist/plugin_model.cjs +5 -0
  248. package/dist/plugin_model.cjs.map +1 -1
  249. package/dist/plugin_model.d.ts +1 -1
  250. package/dist/plugin_model.d.ts.map +1 -1
  251. package/dist/plugin_model.js +3 -1
  252. package/dist/plugin_model.js.map +1 -1
  253. package/dist/raw_globals.cjs.map +1 -1
  254. package/dist/raw_globals.d.ts.map +1 -1
  255. package/dist/raw_globals.js.map +1 -1
  256. package/dist/ref_util.cjs.map +1 -1
  257. package/dist/ref_util.d.ts.map +1 -1
  258. package/dist/ref_util.js.map +1 -1
  259. package/dist/render/accessor.cjs +2 -1
  260. package/dist/render/accessor.cjs.map +1 -1
  261. package/dist/render/accessor.d.ts.map +1 -1
  262. package/dist/render/accessor.js +2 -0
  263. package/dist/render/accessor.js.map +1 -1
  264. package/dist/render/api.cjs +5 -2
  265. package/dist/render/api.cjs.map +1 -1
  266. package/dist/render/api.d.ts.map +1 -1
  267. package/dist/render/api.js +4 -1
  268. package/dist/render/api.js.map +1 -1
  269. package/dist/render/future.cjs +2 -0
  270. package/dist/render/future.cjs.map +1 -1
  271. package/dist/render/future.d.ts.map +1 -1
  272. package/dist/render/future.js +2 -0
  273. package/dist/render/future.js.map +1 -1
  274. package/dist/render/index.cjs +34 -7
  275. package/dist/render/index.d.ts +2 -1
  276. package/dist/render/index.js +8 -7
  277. package/dist/render/internal.cjs +3 -0
  278. package/dist/render/internal.cjs.map +1 -1
  279. package/dist/render/internal.d.ts +1 -1
  280. package/dist/render/internal.d.ts.map +1 -1
  281. package/dist/render/internal.js +1 -1
  282. package/dist/render/internal.js.map +1 -1
  283. package/dist/render/traversal_ops.d.ts.map +1 -1
  284. package/dist/render/util/axis_filtering.cjs.map +1 -1
  285. package/dist/render/util/axis_filtering.d.ts.map +1 -1
  286. package/dist/render/util/axis_filtering.js.map +1 -1
  287. package/dist/render/util/column_collection.cjs +2 -1
  288. package/dist/render/util/column_collection.cjs.map +1 -1
  289. package/dist/render/util/column_collection.d.ts.map +1 -1
  290. package/dist/render/util/column_collection.js +1 -0
  291. package/dist/render/util/column_collection.js.map +1 -1
  292. package/dist/render/util/index.cjs +23 -4
  293. package/dist/render/util/index.d.ts +2 -1
  294. package/dist/render/util/index.js +5 -4
  295. package/dist/render/util/label.cjs.map +1 -1
  296. package/dist/render/util/label.d.ts +1 -1
  297. package/dist/render/util/label.d.ts.map +1 -1
  298. package/dist/render/util/label.js.map +1 -1
  299. package/dist/render/util/pcolumn_data.cjs +8 -11
  300. package/dist/render/util/pcolumn_data.cjs.map +1 -1
  301. package/dist/render/util/pcolumn_data.d.ts.map +1 -1
  302. package/dist/render/util/pcolumn_data.js +8 -10
  303. package/dist/render/util/pcolumn_data.js.map +1 -1
  304. package/dist/render/util/pframe_upgraders.cjs.map +1 -1
  305. package/dist/render/util/pframe_upgraders.js.map +1 -1
  306. package/dist/render/util/split_selectors.d.ts +1 -1
  307. package/dist/render/util/split_selectors.d.ts.map +1 -1
  308. package/dist/services/block_services.cjs +0 -1
  309. package/dist/services/block_services.cjs.map +1 -1
  310. package/dist/services/block_services.d.ts +1 -3
  311. package/dist/services/block_services.d.ts.map +1 -1
  312. package/dist/services/block_services.js.map +1 -1
  313. package/dist/services/get_services.cjs.map +1 -1
  314. package/dist/services/get_services.d.ts.map +1 -1
  315. package/dist/services/get_services.js.map +1 -1
  316. package/dist/services/index.cjs +8 -3
  317. package/dist/services/index.d.ts +2 -1
  318. package/dist/services/index.js +4 -3
  319. package/dist/services/service_bridge.cjs.map +1 -1
  320. package/dist/services/service_bridge.d.ts.map +1 -1
  321. package/dist/services/service_bridge.js.map +1 -1
  322. package/dist/services/service_resolve.d.ts.map +1 -1
  323. package/dist/version.cjs.map +1 -1
  324. package/dist/version.d.ts.map +1 -1
  325. package/dist/version.js.map +1 -1
  326. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"column_snapshot_provider.js","names":[],"sources":["../../src/columns/column_snapshot_provider.ts"],"sourcesContent":["import type { PObjectId } from \"@milaboratories/pl-model-common\";\nimport { isDataInfo, PColumn, visitDataInfo } from \"@milaboratories/pl-model-common\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport type { PColumnDataUniversal } from \"../render/internal\";\nimport type { ColumnDataStatus, ColumnSnapshot } from \"./column_snapshot\";\n\n/**\n * Data source interface for column enumeration.\n *\n * Knows nothing about the render framework, stability tracking, labels,\n * anchoring, or splitting. All that complexity lives in the collection layer.\n */\nexport interface ColumnSnapshotProvider {\n /** Returns all currently known columns. */\n getAllColumns(): ColumnSnapshot<PObjectId>[];\n\n /** Whether the provider has finished enumerating all its columns.\n * Calling this may mark the render context unstable — it touches\n * the reactive tree to check field resolution state. */\n isColumnListComplete(): boolean;\n}\n\n/**\n * Union of types that can serve as column sources for helpers and builders.\n * Does NOT include TreeNodeAccessor — call `.toColumnSource()` on it first.\n */\nexport type ColumnSource =\n | ColumnSnapshotProvider\n | ColumnSnapshot<PObjectId>[]\n | PColumn<PColumnDataUniversal | undefined>[];\n\n/**\n * Simple provider wrapping an array of PColumns.\n * Always complete, data status always 'ready'.\n */\nexport class ArrayColumnProvider implements ColumnSnapshotProvider {\n private readonly columns: ColumnSnapshot<PObjectId>[];\n\n constructor(columns: PColumn<PColumnDataUniversal | undefined>[]) {\n this.columns = columns.map((col) => ({\n id: col.id,\n spec: col.spec,\n data: { get: () => col.data },\n dataStatus: this.getStatus(col.data),\n }));\n }\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n return this.columns;\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n\n protected getStatus(\n d: undefined | PColumnDataUniversal | (() => undefined | PColumnDataUniversal),\n ): ColumnDataStatus {\n if (d == null) {\n return \"absent\";\n }\n if (typeof d === \"function\") {\n return this.getStatus(d());\n }\n if (d instanceof TreeNodeAccessor) {\n if (d.getIsReadyOrError()) return \"ready\";\n if (d.getIsFinal()) return \"absent\";\n return \"computing\";\n }\n if (isDataInfo(d)) {\n let ready = true;\n let final = true;\n visitDataInfo(d, (v) => {\n ready &&= v.getIsReadyOrError();\n final &&= v.getIsFinal();\n });\n if (ready) return \"ready\";\n if (final) return \"absent\";\n return \"computing\";\n }\n return \"ready\";\n }\n}\n\n/**\n * Provider wrapping an array of ColumnSnapshots.\n * Always complete. Data status taken from each snapshot.\n */\nexport class SnapshotColumnProvider implements ColumnSnapshotProvider {\n constructor(private readonly snapshots: ColumnSnapshot<PObjectId>[]) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n return this.snapshots;\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n}\n\nexport interface OutputColumnProviderOpts {\n /** When true and the accessor is final, columns with no ready data get status 'absent'. */\n allowPermanentAbsence?: boolean;\n}\n\n/**\n * Provider wrapping a TreeNodeAccessor (output/prerun resolve result).\n * Detects data status from accessor readiness state.\n */\nexport class OutputColumnProvider implements ColumnSnapshotProvider {\n constructor(\n private readonly accessor: TreeNodeAccessor,\n private readonly opts?: OutputColumnProviderOpts,\n ) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n return this.getColumns();\n }\n\n isColumnListComplete(): boolean {\n return this.accessor.getInputsLocked();\n }\n\n private getColumns(): ColumnSnapshot<PObjectId>[] {\n const pColumns = this.accessor.getPColumns();\n if (pColumns === undefined) return [];\n\n const isFinal = this.accessor.getIsFinal();\n const allowAbsence = this.opts?.allowPermanentAbsence === true;\n\n return pColumns.map((col) => {\n const dataAccessor = col.data;\n const isReady = dataAccessor.getIsReadyOrError();\n\n let dataStatus: ColumnDataStatus;\n if (isReady) {\n dataStatus = \"ready\";\n } else if (allowAbsence && isFinal) {\n dataStatus = \"absent\";\n } else {\n dataStatus = \"computing\";\n }\n\n return {\n id: col.id,\n spec: col.spec,\n dataStatus,\n data: { get: () => (isReady ? dataAccessor : undefined) },\n };\n });\n }\n}\n\n/** Checks if a value is a ColumnSnapshotProvider (duck-typing). */\nexport function isColumnSnapshotProvider(source: unknown): source is ColumnSnapshotProvider {\n return (\n typeof source === \"object\" &&\n source !== null &&\n \"getAllColumns\" in source &&\n \"isColumnListComplete\" in source &&\n typeof (source as ColumnSnapshotProvider).getAllColumns === \"function\" &&\n typeof (source as ColumnSnapshotProvider).isColumnListComplete === \"function\"\n );\n}\n\n/** Checks if a value looks like a PColumn (has id, spec, data). */\nfunction isPColumnArray(source: unknown): source is PColumn<PColumnDataUniversal | undefined>[] {\n if (!Array.isArray(source)) return false;\n if (source.length === 0) return true; // empty array — treat as PColumn[]\n const first = source[0];\n return \"id\" in first && \"spec\" in first && \"data\" in first && !(\"dataStatus\" in first);\n}\n\n/** Checks if a value looks like a ColumnSnapshot array. */\nfunction isColumnSnapshotArray(source: unknown): source is ColumnSnapshot<PObjectId>[] {\n if (!Array.isArray(source)) return false;\n if (source.length === 0) return true; // empty array — treat as snapshots\n const first = source[0];\n return \"id\" in first && \"spec\" in first && \"dataStatus\" in first;\n}\n\n/**\n * Normalize any ColumnSource into a ColumnSnapshotProvider.\n * - ColumnSnapshotProvider → returned as-is\n * - ColumnSnapshot<PObjectId>[] → wrapped in SnapshotColumnProvider\n * - PColumn[] → wrapped in ArrayColumnProvider\n */\nexport function toColumnSnapshotProvider(source: ColumnSource): ColumnSnapshotProvider {\n if (isColumnSnapshotProvider(source)) return source;\n if (isColumnSnapshotArray(source)) return new SnapshotColumnProvider(source);\n if (isPColumnArray(source)) return new ArrayColumnProvider(source);\n // Should not reach here given the type union, but be safe\n throw new Error(\"Unknown ColumnSource type\");\n}\n"],"mappings":";;;;;;;AAmCA,IAAa,sBAAb,MAAmE;CACjE;CAEA,YAAY,SAAsD;AAChE,OAAK,UAAU,QAAQ,KAAK,SAAS;GACnC,IAAI,IAAI;GACR,MAAM,IAAI;GACV,MAAM,EAAE,WAAW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AAO;IACL,IAAI,IAAI;IACR,MAAM,IAAI;IACV;IACA,MAAM,EAAE,WAAY,UAAU,eAAe,KAAA,GAAY;IAC1D;IACD;;;;AAKN,SAAgB,yBAAyB,QAAmD;AAC1F,QACE,OAAO,WAAW,YAClB,WAAW,QACX,mBAAmB,UACnB,0BAA0B,UAC1B,OAAQ,OAAkC,kBAAkB,cAC5D,OAAQ,OAAkC,yBAAyB;;;AAKvE,SAAS,eAAe,QAAwE;AAC9F,KAAI,CAAC,MAAM,QAAQ,OAAO,CAAE,QAAO;AACnC,KAAI,OAAO,WAAW,EAAG,QAAO;CAChC,MAAM,QAAQ,OAAO;AACrB,QAAO,QAAQ,SAAS,UAAU,SAAS,UAAU,SAAS,EAAE,gBAAgB;;;AAIlF,SAAS,sBAAsB,QAAwD;AACrF,KAAI,CAAC,MAAM,QAAQ,OAAO,CAAE,QAAO;AACnC,KAAI,OAAO,WAAW,EAAG,QAAO;CAChC,MAAM,QAAQ,OAAO;AACrB,QAAO,QAAQ,SAAS,UAAU,SAAS,gBAAgB;;;;;;;;AAS7D,SAAgB,yBAAyB,QAA8C;AACrF,KAAI,yBAAyB,OAAO,CAAE,QAAO;AAC7C,KAAI,sBAAsB,OAAO,CAAE,QAAO,IAAI,uBAAuB,OAAO;AAC5E,KAAI,eAAe,OAAO,CAAE,QAAO,IAAI,oBAAoB,OAAO;AAElE,OAAM,IAAI,MAAM,4BAA4B"}
1
+ {"version":3,"file":"column_snapshot_provider.js","names":[],"sources":["../../src/columns/column_snapshot_provider.ts"],"sourcesContent":["import type { PObjectId } from \"@milaboratories/pl-model-common\";\nimport { isDataInfo, PColumn, visitDataInfo } from \"@milaboratories/pl-model-common\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport type { PColumnDataUniversal } from \"../render/internal\";\nimport type { ColumnDataStatus, ColumnSnapshot } from \"./column_snapshot\";\n\n/**\n * Data source interface for column enumeration.\n *\n * Knows nothing about the render framework, stability tracking, labels,\n * anchoring, or splitting. All that complexity lives in the collection layer.\n */\nexport interface ColumnSnapshotProvider {\n /** Returns all currently known columns. */\n getAllColumns(): ColumnSnapshot<PObjectId>[];\n\n /** Whether the provider has finished enumerating all its columns.\n * Calling this may mark the render context unstable — it touches\n * the reactive tree to check field resolution state. */\n isColumnListComplete(): boolean;\n}\n\n/**\n * Union of types that can serve as column sources for helpers and builders.\n * Does NOT include TreeNodeAccessor — call `.toColumnSource()` on it first.\n */\nexport type ColumnSource =\n | ColumnSnapshotProvider\n | ColumnSnapshot<PObjectId>[]\n | PColumn<PColumnDataUniversal | undefined>[];\n\n/**\n * Simple provider wrapping an array of PColumns.\n * Always complete, data status always 'ready'.\n */\nexport class ArrayColumnProvider implements ColumnSnapshotProvider {\n private readonly columns: ColumnSnapshot<PObjectId>[];\n\n constructor(columns: PColumn<PColumnDataUniversal | undefined>[]) {\n this.columns = columns.map((col) => ({\n id: col.id,\n spec: col.spec,\n data: { get: () => col.data },\n dataStatus: this.getStatus(col.data),\n }));\n }\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n return this.columns;\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n\n protected getStatus(\n d: undefined | PColumnDataUniversal | (() => undefined | PColumnDataUniversal),\n ): ColumnDataStatus {\n if (d == null) {\n return \"absent\";\n }\n if (typeof d === \"function\") {\n return this.getStatus(d());\n }\n if (d instanceof TreeNodeAccessor) {\n if (d.getIsReadyOrError()) return \"ready\";\n if (d.getIsFinal()) return \"absent\";\n return \"computing\";\n }\n if (isDataInfo(d)) {\n let ready = true;\n let final = true;\n visitDataInfo(d, (v) => {\n ready &&= v.getIsReadyOrError();\n final &&= v.getIsFinal();\n });\n if (ready) return \"ready\";\n if (final) return \"absent\";\n return \"computing\";\n }\n return \"ready\";\n }\n}\n\n/**\n * Provider wrapping an array of ColumnSnapshots.\n * Always complete. Data status taken from each snapshot.\n */\nexport class SnapshotColumnProvider implements ColumnSnapshotProvider {\n constructor(private readonly snapshots: ColumnSnapshot<PObjectId>[]) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n return this.snapshots;\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n}\n\nexport interface OutputColumnProviderOpts {\n /** When true and the accessor is final, columns with no ready data get status 'absent'. */\n allowPermanentAbsence?: boolean;\n}\n\n/**\n * Provider wrapping a TreeNodeAccessor (output/prerun resolve result).\n * Detects data status from accessor readiness state.\n */\nexport class OutputColumnProvider implements ColumnSnapshotProvider {\n constructor(\n private readonly accessor: TreeNodeAccessor,\n private readonly opts?: OutputColumnProviderOpts,\n ) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n return this.getColumns();\n }\n\n isColumnListComplete(): boolean {\n return this.accessor.getInputsLocked();\n }\n\n private getColumns(): ColumnSnapshot<PObjectId>[] {\n const pColumns = this.accessor.getPColumns();\n if (pColumns === undefined) return [];\n\n const isFinal = this.accessor.getIsFinal();\n const allowAbsence = this.opts?.allowPermanentAbsence === true;\n\n return pColumns.map((col) => {\n const dataAccessor = col.data;\n const isReady = dataAccessor.getIsReadyOrError();\n\n let dataStatus: ColumnDataStatus;\n if (isReady) {\n dataStatus = \"ready\";\n } else if (allowAbsence && isFinal) {\n dataStatus = \"absent\";\n } else {\n dataStatus = \"computing\";\n }\n\n return {\n id: col.id,\n spec: col.spec,\n dataStatus,\n data: { get: () => (isReady ? dataAccessor : undefined) },\n };\n });\n }\n}\n\n/** Checks if a value is a ColumnSnapshotProvider (duck-typing). */\nexport function isColumnSnapshotProvider(source: unknown): source is ColumnSnapshotProvider {\n return (\n typeof source === \"object\" &&\n source !== null &&\n \"getAllColumns\" in source &&\n \"isColumnListComplete\" in source &&\n typeof (source as ColumnSnapshotProvider).getAllColumns === \"function\" &&\n typeof (source as ColumnSnapshotProvider).isColumnListComplete === \"function\"\n );\n}\n\n/** Checks if a value looks like a PColumn (has id, spec, data). */\nfunction isPColumnArray(source: unknown): source is PColumn<PColumnDataUniversal | undefined>[] {\n if (!Array.isArray(source)) return false;\n if (source.length === 0) return true; // empty array — treat as PColumn[]\n const first = source[0];\n return \"id\" in first && \"spec\" in first && \"data\" in first && !(\"dataStatus\" in first);\n}\n\n/** Checks if a value looks like a ColumnSnapshot array. */\nfunction isColumnSnapshotArray(source: unknown): source is ColumnSnapshot<PObjectId>[] {\n if (!Array.isArray(source)) return false;\n if (source.length === 0) return true; // empty array — treat as snapshots\n const first = source[0];\n return \"id\" in first && \"spec\" in first && \"dataStatus\" in first;\n}\n\n/**\n * Normalize any ColumnSource into a ColumnSnapshotProvider.\n * - ColumnSnapshotProvider → returned as-is\n * - ColumnSnapshot<PObjectId>[] → wrapped in SnapshotColumnProvider\n * - PColumn[] → wrapped in ArrayColumnProvider\n */\nexport function toColumnSnapshotProvider(source: ColumnSource): ColumnSnapshotProvider {\n if (isColumnSnapshotProvider(source)) return source;\n if (isColumnSnapshotArray(source)) return new SnapshotColumnProvider(source);\n if (isPColumnArray(source)) return new ArrayColumnProvider(source);\n // Should not reach here given the type union, but be safe\n throw new Error(\"Unknown ColumnSource type\");\n}\n"],"mappings":";;;;;;;AAmCA,IAAa,sBAAb,MAAmE;CACjE;CAEA,YAAY,SAAsD;EAChE,KAAK,UAAU,QAAQ,KAAK,SAAS;GACnC,IAAI,IAAI;GACR,MAAM,IAAI;GACV,MAAM,EAAE,WAAW,IAAI,KAAK;GAC5B,YAAY,KAAK,UAAU,IAAI,IAAI;EACrC,EAAE;CACJ;CAEA,gBAA6C;EAC3C,OAAO,KAAK;CACd;CAEA,uBAAgC;EAC9B,OAAO;CACT;CAEA,UACE,GACkB;EAClB,IAAI,KAAK,MACP,OAAO;EAET,IAAI,OAAO,MAAM,YACf,OAAO,KAAK,UAAU,EAAE,CAAC;EAE3B,IAAI,aAAa,kBAAkB;GACjC,IAAI,EAAE,kBAAkB,GAAG,OAAO;GAClC,IAAI,EAAE,WAAW,GAAG,OAAO;GAC3B,OAAO;EACT;EACA,IAAI,WAAW,CAAC,GAAG;GACjB,IAAI,QAAQ;GACZ,IAAI,QAAQ;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AG,OAAO;CACnC,IAAI,OAAO,WAAW,GAAG,OAAO;CAChC,MAAM,QAAQ,OAAO;CACrB,OAAO,QAAQ,SAAS,UAAU,SAAS,UAAU,SAAS,EAAE,gBAAgB;AAClF;;AAGA,SAAS,sBAAsB,QAAwD;CACrF,IAAI,CAAC,MAAM,QAAQ,MAAM,GAAG,OAAO;CACnC,IAAI,OAAO,WAAW,GAAG,OAAO;CAChC,MAAM,QAAQ,OAAO;CACrB,OAAO,QAAQ,SAAS,UAAU,SAAS,gBAAgB;AAC7D;;;;;;;AAQA,SAAgB,yBAAyB,QAA8C;CACrF,IAAI,yBAAyB,MAAM,GAAG,OAAO;CAC7C,IAAI,sBAAsB,MAAM,GAAG,OAAO,IAAI,uBAAuB,MAAM;CAC3E,IAAI,eAAe,MAAM,GAAG,OAAO,IAAI,oBAAoB,MAAM;CAEjE,MAAM,IAAI,MAAM,2BAA2B;AAC7C"}
@@ -1,4 +1,3 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
1
  const require_column_snapshot_provider = require("./column_snapshot_provider.cjs");
3
2
  let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
4
3
  //#region src/columns/ctx_column_sources.ts
@@ -26,6 +25,7 @@ function collectCtxColumnSnapshotProviders(ctx) {
26
25
  * ready (getIsReadyOrError), computing, or absent (no data resource).
27
26
  */
28
27
  var ResultPoolColumnSnapshotProvider = class {
28
+ pool;
29
29
  constructor(pool) {
30
30
  this.pool = pool;
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ctx_column_sources.cjs","names":["ResourceTypeName","OutputColumnProvider"],"sources":["../../src/columns/ctx_column_sources.ts"],"sourcesContent":["import type { PColumnSpec, PObjectId } from \"@milaboratories/pl-model-common\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport type { RenderCtxBase, ResultPool } from \"../render\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport type { ColumnDataStatus } from \"./column_snapshot\";\nimport type { ColumnSnapshotProvider } from \"./column_snapshot_provider\";\nimport { OutputColumnProvider } from \"./column_snapshot_provider\";\nimport { ResourceTypeName } from \"@milaboratories/pl-model-common\";\nimport type { ValueOf } from \"@milaboratories/helpers\";\n\n/**\n * Collect ColumnSnapshotProviders from `outputs`, `prerun`, and\n * `resultPool` in that order. Dedup keeps the first occurrence per\n * `NativePObjectId`, so a block re-publishing its own columns keeps\n * the `outputs`-rooted canonical id instead of the result-pool variant.\n */\nexport function collectCtxColumnSnapshotProviders(ctx: RenderCtxBase): ColumnSnapshotProvider[] {\n const providers: ColumnSnapshotProvider[] = [];\n\n const outputs = ctx.outputs;\n if (outputs) {\n providers.push(...collectPFrameProviders(outputs));\n }\n\n const prerun = ctx.prerun;\n if (prerun) {\n providers.push(...collectPFrameProviders(prerun));\n }\n\n providers.push(new ResultPoolColumnSnapshotProvider(ctx.resultPool));\n\n return providers;\n}\n\n/**\n * Adapter wrapping ResultPool into the new ColumnSnapshotProvider interface.\n *\n * - `isColumnListComplete()` always returns true — the result pool\n * is a stable snapshot within a single render cycle.\n * - Data status is derived from the underlying TreeNodeAccessor:\n * ready (getIsReadyOrError), computing, or absent (no data resource).\n */\nexport class ResultPoolColumnSnapshotProvider implements ColumnSnapshotProvider {\n constructor(private readonly pool: ResultPool) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n const pColumns = this.pool.selectColumns(() => true);\n return pColumns.map((col) => toSnapshot(col.id, col.spec, col.data));\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n}\n\nfunction toSnapshot(\n id: PObjectId,\n spec: PColumnSpec,\n accessor: TreeNodeAccessor | undefined,\n): ColumnSnapshot<PObjectId> {\n if (accessor === undefined) {\n return { id, spec, dataStatus: \"absent\" as ColumnDataStatus, data: undefined };\n }\n const isReady = accessor.getIsReadyOrError();\n return {\n id,\n spec,\n dataStatus: (isReady ? \"ready\" : \"computing\") as ColumnDataStatus,\n data: { get: () => (isReady ? accessor : undefined) },\n };\n}\n\n/**\n * Recursively walk the output tree starting from `accessor`.\n * - If a node's resourceType is PFrame → wrap it as OutputColumnProvider.\n * - If a node's resourceType is StdMap/std/map → recurse into its output fields.\n * - Otherwise → skip (leaf of unknown type).\n */\nfunction collectPFrameProviders(accessor: TreeNodeAccessor): ColumnSnapshotProvider[] {\n const out: ColumnSnapshotProvider[] = [];\n walkTree(accessor, out);\n return out;\n}\n\nfunction walkTree(node: TreeNodeAccessor, out: ColumnSnapshotProvider[]): void {\n const typeName = node.resourceType.name as ValueOf<typeof ResourceTypeName>;\n\n if (typeName === ResourceTypeName.PFrame) {\n out.push(new OutputColumnProvider(node));\n return;\n }\n\n if (typeName === ResourceTypeName.StdMap || typeName === ResourceTypeName.StdMapSlash) {\n for (const field of node.listInputFields()) {\n const child = node.resolve(field);\n if (child) walkTree(child, out);\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAgBA,SAAgB,kCAAkC,KAA8C;CAC9F,MAAM,YAAsC,EAAE;CAE9C,MAAM,UAAU,IAAI;AACpB,KAAI,QACF,WAAU,KAAK,GAAG,uBAAuB,QAAQ,CAAC;CAGpD,MAAM,SAAS,IAAI;AACnB,KAAI,OACF,WAAU,KAAK,GAAG,uBAAuB,OAAO,CAAC;AAGnD,WAAU,KAAK,IAAI,iCAAiC,IAAI,WAAW,CAAC;AAEpE,QAAO;;;;;;;;;;AAWT,IAAa,mCAAb,MAAgF;CAC9E,YAAY,MAAmC;AAAlB,OAAA,OAAA;;CAE7B,gBAA6C;AAE3C,SADiB,KAAK,KAAK,oBAAoB,KAAK,CACpC,KAAK,QAAQ,WAAW,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,CAAC;;CAGtE,uBAAgC;AAC9B,SAAO;;;AAIX,SAAS,WACP,IACA,MACA,UAC2B;AAC3B,KAAI,aAAa,KAAA,EACf,QAAO;EAAE;EAAI;EAAM,YAAY;EAA8B,MAAM,KAAA;EAAW;CAEhF,MAAM,UAAU,SAAS,mBAAmB;AAC5C,QAAO;EACL;EACA;EACA,YAAa,UAAU,UAAU;EACjC,MAAM,EAAE,WAAY,UAAU,WAAW,KAAA,GAAY;EACtD;;;;;;;;AASH,SAAS,uBAAuB,UAAsD;CACpF,MAAM,MAAgC,EAAE;AACxC,UAAS,UAAU,IAAI;AACvB,QAAO;;AAGT,SAAS,SAAS,MAAwB,KAAqC;CAC7E,MAAM,WAAW,KAAK,aAAa;AAEnC,KAAI,aAAaA,gCAAAA,iBAAiB,QAAQ;AACxC,MAAI,KAAK,IAAIC,iCAAAA,qBAAqB,KAAK,CAAC;AACxC;;AAGF,KAAI,aAAaD,gCAAAA,iBAAiB,UAAU,aAAaA,gCAAAA,iBAAiB,YACxE,MAAK,MAAM,SAAS,KAAK,iBAAiB,EAAE;EAC1C,MAAM,QAAQ,KAAK,QAAQ,MAAM;AACjC,MAAI,MAAO,UAAS,OAAO,IAAI"}
1
+ {"version":3,"file":"ctx_column_sources.cjs","names":["ResourceTypeName","OutputColumnProvider"],"sources":["../../src/columns/ctx_column_sources.ts"],"sourcesContent":["import type { PColumnSpec, PObjectId } from \"@milaboratories/pl-model-common\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport type { RenderCtxBase, ResultPool } from \"../render\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport type { ColumnDataStatus } from \"./column_snapshot\";\nimport type { ColumnSnapshotProvider } from \"./column_snapshot_provider\";\nimport { OutputColumnProvider } from \"./column_snapshot_provider\";\nimport { ResourceTypeName } from \"@milaboratories/pl-model-common\";\nimport type { ValueOf } from \"@milaboratories/helpers\";\n\n/**\n * Collect ColumnSnapshotProviders from `outputs`, `prerun`, and\n * `resultPool` in that order. Dedup keeps the first occurrence per\n * `NativePObjectId`, so a block re-publishing its own columns keeps\n * the `outputs`-rooted canonical id instead of the result-pool variant.\n */\nexport function collectCtxColumnSnapshotProviders(ctx: RenderCtxBase): ColumnSnapshotProvider[] {\n const providers: ColumnSnapshotProvider[] = [];\n\n const outputs = ctx.outputs;\n if (outputs) {\n providers.push(...collectPFrameProviders(outputs));\n }\n\n const prerun = ctx.prerun;\n if (prerun) {\n providers.push(...collectPFrameProviders(prerun));\n }\n\n providers.push(new ResultPoolColumnSnapshotProvider(ctx.resultPool));\n\n return providers;\n}\n\n/**\n * Adapter wrapping ResultPool into the new ColumnSnapshotProvider interface.\n *\n * - `isColumnListComplete()` always returns true — the result pool\n * is a stable snapshot within a single render cycle.\n * - Data status is derived from the underlying TreeNodeAccessor:\n * ready (getIsReadyOrError), computing, or absent (no data resource).\n */\nexport class ResultPoolColumnSnapshotProvider implements ColumnSnapshotProvider {\n constructor(private readonly pool: ResultPool) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n const pColumns = this.pool.selectColumns(() => true);\n return pColumns.map((col) => toSnapshot(col.id, col.spec, col.data));\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n}\n\nfunction toSnapshot(\n id: PObjectId,\n spec: PColumnSpec,\n accessor: TreeNodeAccessor | undefined,\n): ColumnSnapshot<PObjectId> {\n if (accessor === undefined) {\n return { id, spec, dataStatus: \"absent\" as ColumnDataStatus, data: undefined };\n }\n const isReady = accessor.getIsReadyOrError();\n return {\n id,\n spec,\n dataStatus: (isReady ? \"ready\" : \"computing\") as ColumnDataStatus,\n data: { get: () => (isReady ? accessor : undefined) },\n };\n}\n\n/**\n * Recursively walk the output tree starting from `accessor`.\n * - If a node's resourceType is PFrame → wrap it as OutputColumnProvider.\n * - If a node's resourceType is StdMap/std/map → recurse into its output fields.\n * - Otherwise → skip (leaf of unknown type).\n */\nfunction collectPFrameProviders(accessor: TreeNodeAccessor): ColumnSnapshotProvider[] {\n const out: ColumnSnapshotProvider[] = [];\n walkTree(accessor, out);\n return out;\n}\n\nfunction walkTree(node: TreeNodeAccessor, out: ColumnSnapshotProvider[]): void {\n const typeName = node.resourceType.name as ValueOf<typeof ResourceTypeName>;\n\n if (typeName === ResourceTypeName.PFrame) {\n out.push(new OutputColumnProvider(node));\n return;\n }\n\n if (typeName === ResourceTypeName.StdMap || typeName === ResourceTypeName.StdMapSlash) {\n for (const field of node.listInputFields()) {\n const child = node.resolve(field);\n if (child) walkTree(child, out);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAgBA,SAAgB,kCAAkC,KAA8C;CAC9F,MAAM,YAAsC,CAAC;CAE7C,MAAM,UAAU,IAAI;CACpB,IAAI,SACF,UAAU,KAAK,GAAG,uBAAuB,OAAO,CAAC;CAGnD,MAAM,SAAS,IAAI;CACnB,IAAI,QACF,UAAU,KAAK,GAAG,uBAAuB,MAAM,CAAC;CAGlD,UAAU,KAAK,IAAI,iCAAiC,IAAI,UAAU,CAAC;CAEnE,OAAO;AACT;;;;;;;;;AAUA,IAAa,mCAAb,MAAgF;CACjD;CAA7B,YAAY,MAAmC;EAAlB,KAAA,OAAA;CAAmB;CAEhD,gBAA6C;EAE3C,OADiB,KAAK,KAAK,oBAAoB,IACjC,CAAC,CAAC,KAAK,QAAQ,WAAW,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,CAAC;CACrE;CAEA,uBAAgC;EAC9B,OAAO;CACT;AACF;AAEA,SAAS,WACP,IACA,MACA,UAC2B;CAC3B,IAAI,aAAa,KAAA,GACf,OAAO;EAAE;EAAI;EAAM,YAAY;EAA8B,MAAM,KAAA;CAAU;CAE/E,MAAM,UAAU,SAAS,kBAAkB;CAC3C,OAAO;EACL;EACA;EACA,YAAa,UAAU,UAAU;EACjC,MAAM,EAAE,WAAY,UAAU,WAAW,KAAA,EAAW;CACtD;AACF;;;;;;;AAQA,SAAS,uBAAuB,UAAsD;CACpF,MAAM,MAAgC,CAAC;CACvC,SAAS,UAAU,GAAG;CACtB,OAAO;AACT;AAEA,SAAS,SAAS,MAAwB,KAAqC;CAC7E,MAAM,WAAW,KAAK,aAAa;CAEnC,IAAI,aAAaA,gCAAAA,iBAAiB,QAAQ;EACxC,IAAI,KAAK,IAAIC,iCAAAA,qBAAqB,IAAI,CAAC;EACvC;CACF;CAEA,IAAI,aAAaD,gCAAAA,iBAAiB,UAAU,aAAaA,gCAAAA,iBAAiB,aACxE,KAAK,MAAM,SAAS,KAAK,gBAAgB,GAAG;EAC1C,MAAM,QAAQ,KAAK,QAAQ,KAAK;EAChC,IAAI,OAAO,SAAS,OAAO,GAAG;CAChC;AAEJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"ctx_column_sources.d.ts","names":[],"sources":["../../src/columns/ctx_column_sources.ts"],"mappings":";;;;;;;;;AAgBA;;;iBAAgB,iCAAA,CAAkC,GAAA,EAAK,aAAA,GAAgB,sBAAA;;;;;;AA0BvE;;;cAAa,gCAAA,YAA4C,sBAAA;EAAA,iBAC1B,IAAA;cAAA,IAAA,EAAM,UAAA;EAEnC,aAAA,CAAA,GAAiB,cAAA,CAAe,SAAA;EAKhC,oBAAA,CAAA;AAAA"}
1
+ {"version":3,"file":"ctx_column_sources.d.ts","names":[],"sources":["../../src/columns/ctx_column_sources.ts"],"mappings":";;;;;;;;;AAgBA;;;iBAAgB,iCAAA,CAAkC,GAAA,EAAK,aAAA,GAAgB,sBAAsB;;;;;AAAA;AA0B7F;;;cAAa,gCAAA,YAA4C,sBAAA;EAAA,iBAC1B,IAAA;cAAA,IAAA,EAAM,UAAA;EAEnC,aAAA,IAAiB,cAAA,CAAe,SAAA;EAKhC,oBAAA;AAAA"}
@@ -25,6 +25,7 @@ function collectCtxColumnSnapshotProviders(ctx) {
25
25
  * ready (getIsReadyOrError), computing, or absent (no data resource).
26
26
  */
27
27
  var ResultPoolColumnSnapshotProvider = class {
28
+ pool;
28
29
  constructor(pool) {
29
30
  this.pool = pool;
30
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ctx_column_sources.js","names":[],"sources":["../../src/columns/ctx_column_sources.ts"],"sourcesContent":["import type { PColumnSpec, PObjectId } from \"@milaboratories/pl-model-common\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport type { RenderCtxBase, ResultPool } from \"../render\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport type { ColumnDataStatus } from \"./column_snapshot\";\nimport type { ColumnSnapshotProvider } from \"./column_snapshot_provider\";\nimport { OutputColumnProvider } from \"./column_snapshot_provider\";\nimport { ResourceTypeName } from \"@milaboratories/pl-model-common\";\nimport type { ValueOf } from \"@milaboratories/helpers\";\n\n/**\n * Collect ColumnSnapshotProviders from `outputs`, `prerun`, and\n * `resultPool` in that order. Dedup keeps the first occurrence per\n * `NativePObjectId`, so a block re-publishing its own columns keeps\n * the `outputs`-rooted canonical id instead of the result-pool variant.\n */\nexport function collectCtxColumnSnapshotProviders(ctx: RenderCtxBase): ColumnSnapshotProvider[] {\n const providers: ColumnSnapshotProvider[] = [];\n\n const outputs = ctx.outputs;\n if (outputs) {\n providers.push(...collectPFrameProviders(outputs));\n }\n\n const prerun = ctx.prerun;\n if (prerun) {\n providers.push(...collectPFrameProviders(prerun));\n }\n\n providers.push(new ResultPoolColumnSnapshotProvider(ctx.resultPool));\n\n return providers;\n}\n\n/**\n * Adapter wrapping ResultPool into the new ColumnSnapshotProvider interface.\n *\n * - `isColumnListComplete()` always returns true — the result pool\n * is a stable snapshot within a single render cycle.\n * - Data status is derived from the underlying TreeNodeAccessor:\n * ready (getIsReadyOrError), computing, or absent (no data resource).\n */\nexport class ResultPoolColumnSnapshotProvider implements ColumnSnapshotProvider {\n constructor(private readonly pool: ResultPool) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n const pColumns = this.pool.selectColumns(() => true);\n return pColumns.map((col) => toSnapshot(col.id, col.spec, col.data));\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n}\n\nfunction toSnapshot(\n id: PObjectId,\n spec: PColumnSpec,\n accessor: TreeNodeAccessor | undefined,\n): ColumnSnapshot<PObjectId> {\n if (accessor === undefined) {\n return { id, spec, dataStatus: \"absent\" as ColumnDataStatus, data: undefined };\n }\n const isReady = accessor.getIsReadyOrError();\n return {\n id,\n spec,\n dataStatus: (isReady ? \"ready\" : \"computing\") as ColumnDataStatus,\n data: { get: () => (isReady ? accessor : undefined) },\n };\n}\n\n/**\n * Recursively walk the output tree starting from `accessor`.\n * - If a node's resourceType is PFrame → wrap it as OutputColumnProvider.\n * - If a node's resourceType is StdMap/std/map → recurse into its output fields.\n * - Otherwise → skip (leaf of unknown type).\n */\nfunction collectPFrameProviders(accessor: TreeNodeAccessor): ColumnSnapshotProvider[] {\n const out: ColumnSnapshotProvider[] = [];\n walkTree(accessor, out);\n return out;\n}\n\nfunction walkTree(node: TreeNodeAccessor, out: ColumnSnapshotProvider[]): void {\n const typeName = node.resourceType.name as ValueOf<typeof ResourceTypeName>;\n\n if (typeName === ResourceTypeName.PFrame) {\n out.push(new OutputColumnProvider(node));\n return;\n }\n\n if (typeName === ResourceTypeName.StdMap || typeName === ResourceTypeName.StdMapSlash) {\n for (const field of node.listInputFields()) {\n const child = node.resolve(field);\n if (child) walkTree(child, out);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAgBA,SAAgB,kCAAkC,KAA8C;CAC9F,MAAM,YAAsC,EAAE;CAE9C,MAAM,UAAU,IAAI;AACpB,KAAI,QACF,WAAU,KAAK,GAAG,uBAAuB,QAAQ,CAAC;CAGpD,MAAM,SAAS,IAAI;AACnB,KAAI,OACF,WAAU,KAAK,GAAG,uBAAuB,OAAO,CAAC;AAGnD,WAAU,KAAK,IAAI,iCAAiC,IAAI,WAAW,CAAC;AAEpE,QAAO;;;;;;;;;;AAWT,IAAa,mCAAb,MAAgF;CAC9E,YAAY,MAAmC;AAAlB,OAAA,OAAA;;CAE7B,gBAA6C;AAE3C,SADiB,KAAK,KAAK,oBAAoB,KAAK,CACpC,KAAK,QAAQ,WAAW,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,CAAC;;CAGtE,uBAAgC;AAC9B,SAAO;;;AAIX,SAAS,WACP,IACA,MACA,UAC2B;AAC3B,KAAI,aAAa,KAAA,EACf,QAAO;EAAE;EAAI;EAAM,YAAY;EAA8B,MAAM,KAAA;EAAW;CAEhF,MAAM,UAAU,SAAS,mBAAmB;AAC5C,QAAO;EACL;EACA;EACA,YAAa,UAAU,UAAU;EACjC,MAAM,EAAE,WAAY,UAAU,WAAW,KAAA,GAAY;EACtD;;;;;;;;AASH,SAAS,uBAAuB,UAAsD;CACpF,MAAM,MAAgC,EAAE;AACxC,UAAS,UAAU,IAAI;AACvB,QAAO;;AAGT,SAAS,SAAS,MAAwB,KAAqC;CAC7E,MAAM,WAAW,KAAK,aAAa;AAEnC,KAAI,aAAa,iBAAiB,QAAQ;AACxC,MAAI,KAAK,IAAI,qBAAqB,KAAK,CAAC;AACxC;;AAGF,KAAI,aAAa,iBAAiB,UAAU,aAAa,iBAAiB,YACxE,MAAK,MAAM,SAAS,KAAK,iBAAiB,EAAE;EAC1C,MAAM,QAAQ,KAAK,QAAQ,MAAM;AACjC,MAAI,MAAO,UAAS,OAAO,IAAI"}
1
+ {"version":3,"file":"ctx_column_sources.js","names":[],"sources":["../../src/columns/ctx_column_sources.ts"],"sourcesContent":["import type { PColumnSpec, PObjectId } from \"@milaboratories/pl-model-common\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport type { RenderCtxBase, ResultPool } from \"../render\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport type { ColumnDataStatus } from \"./column_snapshot\";\nimport type { ColumnSnapshotProvider } from \"./column_snapshot_provider\";\nimport { OutputColumnProvider } from \"./column_snapshot_provider\";\nimport { ResourceTypeName } from \"@milaboratories/pl-model-common\";\nimport type { ValueOf } from \"@milaboratories/helpers\";\n\n/**\n * Collect ColumnSnapshotProviders from `outputs`, `prerun`, and\n * `resultPool` in that order. Dedup keeps the first occurrence per\n * `NativePObjectId`, so a block re-publishing its own columns keeps\n * the `outputs`-rooted canonical id instead of the result-pool variant.\n */\nexport function collectCtxColumnSnapshotProviders(ctx: RenderCtxBase): ColumnSnapshotProvider[] {\n const providers: ColumnSnapshotProvider[] = [];\n\n const outputs = ctx.outputs;\n if (outputs) {\n providers.push(...collectPFrameProviders(outputs));\n }\n\n const prerun = ctx.prerun;\n if (prerun) {\n providers.push(...collectPFrameProviders(prerun));\n }\n\n providers.push(new ResultPoolColumnSnapshotProvider(ctx.resultPool));\n\n return providers;\n}\n\n/**\n * Adapter wrapping ResultPool into the new ColumnSnapshotProvider interface.\n *\n * - `isColumnListComplete()` always returns true — the result pool\n * is a stable snapshot within a single render cycle.\n * - Data status is derived from the underlying TreeNodeAccessor:\n * ready (getIsReadyOrError), computing, or absent (no data resource).\n */\nexport class ResultPoolColumnSnapshotProvider implements ColumnSnapshotProvider {\n constructor(private readonly pool: ResultPool) {}\n\n getAllColumns(): ColumnSnapshot<PObjectId>[] {\n const pColumns = this.pool.selectColumns(() => true);\n return pColumns.map((col) => toSnapshot(col.id, col.spec, col.data));\n }\n\n isColumnListComplete(): boolean {\n return true;\n }\n}\n\nfunction toSnapshot(\n id: PObjectId,\n spec: PColumnSpec,\n accessor: TreeNodeAccessor | undefined,\n): ColumnSnapshot<PObjectId> {\n if (accessor === undefined) {\n return { id, spec, dataStatus: \"absent\" as ColumnDataStatus, data: undefined };\n }\n const isReady = accessor.getIsReadyOrError();\n return {\n id,\n spec,\n dataStatus: (isReady ? \"ready\" : \"computing\") as ColumnDataStatus,\n data: { get: () => (isReady ? accessor : undefined) },\n };\n}\n\n/**\n * Recursively walk the output tree starting from `accessor`.\n * - If a node's resourceType is PFrame → wrap it as OutputColumnProvider.\n * - If a node's resourceType is StdMap/std/map → recurse into its output fields.\n * - Otherwise → skip (leaf of unknown type).\n */\nfunction collectPFrameProviders(accessor: TreeNodeAccessor): ColumnSnapshotProvider[] {\n const out: ColumnSnapshotProvider[] = [];\n walkTree(accessor, out);\n return out;\n}\n\nfunction walkTree(node: TreeNodeAccessor, out: ColumnSnapshotProvider[]): void {\n const typeName = node.resourceType.name as ValueOf<typeof ResourceTypeName>;\n\n if (typeName === ResourceTypeName.PFrame) {\n out.push(new OutputColumnProvider(node));\n return;\n }\n\n if (typeName === ResourceTypeName.StdMap || typeName === ResourceTypeName.StdMapSlash) {\n for (const field of node.listInputFields()) {\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AAQ,KAAK,QAAQ,KAAK;EAChC,IAAI,OAAO,SAAS,OAAO,GAAG;CAChC;AAEJ"}
@@ -1,4 +1,3 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
1
  const require_axis_filtering = require("../render/util/axis_filtering.cjs");
3
2
  const require_pcolumn_data = require("../render/util/pcolumn_data.cjs");
4
3
  const require_column_snapshot = require("./column_snapshot.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"expand_by_partition.cjs","names":["convertOrParsePColumnData","getUniquePartitionKeys","filterDataInfoEntries","createReadyColumnData"],"sources":["../../src/columns/expand_by_partition.ts"],"sourcesContent":["import type {\n AxisFilterByIdx,\n AxisFilterValue,\n AxisId,\n PartitionedDataInfoEntries,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport {\n canonicalizeAxisId,\n entriesToDataInfo,\n getAxisId,\n isPartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"../render/accessor\";\nimport { filterDataInfoEntries } from \"../render/util/axis_filtering\";\nimport { convertOrParsePColumnData, getUniquePartitionKeys } from \"../render/util/pcolumn_data\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport { createReadyColumnData } from \"./column_snapshot\";\n\n// --- Types ---\n\nexport interface SplitAxis {\n /** Index of the axis in the column's axesSpec to split by. */\n readonly idx: number;\n}\n\nexport interface ExpandByPartitionOpts {\n /** Resolve axis values to human-readable labels. */\n axisLabels?: (axisId: AxisId) => undefined | Record<string | number, string>;\n}\n\nexport interface ExpandByPartitionResult {\n /** Expanded snapshots (one per key combination per original snapshot). */\n readonly items: ColumnSnapshot<PObjectId>[];\n /** False if any column's data was not ready for splitting. */\n readonly complete: boolean;\n}\n\n// --- Implementation ---\n\n/**\n * Expand snapshots by splitting along partition axes.\n *\n * For each snapshot, reads partition data, enumerates unique keys on the\n * split axes, and produces one output snapshot per key combination —\n * with the split axes removed from `axesSpec` and a `pl7.app/trace`\n * annotation recording the split origin.\n *\n * Returns `{ items: [], complete: false }` when any snapshot's data\n * is not ready (status !== 'ready' or partition data unavailable).\n */\nexport function expandByPartition(\n snapshots: ColumnSnapshot<PObjectId>[],\n splitAxes: SplitAxis[],\n opts?: ExpandByPartitionOpts,\n): ExpandByPartitionResult {\n if (splitAxes.length === 0) {\n return { items: snapshots, complete: true };\n }\n\n const splitAxisIdxs = splitAxes.map((a) => a.idx).sort((a, b) => a - b);\n const result: ColumnSnapshot<PObjectId>[] = [];\n\n for (const snapshot of snapshots) {\n if (snapshot.dataStatus !== \"ready\" || snapshot.data === undefined) {\n return { items: [], complete: false };\n }\n\n const rawData = snapshot.data.get();\n const dataEntries = convertOrParsePColumnData(rawData as TreeNodeAccessor | undefined);\n\n if (dataEntries === undefined) {\n return { items: [], complete: false };\n }\n\n if (!isPartitionedDataInfoEntries(dataEntries)) {\n throw new Error(\n `Splitting requires Partitioned DataInfoEntries, but got ${dataEntries.type} for column ${String(snapshot.id)}`,\n );\n }\n\n const uniqueKeys = getUniquePartitionKeys(dataEntries);\n\n const maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n if (maxSplitIdx >= dataEntries.partitionKeyLength) {\n throw new Error(\n `Not enough partition keys (${dataEntries.partitionKeyLength}) for requested split axes (max index ${maxSplitIdx}) in column ${snapshot.spec.name}`,\n );\n }\n\n // Resolve labels for each split axis\n const axesLabels: (undefined | Record<string | number, string>)[] = splitAxisIdxs.map((idx) =>\n opts?.axisLabels?.(getAxisId(snapshot.spec.axesSpec[idx])),\n );\n\n // Generate all key combinations across split axes\n const keyCombinations = generateKeyCombinations(uniqueKeys, splitAxisIdxs);\n if (keyCombinations.length === 0) continue;\n\n // Build adjusted axesSpec (remove split axes in reverse order)\n const newAxesSpec = [...snapshot.spec.axesSpec];\n for (let i = splitAxisIdxs.length - 1; i >= 0; i--) {\n newAxesSpec.splice(splitAxisIdxs[i], 1);\n }\n\n for (const keyCombo of keyCombinations) {\n const axisFilters: AxisFilterByIdx[] = keyCombo.map(\n (value, sAxisIdx): AxisFilterByIdx => [splitAxisIdxs[sAxisIdx], value as AxisFilterValue],\n );\n\n const traceEntries = keyCombo.map((value, sAxisIdx) => {\n const axisIdx = splitAxisIdxs[sAxisIdx];\n const axisId = getAxisId(snapshot.spec.axesSpec[axisIdx]);\n const labelMap = axesLabels[sAxisIdx];\n const label = labelMap?.[value] ?? String(value);\n return {\n type: `split:${canonicalizeAxisId(axisId)}`,\n label,\n importance: 1_000_000,\n };\n });\n\n const filteredData = filterDataInfoEntries(\n dataEntries as PartitionedDataInfoEntries<TreeNodeAccessor>,\n axisFilters,\n );\n\n const adjustedSpec = {\n ...snapshot.spec,\n axesSpec: newAxesSpec,\n annotations: {\n ...snapshot.spec.annotations,\n \"pl7.app/trace\": JSON.stringify(traceEntries),\n },\n };\n\n result.push({\n id: snapshot.id,\n spec: adjustedSpec,\n dataStatus: \"ready\",\n data: createReadyColumnData(() => entriesToDataInfo(filteredData)),\n });\n }\n }\n\n return { items: result, complete: true };\n}\n\nconst MAX_KEY_COMBINATIONS = 10_000;\n\nfunction generateKeyCombinations(\n uniqueKeys: (string | number)[][],\n splitAxisIdxs: number[],\n): (string | number)[][] {\n const combinations: (string | number)[][] = [];\n\n function generate(currentCombo: (string | number)[], sAxisIdx: number): void {\n if (sAxisIdx >= splitAxisIdxs.length) {\n combinations.push([...currentCombo]);\n if (combinations.length > MAX_KEY_COMBINATIONS) {\n throw new Error(\"Too many key combinations, aborting.\");\n }\n return;\n }\n\n const axisIdx = splitAxisIdxs[sAxisIdx];\n if (axisIdx >= uniqueKeys.length) {\n throw new Error(\n `Axis index ${axisIdx} out of bounds for unique keys array (length ${uniqueKeys.length})`,\n );\n }\n\n const axisValues = uniqueKeys[axisIdx];\n if (!axisValues || axisValues.length === 0) {\n combinations.length = 0;\n return;\n }\n\n for (const val of axisValues) {\n currentCombo.push(val);\n generate(currentCombo, sAxisIdx + 1);\n currentCombo.pop();\n }\n }\n\n generate([], 0);\n return combinations;\n}\n"],"mappings":";;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}
1
+ {"version":3,"file":"expand_by_partition.cjs","names":["convertOrParsePColumnData","getUniquePartitionKeys","filterDataInfoEntries","createReadyColumnData"],"sources":["../../src/columns/expand_by_partition.ts"],"sourcesContent":["import type {\n AxisFilterByIdx,\n AxisFilterValue,\n AxisId,\n PartitionedDataInfoEntries,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport {\n canonicalizeAxisId,\n entriesToDataInfo,\n getAxisId,\n isPartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"../render/accessor\";\nimport { filterDataInfoEntries } from \"../render/util/axis_filtering\";\nimport { convertOrParsePColumnData, getUniquePartitionKeys } from \"../render/util/pcolumn_data\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport { createReadyColumnData } from \"./column_snapshot\";\n\n// --- Types ---\n\nexport interface SplitAxis {\n /** Index of the axis in the column's axesSpec to split by. */\n readonly idx: number;\n}\n\nexport interface ExpandByPartitionOpts {\n /** Resolve axis values to human-readable labels. */\n axisLabels?: (axisId: AxisId) => undefined | Record<string | number, string>;\n}\n\nexport interface ExpandByPartitionResult {\n /** Expanded snapshots (one per key combination per original snapshot). */\n readonly items: ColumnSnapshot<PObjectId>[];\n /** False if any column's data was not ready for splitting. */\n readonly complete: boolean;\n}\n\n// --- Implementation ---\n\n/**\n * Expand snapshots by splitting along partition axes.\n *\n * For each snapshot, reads partition data, enumerates unique keys on the\n * split axes, and produces one output snapshot per key combination —\n * with the split axes removed from `axesSpec` and a `pl7.app/trace`\n * annotation recording the split origin.\n *\n * Returns `{ items: [], complete: false }` when any snapshot's data\n * is not ready (status !== 'ready' or partition data unavailable).\n */\nexport function expandByPartition(\n snapshots: ColumnSnapshot<PObjectId>[],\n splitAxes: SplitAxis[],\n opts?: ExpandByPartitionOpts,\n): ExpandByPartitionResult {\n if (splitAxes.length === 0) {\n return { items: snapshots, complete: true };\n }\n\n const splitAxisIdxs = splitAxes.map((a) => a.idx).sort((a, b) => a - b);\n const result: ColumnSnapshot<PObjectId>[] = [];\n\n for (const snapshot of snapshots) {\n if (snapshot.dataStatus !== \"ready\" || snapshot.data === undefined) {\n return { items: [], complete: false };\n }\n\n const rawData = snapshot.data.get();\n const dataEntries = convertOrParsePColumnData(rawData as TreeNodeAccessor | undefined);\n\n if (dataEntries === undefined) {\n return { items: [], complete: false };\n }\n\n if (!isPartitionedDataInfoEntries(dataEntries)) {\n throw new Error(\n `Splitting requires Partitioned DataInfoEntries, but got ${dataEntries.type} for column ${String(snapshot.id)}`,\n );\n }\n\n const uniqueKeys = getUniquePartitionKeys(dataEntries);\n\n const maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n if (maxSplitIdx >= dataEntries.partitionKeyLength) {\n throw new Error(\n `Not enough partition keys (${dataEntries.partitionKeyLength}) for requested split axes (max index ${maxSplitIdx}) in column ${snapshot.spec.name}`,\n );\n }\n\n // Resolve labels for each split axis\n const axesLabels: (undefined | Record<string | number, string>)[] = splitAxisIdxs.map((idx) =>\n opts?.axisLabels?.(getAxisId(snapshot.spec.axesSpec[idx])),\n );\n\n // Generate all key combinations across split axes\n const keyCombinations = generateKeyCombinations(uniqueKeys, splitAxisIdxs);\n if (keyCombinations.length === 0) continue;\n\n // Build adjusted axesSpec (remove split axes in reverse order)\n const newAxesSpec = [...snapshot.spec.axesSpec];\n for (let i = splitAxisIdxs.length - 1; i >= 0; i--) {\n newAxesSpec.splice(splitAxisIdxs[i], 1);\n }\n\n for (const keyCombo of keyCombinations) {\n const axisFilters: AxisFilterByIdx[] = keyCombo.map(\n (value, sAxisIdx): AxisFilterByIdx => [splitAxisIdxs[sAxisIdx], value as AxisFilterValue],\n );\n\n const traceEntries = keyCombo.map((value, sAxisIdx) => {\n const axisIdx = splitAxisIdxs[sAxisIdx];\n const axisId = getAxisId(snapshot.spec.axesSpec[axisIdx]);\n const labelMap = axesLabels[sAxisIdx];\n const label = labelMap?.[value] ?? String(value);\n return {\n type: `split:${canonicalizeAxisId(axisId)}`,\n label,\n importance: 1_000_000,\n };\n });\n\n const filteredData = filterDataInfoEntries(\n dataEntries as PartitionedDataInfoEntries<TreeNodeAccessor>,\n axisFilters,\n );\n\n const adjustedSpec = {\n ...snapshot.spec,\n axesSpec: newAxesSpec,\n annotations: {\n ...snapshot.spec.annotations,\n \"pl7.app/trace\": JSON.stringify(traceEntries),\n },\n };\n\n result.push({\n id: snapshot.id,\n spec: adjustedSpec,\n dataStatus: \"ready\",\n data: createReadyColumnData(() => entriesToDataInfo(filteredData)),\n });\n }\n }\n\n return { items: result, complete: true };\n}\n\nconst MAX_KEY_COMBINATIONS = 10_000;\n\nfunction generateKeyCombinations(\n uniqueKeys: (string | number)[][],\n splitAxisIdxs: number[],\n): (string | number)[][] {\n const combinations: (string | number)[][] = [];\n\n function generate(currentCombo: (string | number)[], sAxisIdx: number): void {\n if (sAxisIdx >= splitAxisIdxs.length) {\n combinations.push([...currentCombo]);\n if (combinations.length > MAX_KEY_COMBINATIONS) {\n throw new Error(\"Too many key combinations, aborting.\");\n }\n return;\n }\n\n const axisIdx = splitAxisIdxs[sAxisIdx];\n if (axisIdx >= uniqueKeys.length) {\n throw new Error(\n `Axis index ${axisIdx} out of bounds for unique keys array (length ${uniqueKeys.length})`,\n );\n }\n\n const axisValues = uniqueKeys[axisIdx];\n if (!axisValues || axisValues.length === 0) {\n combinations.length = 0;\n return;\n }\n\n for (const val of axisValues) {\n currentCombo.push(val);\n generate(currentCombo, sAxisIdx + 1);\n currentCombo.pop();\n }\n }\n\n generate([], 0);\n return combinations;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAgB,kBACd,WACA,WACA,MACyB;CACzB,IAAI,UAAU,WAAW,GACvB,OAAO;EAAE,OAAO;EAAW,UAAU;CAAK;CAG5C,MAAM,gBAAgB,UAAU,KAAK,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,GAAG,MAAM,IAAI,CAAC;CACtE,MAAM,SAAsC,CAAC;CAE7C,KAAK,MAAM,Y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A,mBAAA,CAA4B,MAAM;KACxC;KACA,YAAY;IACd;GACF,CAAC;GAED,MAAM,eAAeC,uBAAAA,sBACnB,aACA,WACF;GAEA,MAAM,eAAe;IACnB,GAAG,SAAS;IACZ,UAAU;IACV,aAAa;KACX,GAAG,SAAS,KAAK;KACjB,iBAAiB,KAAK,UAAU,YAAY;IAC9C;GACF;GAEA,OAAO,KAAK;IACV,IAAI,SAAS;IACb,MAAM;IACN,YAAY;IACZ,MAAMC,wBAAAA,6BAAAA,GAAAA,gCAAAA,kBAAAA,CAA8C,YAAY,CAAC;GACnE,CAAC;EACH;CACF;CAEA,OAAO;EAAE,OAAO;EAAQ,UAAU;CAAK;AACzC;AAEA,MAAM,uBAAuB;AAE7B,SAAS,wBACP,YACA,eACuB;CACvB,MAAM,eAAsC,CAAC;CAE7C,SAAS,SAAS,cAAmC,UAAwB;EAC3E,IAAI,YAAY,cAAc,QAAQ;GACpC,aAAa,KAAK,CAAC,GAAG,YAAY,CAAC;GACnC,IAAI,aAAa,SAAS,sBACxB,MAAM,IAAI,MAAM,sCAAsC;GAExD;EACF;EAEA,MAAM,UAAU,cAAc;EAC9B,IAAI,WAAW,WAAW,QACxB,MAAM,IAAI,MACR,cAAc,QAAQ,+CAA+C,WAAW,OAAO,EACzF;EAGF,MAAM,aAAa,WAAW;EAC9B,IAAI,CAAC,cAAc,WAAW,WAAW,GAAG;GAC1C,aAAa,SAAS;GACtB;EACF;EAEA,KAAK,MAAM,OAAO,YAAY;GAC5B,aAAa,KAAK,GAAG;GACrB,SAAS,cAAc,WAAW,CAAC;GACnC,aAAa,IAAI;EACnB;CACF;CAEA,SAAS,CAAC,GAAG,CAAC;CACd,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"expand_by_partition.d.ts","names":[],"sources":["../../src/columns/expand_by_partition.ts"],"mappings":";;;;UAqBiB,SAAA;;WAEN,GAAA;AAAA;AAAA,UAGM,qBAAA;EAHN;EAKT,UAAA,IAAc,MAAA,EAAQ,MAAA,iBAAuB,MAAA;AAAA;AAAA,UAG9B,uBAAA;;WAEN,KAAA,EAAO,cAAA,CAAe,SAAA;EAL/B;EAAA,SAOS,QAAA;AAAA;;;;AAJX;;;;;;;;iBAoBgB,iBAAA,CACd,SAAA,EAAW,cAAA,CAAe,SAAA,KAC1B,SAAA,EAAW,SAAA,IACX,IAAA,GAAO,qBAAA,GACN,uBAAA"}
1
+ {"version":3,"file":"expand_by_partition.d.ts","names":[],"sources":["../../src/columns/expand_by_partition.ts"],"mappings":";;;;UAqBiB,SAAA;;WAEN,GAAG;AAAA;AAAA,UAGG,qBAAA;EAHH;EAKZ,UAAA,IAAc,MAAA,EAAQ,MAAA,iBAAuB,MAAM;AAAA;AAAA,UAGpC,uBAAA;;WAEN,KAAA,EAAO,cAAc,CAAC,SAAA;EAL/B;EAAA,SAOS,QAAA;AAAA;;;AAP0C;AAGrD;;;;;;;;iBAoBgB,iBAAA,CACd,SAAA,EAAW,cAAA,CAAe,SAAA,KAC1B,SAAA,EAAW,SAAA,IACX,IAAA,GAAO,qBAAA,GACN,uBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"expand_by_partition.js","names":[],"sources":["../../src/columns/expand_by_partition.ts"],"sourcesContent":["import type {\n AxisFilterByIdx,\n AxisFilterValue,\n AxisId,\n PartitionedDataInfoEntries,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport {\n canonicalizeAxisId,\n entriesToDataInfo,\n getAxisId,\n isPartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"../render/accessor\";\nimport { filterDataInfoEntries } from \"../render/util/axis_filtering\";\nimport { convertOrParsePColumnData, getUniquePartitionKeys } from \"../render/util/pcolumn_data\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport { createReadyColumnData } from \"./column_snapshot\";\n\n// --- Types ---\n\nexport interface SplitAxis {\n /** Index of the axis in the column's axesSpec to split by. */\n readonly idx: number;\n}\n\nexport interface ExpandByPartitionOpts {\n /** Resolve axis values to human-readable labels. */\n axisLabels?: (axisId: AxisId) => undefined | Record<string | number, string>;\n}\n\nexport interface ExpandByPartitionResult {\n /** Expanded snapshots (one per key combination per original snapshot). */\n readonly items: ColumnSnapshot<PObjectId>[];\n /** False if any column's data was not ready for splitting. */\n readonly complete: boolean;\n}\n\n// --- Implementation ---\n\n/**\n * Expand snapshots by splitting along partition axes.\n *\n * For each snapshot, reads partition data, enumerates unique keys on the\n * split axes, and produces one output snapshot per key combination —\n * with the split axes removed from `axesSpec` and a `pl7.app/trace`\n * annotation recording the split origin.\n *\n * Returns `{ items: [], complete: false }` when any snapshot's data\n * is not ready (status !== 'ready' or partition data unavailable).\n */\nexport function expandByPartition(\n snapshots: ColumnSnapshot<PObjectId>[],\n splitAxes: SplitAxis[],\n opts?: ExpandByPartitionOpts,\n): ExpandByPartitionResult {\n if (splitAxes.length === 0) {\n return { items: snapshots, complete: true };\n }\n\n const splitAxisIdxs = splitAxes.map((a) => a.idx).sort((a, b) => a - b);\n const result: ColumnSnapshot<PObjectId>[] = [];\n\n for (const snapshot of snapshots) {\n if (snapshot.dataStatus !== \"ready\" || snapshot.data === undefined) {\n return { items: [], complete: false };\n }\n\n const rawData = snapshot.data.get();\n const dataEntries = convertOrParsePColumnData(rawData as TreeNodeAccessor | undefined);\n\n if (dataEntries === undefined) {\n return { items: [], complete: false };\n }\n\n if (!isPartitionedDataInfoEntries(dataEntries)) {\n throw new Error(\n `Splitting requires Partitioned DataInfoEntries, but got ${dataEntries.type} for column ${String(snapshot.id)}`,\n );\n }\n\n const uniqueKeys = getUniquePartitionKeys(dataEntries);\n\n const maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n if (maxSplitIdx >= dataEntries.partitionKeyLength) {\n throw new Error(\n `Not enough partition keys (${dataEntries.partitionKeyLength}) for requested split axes (max index ${maxSplitIdx}) in column ${snapshot.spec.name}`,\n );\n }\n\n // Resolve labels for each split axis\n const axesLabels: (undefined | Record<string | number, string>)[] = splitAxisIdxs.map((idx) =>\n opts?.axisLabels?.(getAxisId(snapshot.spec.axesSpec[idx])),\n );\n\n // Generate all key combinations across split axes\n const keyCombinations = generateKeyCombinations(uniqueKeys, splitAxisIdxs);\n if (keyCombinations.length === 0) continue;\n\n // Build adjusted axesSpec (remove split axes in reverse order)\n const newAxesSpec = [...snapshot.spec.axesSpec];\n for (let i = splitAxisIdxs.length - 1; i >= 0; i--) {\n newAxesSpec.splice(splitAxisIdxs[i], 1);\n }\n\n for (const keyCombo of keyCombinations) {\n const axisFilters: AxisFilterByIdx[] = keyCombo.map(\n (value, sAxisIdx): AxisFilterByIdx => [splitAxisIdxs[sAxisIdx], value as AxisFilterValue],\n );\n\n const traceEntries = keyCombo.map((value, sAxisIdx) => {\n const axisIdx = splitAxisIdxs[sAxisIdx];\n const axisId = getAxisId(snapshot.spec.axesSpec[axisIdx]);\n const labelMap = axesLabels[sAxisIdx];\n const label = labelMap?.[value] ?? String(value);\n return {\n type: `split:${canonicalizeAxisId(axisId)}`,\n label,\n importance: 1_000_000,\n };\n });\n\n const filteredData = filterDataInfoEntries(\n dataEntries as PartitionedDataInfoEntries<TreeNodeAccessor>,\n axisFilters,\n );\n\n const adjustedSpec = {\n ...snapshot.spec,\n axesSpec: newAxesSpec,\n annotations: {\n ...snapshot.spec.annotations,\n \"pl7.app/trace\": JSON.stringify(traceEntries),\n },\n };\n\n result.push({\n id: snapshot.id,\n spec: adjustedSpec,\n dataStatus: \"ready\",\n data: createReadyColumnData(() => entriesToDataInfo(filteredData)),\n });\n }\n }\n\n return { items: result, complete: true };\n}\n\nconst MAX_KEY_COMBINATIONS = 10_000;\n\nfunction generateKeyCombinations(\n uniqueKeys: (string | number)[][],\n splitAxisIdxs: number[],\n): (string | number)[][] {\n const combinations: (string | number)[][] = [];\n\n function generate(currentCombo: (string | number)[], sAxisIdx: number): void {\n if (sAxisIdx >= splitAxisIdxs.length) {\n combinations.push([...currentCombo]);\n if (combinations.length > MAX_KEY_COMBINATIONS) {\n throw new Error(\"Too many key combinations, aborting.\");\n }\n return;\n }\n\n const axisIdx = splitAxisIdxs[sAxisIdx];\n if (axisIdx >= uniqueKeys.length) {\n throw new Error(\n `Axis index ${axisIdx} out of bounds for unique keys array (length ${uniqueKeys.length})`,\n );\n }\n\n const axisValues = uniqueKeys[axisIdx];\n if (!axisValues || axisValues.length === 0) {\n combinations.length = 0;\n return;\n }\n\n for (const val of axisValues) {\n currentCombo.push(val);\n generate(currentCombo, sAxisIdx + 1);\n currentCombo.pop();\n }\n }\n\n generate([], 0);\n return combinations;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAgB,kBACd,WACA,WACA,MACyB;AACzB,KAAI,UAAU,WAAW,EACvB,QAAO;EAAE,OAAO;EAAW,UAAU;EAAM;CAG7C,MAAM,gBAAgB,UAAU,KAAK,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE;CACvE,MAAM,SAAsC,EAAE;AAE9C,MAAK,MAAM,YAAY,WAAW;AAChC,MAAI,SAAS,eAAe,WAAW,SAAS,SAAS,KAAA,EACvD,QAAO;GAAE,OAAO,EAAE;GAAE,UAAU;GAAO;EAIvC,MAAM,cAAc,0BADJ,SAAS,KAAK,KAAK,CACmD;AAEtF,MAAI,gBAAgB,KAAA,EAClB,QAAO;GAAE,OAAO,EAAE;GAAE,UAAU;GAAO;AAGvC,MAAI,CAAC,6BAA6B,YAAY,CAC5C,OAAM,IAAI,MACR,2DAA2D,YAAY,KAAK,cAAc,OAAO,SAAS,GAAG,GAC9G;EAGH,MAAM,aAAa,uBAAuB,YAAY;EAEtD,MAAM,cAAc,cAAc,cAAc,SAAS;AACzD,MAAI,eAAe,YAAY,mBAC7B,OAAM,IAAI,MACR,8BAA8B,YAAY,mBAAmB,wCAAwC,YAAY,cAAc,SAAS,KAAK,OAC9I;EAIH,MAAM,aAA8D,cAAc,KAAK,QACrF,MAAM,aAAa,UAAU,SAAS,KAAK,SAAS,KAAK,CAAC,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W,OAAO,GACxF;EAGH,MAAM,aAAa,WAAW;AAC9B,MAAI,CAAC,cAAc,WAAW,WAAW,GAAG;AAC1C,gBAAa,SAAS;AACtB;;AAGF,OAAK,MAAM,OAAO,YAAY;AAC5B,gBAAa,KAAK,IAAI;AACtB,YAAS,cAAc,WAAW,EAAE;AACpC,gBAAa,KAAK;;;AAItB,UAAS,EAAE,EAAE,EAAE;AACf,QAAO"}
1
+ {"version":3,"file":"expand_by_partition.js","names":[],"sources":["../../src/columns/expand_by_partition.ts"],"sourcesContent":["import type {\n AxisFilterByIdx,\n AxisFilterValue,\n AxisId,\n PartitionedDataInfoEntries,\n PObjectId,\n} from \"@milaboratories/pl-model-common\";\nimport {\n canonicalizeAxisId,\n entriesToDataInfo,\n getAxisId,\n isPartitionedDataInfoEntries,\n} from \"@milaboratories/pl-model-common\";\nimport type { TreeNodeAccessor } from \"../render/accessor\";\nimport { filterDataInfoEntries } from \"../render/util/axis_filtering\";\nimport { convertOrParsePColumnData, getUniquePartitionKeys } from \"../render/util/pcolumn_data\";\nimport type { ColumnSnapshot } from \"./column_snapshot\";\nimport { createReadyColumnData } from \"./column_snapshot\";\n\n// --- Types ---\n\nexport interface SplitAxis {\n /** Index of the axis in the column's axesSpec to split by. */\n readonly idx: number;\n}\n\nexport interface ExpandByPartitionOpts {\n /** Resolve axis values to human-readable labels. */\n axisLabels?: (axisId: AxisId) => undefined | Record<string | number, string>;\n}\n\nexport interface ExpandByPartitionResult {\n /** Expanded snapshots (one per key combination per original snapshot). */\n readonly items: ColumnSnapshot<PObjectId>[];\n /** False if any column's data was not ready for splitting. */\n readonly complete: boolean;\n}\n\n// --- Implementation ---\n\n/**\n * Expand snapshots by splitting along partition axes.\n *\n * For each snapshot, reads partition data, enumerates unique keys on the\n * split axes, and produces one output snapshot per key combination —\n * with the split axes removed from `axesSpec` and a `pl7.app/trace`\n * annotation recording the split origin.\n *\n * Returns `{ items: [], complete: false }` when any snapshot's data\n * is not ready (status !== 'ready' or partition data unavailable).\n */\nexport function expandByPartition(\n snapshots: ColumnSnapshot<PObjectId>[],\n splitAxes: SplitAxis[],\n opts?: ExpandByPartitionOpts,\n): ExpandByPartitionResult {\n if (splitAxes.length === 0) {\n return { items: snapshots, complete: true };\n }\n\n const splitAxisIdxs = splitAxes.map((a) => a.idx).sort((a, b) => a - b);\n const result: ColumnSnapshot<PObjectId>[] = [];\n\n for (const snapshot of snapshots) {\n if (snapshot.dataStatus !== \"ready\" || snapshot.data === undefined) {\n return { items: [], complete: false };\n }\n\n const rawData = snapshot.data.get();\n const dataEntries = convertOrParsePColumnData(rawData as TreeNodeAccessor | undefined);\n\n if (dataEntries === undefined) {\n return { items: [], complete: false };\n }\n\n if (!isPartitionedDataInfoEntries(dataEntries)) {\n throw new Error(\n `Splitting requires Partitioned DataInfoEntries, but got ${dataEntries.type} for column ${String(snapshot.id)}`,\n );\n }\n\n const uniqueKeys = getUniquePartitionKeys(dataEntries);\n\n const maxSplitIdx = splitAxisIdxs[splitAxisIdxs.length - 1];\n if (maxSplitIdx >= dataEntries.partitionKeyLength) {\n throw new Error(\n `Not enough partition keys (${dataEntries.partitionKeyLength}) for requested split axes (max index ${maxSplitIdx}) in column ${snapshot.spec.name}`,\n );\n }\n\n // Resolve labels for each split axis\n const axesLabels: (undefined | Record<string | number, string>)[] = splitAxisIdxs.map((idx) =>\n opts?.axisLabels?.(getAxisId(snapshot.spec.axesSpec[idx])),\n );\n\n // Generate all key combinations across split axes\n const keyCombinations = generateKeyCombinations(uniqueKeys, splitAxisIdxs);\n if (keyCombinations.length === 0) continue;\n\n // Build adjusted axesSpec (remove split axes in reverse order)\n const newAxesSpec = [...snapshot.spec.axesSpec];\n for (let i = splitAxisIdxs.length - 1; i >= 0; i--) {\n newAxesSpec.splice(splitAxisIdxs[i], 1);\n }\n\n for (const keyCombo of keyCombinations) {\n const axisFilters: AxisFilterByIdx[] = keyCombo.map(\n (value, sAxisIdx): AxisFilterByIdx => [splitAxisIdxs[sAxisIdx], value as AxisFilterValue],\n );\n\n const traceEntries = keyCombo.map((value, sAxisIdx) => {\n const axisIdx = splitAxisIdxs[sAxisIdx];\n const axisId = getAxisId(snapshot.spec.axesSpec[axisIdx]);\n const labelMap = axesLabels[sAxisIdx];\n const label = labelMap?.[value] ?? String(value);\n return {\n type: `split:${canonicalizeAxisId(axisId)}`,\n label,\n importance: 1_000_000,\n };\n });\n\n const filteredData = filterDataInfoEntries(\n dataEntries as PartitionedDataInfoEntries<TreeNodeAccessor>,\n axisFilters,\n );\n\n const adjustedSpec = {\n ...snapshot.spec,\n axesSpec: newAxesSpec,\n annotations: {\n ...snapshot.spec.annotations,\n \"pl7.app/trace\": JSON.stringify(traceEntries),\n },\n };\n\n result.push({\n id: snapshot.id,\n spec: adjustedSpec,\n dataStatus: \"ready\",\n data: createReadyColumnData(() => entriesToDataInfo(filteredData)),\n });\n }\n }\n\n return { items: result, complete: true };\n}\n\nconst MAX_KEY_COMBINATIONS = 10_000;\n\nfunction generateKeyCombinations(\n uniqueKeys: (string | number)[][],\n splitAxisIdxs: number[],\n): (string | number)[][] {\n const combinations: (string | number)[][] = [];\n\n function generate(currentCombo: (string | number)[], sAxisIdx: number): void {\n if (sAxisIdx >= splitAxisIdxs.length) {\n combinations.push([...currentCombo]);\n if (combinations.length > MAX_KEY_COMBINATIONS) {\n throw new Error(\"Too many key combinations, aborting.\");\n }\n return;\n }\n\n const axisIdx = splitAxisIdxs[sAxisIdx];\n if (axisIdx >= uniqueKeys.length) {\n throw new Error(\n `Axis index ${axisIdx} out of bounds for unique keys array (length ${uniqueKeys.length})`,\n );\n }\n\n const axisValues = uniqueKeys[axisIdx];\n if (!axisValues || axisValues.length === 0) {\n combinations.length = 0;\n return;\n }\n\n for (const val of axisValues) {\n currentCombo.push(val);\n generate(currentCombo, sAxisIdx + 1);\n currentCombo.pop();\n }\n }\n\n generate([], 0);\n return combinations;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmDA,SAAgB,kBACd,WACA,WACA,MACyB;CAC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UAAU,SAAS,KAAK,SAAS,QAAQ;IAExD,MAAM,QADW,WAAW,SACN,GAAG,UAAU,OAAO,KAAK;IAC/C,OAAO;KACL,MAAM,SAAS,mBAAmB,MAAM;KACxC;KACA,YAAY;IACd;GACF,CAAC;GAED,MAAM,eAAe,sBACnB,aACA,WACF;GAEA,MAAM,eAAe;IACnB,GAAG,SAAS;IACZ,UAAU;IACV,aAAa;KACX,GAAG,SAAS,KAAK;KACjB,iBAAiB,KAAK,UAAU,YAAY;IAC9C;GACF;GAEA,OAAO,KAAK;IACV,IAAI,SAAS;IACb,MAAM;IACN,YAAY;IACZ,MAAM,4BAA4B,kBAAkB,YAAY,CAAC;GACnE,CAAC;EACH;CACF;CAEA,OAAO;EAAE,OAAO;EAAQ,UAAU;CAAK;AACzC;AAEA,MAAM,uBAAuB;AAE7B,SAAS,wBACP,YACA,eACuB;CACvB,MAAM,eAAsC,CAAC;CAE7C,SAAS,SAAS,cAAmC,UAAwB;EAC3E,IAAI,YAAY,cAAc,QAAQ;GACpC,aAAa,KAAK,CAAC,GAAG,YAAY,CAAC;GACnC,IAAI,aAAa,SAAS,sBACxB,MAAM,IAAI,MAAM,sCAAsC;GAExD;EACF;EAEA,MAAM,UAAU,cAAc;EAC9B,IAAI,WAAW,WAAW,QACxB,MAAM,IAAI,MACR,cAAc,QAAQ,+CAA+C,WAAW,OAAO,EACzF;EAGF,MAAM,aAAa,WAAW;EAC9B,IAAI,CAAC,cAAc,WAAW,WAAW,GAAG;GAC1C,aAAa,SAAS;GACtB;EACF;EAEA,KAAK,MAAM,OAAO,YAAY;GAC5B,aAAa,KAAK,GAAG;GACrB,SAAS,cAAc,WAAW,CAAC;GACnC,aAAa,IAAI;EACnB;CACF;CAEA,SAAS,CAAC,GAAG,CAAC;CACd,OAAO;AACT"}
@@ -1,6 +1,20 @@
1
- require("./column_snapshot.cjs");
2
- require("./column_snapshot_provider.cjs");
3
- require("./column_selector.cjs");
4
- require("./column_collection_builder.cjs");
5
- require("./ctx_column_sources.cjs");
6
- require("./expand_by_partition.cjs");
1
+ const require_column_snapshot = require("./column_snapshot.cjs");
2
+ const require_column_snapshot_provider = require("./column_snapshot_provider.cjs");
3
+ const require_column_selector = require("./column_selector.cjs");
4
+ const require_column_collection_builder = require("./column_collection_builder.cjs");
5
+ const require_ctx_column_sources = require("./ctx_column_sources.cjs");
6
+ const require_expand_by_partition = require("./expand_by_partition.cjs");
7
+ exports.ArrayColumnProvider = require_column_snapshot_provider.ArrayColumnProvider;
8
+ exports.ColumnCollectionBuilder = require_column_collection_builder.ColumnCollectionBuilder;
9
+ exports.OutputColumnProvider = require_column_snapshot_provider.OutputColumnProvider;
10
+ exports.ResultPoolColumnSnapshotProvider = require_ctx_column_sources.ResultPoolColumnSnapshotProvider;
11
+ exports.SnapshotColumnProvider = require_column_snapshot_provider.SnapshotColumnProvider;
12
+ exports.collectCtxColumnSnapshotProviders = require_ctx_column_sources.collectCtxColumnSnapshotProviders;
13
+ exports.convertColumnSelectorToMultiColumnSelector = require_column_selector.convertColumnSelectorToMultiColumnSelector;
14
+ exports.convertRelaxedAxisSelectorToMultiAxisSelector = require_column_selector.convertRelaxedAxisSelectorToMultiAxisSelector;
15
+ exports.convertRelaxedColumnSelectorToMultiColumnSelector = require_column_selector.convertRelaxedColumnSelectorToMultiColumnSelector;
16
+ exports.createColumnSnapshot = require_column_snapshot.createColumnSnapshot;
17
+ exports.createReadyColumnData = require_column_snapshot.createReadyColumnData;
18
+ exports.expandByPartition = require_expand_by_partition.expandByPartition;
19
+ exports.isColumnSnapshotProvider = require_column_snapshot_provider.isColumnSnapshotProvider;
20
+ exports.toColumnSnapshotProvider = require_column_snapshot_provider.toColumnSnapshotProvider;
@@ -3,4 +3,5 @@ import { ColumnData, ColumnDataStatus, ColumnSnapshot, createColumnSnapshot, cre
3
3
  import { ArrayColumnProvider, ColumnSnapshotProvider, ColumnSource, OutputColumnProvider, OutputColumnProviderOpts, SnapshotColumnProvider, isColumnSnapshotProvider, toColumnSnapshotProvider } from "./column_snapshot_provider.js";
4
4
  import { AnchorEntry, AnchoredBuildOptions, AnchoredColumnCollection, AnchoredFindColumnsOptions, BuildOptions, ColumnCollection, ColumnCollectionBuilder, ColumnMatch, ColumnVariant, FindColumnsOptions, MatchQualifications, MatchVariant, MatchingMode } from "./column_collection_builder.js";
5
5
  import { ResultPoolColumnSnapshotProvider, collectCtxColumnSnapshotProviders } from "./ctx_column_sources.js";
6
- import { ExpandByPartitionOpts, ExpandByPartitionResult, SplitAxis, expandByPartition } from "./expand_by_partition.js";
6
+ import { ExpandByPartitionOpts, ExpandByPartitionResult, SplitAxis, expandByPartition } from "./expand_by_partition.js";
7
+ export { AnchorEntry, AnchoredBuildOptions, AnchoredColumnCollection, AnchoredFindColumnsOptions, ArrayColumnProvider, BuildOptions, ColumnCollection, ColumnCollectionBuilder, ColumnData, ColumnDataStatus, ColumnMatch, ColumnSelector, ColumnSnapshot, ColumnSnapshotProvider, ColumnSource, ColumnVariant, ExpandByPartitionOpts, ExpandByPartitionResult, FindColumnsOptions, MatchQualifications, MatchVariant, MatchingMode, OutputColumnProvider, OutputColumnProviderOpts, RelaxedAxisSelector, RelaxedColumnSelector, RelaxedRecord, RelaxedStringMatchers, ResultPoolColumnSnapshotProvider, SnapshotColumnProvider, SplitAxis, type StringMatcher, collectCtxColumnSnapshotProviders, convertColumnSelectorToMultiColumnSelector, convertRelaxedAxisSelectorToMultiAxisSelector, convertRelaxedColumnSelectorToMultiColumnSelector, createColumnSnapshot, createReadyColumnData, expandByPartition, isColumnSnapshotProvider, toColumnSnapshotProvider };
@@ -1,6 +1,7 @@
1
- import "./column_snapshot.js";
2
- import "./column_snapshot_provider.js";
3
- import "./column_selector.js";
4
- import "./column_collection_builder.js";
5
- import "./ctx_column_sources.js";
6
- import "./expand_by_partition.js";
1
+ import { createColumnSnapshot, createReadyColumnData } from "./column_snapshot.js";
2
+ import { ArrayColumnProvider, OutputColumnProvider, SnapshotColumnProvider, isColumnSnapshotProvider, toColumnSnapshotProvider } from "./column_snapshot_provider.js";
3
+ import { convertColumnSelectorToMultiColumnSelector, convertRelaxedAxisSelectorToMultiAxisSelector, convertRelaxedColumnSelectorToMultiColumnSelector } from "./column_selector.js";
4
+ import { ColumnCollectionBuilder } from "./column_collection_builder.js";
5
+ import { ResultPoolColumnSnapshotProvider, collectCtxColumnSnapshotProviders } from "./ctx_column_sources.js";
6
+ import { expandByPartition } from "./expand_by_partition.js";
7
+ export { ArrayColumnProvider, ColumnCollectionBuilder, OutputColumnProvider, ResultPoolColumnSnapshotProvider, SnapshotColumnProvider, collectCtxColumnSnapshotProviders, convertColumnSelectorToMultiColumnSelector, convertRelaxedAxisSelectorToMultiAxisSelector, convertRelaxedColumnSelectorToMultiColumnSelector, createColumnSnapshot, createReadyColumnData, expandByPartition, isColumnSnapshotProvider, toColumnSnapshotProvider };
@@ -1,5 +1,4 @@
1
- require("../_virtual/_rolldown/runtime.cjs");
2
- require("../pframe_utils/axes.cjs");
1
+ const require_axes = require("../pframe_utils/axes.cjs");
3
2
  const require_columns = require("../pframe_utils/columns.cjs");
4
3
  let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
5
4
  //#region src/components/PFrameForGraphs.ts
@@ -31,6 +30,8 @@ function createPFrameForGraphs(ctx, blockColumns) {
31
30
  }
32
31
  //#endregion
33
32
  exports.createPFrameForGraphs = createPFrameForGraphs;
33
+ exports.enrichCompatible = require_axes.enrichCompatible;
34
+ exports.getAvailableWithLinkersAxes = require_axes.getAvailableWithLinkersAxes;
34
35
  exports.isHiddenFromGraphColumn = isHiddenFromGraphColumn;
35
36
  exports.isHiddenFromUIColumn = isHiddenFromUIColumn;
36
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"PFrameForGraphs.cjs","names":["Annotation","getAllRelatedColumns","getRelatedColumns"],"sources":["../../src/components/PFrameForGraphs.ts"],"sourcesContent":["import type { PColumn, PColumnSpec, PFrameHandle } from \"@milaboratories/pl-model-common\";\nimport { Annotation, readAnnotationJson } from \"@milaboratories/pl-model-common\";\nimport type { PColumnDataUniversal, RenderCtxBase } from \"../render\";\nimport { getAllRelatedColumns, getRelatedColumns } from \"../pframe_utils/columns\";\nexport type { AxesVault } from \"../pframe_utils/axes\";\nexport { enrichCompatible, getAvailableWithLinkersAxes } from \"../pframe_utils/axes\";\n\nexport function isHiddenFromGraphColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n}\n\nexport function isHiddenFromUIColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromUi);\n}\n\n/**\n The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n (including linker columns and all label columns).\n Block’s columns are added to pframe as is.\n Other columns are added basing on set of axes of block’s columns, considering available with linker columns.\n Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\n result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\n among existing ones).\n In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\n of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\n and modified label (with added domain values in case if more than one copy with different domains exist).\n */\nexport function createPFrameForGraphs<A, U>(\n ctx: RenderCtxBase<A, U>,\n blockColumns?: PColumn<PColumnDataUniversal>[],\n): PFrameHandle | undefined {\n const suitableSpec = (spec: PColumnSpec) =>\n !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n // if current block doesn't produce own columns then use all columns from result pool\n if (!blockColumns) {\n return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n }\n\n return ctx.createPFrame(\n getRelatedColumns(ctx, { columns: blockColumns, predicate: suitableSpec }),\n );\n}\n"],"mappings":";;;;;AAOA,SAAgB,wBAAwB,QAA8B;AACpE,QAAO,CAAC,EAAA,GAAA,gCAAA,oBAAoB,QAAQA,gCAAAA,WAAW,mBAAmB;;AAGpE,SAAgB,qBAAqB,QAA8B;AACjE,QAAO,CAAC,EAAA,GAAA,gCAAA,oBAAoB,QAAQA,gCAAAA,WAAW,eAAe;;;;;;;;;;;;;;AAehE,SAAgB,sBACd,KACA,cAC0B;CAC1B,MAAM,gBAAgB,SACpB,CAAC,qBAAqB,KAAK,IAAI,CAAC,wBAAwB,KAAK;AAE/D,KAAI,CAAC,aACH,QAAO,IAAI,aAAaC,gBAAAA,qBAAqB,KAAK,aAAa,CAAC;AAGlE,QAAO,IAAI,aACTC,gBAAAA,kBAAkB,KAAK;EAAE,SAAS;EAAc,WAAW;EAAc,CAAC,CAC3E"}
1
+ {"version":3,"file":"PFrameForGraphs.cjs","names":["Annotation","getAllRelatedColumns","getRelatedColumns"],"sources":["../../src/components/PFrameForGraphs.ts"],"sourcesContent":["import type { PColumn, PColumnSpec, PFrameHandle } from \"@milaboratories/pl-model-common\";\nimport { Annotation, readAnnotationJson } from \"@milaboratories/pl-model-common\";\nimport type { PColumnDataUniversal, RenderCtxBase } from \"../render\";\nimport { getAllRelatedColumns, getRelatedColumns } from \"../pframe_utils/columns\";\nexport type { AxesVault } from \"../pframe_utils/axes\";\nexport { enrichCompatible, getAvailableWithLinkersAxes } from \"../pframe_utils/axes\";\n\nexport function isHiddenFromGraphColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n}\n\nexport function isHiddenFromUIColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromUi);\n}\n\n/**\n The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n (including linker columns and all label columns).\n Block’s columns are added to pframe as is.\n Other columns are added basing on set of axes of block’s columns, considering available with linker columns.\n Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\n result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\n among existing ones).\n In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\n of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\n and modified label (with added domain values in case if more than one copy with different domains exist).\n */\nexport function createPFrameForGraphs<A, U>(\n ctx: RenderCtxBase<A, U>,\n blockColumns?: PColumn<PColumnDataUniversal>[],\n): PFrameHandle | undefined {\n const suitableSpec = (spec: PColumnSpec) =>\n !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n // if current block doesn't produce own columns then use all columns from result pool\n if (!blockColumns) {\n return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n }\n\n return ctx.createPFrame(\n getRelatedColumns(ctx, { columns: blockColumns, predicate: suitableSpec }),\n );\n}\n"],"mappings":";;;;AAOA,SAAgB,wBAAwB,QAA8B;CACpE,OAAO,CAAC,EAAA,GAAA,gCAAA,mBAAA,CAAoB,QAAQA,gCAAAA,WAAW,kBAAkB;AACnE;AAEA,SAAgB,qBAAqB,QAA8B;CACjE,OAAO,CAAC,EAAA,GAAA,gCAAA,mBAAA,CAAoB,QAAQA,gCAAAA,WAAW,cAAc;AAC/D;;;;;;;;;;;;;AAcA,SAAgB,sBACd,KACA,cAC0B;CAC1B,MAAM,gBAAgB,SACpB,CAAC,qBAAqB,IAAI,KAAK,CAAC,wBAAwB,IAAI;CAE9D,IAAI,CAAC,cACH,OAAO,IAAI,aAAaC,gBAAAA,qBAAqB,KAAK,YAAY,CAAC;CAGjE,OAAO,IAAI,aACTC,gBAAAA,kBAAkB,KAAK;EAAE,SAAS;EAAc,WAAW;CAAa,CAAC,CAC3E;AACF"}
@@ -20,5 +20,5 @@ declare function isHiddenFromUIColumn(column: PColumnSpec): boolean;
20
20
  */
21
21
  declare function createPFrameForGraphs<A, U>(ctx: RenderCtxBase<A, U>, blockColumns?: PColumn<PColumnDataUniversal>[]): PFrameHandle | undefined;
22
22
  //#endregion
23
- export { createPFrameForGraphs, isHiddenFromGraphColumn, isHiddenFromUIColumn };
23
+ export { type AxesVault, createPFrameForGraphs, enrichCompatible, getAvailableWithLinkersAxes, isHiddenFromGraphColumn, isHiddenFromUIColumn };
24
24
  //# sourceMappingURL=PFrameForGraphs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PFrameForGraphs.d.ts","names":[],"sources":["../../src/components/PFrameForGraphs.ts"],"mappings":";;;;;;iBAOgB,uBAAA,CAAwB,MAAA,EAAQ,WAAA;AAAA,iBAIhC,oBAAA,CAAqB,MAAA,EAAQ,WAAA;;AAJ7C;;;;;AAIA;;;;;AAgBA;iBAAgB,qBAAA,MAAA,CACd,GAAA,EAAK,aAAA,CAAc,CAAA,EAAG,CAAA,GACtB,YAAA,GAAe,OAAA,CAAQ,oBAAA,MACtB,YAAA"}
1
+ {"version":3,"file":"PFrameForGraphs.d.ts","names":[],"sources":["../../src/components/PFrameForGraphs.ts"],"mappings":";;;;;;iBAOgB,uBAAA,CAAwB,MAAmB,EAAX,WAAW;AAAA,iBAI3C,oBAAA,CAAqB,MAAmB,EAAX,WAAW;;AAJxD;;;;AAA2D;AAI3D;;;;AAAwD;AAgBxD;iBAAgB,qBAAA,OACd,GAAA,EAAK,aAAA,CAAc,CAAA,EAAG,CAAA,GACtB,YAAA,GAAe,OAAA,CAAQ,oBAAA,MACtB,YAAA"}
@@ -1,4 +1,4 @@
1
- import "../pframe_utils/axes.js";
1
+ import { enrichCompatible, getAvailableWithLinkersAxes } from "../pframe_utils/axes.js";
2
2
  import { getAllRelatedColumns, getRelatedColumns } from "../pframe_utils/columns.js";
3
3
  import { Annotation, readAnnotationJson } from "@milaboratories/pl-model-common";
4
4
  //#region src/components/PFrameForGraphs.ts
@@ -29,6 +29,6 @@ function createPFrameForGraphs(ctx, blockColumns) {
29
29
  }));
30
30
  }
31
31
  //#endregion
32
- export { createPFrameForGraphs, isHiddenFromGraphColumn, isHiddenFromUIColumn };
32
+ export { createPFrameForGraphs, enrichCompatible, getAvailableWithLinkersAxes, isHiddenFromGraphColumn, isHiddenFromUIColumn };
33
33
 
34
34
  //# sourceMappingURL=PFrameForGraphs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PFrameForGraphs.js","names":[],"sources":["../../src/components/PFrameForGraphs.ts"],"sourcesContent":["import type { PColumn, PColumnSpec, PFrameHandle } from \"@milaboratories/pl-model-common\";\nimport { Annotation, readAnnotationJson } from \"@milaboratories/pl-model-common\";\nimport type { PColumnDataUniversal, RenderCtxBase } from \"../render\";\nimport { getAllRelatedColumns, getRelatedColumns } from \"../pframe_utils/columns\";\nexport type { AxesVault } from \"../pframe_utils/axes\";\nexport { enrichCompatible, getAvailableWithLinkersAxes } from \"../pframe_utils/axes\";\n\nexport function isHiddenFromGraphColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n}\n\nexport function isHiddenFromUIColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromUi);\n}\n\n/**\n The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n (including linker columns and all label columns).\n Block’s columns are added to pframe as is.\n Other columns are added basing on set of axes of block’s columns, considering available with linker columns.\n Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\n result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\n among existing ones).\n In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\n of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\n and modified label (with added domain values in case if more than one copy with different domains exist).\n */\nexport function createPFrameForGraphs<A, U>(\n ctx: RenderCtxBase<A, U>,\n blockColumns?: PColumn<PColumnDataUniversal>[],\n): PFrameHandle | undefined {\n const suitableSpec = (spec: PColumnSpec) =>\n !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n // if current block doesn't produce own columns then use all columns from result pool\n if (!blockColumns) {\n return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n }\n\n return ctx.createPFrame(\n getRelatedColumns(ctx, { columns: blockColumns, predicate: suitableSpec }),\n );\n}\n"],"mappings":";;;;AAOA,SAAgB,wBAAwB,QAA8B;AACpE,QAAO,CAAC,CAAC,mBAAmB,QAAQ,WAAW,mBAAmB;;AAGpE,SAAgB,qBAAqB,QAA8B;AACjE,QAAO,CAAC,CAAC,mBAAmB,QAAQ,WAAW,eAAe;;;;;;;;;;;;;;AAehE,SAAgB,sBACd,KACA,cAC0B;CAC1B,MAAM,gBAAgB,SACpB,CAAC,qBAAqB,KAAK,IAAI,CAAC,wBAAwB,KAAK;AAE/D,KAAI,CAAC,aACH,QAAO,IAAI,aAAa,qBAAqB,KAAK,aAAa,CAAC;AAGlE,QAAO,IAAI,aACT,kBAAkB,KAAK;EAAE,SAAS;EAAc,WAAW;EAAc,CAAC,CAC3E"}
1
+ {"version":3,"file":"PFrameForGraphs.js","names":[],"sources":["../../src/components/PFrameForGraphs.ts"],"sourcesContent":["import type { PColumn, PColumnSpec, PFrameHandle } from \"@milaboratories/pl-model-common\";\nimport { Annotation, readAnnotationJson } from \"@milaboratories/pl-model-common\";\nimport type { PColumnDataUniversal, RenderCtxBase } from \"../render\";\nimport { getAllRelatedColumns, getRelatedColumns } from \"../pframe_utils/columns\";\nexport type { AxesVault } from \"../pframe_utils/axes\";\nexport { enrichCompatible, getAvailableWithLinkersAxes } from \"../pframe_utils/axes\";\n\nexport function isHiddenFromGraphColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);\n}\n\nexport function isHiddenFromUIColumn(column: PColumnSpec): boolean {\n return !!readAnnotationJson(column, Annotation.HideDataFromUi);\n}\n\n/**\n The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool\n (including linker columns and all label columns).\n Block’s columns are added to pframe as is.\n Other columns are added basing on set of axes of block’s columns, considering available with linker columns.\n Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from\n result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values\n among existing ones).\n In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case\n of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)\n and modified label (with added domain values in case if more than one copy with different domains exist).\n */\nexport function createPFrameForGraphs<A, U>(\n ctx: RenderCtxBase<A, U>,\n blockColumns?: PColumn<PColumnDataUniversal>[],\n): PFrameHandle | undefined {\n const suitableSpec = (spec: PColumnSpec) =>\n !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);\n // if current block doesn't produce own columns then use all columns from result pool\n if (!blockColumns) {\n return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));\n }\n\n return ctx.createPFrame(\n getRelatedColumns(ctx, { columns: blockColumns, predicate: suitableSpec }),\n );\n}\n"],"mappings":";;;;AAOA,SAAgB,wBAAwB,QAA8B;CACpE,OAAO,CAAC,CAAC,mBAAmB,QAAQ,WAAW,kBAAkB;AACnE;AAEA,SAAgB,qBAAqB,QAA8B;CACjE,OAAO,CAAC,CAAC,mBAAmB,QAAQ,WAAW,cAAc;AAC/D;;;;;;;;;;;;;AAcA,SAAgB,sBACd,KACA,cAC0B;CAC1B,MAAM,gBAAgB,SACpB,CAAC,qBAAqB,IAAI,KAAK,CAAC,wBAAwB,IAAI;CAE9D,IAAI,CAAC,cACH,OAAO,IAAI,aAAa,qBAAqB,KAAK,YAAY,CAAC;CAGjE,OAAO,IAAI,aACT,kBAAkB,KAAK;EAAE,SAAS;EAAc,WAAW;CAAa,CAAC,CAC3E;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"filter.d.ts","names":[],"sources":["../../../src/components/PlAnnotations/filter.ts"],"mappings":";;;;;AAWA;;;KAAY,sBAAA;EACV,IAAA,YAUU;EARV,KAAA;AAAA;;;AAiBF;;;KATY,kCAAA;EACV,IAAA,wBAcU;EAZV,KAAA;AAAA;;;;KAMU,gBAAA,GAAmB,sBAAA,GAAyB,kCAAA;;;;;KAM5C,aAAA;EACV,IAAA;EAEA,MAAA,EAAQ,mBAAA,EAqBR;EAnBA,SAAA,EAAW,gBAAA;AAAA;;;;AAoCb;;;;;;;;KAlBY,SAAA;EACV,WAAA,UAkCU;EAhCV,MAAA,EAAQ,mBAAA;EAER,UAAA;AAAA;;;;;AA0CF;;;;;;KA7BY,mB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,KAAA;AAAA;AAsCqB;AAGvB;;;AAHuB,KA/BX,cAAA;;;;;;;;;;;;AAsCF;;;;;;;;;;;;KAbE,gBAAA;oCAEV,KAAA;EAEA,IAAA,EAAM,cAAA;EAEN,KAAA,EAAO,cAAc;AAAA;AAAA,KAGX,iBAAA,WAA4B,cAAA;wCAEtC,IAAA,EAAM,cAAA;EAEN,KAAA,EAAO,CAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"filters_ui.cjs","names":[],"sources":["../../../src/components/PlAnnotations/filters_ui.ts"],"sourcesContent":["// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations\nimport type { SUniversalPColumnId } from \"@milaboratories/pl-model-common\";\nimport type { FilterSpecUi } from \"../../annotations\";\nimport type { FilterSpec, FilterSpecLeaf } from \"../../filters\";\nimport type {\n AnnotationFilter,\n AnnotationMode,\n AnnotationScript,\n IsNA,\n NotFilter,\n NumericalComparisonFilter,\n PatternFilter,\n PatternPredicate,\n ValueRank,\n} from \"./filter\";\n\nexport type FilterUi = FilterSpec<\n Extract<\n FilterSpecLeaf,\n // supported filters\n {\n type:\n | \"lessThan\"\n | \"greaterThan\"\n | \"lessThanOrEqual\"\n | \"greaterThanOrEqual\"\n | \"lessThanColumn\"\n | \"lessThanColumnOrEqual\"\n | \"patternContainSubsequence\"\n | \"patternNotContainSubsequence\"\n | \"patternEquals\"\n | \"patternNotEquals\"\n | \"topN\"\n | \"bottomN\"\n | \"isNA\"\n | \"isNotNA\";\n }\n >,\n { id: number; name?: string; isExpanded?: boolean }\n>;\n\nexport type FilterUiType = Exclude<FilterUi, { type: undefined }>[\"type\"];\n\nexport type FilterUiOfType<T extends FilterUiType> = Extract<FilterUi, { type: T }>;\n\n// DEPRECATED - use lib/ui/uikit/src/composition/filters\nexport function unreachable(x: never): never {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n throw new Error(\"Unexpected object: \" + x);\n}\n\nexport type TypeToLiteral<T> = [T] extends [FilterUiType]\n ? \"FilterUiType\"\n : [T] extends [SUniversalPColumnId]\n ? \"SUniversalPColumnId\"\n : [T] extends [PatternPredicate]\n ? \"PatternPredicate\"\n : [T] extends [AnnotationFilter[]]\n ? \"AnnotationFilter[]\"\n : [T] extends [AnnotationFilter]\n ? \"AnnotationFilter\"\n : [T] extends [number]\n ? \"number\"\n : [T] extends [number | undefined]\n ? \"number?\"\n : [T] extends [string]\n ? \"string\"\n : [T] extends [string | undefined]\n ? \"string?\"\n : [T] extends [boolean]\n ? \"boolean\"\n : [T] extends [boolean | undefined]\n ? \"boolean?\"\n : [T] extends [unknown[]]\n ? \"unknown[]\"\n : // this is special\n T extends number\n ? \"number\"\n : T extends string\n ? \"string\"\n : T extends boolean\n ? \"boolean\"\n : T extends Record<string, unknown>\n ? \"form\"\n : \"unknown\";\n\n// @TODO: \"parse\" option\nexport type TypeField<V> = {\n fieldType: TypeToLiteral<V>;\n label: string;\n defaultValue: () => V | undefined;\n};\n\nexport type TypeFieldRecord<T extends FilterUi> = { [K in keyof T]: TypeField<T[K]> };\n\nexport type TypeForm<T> = {\n [P in keyof T]: T[P] extends Record<string, unknown>\n ? {\n fieldType: \"form\";\n label?: string;\n form?: T[P] extends Record<string, unknown> ? TypeForm<T[P]> : undefined;\n defaultValue: () => T[P];\n }\n : TypeField<T[P]>;\n};\n\nexport type FormField =\n | {\n fieldType: \"form\";\n form?: Record<string, FormField>;\n defaultValue: () => Record<string, unknown>;\n }\n | TypeField<FilterUiType>\n | TypeField<string>\n | TypeField<number>\n | TypeField<number | undefined>\n | TypeField<boolean>\n | TypeField<boolean | undefined>\n | TypeField<SUniversalPColumnId>;\n\nexport type AnyForm = Record<string, FormField>;\n\nexport type AnnotationStepUi = FilterSpecUi<Extract<FilterUi, { type: \"and\" | \"or\" }>> & {\n id: number;\n};\n\nexport type AnnotationScriptUi = {\n isCreated?: boolean;\n title: string;\n mode: AnnotationMode;\n steps: AnnotationStepUi[];\n};\n\nexport function compileFilter(ui: FilterUi): AnnotationFilter {\n if (ui.type === \"or\") {\n return {\n type: \"or\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"and\") {\n return {\n type: \"and\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"not\") {\n return {\n type: \"not\" as const,\n filter: compileFilter(ui.filter),\n };\n }\n\n if (ui.type === \"isNA\") {\n return {\n type: \"isNA\" as const,\n column: ui.column,\n };\n }\n\n if (ui.type === \"isNotNA\") {\n const isNAFilter: IsNA = { type: \"isNA\", column: ui.column };\n const notFilter: NotFilter = { type: \"not\", filter: isNAFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternEquals\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"equals\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotEquals\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"equals\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternContainSubsequence\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"containSubsequence\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotContainSubsequence\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"containSubsequence\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"topN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n descending: true,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"bottomN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"lessThan\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThan\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanColumn\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: undefined,\n };\n }\n\n if (ui.type === \"lessThanColumnOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: true,\n };\n }\n\n unreachable(ui);\n}\n\nexport function compileFilters(uiFilters: FilterUi[]): AnnotationFilter[] {\n return uiFilters.filter((f) => f.type !== undefined).map(compileFilter);\n}\n\nexport function compileAnnotationScript(uiScript: AnnotationScriptUi): AnnotationScript {\n return {\n title: uiScript.title,\n mode: uiScript.mode,\n steps: uiScript.steps\n .filter((step) => {\n // No need to compile empty steps\n if (step.filter.type == null) {\n return false;\n }\n\n if (step.filter.type === \"or\") {\n return step.filter.filters.length > 0;\n }\n\n if (step.filter.type === \"and\") {\n return step.filter.filters.length > 0;\n }\n\n return false;\n })\n .map((step) => ({\n label: step.label.trim(),\n filter: compileFilter(step.filter),\n })),\n };\n}\n"],"mappings":";AA8CA,SAAgB,YAAY,GAAiB;AAE3C,OAAM,IAAI,MAAM,wBAAwB,EAAE;;AAqF5C,SAAgB,cAAc,IAAgC;AAC5D,KAAI,GAAG,SAAS,KACd,QAAO;EACL,MAAM;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KAAK,GAAG;EACR,KAAK,GAAG;EACT;AAGH,KAAI,GAAG,SAAS,cACd,QAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACT;AAGH,KAAI,GAAG,SAAS,qBACd,QAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,YAAY;EACb;AAGH,KAAI,GAAG,SAAS,kBACd,QAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,YAAY;EACb;AAGH,KAAI,GAAG,SAAS,iBACd,QAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,SAAS,GAAG;EACZ,YAAY,KAAA;EACb;AAGH,KAAI,GAAG,SAAS,wBACd,QAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,SAAS,GAAG;EACZ,YAAY;EACb;AAGH,aAAY,GAAG;;AAGjB,SAAgB,eAAe,WAA2C;AACxE,QAAO,UAAU,QAAQ,MAAM,EAAE,SAAS,KAAA,EAAU,CAAC,IAAI,cAAc;;AAGzE,SAAgB,wBAAwB,UAAgD;AACtF,QAAO;EACL,OAAO,SAAS;EAChB,MAAM,SAAS;EACf,OAAO,SAAS,MACb,QAAQ,SAAS;AAEhB,OAAI,KAAK,OAAO,QAAQ,KACtB,QAAO;AAGT,OAAI,KAAK,OAAO,SAAS,KACvB,QAAO,KAAK,OAAO,QAAQ,SAAS;AAGtC,OAAI,KAAK,OAAO,SAAS,MACvB,QAAO,KAAK,OAAO,QAAQ,SAAS;AAGtC,UAAO;IACP,CACD,KAAK,UAAU;GACd,OAAO,KAAK,MAAM,MAAM;GACxB,QAAQ,cAAc,KAAK,OAAO;GACnC,EAAE;EACN"}
1
+ {"version":3,"file":"filters_ui.cjs","names":[],"sources":["../../../src/components/PlAnnotations/filters_ui.ts"],"sourcesContent":["// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations\nimport type { SUniversalPColumnId } from \"@milaboratories/pl-model-common\";\nimport type { FilterSpecUi } from \"../../annotations\";\nimport type { FilterSpec, FilterSpecLeaf } from \"../../filters\";\nimport type {\n AnnotationFilter,\n AnnotationMode,\n AnnotationScript,\n IsNA,\n NotFilter,\n NumericalComparisonFilter,\n PatternFilter,\n PatternPredicate,\n ValueRank,\n} from \"./filter\";\n\nexport type FilterUi = FilterSpec<\n Extract<\n FilterSpecLeaf,\n // supported filters\n {\n type:\n | \"lessThan\"\n | \"greaterThan\"\n | \"lessThanOrEqual\"\n | \"greaterThanOrEqual\"\n | \"lessThanColumn\"\n | \"lessThanColumnOrEqual\"\n | \"patternContainSubsequence\"\n | \"patternNotContainSubsequence\"\n | \"patternEquals\"\n | \"patternNotEquals\"\n | \"topN\"\n | \"bottomN\"\n | \"isNA\"\n | \"isNotNA\";\n }\n >,\n { id: number; name?: string; isExpanded?: boolean }\n>;\n\nexport type FilterUiType = Exclude<FilterUi, { type: undefined }>[\"type\"];\n\nexport type FilterUiOfType<T extends FilterUiType> = Extract<FilterUi, { type: T }>;\n\n// DEPRECATED - use lib/ui/uikit/src/composition/filters\nexport function unreachable(x: never): never {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n throw new Error(\"Unexpected object: \" + x);\n}\n\nexport type TypeToLiteral<T> = [T] extends [FilterUiType]\n ? \"FilterUiType\"\n : [T] extends [SUniversalPColumnId]\n ? \"SUniversalPColumnId\"\n : [T] extends [PatternPredicate]\n ? \"PatternPredicate\"\n : [T] extends [AnnotationFilter[]]\n ? \"AnnotationFilter[]\"\n : [T] extends [AnnotationFilter]\n ? \"AnnotationFilter\"\n : [T] extends [number]\n ? \"number\"\n : [T] extends [number | undefined]\n ? \"number?\"\n : [T] extends [string]\n ? \"string\"\n : [T] extends [string | undefined]\n ? \"string?\"\n : [T] extends [boolean]\n ? \"boolean\"\n : [T] extends [boolean | undefined]\n ? \"boolean?\"\n : [T] extends [unknown[]]\n ? \"unknown[]\"\n : // this is special\n T extends number\n ? \"number\"\n : T extends string\n ? \"string\"\n : T extends boolean\n ? \"boolean\"\n : T extends Record<string, unknown>\n ? \"form\"\n : \"unknown\";\n\n// @TODO: \"parse\" option\nexport type TypeField<V> = {\n fieldType: TypeToLiteral<V>;\n label: string;\n defaultValue: () => V | undefined;\n};\n\nexport type TypeFieldRecord<T extends FilterUi> = { [K in keyof T]: TypeField<T[K]> };\n\nexport type TypeForm<T> = {\n [P in keyof T]: T[P] extends Record<string, unknown>\n ? {\n fieldType: \"form\";\n label?: string;\n form?: T[P] extends Record<string, unknown> ? TypeForm<T[P]> : undefined;\n defaultValue: () => T[P];\n }\n : TypeField<T[P]>;\n};\n\nexport type FormField =\n | {\n fieldType: \"form\";\n form?: Record<string, FormField>;\n defaultValue: () => Record<string, unknown>;\n }\n | TypeField<FilterUiType>\n | TypeField<string>\n | TypeField<number>\n | TypeField<number | undefined>\n | TypeField<boolean>\n | TypeField<boolean | undefined>\n | TypeField<SUniversalPColumnId>;\n\nexport type AnyForm = Record<string, FormField>;\n\nexport type AnnotationStepUi = FilterSpecUi<Extract<FilterUi, { type: \"and\" | \"or\" }>> & {\n id: number;\n};\n\nexport type AnnotationScriptUi = {\n isCreated?: boolean;\n title: string;\n mode: AnnotationMode;\n steps: AnnotationStepUi[];\n};\n\nexport function compileFilter(ui: FilterUi): AnnotationFilter {\n if (ui.type === \"or\") {\n return {\n type: \"or\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"and\") {\n return {\n type: \"and\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"not\") {\n return {\n type: \"not\" as const,\n filter: compileFilter(ui.filter),\n };\n }\n\n if (ui.type === \"isNA\") {\n return {\n type: \"isNA\" as const,\n column: ui.column,\n };\n }\n\n if (ui.type === \"isNotNA\") {\n const isNAFilter: IsNA = { type: \"isNA\", column: ui.column };\n const notFilter: NotFilter = { type: \"not\", filter: isNAFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternEquals\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"equals\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotEquals\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"equals\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternContainSubsequence\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"containSubsequence\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotContainSubsequence\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"containSubsequence\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"topN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n descending: true,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"bottomN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"lessThan\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThan\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanColumn\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: undefined,\n };\n }\n\n if (ui.type === \"lessThanColumnOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: true,\n };\n }\n\n unreachable(ui);\n}\n\nexport function compileFilters(uiFilters: FilterUi[]): AnnotationFilter[] {\n return uiFilters.filter((f) => f.type !== undefined).map(compileFilter);\n}\n\nexport function compileAnnotationScript(uiScript: AnnotationScriptUi): AnnotationScript {\n return {\n title: uiScript.title,\n mode: uiScript.mode,\n steps: uiScript.steps\n .filter((step) => {\n // No need to compile empty steps\n if (step.filter.type == null) {\n return false;\n }\n\n if (step.filter.type === \"or\") {\n return step.filter.filters.length > 0;\n }\n\n if (step.filter.type === \"and\") {\n return step.filter.filters.length > 0;\n }\n\n return false;\n })\n .map((step) => ({\n label: step.label.trim(),\n filter: compileFilter(step.filter),\n })),\n };\n}\n"],"mappings":";AA8CA,SAAgB,YAAY,GAAiB;CAE3C,MAAM,IAAI,MAAM,wBAAwB,CAAC;AAC3C;AAoFA,SAAgB,cAAc,IAAgC;CAC5D,IAAI,GAAG,SAAS,MACd,OAAO;EACL,MAAM;EACN,SAAS,eAAe,GAAG,OAAO;CACpC;CAGF,IAAI,GAAG,SAAS,OACd,OAAO;EACL,MAAM;EACN,SAAS,eAAe,GAAG,OAAO;CACpC;CAGF,IAAI,GAAG,SAAS,OACd,OAAO;EACL,MAAM;EACN,QAAQ,cAAc,GAAG,MAAM;CACjC;CAGF,IAAI,GAAG,SAAS,QACd,OAAO;EACL,MAAM;EACN,QAAQ,GAAG;CACb;CAGF,IAAI,GAAG,SAAS,WAGd,OAAO;EADwB,MAAM;EAAO,QAAQ;GADzB,MAAM;GAAQ,QAAQ,GAAG;EACS;CAC9C;CAGjB,IAAI,GAAG,SAAS,iBACd,OAAO;EACL,MAAM;EACN,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WACA,SAAA,uBACA,SAAA,YACA,SAAA,wBACA,SAAA,CAAU,mBAAA;AAAA,KAEF,OAAA,GAAU,MAAM,SAAS,SAAA;AAAA,KAEzB,gBAAA,GAAmB,YAAA,CAAa,OAAA,CAAQ,QAAA;EAAY,IAAA;AAAA;EAC9D,EAAA;AAAA;AAAA,KAGU,kBAAA;EACV,SAAA;EACA,KAAA;EACA,IAAA,EAAM,cAAA;EACN,KAAA,EAAO,gBAAgB;AAAA;AAAA,iBAGT,aAAA,CAAc,EAAA,EAAI,QAAA,GAAW,gBAAgB;AAAA,iBAmK7C,cAAA,CAAe,SAAA,EAAW,QAAA,KAAa,gBAAgB;AAAA,iBAIvD,uBAAA,CAAwB,QAAA,EAAU,kBAAA,GAAqB,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"filters_ui.js","names":[],"sources":["../../../src/components/PlAnnotations/filters_ui.ts"],"sourcesContent":["// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations\nimport type { SUniversalPColumnId } from \"@milaboratories/pl-model-common\";\nimport type { FilterSpecUi } from \"../../annotations\";\nimport type { FilterSpec, FilterSpecLeaf } from \"../../filters\";\nimport type {\n AnnotationFilter,\n AnnotationMode,\n AnnotationScript,\n IsNA,\n NotFilter,\n NumericalComparisonFilter,\n PatternFilter,\n PatternPredicate,\n ValueRank,\n} from \"./filter\";\n\nexport type FilterUi = FilterSpec<\n Extract<\n FilterSpecLeaf,\n // supported filters\n {\n type:\n | \"lessThan\"\n | \"greaterThan\"\n | \"lessThanOrEqual\"\n | \"greaterThanOrEqual\"\n | \"lessThanColumn\"\n | \"lessThanColumnOrEqual\"\n | \"patternContainSubsequence\"\n | \"patternNotContainSubsequence\"\n | \"patternEquals\"\n | \"patternNotEquals\"\n | \"topN\"\n | \"bottomN\"\n | \"isNA\"\n | \"isNotNA\";\n }\n >,\n { id: number; name?: string; isExpanded?: boolean }\n>;\n\nexport type FilterUiType = Exclude<FilterUi, { type: undefined }>[\"type\"];\n\nexport type FilterUiOfType<T extends FilterUiType> = Extract<FilterUi, { type: T }>;\n\n// DEPRECATED - use lib/ui/uikit/src/composition/filters\nexport function unreachable(x: never): never {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n throw new Error(\"Unexpected object: \" + x);\n}\n\nexport type TypeToLiteral<T> = [T] extends [FilterUiType]\n ? \"FilterUiType\"\n : [T] extends [SUniversalPColumnId]\n ? \"SUniversalPColumnId\"\n : [T] extends [PatternPredicate]\n ? \"PatternPredicate\"\n : [T] extends [AnnotationFilter[]]\n ? \"AnnotationFilter[]\"\n : [T] extends [AnnotationFilter]\n ? \"AnnotationFilter\"\n : [T] extends [number]\n ? \"number\"\n : [T] extends [number | undefined]\n ? \"number?\"\n : [T] extends [string]\n ? \"string\"\n : [T] extends [string | undefined]\n ? \"string?\"\n : [T] extends [boolean]\n ? \"boolean\"\n : [T] extends [boolean | undefined]\n ? \"boolean?\"\n : [T] extends [unknown[]]\n ? \"unknown[]\"\n : // this is special\n T extends number\n ? \"number\"\n : T extends string\n ? \"string\"\n : T extends boolean\n ? \"boolean\"\n : T extends Record<string, unknown>\n ? \"form\"\n : \"unknown\";\n\n// @TODO: \"parse\" option\nexport type TypeField<V> = {\n fieldType: TypeToLiteral<V>;\n label: string;\n defaultValue: () => V | undefined;\n};\n\nexport type TypeFieldRecord<T extends FilterUi> = { [K in keyof T]: TypeField<T[K]> };\n\nexport type TypeForm<T> = {\n [P in keyof T]: T[P] extends Record<string, unknown>\n ? {\n fieldType: \"form\";\n label?: string;\n form?: T[P] extends Record<string, unknown> ? TypeForm<T[P]> : undefined;\n defaultValue: () => T[P];\n }\n : TypeField<T[P]>;\n};\n\nexport type FormField =\n | {\n fieldType: \"form\";\n form?: Record<string, FormField>;\n defaultValue: () => Record<string, unknown>;\n }\n | TypeField<FilterUiType>\n | TypeField<string>\n | TypeField<number>\n | TypeField<number | undefined>\n | TypeField<boolean>\n | TypeField<boolean | undefined>\n | TypeField<SUniversalPColumnId>;\n\nexport type AnyForm = Record<string, FormField>;\n\nexport type AnnotationStepUi = FilterSpecUi<Extract<FilterUi, { type: \"and\" | \"or\" }>> & {\n id: number;\n};\n\nexport type AnnotationScriptUi = {\n isCreated?: boolean;\n title: string;\n mode: AnnotationMode;\n steps: AnnotationStepUi[];\n};\n\nexport function compileFilter(ui: FilterUi): AnnotationFilter {\n if (ui.type === \"or\") {\n return {\n type: \"or\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"and\") {\n return {\n type: \"and\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"not\") {\n return {\n type: \"not\" as const,\n filter: compileFilter(ui.filter),\n };\n }\n\n if (ui.type === \"isNA\") {\n return {\n type: \"isNA\" as const,\n column: ui.column,\n };\n }\n\n if (ui.type === \"isNotNA\") {\n const isNAFilter: IsNA = { type: \"isNA\", column: ui.column };\n const notFilter: NotFilter = { type: \"not\", filter: isNAFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternEquals\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"equals\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotEquals\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"equals\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternContainSubsequence\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"containSubsequence\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotContainSubsequence\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"containSubsequence\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"topN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n descending: true,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"bottomN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"lessThan\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThan\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanColumn\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: undefined,\n };\n }\n\n if (ui.type === \"lessThanColumnOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: true,\n };\n }\n\n unreachable(ui);\n}\n\nexport function compileFilters(uiFilters: FilterUi[]): AnnotationFilter[] {\n return uiFilters.filter((f) => f.type !== undefined).map(compileFilter);\n}\n\nexport function compileAnnotationScript(uiScript: AnnotationScriptUi): AnnotationScript {\n return {\n title: uiScript.title,\n mode: uiScript.mode,\n steps: uiScript.steps\n .filter((step) => {\n // No need to compile empty steps\n if (step.filter.type == null) {\n return false;\n }\n\n if (step.filter.type === \"or\") {\n return step.filter.filters.length > 0;\n }\n\n if (step.filter.type === \"and\") {\n return step.filter.filters.length > 0;\n }\n\n return false;\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,MAAM;GACxB,QAAQ,cAAc,KAAK,OAAO;GACnC,EAAE;EACN"}
1
+ {"version":3,"file":"filters_ui.js","names":[],"sources":["../../../src/components/PlAnnotations/filters_ui.ts"],"sourcesContent":["// @DEPRECATED - use sdk/model/src/filters + sdk/model/src/annotations\nimport type { SUniversalPColumnId } from \"@milaboratories/pl-model-common\";\nimport type { FilterSpecUi } from \"../../annotations\";\nimport type { FilterSpec, FilterSpecLeaf } from \"../../filters\";\nimport type {\n AnnotationFilter,\n AnnotationMode,\n AnnotationScript,\n IsNA,\n NotFilter,\n NumericalComparisonFilter,\n PatternFilter,\n PatternPredicate,\n ValueRank,\n} from \"./filter\";\n\nexport type FilterUi = FilterSpec<\n Extract<\n FilterSpecLeaf,\n // supported filters\n {\n type:\n | \"lessThan\"\n | \"greaterThan\"\n | \"lessThanOrEqual\"\n | \"greaterThanOrEqual\"\n | \"lessThanColumn\"\n | \"lessThanColumnOrEqual\"\n | \"patternContainSubsequence\"\n | \"patternNotContainSubsequence\"\n | \"patternEquals\"\n | \"patternNotEquals\"\n | \"topN\"\n | \"bottomN\"\n | \"isNA\"\n | \"isNotNA\";\n }\n >,\n { id: number; name?: string; isExpanded?: boolean }\n>;\n\nexport type FilterUiType = Exclude<FilterUi, { type: undefined }>[\"type\"];\n\nexport type FilterUiOfType<T extends FilterUiType> = Extract<FilterUi, { type: T }>;\n\n// DEPRECATED - use lib/ui/uikit/src/composition/filters\nexport function unreachable(x: never): never {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n throw new Error(\"Unexpected object: \" + x);\n}\n\nexport type TypeToLiteral<T> = [T] extends [FilterUiType]\n ? \"FilterUiType\"\n : [T] extends [SUniversalPColumnId]\n ? \"SUniversalPColumnId\"\n : [T] extends [PatternPredicate]\n ? \"PatternPredicate\"\n : [T] extends [AnnotationFilter[]]\n ? \"AnnotationFilter[]\"\n : [T] extends [AnnotationFilter]\n ? \"AnnotationFilter\"\n : [T] extends [number]\n ? \"number\"\n : [T] extends [number | undefined]\n ? \"number?\"\n : [T] extends [string]\n ? \"string\"\n : [T] extends [string | undefined]\n ? \"string?\"\n : [T] extends [boolean]\n ? \"boolean\"\n : [T] extends [boolean | undefined]\n ? \"boolean?\"\n : [T] extends [unknown[]]\n ? \"unknown[]\"\n : // this is special\n T extends number\n ? \"number\"\n : T extends string\n ? \"string\"\n : T extends boolean\n ? \"boolean\"\n : T extends Record<string, unknown>\n ? \"form\"\n : \"unknown\";\n\n// @TODO: \"parse\" option\nexport type TypeField<V> = {\n fieldType: TypeToLiteral<V>;\n label: string;\n defaultValue: () => V | undefined;\n};\n\nexport type TypeFieldRecord<T extends FilterUi> = { [K in keyof T]: TypeField<T[K]> };\n\nexport type TypeForm<T> = {\n [P in keyof T]: T[P] extends Record<string, unknown>\n ? {\n fieldType: \"form\";\n label?: string;\n form?: T[P] extends Record<string, unknown> ? TypeForm<T[P]> : undefined;\n defaultValue: () => T[P];\n }\n : TypeField<T[P]>;\n};\n\nexport type FormField =\n | {\n fieldType: \"form\";\n form?: Record<string, FormField>;\n defaultValue: () => Record<string, unknown>;\n }\n | TypeField<FilterUiType>\n | TypeField<string>\n | TypeField<number>\n | TypeField<number | undefined>\n | TypeField<boolean>\n | TypeField<boolean | undefined>\n | TypeField<SUniversalPColumnId>;\n\nexport type AnyForm = Record<string, FormField>;\n\nexport type AnnotationStepUi = FilterSpecUi<Extract<FilterUi, { type: \"and\" | \"or\" }>> & {\n id: number;\n};\n\nexport type AnnotationScriptUi = {\n isCreated?: boolean;\n title: string;\n mode: AnnotationMode;\n steps: AnnotationStepUi[];\n};\n\nexport function compileFilter(ui: FilterUi): AnnotationFilter {\n if (ui.type === \"or\") {\n return {\n type: \"or\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"and\") {\n return {\n type: \"and\" as const,\n filters: compileFilters(ui.filters),\n };\n }\n\n if (ui.type === \"not\") {\n return {\n type: \"not\" as const,\n filter: compileFilter(ui.filter),\n };\n }\n\n if (ui.type === \"isNA\") {\n return {\n type: \"isNA\" as const,\n column: ui.column,\n };\n }\n\n if (ui.type === \"isNotNA\") {\n const isNAFilter: IsNA = { type: \"isNA\", column: ui.column };\n const notFilter: NotFilter = { type: \"not\", filter: isNAFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternEquals\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"equals\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotEquals\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"equals\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"patternContainSubsequence\") {\n return {\n type: \"pattern\" as const,\n column: ui.column,\n predicate: {\n type: \"containSubsequence\" as const,\n value: ui.value,\n },\n };\n }\n\n if (ui.type === \"patternNotContainSubsequence\") {\n const patternFilter: PatternFilter = {\n type: \"pattern\",\n column: ui.column,\n predicate: { type: \"containSubsequence\", value: ui.value },\n };\n const notFilter: NotFilter = { type: \"not\", filter: patternFilter };\n return notFilter;\n }\n\n if (ui.type === \"topN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n descending: true,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"bottomN\") {\n const rankTransform: ValueRank = {\n transformer: \"rank\",\n column: ui.column,\n };\n const comparisonFilter: NumericalComparisonFilter = {\n type: \"numericalComparison\",\n lhs: rankTransform,\n rhs: ui.n,\n allowEqual: true,\n };\n return comparisonFilter;\n }\n\n if (ui.type === \"lessThan\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThan\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n };\n }\n\n if (ui.type === \"greaterThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n rhs: ui.column,\n lhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.x,\n allowEqual: true,\n };\n }\n\n if (ui.type === \"lessThanColumn\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: undefined,\n };\n }\n\n if (ui.type === \"lessThanColumnOrEqual\") {\n return {\n type: \"numericalComparison\" as const,\n lhs: ui.column,\n rhs: ui.rhs,\n minDiff: ui.minDiff,\n allowEqual: true,\n };\n }\n\n unreachable(ui);\n}\n\nexport function compileFilters(uiFilters: FilterUi[]): AnnotationFilter[] {\n return uiFilters.filter((f) => f.type !== undefined).map(compileFilter);\n}\n\nexport function compileAnnotationScript(uiScript: AnnotationScriptUi): AnnotationScript {\n return {\n title: uiScript.title,\n mode: uiScript.mode,\n steps: uiScript.steps\n .filter((step) => {\n // No need to compile empty steps\n if (step.filter.type == null) {\n return false;\n }\n\n if (step.filter.type === \"or\") {\n return step.filter.filters.length > 0;\n }\n\n if (step.filter.type === \"and\") {\n return step.filter.filters.length > 0;\n }\n\n return false;\n })\n .map((step) => ({\n label: step.label.trim(),\n filter: compileFilter(step.filter),\n })),\n };\n}\n"],"mappings":";AA8CA,SAAgB,YAAY,GAAiB;CAE3C,MAAM,IAAI,MAAM,wBAAwB,CAAC;AAC3C;AAoFA,SAAgB,cAAc,IAAgC;CAC5D,IAAI,GAAG,SAAS,MACd,OAAO;EACL,MAAM;EACN,SAAS,eAAe,GAAG,OAAO;CACpC;CAGF,IAAI,GAAG,SAAS,OACd,OAAO;EACL,MAAM;EACN,SAAS,eAAe,GAAG,OAAO;CACpC;CAGF,IAAI,GAAG,SAAS,OACd,OAAO;EACL,MAAM;EACN,QAAQ,cAAc,GAAG,MAAM;CACjC;CAGF,IAAI,G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CACd;CAGF,IAAI,GAAG,SAAS,mBACd,OAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,YAAY;CACd;CAGF,IAAI,GAAG,SAAS,kBACd,OAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,SAAS,GAAG;EACZ,YAAY,KAAA;CACd;CAGF,IAAI,GAAG,SAAS,yBACd,OAAO;EACL,MAAM;EACN,KAAK,GAAG;EACR,KAAK,GAAG;EACR,SAAS,GAAG;EACZ,YAAY;CACd;CAGF,YAAY,EAAE;AAChB;AAEA,SAAgB,eAAe,WAA2C;CACxE,OAAO,UAAU,QAAQ,MAAM,EAAE,SAAS,KAAA,CAAS,CAAC,CAAC,IAAI,aAAa;AACxE;AAEA,SAAgB,wBAAwB,UAAgD;CACtF,OAAO;EACL,OAAO,SAAS;EAChB,MAAM,SAAS;EACf,OAAO,SAAS,MACb,QAAQ,SAAS;GAEhB,IAAI,KAAK,OAAO,QAAQ,MACtB,OAAO;GAGT,IAAI,KAAK,OAAO,SAAS,MACvB,OAAO,KAAK,OAAO,QAAQ,SAAS;GAGtC,IAAI,KAAK,OAAO,SAAS,OACvB,OAAO,KAAK,OAAO,QAAQ,SAAS;GAGtC,OAAO;EACT,CAAC,CAAC,CACD,KAAK,UAAU;GACd,OAAO,KAAK,MAAM,KAAK;GACvB,QAAQ,cAAc,KAAK,MAAM;EACnC,EAAE;CACN;AACF"}
@@ -1,2 +1,3 @@
1
1
  import { AndFilter, AnnotationFilter, AnnotationMode, AnnotationScript, AnnotationScript2, AnnotationStep, IsNA, Log10, NotFilter, NumericalComparisonFilter, OrFilter, PatternFilter, PatternPredicate, PatternPredicateContainSubsequence, PatternPredicateEquals, SortedCumulativeSum, TransformedColumn, ValueRank } from "./filter.js";
2
- import { AnnotationScriptUi, AnnotationStepUi, AnyForm, FilterUi, FilterUiOfType, FilterUiType, FormField, TypeField, TypeFieldRecord, TypeForm, TypeToLiteral, compileAnnotationScript, compileFilter, compileFilters, unreachable } from "./filters_ui.js";
2
+ import { AnnotationScriptUi, AnnotationStepUi, AnyForm, FilterUi, FilterUiOfType, FilterUiType, FormField, TypeField, TypeFieldRecord, TypeForm, TypeToLiteral, compileAnnotationScript, compileFilter, compileFilters, unreachable } from "./filters_ui.js";
3
+ export { AndFilter, AnnotationFilter, AnnotationMode, AnnotationScript, AnnotationScript2, AnnotationScriptUi, AnnotationStep, AnnotationStepUi, AnyForm, FilterUi, FilterUiOfType, FilterUiType, FormField, IsNA, Log10, NotFilter, NumericalComparisonFilter, OrFilter, PatternFilter, PatternPredicate, PatternPredicateContainSubsequence, PatternPredicateEquals, SortedCumulativeSum, TransformedColumn, TypeField, TypeFieldRecord, TypeForm, TypeToLiteral, ValueRank, compileAnnotationScript, compileFilter, compileFilters, unreachable };
@@ -1,4 +1,3 @@
1
- require("../../../_virtual/_rolldown/runtime.cjs");
2
1
  const require_createPTableDefV3 = require("./createPTableDefV3.cjs");
3
2
  let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
4
3
  let es_toolkit = require("es-toolkit");
@@ -1 +1 @@
1
- {"version":3,"file":"createPTableDefV2.cjs","names":["createPTableDefV3"],"sources":["../../../../src/components/PlDataTable/createPlDataTable/createPTableDefV2.ts"],"sourcesContent":["import type {\n PColumn,\n PColumnIdAndSpec,\n PTableSorting,\n PTableDefV2,\n DataInfo,\n PColumnValues,\n} from \"@milaboratories/pl-model-common\";\nimport { getColumnIdAndSpec } from \"@milaboratories/pl-model-common\";\nimport type { PColumnDataUniversal, TreeNodeAccessor } from \"../../../render\";\nimport { isFunction } from \"es-toolkit\";\nimport type { PlDataTableFilters } from \"../typesV7\";\nimport { createPTableDefV3 } from \"./createPTableDefV3\";\n\nexport function createPTableDefV2(params: {\n columns: PColumn<PColumnDataUniversal>[];\n labelColumns: PColumn<PColumnDataUniversal>[];\n coreJoinType: \"inner\" | \"full\";\n filters: null | PlDataTableFilters;\n sorting: PTableSorting[];\n coreColumnPredicate?: (spec: PColumnIdAndSpec) => boolean;\n}): PTableDefV2<PColumn<TreeNodeAccessor | PColumnValues | DataInfo<TreeNodeAccessor>>> {\n let coreColumns = params.columns;\n const secondaryColumns: typeof params.columns = [];\n\n if (isFunction(params.coreColumnPredicate)) {\n coreColumns = [];\n for (const c of params.columns)\n if (params.coreColumnPredicate(getColumnIdAndSpec(c))) coreColumns.push(c);\n else secondaryColumns.push(c);\n }\n\n secondaryColumns.push(...params.labelColumns);\n\n return createPTableDefV3({\n primary: coreColumns.map((column) => ({ column })),\n secondary: secondaryColumns.map((column) => ({ entries: [{ column }] })),\n primaryJoinType: params.coreJoinType,\n filters: params.filters,\n sorting: params.sorting,\n });\n}\n"],"mappings":";;;;;AAcA,SAAgB,kBAAkB,QAOsD;CACtF,IAAI,cAAc,OAAO;CACzB,MAAM,mBAA0C,EAAE;AAElD,MAAA,GAAA,WAAA,YAAe,OAAO,oBAAoB,EAAE;AAC1C,gBAAc,EAAE;AAChB,OAAK,MAAM,KAAK,OAAO,QACrB,KAAI,OAAO,qBAAA,GAAA,gCAAA,oBAAuC,EAAE,CAAC,CAAE,aAAY,KAAK,EAAE;MACrE,kBAAiB,KAAK,EAAE;;AAGjC,kBAAiB,KAAK,GAAG,OAAO,aAAa;AAE7C,QAAOA,0BAAAA,kBAAkB;EACvB,SAAS,YAAY,KAAK,YAAY,EAAE,QAAQ,EAAE;EAClD,WAAW,iBAAiB,KAAK,YAAY,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE;EACxE,iBAAiB,OAAO;EACxB,SAAS,OAAO;EAChB,SAAS,OAAO;EACjB,CAAC"}
1
+ {"version":3,"file":"createPTableDefV2.cjs","names":["createPTableDefV3"],"sources":["../../../../src/components/PlDataTable/createPlDataTable/createPTableDefV2.ts"],"sourcesContent":["import type {\n PColumn,\n PColumnIdAndSpec,\n PTableSorting,\n PTableDefV2,\n DataInfo,\n PColumnValues,\n} from \"@milaboratories/pl-model-common\";\nimport { getColumnIdAndSpec } from \"@milaboratories/pl-model-common\";\nimport type { PColumnDataUniversal, TreeNodeAccessor } from \"../../../render\";\nimport { isFunction } from \"es-toolkit\";\nimport type { PlDataTableFilters } from \"../typesV7\";\nimport { createPTableDefV3 } from \"./createPTableDefV3\";\n\nexport function createPTableDefV2(params: {\n columns: PColumn<PColumnDataUniversal>[];\n labelColumns: PColumn<PColumnDataUniversal>[];\n coreJoinType: \"inner\" | \"full\";\n filters: null | PlDataTableFilters;\n sorting: PTableSorting[];\n coreColumnPredicate?: (spec: PColumnIdAndSpec) => boolean;\n}): PTableDefV2<PColumn<TreeNodeAccessor | PColumnValues | DataInfo<TreeNodeAccessor>>> {\n let coreColumns = params.columns;\n const secondaryColumns: typeof params.columns = [];\n\n if (isFunction(params.coreColumnPredicate)) {\n coreColumns = [];\n for (const c of params.columns)\n if (params.coreColumnPredicate(getColumnIdAndSpec(c))) coreColumns.push(c);\n else secondaryColumns.push(c);\n }\n\n secondaryColumns.push(...params.labelColumns);\n\n return createPTableDefV3({\n primary: coreColumns.map((column) => ({ column })),\n secondary: secondaryColumns.map((column) => ({ entries: [{ column }] })),\n primaryJoinType: params.coreJoinType,\n filters: params.filters,\n sorting: params.sorting,\n });\n}\n"],"mappings":";;;;AAcA,SAAgB,kBAAkB,QAOsD;CACtF,IAAI,cAAc,OAAO;CACzB,MAAM,mBAA0C,CAAC;CAEjD,KAAA,GAAA,WAAA,WAAA,CAAe,OAAO,mBAAmB,GAAG;EAC1C,cAAc,CAAC;EACf,KAAK,MAAM,KAAK,OAAO,SACrB,IAAI,OAAO,qBAAA,GAAA,gCAAA,mBAAA,CAAuC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC;OACpE,iBAAiB,KAAK,CAAC;CAChC;CAEA,iBAAiB,KAAK,GAAG,OAAO,YAAY;CAE5C,OAAOA,0BAAAA,kBAAkB;EACvB,SAAS,YAAY,KAAK,YAAY,EAAE,OAAO,EAAE;EACjD,WAAW,iBAAiB,KAAK,YAAY,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE;EACvE,iBAAiB,OAAO;EACxB,SAAS,OAAO;EAChB,SAAS,OAAO;CAClB,CAAC;AACH"}