@platforma-sdk/model 1.85.2 → 1.86.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +2 -3
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/annotations/converter.cjs +1 -2
- package/dist/annotations/converter.cjs.map +1 -1
- package/dist/annotations/converter.d.ts +0 -2
- package/dist/annotations/converter.d.ts.map +1 -1
- package/dist/annotations/converter.js +1 -2
- package/dist/annotations/converter.js.map +1 -1
- package/dist/annotations/index.js +1 -2
- package/dist/annotations/types.d.ts +0 -2
- package/dist/annotations/types.d.ts.map +1 -1
- package/dist/bconfig/lambdas.d.ts +0 -2
- package/dist/bconfig/lambdas.d.ts.map +1 -1
- package/dist/bconfig/normalization.cjs +1 -2
- package/dist/bconfig/normalization.cjs.map +1 -1
- package/dist/bconfig/normalization.d.ts +0 -2
- package/dist/bconfig/normalization.d.ts.map +1 -1
- package/dist/bconfig/normalization.js +1 -2
- package/dist/bconfig/types.cjs +1 -2
- package/dist/bconfig/types.d.ts +0 -2
- package/dist/bconfig/types.d.ts.map +1 -1
- package/dist/bconfig/types.js +1 -2
- package/dist/bconfig/util.d.ts +1 -2
- package/dist/bconfig/util.d.ts.map +1 -1
- package/dist/bconfig/v3.d.ts +0 -2
- package/dist/bconfig/v3.d.ts.map +1 -1
- package/dist/block_api_v1.d.ts +0 -2
- package/dist/block_api_v1.d.ts.map +1 -1
- package/dist/block_api_v2.d.ts +0 -2
- package/dist/block_api_v2.d.ts.map +1 -1
- package/dist/block_api_v3.d.ts +0 -2
- package/dist/block_api_v3.d.ts.map +1 -1
- package/dist/block_migrations.cjs +3 -3
- package/dist/block_migrations.cjs.map +1 -1
- package/dist/block_migrations.d.ts +1 -2
- package/dist/block_migrations.d.ts.map +1 -1
- package/dist/block_migrations.js +3 -3
- package/dist/block_migrations.js.map +1 -1
- package/dist/block_model.cjs +1 -2
- package/dist/block_model.cjs.map +1 -1
- package/dist/block_model.d.ts +1 -2
- package/dist/block_model.d.ts.map +1 -1
- package/dist/block_model.js +1 -2
- package/dist/block_state_patch.d.ts +0 -2
- package/dist/block_state_patch.d.ts.map +1 -1
- package/dist/block_state_util.cjs +1 -2
- package/dist/block_state_util.d.ts +1 -2
- package/dist/block_state_util.d.ts.map +1 -1
- package/dist/block_state_util.js +1 -2
- package/dist/block_storage.cjs +1 -2
- package/dist/block_storage.d.ts +0 -2
- package/dist/block_storage.d.ts.map +1 -1
- package/dist/block_storage.js +1 -2
- package/dist/block_storage_callbacks.cjs +9 -7
- package/dist/block_storage_callbacks.cjs.map +1 -1
- package/dist/block_storage_callbacks.js +9 -7
- package/dist/block_storage_callbacks.js.map +1 -1
- package/dist/block_storage_facade.cjs +1 -2
- package/dist/block_storage_facade.cjs.map +1 -1
- package/dist/block_storage_facade.d.ts +0 -2
- package/dist/block_storage_facade.d.ts.map +1 -1
- package/dist/block_storage_facade.js +1 -2
- package/dist/block_storage_facade.js.map +1 -1
- package/dist/columns/column.cjs +1 -2
- package/dist/columns/column.d.ts +0 -2
- package/dist/columns/column.d.ts.map +1 -1
- package/dist/columns/column.js +1 -2
- package/dist/columns/column_providers/index.cjs +1 -2
- package/dist/columns/column_providers/index.d.ts +0 -2
- package/dist/columns/column_providers/index.d.ts.map +1 -1
- package/dist/columns/column_providers/index.js +1 -2
- package/dist/columns/column_providers/providers.cjs +1 -2
- package/dist/columns/column_providers/providers.cjs.map +1 -1
- package/dist/columns/column_providers/providers.d.ts +0 -2
- package/dist/columns/column_providers/providers.d.ts.map +1 -1
- package/dist/columns/column_providers/providers.js +1 -2
- package/dist/columns/column_providers/types.d.ts +0 -2
- package/dist/columns/column_providers/types.d.ts.map +1 -1
- package/dist/columns/column_recipes/column_discovered_recipe.cjs +1 -2
- package/dist/columns/column_recipes/column_discovered_recipe.cjs.map +1 -1
- package/dist/columns/column_recipes/column_discovered_recipe.d.ts +0 -2
- package/dist/columns/column_recipes/column_discovered_recipe.d.ts.map +1 -1
- package/dist/columns/column_recipes/column_discovered_recipe.js +1 -2
- package/dist/columns/column_recipes/column_filtered_recipe.cjs +1 -2
- package/dist/columns/column_recipes/column_filtered_recipe.cjs.map +1 -1
- package/dist/columns/column_recipes/column_filtered_recipe.d.ts +0 -2
- package/dist/columns/column_recipes/column_filtered_recipe.d.ts.map +1 -1
- package/dist/columns/column_recipes/column_filtered_recipe.js +1 -2
- package/dist/columns/column_recipes/column_overrided_recipe.cjs +1 -2
- package/dist/columns/column_recipes/column_overrided_recipe.cjs.map +1 -1
- package/dist/columns/column_recipes/column_overrided_recipe.d.ts +1 -2
- package/dist/columns/column_recipes/column_overrided_recipe.d.ts.map +1 -1
- package/dist/columns/column_recipes/column_overrided_recipe.js +1 -2
- package/dist/columns/column_recipes/index.cjs +1 -2
- package/dist/columns/column_recipes/index.cjs.map +1 -1
- package/dist/columns/column_recipes/index.d.ts +0 -2
- package/dist/columns/column_recipes/index.d.ts.map +1 -1
- package/dist/columns/column_recipes/index.js +1 -2
- package/dist/columns/column_recipes/leaf_rebrand.cjs +1 -2
- package/dist/columns/column_recipes/leaf_rebrand.cjs.map +1 -1
- package/dist/columns/column_recipes/leaf_rebrand.js +1 -2
- package/dist/columns/column_recipes/types.d.ts +0 -2
- package/dist/columns/column_recipes/types.d.ts.map +1 -1
- package/dist/columns/columns_collection.cjs +1 -2
- package/dist/columns/columns_collection.cjs.map +1 -1
- package/dist/columns/columns_collection.d.ts +0 -2
- package/dist/columns/columns_collection.d.ts.map +1 -1
- package/dist/columns/columns_collection.js +1 -2
- package/dist/columns/data_column.cjs +1 -2
- package/dist/columns/data_column.cjs.map +1 -1
- package/dist/columns/data_column.d.ts +0 -2
- package/dist/columns/data_column.d.ts.map +1 -1
- package/dist/columns/data_column.js +1 -2
- package/dist/columns/derive_axis_values_labels.cjs +1 -2
- package/dist/columns/derive_axis_values_labels.cjs.map +1 -1
- package/dist/columns/derive_axis_values_labels.d.ts +0 -2
- package/dist/columns/derive_axis_values_labels.d.ts.map +1 -1
- package/dist/columns/derive_axis_values_labels.js +1 -2
- package/dist/columns/index.cjs +8 -0
- package/dist/columns/index.d.ts +3 -2
- package/dist/columns/index.js +3 -2
- package/dist/columns/peer_links.cjs +42 -0
- package/dist/columns/peer_links.cjs.map +1 -0
- package/dist/columns/peer_links.d.ts +16 -0
- package/dist/columns/peer_links.d.ts.map +1 -0
- package/dist/columns/peer_links.js +38 -0
- package/dist/columns/peer_links.js.map +1 -0
- package/dist/columns/split_by_axes.cjs +1 -2
- package/dist/columns/split_by_axes.cjs.map +1 -1
- package/dist/columns/split_by_axes.d.ts +0 -2
- package/dist/columns/split_by_axes.d.ts.map +1 -1
- package/dist/columns/split_by_axes.js +1 -2
- package/dist/columns/split_by_axes.js.map +1 -1
- package/dist/columns/utils.cjs +31 -7
- package/dist/columns/utils.cjs.map +1 -1
- package/dist/columns/utils.d.ts +11 -2
- package/dist/columns/utils.d.ts.map +1 -1
- package/dist/columns/utils.js +30 -8
- package/dist/columns/utils.js.map +1 -1
- package/dist/components/PFrameForGraphs.cjs +1 -2
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +0 -2
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +1 -2
- package/dist/components/PlAnnotations/filter.d.ts +0 -2
- package/dist/components/PlAnnotations/filter.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.cjs +1 -2
- package/dist/components/PlAnnotations/filters_ui.d.ts +0 -2
- package/dist/components/PlAnnotations/filters_ui.d.ts.map +1 -1
- package/dist/components/PlAnnotations/filters_ui.js +1 -2
- package/dist/components/PlDataTable/columnResolver.cjs +1 -2
- package/dist/components/PlDataTable/columnResolver.cjs.map +1 -1
- package/dist/components/PlDataTable/columnResolver.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.d.ts +0 -2
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs +21 -5
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.d.ts +0 -2
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js +21 -5
- package/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.d.ts +0 -2
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/discoverColumns.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/index.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTable/index.d.ts +0 -2
- package/dist/components/PlDataTable/createPlDataTable/index.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/index.js +1 -2
- package/dist/components/PlDataTable/createPlDataTable/utils.cjs +8 -6
- package/dist/components/PlDataTable/createPlDataTable/utils.cjs.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/utils.d.ts +0 -2
- package/dist/components/PlDataTable/createPlDataTable/utils.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTable/utils.js +8 -6
- package/dist/components/PlDataTable/createPlDataTable/utils.js.map +1 -1
- package/dist/components/PlDataTable/createPlDataTableSheet.cjs +1 -2
- package/dist/components/PlDataTable/createPlDataTableSheet.d.ts +0 -2
- package/dist/components/PlDataTable/createPlDataTableSheet.d.ts.map +1 -1
- package/dist/components/PlDataTable/createPlDataTableSheet.js +1 -2
- package/dist/components/PlDataTable/labels.cjs +1 -2
- package/dist/components/PlDataTable/labels.cjs.map +1 -1
- package/dist/components/PlDataTable/labels.js +1 -2
- package/dist/components/PlDataTable/state-migration.cjs +1 -2
- package/dist/components/PlDataTable/state-migration.cjs.map +1 -1
- package/dist/components/PlDataTable/state-migration.d.ts +0 -2
- package/dist/components/PlDataTable/state-migration.d.ts.map +1 -1
- package/dist/components/PlDataTable/state-migration.js +1 -2
- package/dist/components/PlDataTable/state-migration.js.map +1 -1
- package/dist/components/PlDataTable/typesV4.d.ts +0 -2
- package/dist/components/PlDataTable/typesV4.d.ts.map +1 -1
- package/dist/components/PlDataTable/typesV5.d.ts +0 -2
- package/dist/components/PlDataTable/typesV5.d.ts.map +1 -1
- package/dist/components/PlDataTable/typesV6.d.ts +0 -2
- package/dist/components/PlDataTable/typesV6.d.ts.map +1 -1
- package/dist/components/PlDataTable/typesV7.d.ts +0 -2
- package/dist/components/PlDataTable/typesV7.d.ts.map +1 -1
- package/dist/components/PlDataTable/typesV8.d.ts +2 -2
- package/dist/components/PlDataTable/typesV8.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.cjs +1 -2
- package/dist/components/PlDatasetSelector/build_dataset_options.cjs.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.d.ts +1 -2
- package/dist/components/PlDatasetSelector/build_dataset_options.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/build_dataset_options.js +1 -2
- package/dist/components/PlDatasetSelector/dataset_selection.cjs +1 -2
- package/dist/components/PlDatasetSelector/dataset_selection.d.ts +0 -2
- package/dist/components/PlDatasetSelector/dataset_selection.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/dataset_selection.js +1 -2
- package/dist/components/PlDatasetSelector/enrichment_discovery.cjs +4 -4
- package/dist/components/PlDatasetSelector/enrichment_discovery.cjs.map +1 -1
- package/dist/components/PlDatasetSelector/enrichment_discovery.js +4 -4
- package/dist/components/PlDatasetSelector/enrichment_discovery.js.map +1 -1
- package/dist/components/PlDatasetSelector/filter_discovery.cjs +1 -2
- package/dist/components/PlDatasetSelector/filter_discovery.cjs.map +1 -1
- package/dist/components/PlDatasetSelector/filter_discovery.d.ts +0 -2
- package/dist/components/PlDatasetSelector/filter_discovery.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/filter_discovery.js +1 -2
- package/dist/components/PlMultiSequenceAlignment.cjs +1 -2
- package/dist/components/PlMultiSequenceAlignment.cjs.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts +0 -2
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.js +1 -2
- package/dist/components/PlSelectionModel.cjs +1 -2
- package/dist/components/PlSelectionModel.d.ts +0 -2
- package/dist/components/PlSelectionModel.d.ts.map +1 -1
- package/dist/components/PlSelectionModel.js +1 -2
- package/dist/config/model.d.ts +0 -2
- package/dist/config/model.d.ts.map +1 -1
- package/dist/config/type_engine.d.ts +1 -2
- package/dist/config/type_engine.d.ts.map +1 -1
- package/dist/env_value.cjs +1 -2
- package/dist/env_value.d.ts +0 -2
- package/dist/env_value.d.ts.map +1 -1
- package/dist/env_value.js +1 -2
- package/dist/filters/converters/filterToQuery.cjs +1 -2
- package/dist/filters/converters/filterToQuery.d.ts +0 -2
- package/dist/filters/converters/filterToQuery.d.ts.map +1 -1
- package/dist/filters/converters/filterToQuery.js +1 -2
- package/dist/filters/converters/filterUiToExpressionImpl.cjs +1 -2
- package/dist/filters/converters/filterUiToExpressionImpl.cjs.map +1 -1
- package/dist/filters/converters/filterUiToExpressionImpl.d.ts +0 -2
- package/dist/filters/converters/filterUiToExpressionImpl.d.ts.map +1 -1
- package/dist/filters/converters/filterUiToExpressionImpl.js +1 -2
- package/dist/filters/distill.cjs +1 -2
- package/dist/filters/distill.cjs.map +1 -1
- package/dist/filters/distill.d.ts +1 -3
- package/dist/filters/distill.d.ts.map +1 -1
- package/dist/filters/distill.js +1 -2
- package/dist/filters/distill.js.map +1 -1
- package/dist/filters/traverse.cjs +1 -2
- package/dist/filters/traverse.js +1 -2
- package/dist/filters/types.d.ts +0 -2
- package/dist/filters/types.d.ts.map +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/internal.cjs +1 -2
- package/dist/internal.js +1 -2
- package/dist/labels/derive_distinct_labels.cjs +7 -5
- package/dist/labels/derive_distinct_labels.cjs.map +1 -1
- package/dist/labels/derive_distinct_labels.d.ts +3 -2
- package/dist/labels/derive_distinct_labels.d.ts.map +1 -1
- package/dist/labels/derive_distinct_labels.js +7 -5
- package/dist/labels/derive_distinct_labels.js.map +1 -1
- package/dist/labels/derive_distinct_tooltips.cjs +1 -2
- package/dist/labels/derive_distinct_tooltips.cjs.map +1 -1
- package/dist/labels/derive_distinct_tooltips.d.ts +0 -2
- package/dist/labels/derive_distinct_tooltips.d.ts.map +1 -1
- package/dist/labels/derive_distinct_tooltips.js +1 -2
- package/dist/labels/linked_column_postfix.cjs +5 -3
- package/dist/labels/linked_column_postfix.cjs.map +1 -1
- package/dist/labels/linked_column_postfix.d.ts +0 -2
- package/dist/labels/linked_column_postfix.d.ts.map +1 -1
- package/dist/labels/linked_column_postfix.js +5 -3
- package/dist/labels/linked_column_postfix.js.map +1 -1
- package/dist/package.cjs +2 -3
- package/dist/package.js +2 -3
- package/dist/pframe.cjs +1 -2
- package/dist/pframe.d.ts +0 -2
- package/dist/pframe.d.ts.map +1 -1
- package/dist/pframe.js +1 -2
- package/dist/pframe_utils/axes.cjs +3 -3
- package/dist/pframe_utils/axes.cjs.map +1 -1
- package/dist/pframe_utils/axes.d.ts +0 -2
- package/dist/pframe_utils/axes.d.ts.map +1 -1
- package/dist/pframe_utils/axes.js +3 -3
- package/dist/pframe_utils/axes.js.map +1 -1
- package/dist/pframe_utils/columns.cjs +10 -7
- package/dist/pframe_utils/columns.cjs.map +1 -1
- package/dist/pframe_utils/columns.d.ts +0 -2
- package/dist/pframe_utils/columns.d.ts.map +1 -1
- package/dist/pframe_utils/columns.js +10 -7
- package/dist/pframe_utils/columns.js.map +1 -1
- package/dist/pframe_utils/index.cjs +1 -2
- package/dist/pframe_utils/index.cjs.map +1 -1
- package/dist/pframe_utils/index.d.ts +0 -2
- package/dist/pframe_utils/index.d.ts.map +1 -1
- package/dist/pframe_utils/index.js +1 -2
- package/dist/platforma.d.ts +0 -2
- package/dist/platforma.d.ts.map +1 -1
- package/dist/plugin_handle.cjs +1 -2
- package/dist/plugin_handle.d.ts +0 -2
- package/dist/plugin_handle.d.ts.map +1 -1
- package/dist/plugin_handle.js +1 -2
- package/dist/plugin_model.cjs +1 -2
- package/dist/plugin_model.d.ts +1 -2
- package/dist/plugin_model.d.ts.map +1 -1
- package/dist/plugin_model.js +1 -2
- package/dist/raw_globals.cjs +1 -2
- package/dist/raw_globals.d.ts +0 -2
- package/dist/raw_globals.d.ts.map +1 -1
- package/dist/raw_globals.js +1 -2
- package/dist/render/accessor.cjs +1 -2
- package/dist/render/accessor.cjs.map +1 -1
- package/dist/render/accessor.d.ts +1 -2
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/accessor.js +1 -2
- package/dist/render/api.cjs +10 -8
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +1 -2
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +10 -8
- package/dist/render/api.js.map +1 -1
- package/dist/render/future.cjs +1 -2
- package/dist/render/future.d.ts +0 -2
- package/dist/render/future.d.ts.map +1 -1
- package/dist/render/future.js +1 -2
- package/dist/render/internal.cjs +1 -2
- package/dist/render/internal.cjs.map +1 -1
- package/dist/render/internal.d.ts +0 -1
- package/dist/render/internal.js +1 -2
- package/dist/render/internal.js.map +1 -1
- package/dist/render/traversal_ops.d.ts +0 -2
- package/dist/render/traversal_ops.d.ts.map +1 -1
- package/dist/render/util/axis_filtering.cjs +1 -2
- package/dist/render/util/axis_filtering.d.ts +0 -2
- package/dist/render/util/axis_filtering.d.ts.map +1 -1
- package/dist/render/util/axis_filtering.js +1 -2
- package/dist/render/util/column_collection.cjs +3 -3
- package/dist/render/util/column_collection.cjs.map +1 -1
- package/dist/render/util/column_collection.d.ts +1 -2
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/column_collection.js +3 -3
- package/dist/render/util/column_collection.js.map +1 -1
- package/dist/render/util/label.cjs +3 -3
- package/dist/render/util/label.cjs.map +1 -1
- package/dist/render/util/label.d.ts +0 -2
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/label.js +3 -3
- package/dist/render/util/label.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +23 -26
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +1 -2
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.js +23 -26
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/dist/render/util/pframe_upgraders.cjs +1 -2
- package/dist/render/util/pframe_upgraders.js +1 -2
- package/dist/render/util/split_selectors.d.ts +0 -2
- package/dist/render/util/split_selectors.d.ts.map +1 -1
- package/dist/services/block_services.cjs +1 -2
- package/dist/services/block_services.cjs.map +1 -1
- package/dist/services/block_services.d.ts +0 -2
- package/dist/services/block_services.d.ts.map +1 -1
- package/dist/services/block_services.js +1 -2
- package/dist/services/get_services.cjs +1 -2
- package/dist/services/get_services.d.ts +0 -2
- package/dist/services/get_services.d.ts.map +1 -1
- package/dist/services/get_services.js +1 -2
- package/dist/services/service_bridge.cjs +1 -2
- package/dist/services/service_bridge.d.ts +0 -2
- package/dist/services/service_bridge.d.ts.map +1 -1
- package/dist/services/service_bridge.js +1 -2
- package/dist/services/service_resolve.d.ts +0 -2
- package/dist/services/service_resolve.d.ts.map +1 -1
- package/dist/version.cjs +1 -2
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -2
- package/package.json +22 -17
- package/src/annotations/converter.ts +5 -10
- package/src/block_storage_facade.ts +3 -1
- package/src/columns/index.ts +1 -0
- package/src/columns/peer_links.test.ts +58 -0
- package/src/columns/peer_links.ts +57 -0
- package/src/columns/split_by_axes.ts +4 -3
- package/src/columns/utils.ts +42 -2
- package/src/components/PlDataTable/createPlDataTable/createPlDataTableV3.ts +28 -3
- package/src/components/PlDataTable/createPlDataTable/utils.ts +3 -0
- package/src/components/PlDataTable/state-migration.ts +4 -6
- package/src/components/PlDataTable/typesV8.ts +2 -0
- package/src/filters/distill.ts +2 -2
- package/src/labels/derive_distinct_labels.ts +9 -2
- package/src/labels/linked_column_postfix.test.ts +8 -0
- package/src/labels/linked_column_postfix.ts +13 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DataColumn","ColumnDiscoveredRecipe","ColumnOverriddenRecipe","ColumnFilteredRecipe"],"sources":["../../../src/columns/column_recipes/index.ts"],"sourcesContent":["import {\n isColumnDiscoveredKey,\n isColumnOverriddenKey,\n parseColumnIdSafely,\n type ColumnUniversalId,\n type PObjectId,\n isPObjectKey,\n isColumnFilteredKey,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx } from \"../../render/internal\";\nimport { DataColumn } from \"../data_column\";\nimport { ColumnDiscoveredRecipe } from \"./column_discovered_recipe\";\nimport { ColumnFilteredRecipe } from \"./column_filtered_recipe\";\nimport { ColumnOverriddenRecipe } from \"./column_overrided_recipe\";\nimport type {\n ColumnRecipe as ColumnRecipeBase,\n ColumnRecipeId,\n ColumnResolutionStatus,\n} from \"./types\";\n\nexport type { ColumnFieldStatus, ColumnRecipeId, ColumnResolutionStatus, SpecQuery } from \"./types\";\nexport { ColumnAbsentError } from \"../data_column\";\nexport { ColumnDiscoveredRecipe } from \"./column_discovered_recipe\";\nexport { ColumnFilteredRecipe } from \"./column_filtered_recipe\";\nexport { ColumnOverriddenRecipe } from \"./column_overrided_recipe\";\n\n// Re-declare the interface locally so the name can merge with the dispatcher\n// value declared below: a single name `ColumnRecipe` resolves to the\n// interface in type position and to the factory function (`Object.assign`d\n// with `.getStatus`) in value position.\n// (Type-only re-exports do not participate in TS declaration merging.)\nexport interface ColumnRecipe<\n ID extends ColumnRecipeId = ColumnRecipeId,\n> extends ColumnRecipeBase<ID> {}\n\n/**\n * Build a `ColumnRecipe` from a stringified id. Dispatches to the matching\n * concrete recipe variant based on the id's encoding and recurses on\n * wrappers' inner `source`:\n *\n * - bare {@link PObjectId} (non-JSON) → `DataColumnRecipe.fromId`\n * - `ColumnDiscoveredKey` → {@link ColumnDiscoveredRecipe}\n * - `ColumnOverriddenKey { source, specOverrides }` → recurse on `source`,\n * then {@link ColumnOverriddenRecipe.wrap}\n * - `ColumnFilteredKey { source, axisFilters }` → recurse on `source`,\n * then {@link ColumnFilteredRecipe.wrap}\n *\n * Returns `undefined` for unsupported variants (e.g. AnchoredPColumnId,\n * which needs an anchor map to resolve) or when a nested source itself\n * cannot be built.\n */\nfunction ColumnRecipeBuild(\n id: ColumnUniversalId,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): undefined | ColumnRecipe {\n const parsed = parseColumnIdSafely(id);\n\n if (isPObjectKey(parsed)) {\n return DataColumn.fromId(id as PObjectId, opts);\n }\n\n if (isColumnDiscoveredKey(parsed)) {\n return ColumnDiscoveredRecipe.fromKey(parsed, opts);\n }\n\n if (isColumnOverriddenKey(parsed)) {\n const inner = ColumnRecipe(parsed.source, opts);\n if (inner === undefined) return undefined;\n return ColumnOverriddenRecipe.wrap(inner, parsed.specOverrides);\n }\n\n if (isColumnFilteredKey(parsed)) {\n // ColumnFilteredKey.source is a stringified ColumnUniversalId (leaf or\n // any nested wrapper). Legacy `FilteredPColumnId` with an AnchoredPColumnId\n // (object) source is not supported here — guard against it explicitly.\n if (typeof parsed.source !== \"string\") {\n throw new Error(\n `Unsupported ColumnRecipe id variant: filtered column with non-string source (${JSON.stringify(parsed.source)})`,\n );\n }\n const inner = ColumnRecipe(parsed.source, opts);\n if (inner === undefined) return undefined;\n return ColumnFilteredRecipe.wrap(inner, parsed.axisFilters);\n }\n\n throw new Error(`Unsupported ColumnRecipe id variant: ${id}`);\n}\n\n/**\n * Resolution status counterpart to {@link ColumnRecipeBuild}. Dispatches on\n * the parsed id shape to the matching `getStatusBy*` static — never\n * constructs the recipe. Use this at boundaries (resolver, filter/sort\n * targets) to throw early on `absent` instead of silently producing an empty\n * recipe via {@link ColumnRecipeBuild}.\n */\nfunction ColumnRecipeGetStatus(\n id: ColumnUniversalId,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): ColumnResolutionStatus {\n const parsed = parseColumnIdSafely(id);\n if (isPObjectKey(parsed)) return DataColumn.getStatusById(id as PObjectId, opts);\n if (isColumnDiscoveredKey(parsed)) return ColumnDiscoveredRecipe.getStatusByKey(parsed, opts);\n if (isColumnOverriddenKey(parsed)) return ColumnOverriddenRecipe.getStatusByKey(parsed, opts);\n if (isColumnFilteredKey(parsed)) return ColumnFilteredRecipe.getStatusByKey(parsed, opts);\n throw new Error(`Unsupported ColumnRecipe id variant: ${id}`);\n}\n\nexport const ColumnRecipe: typeof ColumnRecipeBuild & {\n readonly getStatus: typeof ColumnRecipeGetStatus;\n} = Object.assign(ColumnRecipeBuild, {\n getStatus: ColumnRecipeGetStatus,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAS,kBACP,IACA,OAAqC,CAAC,GACZ;CAC1B,MAAM,UAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["parseColumnIdSafely","isPObjectKey","DataColumn","isColumnDiscoveredKey","ColumnDiscoveredRecipe","isColumnOverriddenKey","ColumnOverriddenRecipe","isColumnFilteredKey","ColumnFilteredRecipe"],"sources":["../../../src/columns/column_recipes/index.ts"],"sourcesContent":["import {\n isColumnDiscoveredKey,\n isColumnOverriddenKey,\n parseColumnIdSafely,\n type ColumnUniversalId,\n type PObjectId,\n isPObjectKey,\n isColumnFilteredKey,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx } from \"../../render/internal\";\nimport { DataColumn } from \"../data_column\";\nimport { ColumnDiscoveredRecipe } from \"./column_discovered_recipe\";\nimport { ColumnFilteredRecipe } from \"./column_filtered_recipe\";\nimport { ColumnOverriddenRecipe } from \"./column_overrided_recipe\";\nimport type {\n ColumnRecipe as ColumnRecipeBase,\n ColumnRecipeId,\n ColumnResolutionStatus,\n} from \"./types\";\n\nexport type { ColumnFieldStatus, ColumnRecipeId, ColumnResolutionStatus, SpecQuery } from \"./types\";\nexport { ColumnAbsentError } from \"../data_column\";\nexport { ColumnDiscoveredRecipe } from \"./column_discovered_recipe\";\nexport { ColumnFilteredRecipe } from \"./column_filtered_recipe\";\nexport { ColumnOverriddenRecipe } from \"./column_overrided_recipe\";\n\n// Re-declare the interface locally so the name can merge with the dispatcher\n// value declared below: a single name `ColumnRecipe` resolves to the\n// interface in type position and to the factory function (`Object.assign`d\n// with `.getStatus`) in value position.\n// (Type-only re-exports do not participate in TS declaration merging.)\nexport interface ColumnRecipe<\n ID extends ColumnRecipeId = ColumnRecipeId,\n> extends ColumnRecipeBase<ID> {}\n\n/**\n * Build a `ColumnRecipe` from a stringified id. Dispatches to the matching\n * concrete recipe variant based on the id's encoding and recurses on\n * wrappers' inner `source`:\n *\n * - bare {@link PObjectId} (non-JSON) → `DataColumnRecipe.fromId`\n * - `ColumnDiscoveredKey` → {@link ColumnDiscoveredRecipe}\n * - `ColumnOverriddenKey { source, specOverrides }` → recurse on `source`,\n * then {@link ColumnOverriddenRecipe.wrap}\n * - `ColumnFilteredKey { source, axisFilters }` → recurse on `source`,\n * then {@link ColumnFilteredRecipe.wrap}\n *\n * Returns `undefined` for unsupported variants (e.g. AnchoredPColumnId,\n * which needs an anchor map to resolve) or when a nested source itself\n * cannot be built.\n */\nfunction ColumnRecipeBuild(\n id: ColumnUniversalId,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): undefined | ColumnRecipe {\n const parsed = parseColumnIdSafely(id);\n\n if (isPObjectKey(parsed)) {\n return DataColumn.fromId(id as PObjectId, opts);\n }\n\n if (isColumnDiscoveredKey(parsed)) {\n return ColumnDiscoveredRecipe.fromKey(parsed, opts);\n }\n\n if (isColumnOverriddenKey(parsed)) {\n const inner = ColumnRecipe(parsed.source, opts);\n if (inner === undefined) return undefined;\n return ColumnOverriddenRecipe.wrap(inner, parsed.specOverrides);\n }\n\n if (isColumnFilteredKey(parsed)) {\n // ColumnFilteredKey.source is a stringified ColumnUniversalId (leaf or\n // any nested wrapper). Legacy `FilteredPColumnId` with an AnchoredPColumnId\n // (object) source is not supported here — guard against it explicitly.\n if (typeof parsed.source !== \"string\") {\n throw new Error(\n `Unsupported ColumnRecipe id variant: filtered column with non-string source (${JSON.stringify(parsed.source)})`,\n );\n }\n const inner = ColumnRecipe(parsed.source, opts);\n if (inner === undefined) return undefined;\n return ColumnFilteredRecipe.wrap(inner, parsed.axisFilters);\n }\n\n throw new Error(`Unsupported ColumnRecipe id variant: ${id}`);\n}\n\n/**\n * Resolution status counterpart to {@link ColumnRecipeBuild}. Dispatches on\n * the parsed id shape to the matching `getStatusBy*` static — never\n * constructs the recipe. Use this at boundaries (resolver, filter/sort\n * targets) to throw early on `absent` instead of silently producing an empty\n * recipe via {@link ColumnRecipeBuild}.\n */\nfunction ColumnRecipeGetStatus(\n id: ColumnUniversalId,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): ColumnResolutionStatus {\n const parsed = parseColumnIdSafely(id);\n if (isPObjectKey(parsed)) return DataColumn.getStatusById(id as PObjectId, opts);\n if (isColumnDiscoveredKey(parsed)) return ColumnDiscoveredRecipe.getStatusByKey(parsed, opts);\n if (isColumnOverriddenKey(parsed)) return ColumnOverriddenRecipe.getStatusByKey(parsed, opts);\n if (isColumnFilteredKey(parsed)) return ColumnFilteredRecipe.getStatusByKey(parsed, opts);\n throw new Error(`Unsupported ColumnRecipe id variant: ${id}`);\n}\n\nexport const ColumnRecipe: typeof ColumnRecipeBuild & {\n readonly getStatus: typeof ColumnRecipeGetStatus;\n} = Object.assign(ColumnRecipeBuild, {\n getStatus: ColumnRecipeGetStatus,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAS,kBACP,IACA,OAAqC,CAAC,GACZ;CAC1B,MAAM,UAAA,GAASA,gCAAAA,oBAAAA,CAAoB,EAAE;CAErC,KAAA,GAAIC,gCAAAA,aAAAA,CAAa,MAAM,GACrB,OAAOC,oBAAAA,WAAW,OAAO,IAAiB,IAAI;CAGhD,KAAA,GAAIC,gCAAAA,sBAAAA,CAAsB,MAAM,GAC9B,OAAOC,iCAAAA,uBAAuB,QAAQ,QAAQ,IAAI;CAGpD,KAAA,GAAIC,gCAAAA,sBAAAA,CAAsB,MAAM,GAAG;EACjC,MAAM,QAAQ,aAAa,OAAO,QAAQ,IAAI;EAC9C,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;EAChC,OAAOC,gCAAAA,uBAAuB,KAAK,OAAO,OAAO,aAAa;CAChE;CAEA,KAAA,GAAIC,gCAAAA,oBAAAA,CAAoB,MAAM,GAAG;EAI/B,IAAI,OAAO,OAAO,WAAW,UAC3B,MAAM,IAAI,MACR,gFAAgF,KAAK,UAAU,OAAO,MAAM,EAAE,EAChH;EAEF,MAAM,QAAQ,aAAa,OAAO,QAAQ,IAAI;EAC9C,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;EAChC,OAAOC,+BAAAA,qBAAqB,KAAK,OAAO,OAAO,WAAW;CAC5D;CAEA,MAAM,IAAI,MAAM,wCAAwC,IAAI;AAC9D;;;;;;;;AASA,SAAS,sBACP,IACA,OAAqC,CAAC,GACd;CACxB,MAAM,UAAA,GAASR,gCAAAA,oBAAAA,CAAoB,EAAE;CACrC,KAAA,GAAIC,gCAAAA,aAAAA,CAAa,MAAM,GAAG,OAAOC,oBAAAA,WAAW,cAAc,IAAiB,IAAI;CAC/E,KAAA,GAAIC,gCAAAA,sBAAAA,CAAsB,MAAM,GAAG,OAAOC,iCAAAA,uBAAuB,eAAe,QAAQ,IAAI;CAC5F,KAAA,GAAIC,gCAAAA,sBAAAA,CAAsB,MAAM,GAAG,OAAOC,gCAAAA,uBAAuB,eAAe,QAAQ,IAAI;CAC5F,KAAA,GAAIC,gCAAAA,oBAAAA,CAAoB,MAAM,GAAG,OAAOC,+BAAAA,qBAAqB,eAAe,QAAQ,IAAI;CACxF,MAAM,IAAI,MAAM,wCAAwC,IAAI;AAC9D;AAEA,MAAa,eAET,OAAO,OAAO,mBAAmB,EACnC,WAAW,sBACb,CAAC"}
|
|
@@ -5,7 +5,6 @@ import { ColumnDiscoveredRecipe } from "./column_discovered_recipe.js";
|
|
|
5
5
|
import { ColumnFilteredRecipe } from "./column_filtered_recipe.js";
|
|
6
6
|
import { ColumnOverriddenRecipe } from "./column_overrided_recipe.js";
|
|
7
7
|
import { ColumnUniversalId } from "@milaboratories/pl-model-common";
|
|
8
|
-
//#region src/columns/column_recipes/index.d.ts
|
|
9
8
|
export interface ColumnRecipe<ID extends ColumnRecipeId = ColumnRecipeId> extends ColumnRecipe$1<ID> {}
|
|
10
9
|
/**
|
|
11
10
|
* Build a `ColumnRecipe` from a stringified id. Dispatches to the matching
|
|
@@ -39,6 +38,5 @@ declare function ColumnRecipeGetStatus(id: ColumnUniversalId, opts?: {
|
|
|
39
38
|
export declare const ColumnRecipe: typeof ColumnRecipeBuild & {
|
|
40
39
|
readonly getStatus: typeof ColumnRecipeGetStatus;
|
|
41
40
|
};
|
|
42
|
-
//#endregion
|
|
43
41
|
export { ColumnDiscoveredRecipe, ColumnFilteredRecipe, ColumnOverriddenRecipe, type ColumnRecipeId, type SpecQuery$1 as SpecQuery };
|
|
44
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/columns/column_recipes/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["ColumnRecipeBase"],"sources":["../../../src/columns/column_recipes/index.ts"],"mappings":";;;;;;;iBA+BiB,aACf,WAAW,iBAAiB,wBACpBA,eAAiB;;;;;;;;;;;;;;;;;iBAkBlB,kBACP,IAAI,mBACJ;EAAQ,MAAM;gBACD;;;;;;;;iBAyCN,sBACP,IAAI,mBACJ;EAAQ,MAAM;IACb;qBASU,qBAAqB;WACvB,kBAAkB"}
|
|
@@ -3,7 +3,7 @@ import { ColumnFilteredRecipe } from "./column_filtered_recipe.js";
|
|
|
3
3
|
import { ColumnOverriddenRecipe } from "./column_overrided_recipe.js";
|
|
4
4
|
import { DataColumn } from "../data_column.js";
|
|
5
5
|
import { isColumnDiscoveredKey, isColumnFilteredKey, isColumnOverriddenKey, isPObjectKey, parseColumnIdSafely } from "@milaboratories/pl-model-common";
|
|
6
|
-
|
|
6
|
+
// src/columns/column_recipes/index.ts
|
|
7
7
|
/**
|
|
8
8
|
* Build a `ColumnRecipe` from a stringified id. Dispatches to the matching
|
|
9
9
|
* concrete recipe variant based on the id's encoding and recurses on
|
|
@@ -53,7 +53,6 @@ function ColumnRecipeGetStatus(id, opts = {}) {
|
|
|
53
53
|
throw new Error(`Unsupported ColumnRecipe id variant: ${id}`);
|
|
54
54
|
}
|
|
55
55
|
const ColumnRecipe = Object.assign(ColumnRecipeBuild, { getStatus: ColumnRecipeGetStatus });
|
|
56
|
-
//#endregion
|
|
57
56
|
export { ColumnDiscoveredRecipe, ColumnFilteredRecipe, ColumnOverriddenRecipe, ColumnRecipe };
|
|
58
57
|
|
|
59
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
2
|
-
|
|
2
|
+
// src/columns/column_recipes/leaf_rebrand.ts
|
|
3
3
|
/**
|
|
4
4
|
* Replace every column leaf whose id equals `fromId` with `toId`, leaving
|
|
5
5
|
* other column refs (linkers, sub-anchors) intact. Wrapper recipes
|
|
@@ -16,7 +16,6 @@ function rebrandLeafId(node, fromId, toId) {
|
|
|
16
16
|
if (fromId === toId) return node;
|
|
17
17
|
return (0, _milaboratories_pl_model_common.mapSpecQueryColumns)(node, { column: (id) => id === fromId ? toId : id });
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.rebrandLeafId = rebrandLeafId;
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=leaf_rebrand.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaf_rebrand.cjs","names":[],"sources":["../../../src/columns/column_recipes/leaf_rebrand.ts"],"sourcesContent":["import {\n mapSpecQueryColumns,\n type ColumnUniversalId,\n type SpecQuery,\n} from \"@milaboratories/pl-model-common\";\n\n/**\n * Replace every column leaf whose id equals `fromId` with `toId`, leaving\n * other column refs (linkers, sub-anchors) intact. Wrapper recipes\n * (Overridden / Filtered) and Discovered use this to lift their own id onto\n * the hit leaf, so per-variant uniqueness propagates to the engine and\n * resolver-emitted ids match leaves in the emitted SpecQuery.\n *\n * Generic over all SpecQuery node shapes — including `linkerJoin`, which\n * occurs when a wrapper sits over a {@link ColumnDiscoveredRecipe}: only\n * the deepest hit leaf carries `fromId`, every linker leaf has a different\n * id and is left untouched.\n */\nexport function rebrandLeafId(\n node: SpecQuery,\n fromId: ColumnUniversalId,\n toId: ColumnUniversalId,\n): SpecQuery {\n if (fromId === toId) return node;\n return mapSpecQueryColumns(node, {\n column: (id) => (id === fromId ? toId : id),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,cACd,MACA,QACA,MACW;CACX,IAAI,WAAW,MAAM,OAAO;CAC5B,QAAA,
|
|
1
|
+
{"version":3,"file":"leaf_rebrand.cjs","names":["mapSpecQueryColumns"],"sources":["../../../src/columns/column_recipes/leaf_rebrand.ts"],"sourcesContent":["import {\n mapSpecQueryColumns,\n type ColumnUniversalId,\n type SpecQuery,\n} from \"@milaboratories/pl-model-common\";\n\n/**\n * Replace every column leaf whose id equals `fromId` with `toId`, leaving\n * other column refs (linkers, sub-anchors) intact. Wrapper recipes\n * (Overridden / Filtered) and Discovered use this to lift their own id onto\n * the hit leaf, so per-variant uniqueness propagates to the engine and\n * resolver-emitted ids match leaves in the emitted SpecQuery.\n *\n * Generic over all SpecQuery node shapes — including `linkerJoin`, which\n * occurs when a wrapper sits over a {@link ColumnDiscoveredRecipe}: only\n * the deepest hit leaf carries `fromId`, every linker leaf has a different\n * id and is left untouched.\n */\nexport function rebrandLeafId(\n node: SpecQuery,\n fromId: ColumnUniversalId,\n toId: ColumnUniversalId,\n): SpecQuery {\n if (fromId === toId) return node;\n return mapSpecQueryColumns(node, {\n column: (id) => (id === fromId ? toId : id),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,cACd,MACA,QACA,MACW;CACX,IAAI,WAAW,MAAM,OAAO;CAC5B,QAAA,GAAOA,gCAAAA,oBAAAA,CAAoB,MAAM,EAC/B,SAAS,OAAQ,OAAO,SAAS,OAAO,GAC1C,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mapSpecQueryColumns } from "@milaboratories/pl-model-common";
|
|
2
|
-
|
|
2
|
+
// src/columns/column_recipes/leaf_rebrand.ts
|
|
3
3
|
/**
|
|
4
4
|
* Replace every column leaf whose id equals `fromId` with `toId`, leaving
|
|
5
5
|
* other column refs (linkers, sub-anchors) intact. Wrapper recipes
|
|
@@ -16,7 +16,6 @@ function rebrandLeafId(node, fromId, toId) {
|
|
|
16
16
|
if (fromId === toId) return node;
|
|
17
17
|
return mapSpecQueryColumns(node, { column: (id) => id === fromId ? toId : id });
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
export { rebrandLeafId };
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=leaf_rebrand.js.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ColumnUniversalId, PColumnSpec, PObjectId, SpecOverrides, SpecQuery as SpecQuery$1 } from "@milaboratories/pl-model-common";
|
|
2
|
-
//#region src/columns/column_recipes/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Stable identifier of a recipe: either the canonical {@link PObjectId} of a
|
|
5
4
|
* leaf or a {@link ColumnUniversalId} encoding `Overridden / Discovered /
|
|
@@ -95,6 +94,5 @@ export interface ColumnRecipe<ID extends ColumnRecipeId = ColumnRecipeId> {
|
|
|
95
94
|
*/
|
|
96
95
|
withSpecs(overrides: SpecOverrides): ColumnRecipe;
|
|
97
96
|
}
|
|
98
|
-
//#endregion
|
|
99
97
|
export type { SpecQuery$1 as SpecQuery };
|
|
100
98
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../src/columns/column_recipes/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":["SpecQuery"],"sources":["../../../src/columns/column_recipes/types.ts"],"mappings":";;;;;;;;;YAkBY,iBAAiB;;;;;;;;;YAUjB;;;;;;;;;;;;;;;;YAiBA;;;;;;;;;;;;;;;;;;;;;iBAsBK,aAAa,WAAW,iBAAiB;;WAE/C,IAAI;;EAGb,oBAAoB;;;;;;;;;;EAWpB,WAAW;;;;;;;;;;EAWX,YAAYA;;;;;;;EAQZ,iBAAiB;;;;;;;;EASjB,UAAU,WAAW,gBAAgB"}
|
|
@@ -5,7 +5,7 @@ const require_get_services = require("../services/get_services.cjs");
|
|
|
5
5
|
const require_index = require("./column_recipes/index.cjs");
|
|
6
6
|
const require_index$1 = require("./column_providers/index.cjs");
|
|
7
7
|
let es_toolkit = require("es-toolkit");
|
|
8
|
-
|
|
8
|
+
// src/columns/columns_collection.ts
|
|
9
9
|
/**
|
|
10
10
|
* Build a {@link ColumnsCollection} from sandbox-side source descriptors.
|
|
11
11
|
* Resolves the `columnsCollection` driver (either from `deps.driver` or via
|
|
@@ -116,7 +116,6 @@ function currentBlockSources(ctx) {
|
|
|
116
116
|
function defaultCtxSources(ctx) {
|
|
117
117
|
return [...currentBlockSources(ctx), { kind: "result_pool" }];
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
exports.ColumnsCollection = ColumnsCollection;
|
|
121
120
|
exports.ColumnsCollectionImpl = ColumnsCollectionImpl;
|
|
122
121
|
exports.isColumnsCollection = isColumnsCollection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns_collection.cjs","names":["getService","ColumnRecipe","TreeNodeAccessor","isColumnProvider","getCfgRenderCtx","MainAccessorName","StagingAccessorName"],"sources":["../../src/columns/columns_collection.ts"],"sourcesContent":["import type {\n CollectionHandle,\n ColumnUniversalId,\n ColumnsCollectionDriverModel,\n ColumnsDiscoverOptions,\n ColumnsFilterOptions,\n SerializedColumnsSource,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx } from \"../render/internal\";\nimport { MainAccessorName, StagingAccessorName } from \"../render/internal\";\nimport type { ColumnsSource } from \"./column_providers\";\nimport { isColumnProvider } from \"./column_providers\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport { getService } from \"../services/get_services\";\nimport { getCfgRenderCtx } from \"../internal\";\nimport { ColumnRecipe } from \"./column_recipes\";\nimport { isNil } from \"es-toolkit\";\n\nexport interface ColumnsCollectionDeps {\n /** Render ctx used both for service resolution and for default ctx sources. */\n readonly ctx?: GlobalCfgRenderCtx;\n /** Override the resolved `columnsCollection` service — primarily for tests. */\n readonly driver?: ColumnsCollectionDriverModel;\n}\n\n/**\n * Shorthand literals accepted inside `ColumnsCollection`'s `sources`\n * array, expanded against the active render ctx:\n *\n * - `\"result_pool\"` – fan-out into the host's upstream-block result pool.\n * - `\"current_block\"` – main outputs + prerun (staging) accessors of the\n * current block, when present.\n */\nexport type ColumnsSourceShorthand = \"result_pool\" | \"current_block\";\n\n/**\n * Build a {@link ColumnsCollection} from sandbox-side source descriptors.\n * Resolves the `columnsCollection` driver (either from `deps.driver` or via\n * `getService(\"columnsCollection\")`) and asks the host to mint a fresh\n * handle covering the supplied sources. Pass `sources === undefined` to\n * fall back to the active render ctx (main outputs + prerun + result pool).\n *\n * `sources` accepts {@link ColumnsSourceShorthand} string literals\n * (`\"result_pool\"`, `\"current_block\"`) for the common ctx-derived sources.\n */\nexport function ColumnsCollection(\n sources?: (ColumnsCollection | ColumnsSource | ColumnsSourceShorthand)[],\n deps?: ColumnsCollectionDeps,\n): ColumnsCollection {\n const driver = deps?.driver ?? getService(\"columnsCollection\", { ctx: deps?.ctx });\n const serialized: SerializedColumnsSource[] = sources\n ? sources.flatMap((s) => toSerializedSources(s, deps?.ctx))\n : defaultCtxSources(deps?.ctx);\n return new ColumnsCollectionImpl(driver.create(serialized), driver);\n}\n\nexport function isColumnsCollection(value: unknown): value is ColumnsCollection {\n return value instanceof ColumnsCollectionImpl;\n}\n\n/**\n * Sandbox proxy over the host-side `ColumnsCollection` driver. The driver\n * owns all column-set state; this object only carries an opaque\n * {@link CollectionHandle} plus a reference to the driver service.\n *\n * Construct via {@link ColumnsCollection} — the bare constructor is a\n * trivial `(handle, driver)` pair so that `addSource` / `discover` / `filter`\n * can rebind a freshly-minted handle without going through source\n * serialisation again.\n *\n * Every method returning a `ColumnsCollection` mints a fresh handle on the\n * host — the host VM bridge pins it to the active render ctx, so the sandbox\n * never has to manage refcounts.\n */\nexport class ColumnsCollectionImpl {\n constructor(\n public readonly handle: CollectionHandle,\n private readonly driver: ColumnsCollectionDriverModel,\n ) {}\n\n isEmpty(): boolean {\n return this.driver.isEmpty(this.handle);\n }\n\n isFinal(): boolean {\n return this.driver.isFinal(this.handle);\n }\n\n getColumnIds(): ColumnUniversalId[] {\n return this.driver.getColumns(this.handle);\n }\n\n getColumns(): ColumnRecipe[] {\n return this.getColumnIds()\n .map((id) => ColumnRecipe(id))\n .filter((c): c is ColumnRecipe => !isNil(c));\n }\n\n addSource(source: ColumnsSource | ColumnsCollection): ColumnsCollection {\n return new ColumnsCollectionImpl(\n this.driver.addSource(this.handle, toSerializedSources(source)),\n this.driver,\n );\n }\n\n discover(options: ColumnsDiscoverOptions): ColumnsCollection {\n return new ColumnsCollectionImpl(this.driver.discover(this.handle, options), this.driver);\n }\n\n filter(options: ColumnsFilterOptions): ColumnsCollection {\n return new ColumnsCollectionImpl(this.driver.filter(this.handle, options), this.driver);\n }\n}\n\n/** Public type alias — value of the same name is the factory function above. */\nexport type ColumnsCollection = ColumnsCollectionImpl;\n\nfunction toSerializedSources(\n source: ColumnsCollection | ColumnsSource | ColumnsSourceShorthand,\n ctx?: GlobalCfgRenderCtx,\n): SerializedColumnsSource[] {\n if (source === \"result_pool\") {\n return [{ kind: \"result_pool\" }];\n }\n if (source === \"current_block\") {\n return currentBlockSources(ctx);\n }\n if (source instanceof ColumnsCollectionImpl) {\n return [{ kind: \"collection\", handle: source.handle }];\n }\n if (source instanceof TreeNodeAccessor) {\n return [{ kind: \"accessor\", accessor: source.handle, path: source.resolvePath }];\n }\n if (isColumnArray(source)) {\n return [{ kind: \"ids\", ids: source.columns.map((c) => c.id), isFinal: source.isFinal }];\n }\n if (isColumnProvider(source)) {\n return [{ kind: \"ids\", ids: source.getColumns().map((c) => c.id), isFinal: source.isFinal() }];\n }\n throw new Error(\"ColumnsCollection: unrecognised ColumnsSource shape\");\n}\n\nfunction isColumnArray(source: unknown): source is {\n columns: ReadonlyArray<{ id: ColumnUniversalId; spec?: unknown; data?: unknown }>;\n isFinal: boolean;\n} {\n if (typeof source !== \"object\" || source === null) return false;\n const s = source as { columns?: unknown; isFinal?: unknown };\n return Array.isArray(s.columns) && typeof s.isFinal === \"boolean\";\n}\n\nfunction currentBlockSources(ctx?: GlobalCfgRenderCtx): SerializedColumnsSource[] {\n const renderCtx = ctx ?? getCfgRenderCtx();\n const sources: SerializedColumnsSource[] = [];\n\n const outputs = renderCtx.getAccessorHandleByName(MainAccessorName);\n if (outputs !== undefined) {\n sources.push({ kind: \"accessor\", accessor: outputs, path: [MainAccessorName] });\n }\n const prerun = renderCtx.getAccessorHandleByName(StagingAccessorName);\n if (prerun !== undefined) {\n sources.push({ kind: \"accessor\", accessor: prerun, path: [StagingAccessorName] });\n }\n\n return sources;\n}\n\nfunction defaultCtxSources(ctx?: GlobalCfgRenderCtx): SerializedColumnsSource[] {\n return [...currentBlockSources(ctx), { kind: \"result_pool\" }];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA6CA,SAAgB,kBACd,SACA,MACmB;CACnB,MAAM,SAAS,MAAM,UAAUA,qBAAAA,WAAW,qBAAqB,EAAE,KAAK,MAAM,IAAI,CAAC;CACjF,MAAM,aAAwC,UAC1C,QAAQ,SAAS,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC,IACxD,kBAAkB,MAAM,GAAG;CAC/B,OAAO,IAAI,sBAAsB,OAAO,OAAO,UAAU,GAAG,MAAM;AACpE;AAEA,SAAgB,oBAAoB,OAA4C;CAC9E,OAAO,iBAAiB;AAC1B;;;;;;;;;;;;;;;AAgBA,IAAa,wBAAb,MAAa,sBAAsB;CAEf;CACC;CAFnB,YACE,QACA,QACA;EAFgB,KAAA,SAAA;EACC,KAAA,SAAA;CAChB;CAEH,UAAmB;EACjB,OAAO,KAAK,OAAO,QAAQ,KAAK,MAAM;CACxC;CAEA,UAAmB;EACjB,OAAO,KAAK,OAAO,QAAQ,KAAK,MAAM;CACxC;CAEA,eAAoC;EAClC,OAAO,KAAK,OAAO,WAAW,KAAK,MAAM;CAC3C;CAEA,aAA6B;EAC3B,OAAO,KAAK,aAAa,CAAC,CACvB,KAAK,OAAOC,cAAAA,aAAa,EAAE,CAAC,CAAC,CAC7B,QAAQ,MAAyB,EAAA,
|
|
1
|
+
{"version":3,"file":"columns_collection.cjs","names":["getService","ColumnRecipe","isNil","TreeNodeAccessor","isColumnProvider","getCfgRenderCtx","MainAccessorName","StagingAccessorName"],"sources":["../../src/columns/columns_collection.ts"],"sourcesContent":["import type {\n CollectionHandle,\n ColumnUniversalId,\n ColumnsCollectionDriverModel,\n ColumnsDiscoverOptions,\n ColumnsFilterOptions,\n SerializedColumnsSource,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx } from \"../render/internal\";\nimport { MainAccessorName, StagingAccessorName } from \"../render/internal\";\nimport type { ColumnsSource } from \"./column_providers\";\nimport { isColumnProvider } from \"./column_providers\";\nimport { TreeNodeAccessor } from \"../render/accessor\";\nimport { getService } from \"../services/get_services\";\nimport { getCfgRenderCtx } from \"../internal\";\nimport { ColumnRecipe } from \"./column_recipes\";\nimport { isNil } from \"es-toolkit\";\n\nexport interface ColumnsCollectionDeps {\n /** Render ctx used both for service resolution and for default ctx sources. */\n readonly ctx?: GlobalCfgRenderCtx;\n /** Override the resolved `columnsCollection` service — primarily for tests. */\n readonly driver?: ColumnsCollectionDriverModel;\n}\n\n/**\n * Shorthand literals accepted inside `ColumnsCollection`'s `sources`\n * array, expanded against the active render ctx:\n *\n * - `\"result_pool\"` – fan-out into the host's upstream-block result pool.\n * - `\"current_block\"` – main outputs + prerun (staging) accessors of the\n * current block, when present.\n */\nexport type ColumnsSourceShorthand = \"result_pool\" | \"current_block\";\n\n/**\n * Build a {@link ColumnsCollection} from sandbox-side source descriptors.\n * Resolves the `columnsCollection` driver (either from `deps.driver` or via\n * `getService(\"columnsCollection\")`) and asks the host to mint a fresh\n * handle covering the supplied sources. Pass `sources === undefined` to\n * fall back to the active render ctx (main outputs + prerun + result pool).\n *\n * `sources` accepts {@link ColumnsSourceShorthand} string literals\n * (`\"result_pool\"`, `\"current_block\"`) for the common ctx-derived sources.\n */\nexport function ColumnsCollection(\n sources?: (ColumnsCollection | ColumnsSource | ColumnsSourceShorthand)[],\n deps?: ColumnsCollectionDeps,\n): ColumnsCollection {\n const driver = deps?.driver ?? getService(\"columnsCollection\", { ctx: deps?.ctx });\n const serialized: SerializedColumnsSource[] = sources\n ? sources.flatMap((s) => toSerializedSources(s, deps?.ctx))\n : defaultCtxSources(deps?.ctx);\n return new ColumnsCollectionImpl(driver.create(serialized), driver);\n}\n\nexport function isColumnsCollection(value: unknown): value is ColumnsCollection {\n return value instanceof ColumnsCollectionImpl;\n}\n\n/**\n * Sandbox proxy over the host-side `ColumnsCollection` driver. The driver\n * owns all column-set state; this object only carries an opaque\n * {@link CollectionHandle} plus a reference to the driver service.\n *\n * Construct via {@link ColumnsCollection} — the bare constructor is a\n * trivial `(handle, driver)` pair so that `addSource` / `discover` / `filter`\n * can rebind a freshly-minted handle without going through source\n * serialisation again.\n *\n * Every method returning a `ColumnsCollection` mints a fresh handle on the\n * host — the host VM bridge pins it to the active render ctx, so the sandbox\n * never has to manage refcounts.\n */\nexport class ColumnsCollectionImpl {\n constructor(\n public readonly handle: CollectionHandle,\n private readonly driver: ColumnsCollectionDriverModel,\n ) {}\n\n isEmpty(): boolean {\n return this.driver.isEmpty(this.handle);\n }\n\n isFinal(): boolean {\n return this.driver.isFinal(this.handle);\n }\n\n getColumnIds(): ColumnUniversalId[] {\n return this.driver.getColumns(this.handle);\n }\n\n getColumns(): ColumnRecipe[] {\n return this.getColumnIds()\n .map((id) => ColumnRecipe(id))\n .filter((c): c is ColumnRecipe => !isNil(c));\n }\n\n addSource(source: ColumnsSource | ColumnsCollection): ColumnsCollection {\n return new ColumnsCollectionImpl(\n this.driver.addSource(this.handle, toSerializedSources(source)),\n this.driver,\n );\n }\n\n discover(options: ColumnsDiscoverOptions): ColumnsCollection {\n return new ColumnsCollectionImpl(this.driver.discover(this.handle, options), this.driver);\n }\n\n filter(options: ColumnsFilterOptions): ColumnsCollection {\n return new ColumnsCollectionImpl(this.driver.filter(this.handle, options), this.driver);\n }\n}\n\n/** Public type alias — value of the same name is the factory function above. */\nexport type ColumnsCollection = ColumnsCollectionImpl;\n\nfunction toSerializedSources(\n source: ColumnsCollection | ColumnsSource | ColumnsSourceShorthand,\n ctx?: GlobalCfgRenderCtx,\n): SerializedColumnsSource[] {\n if (source === \"result_pool\") {\n return [{ kind: \"result_pool\" }];\n }\n if (source === \"current_block\") {\n return currentBlockSources(ctx);\n }\n if (source instanceof ColumnsCollectionImpl) {\n return [{ kind: \"collection\", handle: source.handle }];\n }\n if (source instanceof TreeNodeAccessor) {\n return [{ kind: \"accessor\", accessor: source.handle, path: source.resolvePath }];\n }\n if (isColumnArray(source)) {\n return [{ kind: \"ids\", ids: source.columns.map((c) => c.id), isFinal: source.isFinal }];\n }\n if (isColumnProvider(source)) {\n return [{ kind: \"ids\", ids: source.getColumns().map((c) => c.id), isFinal: source.isFinal() }];\n }\n throw new Error(\"ColumnsCollection: unrecognised ColumnsSource shape\");\n}\n\nfunction isColumnArray(source: unknown): source is {\n columns: ReadonlyArray<{ id: ColumnUniversalId; spec?: unknown; data?: unknown }>;\n isFinal: boolean;\n} {\n if (typeof source !== \"object\" || source === null) return false;\n const s = source as { columns?: unknown; isFinal?: unknown };\n return Array.isArray(s.columns) && typeof s.isFinal === \"boolean\";\n}\n\nfunction currentBlockSources(ctx?: GlobalCfgRenderCtx): SerializedColumnsSource[] {\n const renderCtx = ctx ?? getCfgRenderCtx();\n const sources: SerializedColumnsSource[] = [];\n\n const outputs = renderCtx.getAccessorHandleByName(MainAccessorName);\n if (outputs !== undefined) {\n sources.push({ kind: \"accessor\", accessor: outputs, path: [MainAccessorName] });\n }\n const prerun = renderCtx.getAccessorHandleByName(StagingAccessorName);\n if (prerun !== undefined) {\n sources.push({ kind: \"accessor\", accessor: prerun, path: [StagingAccessorName] });\n }\n\n return sources;\n}\n\nfunction defaultCtxSources(ctx?: GlobalCfgRenderCtx): SerializedColumnsSource[]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,mBAAAA,mBAAmB;CAAE,CAAC;CAGlF,OAAO;AACT;AAEA,SAAS,kBAAkB,KAAqD;CAC9E,OAAO,CAAC,GAAG,oBAAoB,GAAG,GAAG,EAAE,MAAM,cAAc,CAAC;AAC9D"}
|
|
@@ -3,7 +3,6 @@ import { ColumnRecipe } from "./column_recipes/index.js";
|
|
|
3
3
|
import { ColumnsSource } from "./column_providers/types.js";
|
|
4
4
|
import "./column_providers/index.js";
|
|
5
5
|
import { CollectionHandle, ColumnUniversalId, ColumnsCollectionDriverModel, ColumnsDiscoverOptions, ColumnsFilterOptions } from "@milaboratories/pl-model-common";
|
|
6
|
-
//#region src/columns/columns_collection.d.ts
|
|
7
6
|
export interface ColumnsCollectionDeps {
|
|
8
7
|
/** Render ctx used both for service resolution and for default ctx sources. */
|
|
9
8
|
readonly ctx?: GlobalCfgRenderCtx;
|
|
@@ -59,5 +58,4 @@ export declare class ColumnsCollectionImpl {
|
|
|
59
58
|
}
|
|
60
59
|
/** Public type alias — value of the same name is the factory function above. */
|
|
61
60
|
export type ColumnsCollection = ColumnsCollectionImpl;
|
|
62
|
-
//#endregion
|
|
63
61
|
//# sourceMappingURL=columns_collection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns_collection.d.ts","names":[],"sources":["../../src/columns/columns_collection.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"columns_collection.d.ts","names":[],"sources":["../../src/columns/columns_collection.ts"],"mappings":";;;;;iBAkBiB;;WAEN,MAAM;;WAEN,SAAS;;;;;;;;;;YAWR;;;;;;;;;;;wBAYI,kBACd,WAAW,oBAAoB,gBAAgB,2BAC/C,OAAO,wBACN;wBAQa,oBAAoB,iBAAiB,SAAS;;;;;;;;;;;;;;;qBAkBjD;WAEO,QAAQ;mBACP;EAFnB,YACkB,QAAQ,kBACP,QAAQ;EAG3B;EAIA;EAIA,gBAAgB;EAIhB,cAAc;EAMd,UAAU,QAAQ,gBAAgB,oBAAoB;EAOtD,SAAS,SAAS,yBAAyB;EAI3C,OAAO,SAAS,uBAAuB;;;YAM7B,oBAAoB"}
|
|
@@ -5,7 +5,7 @@ import { getService } from "../services/get_services.js";
|
|
|
5
5
|
import { ColumnRecipe } from "./column_recipes/index.js";
|
|
6
6
|
import { isColumnProvider } from "./column_providers/index.js";
|
|
7
7
|
import { isNil } from "es-toolkit";
|
|
8
|
-
|
|
8
|
+
// src/columns/columns_collection.ts
|
|
9
9
|
/**
|
|
10
10
|
* Build a {@link ColumnsCollection} from sandbox-side source descriptors.
|
|
11
11
|
* Resolves the `columnsCollection` driver (either from `deps.driver` or via
|
|
@@ -116,7 +116,6 @@ function currentBlockSources(ctx) {
|
|
|
116
116
|
function defaultCtxSources(ctx) {
|
|
117
117
|
return [...currentBlockSources(ctx), { kind: "result_pool" }];
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { ColumnsCollection, ColumnsCollectionImpl, isColumnsCollection };
|
|
121
120
|
|
|
122
121
|
//# sourceMappingURL=columns_collection.js.map
|
|
@@ -3,7 +3,7 @@ const require_index = require("./column_providers/index.cjs");
|
|
|
3
3
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
4
4
|
let es_toolkit = require("es-toolkit");
|
|
5
5
|
let lru_cache = require("lru-cache");
|
|
6
|
-
|
|
6
|
+
// src/columns/data_column.ts
|
|
7
7
|
/**
|
|
8
8
|
* Thrown by leaf-recipe factories when the requested column is provably
|
|
9
9
|
* absent in the active render ctx — i.e. every relevant accessor reports
|
|
@@ -242,7 +242,6 @@ function memoizeByEntry(fn) {
|
|
|
242
242
|
return hit.value;
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
-
//#endregion
|
|
246
245
|
exports.ColumnAbsentError = ColumnAbsentError;
|
|
247
246
|
exports.DataColumn = DataColumn;
|
|
248
247
|
exports.DataColumnImpl = DataColumnImpl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_column.cjs","names":["ColumnOverriddenRecipe","ColumnRegistry","getCtxProviders","LRUCache"],"sources":["../../src/columns/data_column.ts"],"sourcesContent":["import {\n ColumnRegistry,\n createGlobalPObjectId,\n isPColumn,\n isPlRef,\n PlRef,\n PObjectId,\n type ColumnUniversalId,\n type LeafEntry,\n type PColumn,\n type PColumnSpec,\n type SpecOverrides,\n type SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx, PColumnDataUniversal } from \"../render/internal\";\nimport { getCtxProviders } from \"./column_providers\";\nimport { isNil } from \"es-toolkit\";\nimport { LRUCache } from \"lru-cache\";\nimport { TreeNodeAccessor } from \"../render\";\nimport type {\n ColumnFieldStatus,\n ColumnRecipe,\n ColumnRecipeId,\n ColumnResolutionStatus,\n} from \"./column_recipes/types\";\nimport { ColumnOverriddenRecipe } from \"./column_recipes/column_overrided_recipe\";\n\nexport type DataColumnId = PObjectId;\nexport type ColumnData = undefined | PColumnDataUniversal;\nexport type { ColumnFieldStatus, ColumnResolutionStatus } from \"./column_recipes/types\";\n\n/**\n * A {@link ColumnRecipe} that can be read directly in the sandbox: its\n * {@link getData} is guaranteed to be consistent with {@link getSpec}.\n *\n * This is a *capability*, not a class. Only two recipe shapes carry it — a\n * bare leaf and a spec-override over a bare leaf — because those are the only\n * ones whose data still matches their spec. An axis-filtered recipe drops axes\n * from its spec while the underlying data keeps them, and a discovered recipe\n * only materialises after a join; neither can be read here, so neither\n * implements this interface.\n *\n * Narrow to it with `hasReachableData(recipe)` rather than testing for a concrete\n * class — which recipe classes exist is an implementation detail behind\n * `recipe.id`.\n */\nexport interface DataColumnRecipe<\n ID extends ColumnRecipeId = ColumnRecipeId,\n> extends ColumnRecipe<ID> {\n /** Column data, consistent with {@link ColumnRecipe.getSpec}. */\n getData(): ColumnData;\n}\n\n/**\n * Thrown by leaf-recipe factories when the requested column is provably\n * absent in the active render ctx — i.e. every relevant accessor reports\n * `inputsLocked` and the column did not appear. Distinct from the\n * `undefined` return that the factories still use for the \"resolving\" case\n * (the column may still appear later).\n *\n * Catch at the boundary (resolver / filter+sort wiring / data-table assembly)\n * when partial absence should be surfaced to the user rather than silently\n * producing an empty result.\n */\nexport class ColumnAbsentError extends Error {\n constructor(public readonly id: ColumnUniversalId) {\n super(`Column is absent in the active render ctx and will not appear: ${id}`);\n this.name = \"ColumnAbsentError\";\n }\n}\n\n/**\n * The leaf-recipe building block: a {@link DataColumnRecipe} whose `id` is a bare\n * {@link PObjectId} and whose readers are bound to a single tree-accessor\n * leaf. Layered encodings (Overridden / Discovered / Filtered) are reified\n * through their dedicated recipe classes and reference leaf columns by id.\n *\n * Internal — consumers hold the {@link DataColumnRecipe} interface and construct\n * through the {@link DataColumnRecipe} dispatcher.\n */\nexport class DataColumnImpl implements DataColumnRecipe<PObjectId> {\n private specCache?: { readonly value: PColumnSpec };\n private dataCache?: { readonly value: ColumnData };\n private dataStatusCache?: { readonly value: ColumnFieldStatus };\n\n private constructor(\n public readonly id: PObjectId,\n private readonly options: {\n getSpec: () => PColumnSpec;\n getData: () => ColumnData;\n getDataStatus: () => ColumnFieldStatus;\n },\n ) {}\n\n /** A leaf-recipe references exactly one column — its own id. */\n getReferencedIds(): PObjectId[] {\n return [this.id];\n }\n\n getSpec(): PColumnSpec {\n if (this.specCache === undefined) {\n this.specCache = { value: this.options.getSpec() };\n }\n return this.specCache.value;\n }\n\n /** Leaf-shaped — points straight at `this.id`. */\n getQuery(): SpecQuery {\n return { type: \"column\", column: this.id } as SpecQuery;\n }\n\n getData(): ColumnData {\n if (this.dataCache === undefined) this.dataCache = { value: this.options.getData() };\n return this.dataCache.value;\n }\n\n getDataStatus(): ColumnFieldStatus {\n if (this.dataStatusCache === undefined) {\n this.dataStatusCache = { value: this.options.getDataStatus() };\n }\n return this.dataStatusCache.value;\n }\n\n /**\n * Overlay overrides → produces a {@link ColumnOverriddenRecipe} wrapping\n * this leaf. The leaf itself stays bare (id remains a plain PObjectId);\n * layering lives entirely in the recipe wrappers.\n */\n withSpecs(overrides: SpecOverrides): ColumnRecipe {\n return ColumnOverriddenRecipe.wrap(this, overrides);\n }\n\n /**\n * Resolve via the ambient {@link ColumnRegistry}. Spec is resolved eagerly:\n * returns `undefined` if the leaf isn't reachable yet (resolving). Throws\n * {@link ColumnAbsentError} when every relevant accessor is `inputsLocked`\n * and the column did not appear — the column will not exist in this ctx.\n * Data and dataStatus stay lazy.\n */\n static fromId(\n id: PObjectId,\n { ctx }: { ctx?: GlobalCfgRenderCtx } = {},\n ): undefined | DataColumnRecipe<PObjectId> {\n const registry = new ColumnRegistry(getCtxProviders({ ctx }));\n const leaf = registry.resolve(id);\n if (isNil(leaf)) {\n if (registry.isFinal()) throw new ColumnAbsentError(id);\n return undefined;\n }\n const spec = readSpecAccessor(leaf);\n if (isNil(spec)) {\n if (leaf.accessor.getInputsLocked()) throw new ColumnAbsentError(id);\n return undefined;\n }\n if (!spec.hasData()) return undefined;\n return new DataColumnImpl(id, {\n getSpec: () => spec.getDataAsJson<PColumnSpec>(),\n getData: () => readDataAccessor(leaf),\n getDataStatus: () => readDataStatus(leaf),\n });\n }\n\n /** {@link PlRef} wrapper over {@link fromId}. */\n static fromPlRef(ref: PlRef): undefined | DataColumnRecipe<PObjectId> {\n return DataColumnImpl.fromId(createGlobalPObjectId(ref.blockId, ref.name));\n }\n\n /**\n * Bind directly to an accessor-backed {@link LeafEntry} — no registry.\n * Throws {@link ColumnAbsentError} if the leaf has no spec field and its\n * accessor is `inputsLocked`. Returns `undefined` while still resolving.\n */\n static fromAccessor(entry: LeafEntry<TreeNodeAccessor>): undefined | DataColumnRecipe<PObjectId> {\n const spec = readSpecAccessor(entry);\n if (isNil(spec)) {\n if (entry.accessor.getInputsLocked()) throw new ColumnAbsentError(entry.id);\n return undefined;\n }\n if (!spec.hasData()) return undefined;\n return new DataColumnImpl(entry.id, {\n getSpec: () => spec.getDataAsJson<PColumnSpec>(),\n getData: () => readDataAccessor(entry),\n getDataStatus: () => readDataStatus(entry),\n });\n }\n\n /**\n * Wrap a materialised {@link PColumn}. If the input is already a\n * {@link DataColumnRecipe} leaf it is returned as-is.\n */\n static fromColumn(\n column: PColumn<ColumnData> | DataColumnRecipe<PObjectId>,\n ): DataColumnRecipe<PObjectId> {\n if (column instanceof DataColumnImpl) return column;\n // `DataColumnRecipe` is an interface, so `instanceof` above does not remove it\n // from the union. The only implementation carrying a bare `PObjectId` is\n // `DataColumnImpl` (wrappers expose `ColumnUniversalId`), so anything\n // reaching here is a materialised `PColumn`.\n const pColumn = column as PColumn<ColumnData>;\n return new DataColumnImpl(pColumn.id, {\n getSpec: () => pColumn.spec,\n getData: () => pColumn.data,\n getDataStatus: () => \"present\",\n });\n }\n\n /**\n * Distinguishes `present` / `resolving` / `absent` for a {@link PObjectId}\n * in the active render ctx. Falls back to the registry's `isFinal()`\n * when the id has no entry — only then we can say `absent` instead of\n * `resolving`.\n */\n static getStatusById(\n id: PObjectId,\n { ctx }: { ctx?: GlobalCfgRenderCtx } = {},\n ): ColumnResolutionStatus {\n const registry = new ColumnRegistry(getCtxProviders({ ctx }));\n const leaf = registry.resolve(id);\n if (isNil(leaf)) return registry.isFinal() ? \"absent\" : \"resolving\";\n return getLeafEntryStatus(leaf);\n }\n\n /** {@link PlRef} wrapper over {@link getStatusById}. */\n static getStatusByPlRef(\n ref: PlRef,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n ): ColumnResolutionStatus {\n return DataColumnImpl.getStatusById(createGlobalPObjectId(ref.blockId, ref.name), opts);\n }\n\n /** No registry — reads straight off the entry's accessor. */\n static getStatusByAccessor(entry: LeafEntry<TreeNodeAccessor>): ColumnResolutionStatus {\n return getLeafEntryStatus(entry);\n }\n}\n\n/** Anything the {@link DataColumnRecipe} dispatcher can build a leaf from. */\nexport type DataColumnSource =\n | PObjectId\n | PlRef\n | LeafEntry<TreeNodeAccessor>\n | PColumn<ColumnData>\n | DataColumnRecipe<PObjectId>;\n\n/**\n * Unified dispatcher — picks the right `DataColumnImpl.fromX` by source\n * shape. For ambiguous inputs callers can still use the explicit factories\n * (also attached as properties: `DataColumn.fromId`, `.fromPlRef`,\n * `.fromAccessor`, `.fromColumn`).\n */\nfunction DataColumnDispatch(\n source: DataColumnSource,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): undefined | DataColumnRecipe<PObjectId> {\n if (typeof source === \"string\") return DataColumnImpl.fromId(source, opts);\n if (source instanceof DataColumnImpl) return source;\n // `DataColumnRecipe` is an interface — `instanceof` above cannot remove it from\n // the union, and only `DataColumnImpl` implements it with a bare id.\n const rest = source as LeafEntry<TreeNodeAccessor> | PlRef | PColumn<ColumnData>;\n if (\"accessor\" in rest) return DataColumnImpl.fromAccessor(rest);\n if (isPlRef(rest)) return DataColumnImpl.fromPlRef(rest);\n if (isPColumn(rest)) return DataColumnImpl.fromColumn(rest);\n throw new Error(\"DataColumn: unknown source shape\");\n}\n\n/**\n * Polymorphic counterpart to {@link DataColumnDispatch}: returns the\n * {@link ColumnResolutionStatus} for any factory input without constructing\n * the recipe. For already-materialised sources ({@link PColumn} value,\n * existing {@link DataColumnRecipe}) status is `present` by construction.\n */\nfunction DataColumnGetStatus(\n source: DataColumnSource,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): ColumnResolutionStatus {\n if (typeof source === \"string\") return DataColumnImpl.getStatusById(source, opts);\n if (source instanceof DataColumnImpl) return \"present\";\n const rest = source as LeafEntry<TreeNodeAccessor> | PlRef | PColumn<ColumnData>;\n if (\"accessor\" in rest) return DataColumnImpl.getStatusByAccessor(rest);\n if (isPlRef(rest)) return DataColumnImpl.getStatusByPlRef(rest, opts);\n if (isPColumn(rest)) return \"present\";\n throw new Error(\"DataColumn.getStatus: unknown source shape\");\n}\n\nexport const DataColumn = Object.assign(DataColumnDispatch, {\n fromId: DataColumnImpl.fromId,\n fromPlRef: DataColumnImpl.fromPlRef,\n fromAccessor: DataColumnImpl.fromAccessor,\n fromColumn: DataColumnImpl.fromColumn,\n getStatus: DataColumnGetStatus,\n getStatusById: DataColumnImpl.getStatusById,\n getStatusByPlRef: DataColumnImpl.getStatusByPlRef,\n getStatusByAccessor: DataColumnImpl.getStatusByAccessor,\n});\n\n/**\n * Type-guard narrowing to a bare leaf — a {@link DataColumnRecipe} whose `id` is a\n * plain {@link PObjectId}.\n */\nexport function isDataColumn(value: unknown): value is DataColumnRecipe<PObjectId> {\n return value instanceof DataColumnImpl;\n}\n\nconst readSpecAccessor = memoizeByEntry(\n ({ accessor, name }: LeafEntry<TreeNodeAccessor>): undefined | TreeNodeAccessor =>\n accessor.traverse({ field: `${name}.spec`, assertFieldType: \"Input\", ignoreError: true }),\n);\n\n/**\n * Per-entry counterpart to {@link readDataStatus}: tells whether the leaf's\n * **spec** can be read in this ctx, and — for the negative cases —\n * distinguishes `resolving` from `absent` via `getInputsLocked()`.\n *\n * - spec field not yet on the entry's accessor + inputs locked → `absent`\n * - spec field not yet on the entry's accessor + still resolving → `resolving`\n * - spec resource present but bytes not yet written → `resolving`\n * (transient — the spec resource is connected, just unfilled)\n * - spec resource present and `hasData()` → `present`\n */\nfunction getLeafEntryStatus(entry: LeafEntry<TreeNodeAccessor>): ColumnResolutionStatus {\n const spec = readSpecAccessor(entry);\n if (isNil(spec)) return entry.accessor.getInputsLocked() ? \"absent\" : \"resolving\";\n if (!spec.hasData()) return \"resolving\";\n return \"present\";\n}\n\nconst readDataAccessor = memoizeByEntry(\n ({ accessor, name }: LeafEntry<TreeNodeAccessor>): undefined | TreeNodeAccessor =>\n accessor.traverse({ field: `${name}.data`, assertFieldType: \"Input\", ignoreError: true }),\n);\n\nconst readDataStatus = memoizeByEntry(\n ({ accessor, name }: LeafEntry<TreeNodeAccessor>): ColumnFieldStatus => {\n if (accessor.listInputFields().includes(`${name}.data`)) return \"present\";\n return accessor.getInputsLocked() ? \"absent\" : \"resolving\";\n },\n);\n\nfunction memoizeByEntry<R>(\n fn: (entry: LeafEntry<TreeNodeAccessor>) => R,\n): (entry: LeafEntry<TreeNodeAccessor>) => R {\n const cache = new LRUCache<string, { value: R }>({ max: 1000 });\n return (entry) => {\n const key = `${entry.accessor.handle}:${entry.name}`;\n let hit = cache.get(key);\n if (!hit) cache.set(key, (hit = { value: fn(entry) }));\n return hit.value;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgEA,IAAa,oBAAb,cAAuC,MAAM;CACf;CAA5B,YAAY,IAAuC;EACjD,MAAM,kEAAkE,IAAI;EADlD,KAAA,KAAA;EAE1B,KAAK,OAAO;CACd;AACF;;;;;;;;;;AAWA,IAAa,iBAAb,MAAa,eAAsD;CAM/C;CACC;CANnB;CACA;CACA;CAEA,YACE,IACA,SAKA;EANgB,KAAA,KAAA;EACC,KAAA,UAAA;CAKhB;;CAGH,mBAAgC;EAC9B,OAAO,CAAC,KAAK,EAAE;CACjB;CAEA,UAAuB;EACrB,IAAI,KAAK,cAAc,KAAA,GACrB,KAAK,YAAY,EAAE,OAAO,KAAK,QAAQ,QAAQ,EAAE;EAEnD,OAAO,KAAK,UAAU;CACxB;;CAGA,WAAsB;EACpB,OAAO;GAAE,MAAM;GAAU,QAAQ,KAAK;EAAG;CAC3C;CAEA,UAAsB;EACpB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,EAAE,OAAO,KAAK,QAAQ,QAAQ,EAAE;EACnF,OAAO,KAAK,UAAU;CACxB;CAEA,gBAAmC;EACjC,IAAI,KAAK,oBAAoB,KAAA,GAC3B,KAAK,kBAAkB,EAAE,OAAO,KAAK,QAAQ,cAAc,EAAE;EAE/D,OAAO,KAAK,gBAAgB;CAC9B;;;;;;CAOA,UAAU,WAAwC;EAChD,OAAOA,gCAAAA,uBAAuB,KAAK,MAAM,SAAS;CACpD;;;;;;;;CASA,OAAO,OACL,IACA,EAAE,QAAsC,CAAC,GACA;EACzC,MAAM,WAAW,IAAIC,gCAAAA,eAAeC,cAAAA,gBAAgB,EAAE,IAAI,CAAC,CAAC;EAC5D,MAAM,OAAO,SAAS,QAAQ,EAAE;EAChC,KAAA,GAAA,WAAA,MAAA,CAAU,IA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umn","LRUCache"],"sources":["../../src/columns/data_column.ts"],"sourcesContent":["import {\n ColumnRegistry,\n createGlobalPObjectId,\n isPColumn,\n isPlRef,\n PlRef,\n PObjectId,\n type ColumnUniversalId,\n type LeafEntry,\n type PColumn,\n type PColumnSpec,\n type SpecOverrides,\n type SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport type { GlobalCfgRenderCtx, PColumnDataUniversal } from \"../render/internal\";\nimport { getCtxProviders } from \"./column_providers\";\nimport { isNil } from \"es-toolkit\";\nimport { LRUCache } from \"lru-cache\";\nimport { TreeNodeAccessor } from \"../render\";\nimport type {\n ColumnFieldStatus,\n ColumnRecipe,\n ColumnRecipeId,\n ColumnResolutionStatus,\n} from \"./column_recipes/types\";\nimport { ColumnOverriddenRecipe } from \"./column_recipes/column_overrided_recipe\";\n\nexport type DataColumnId = PObjectId;\nexport type ColumnData = undefined | PColumnDataUniversal;\nexport type { ColumnFieldStatus, ColumnResolutionStatus } from \"./column_recipes/types\";\n\n/**\n * A {@link ColumnRecipe} that can be read directly in the sandbox: its\n * {@link getData} is guaranteed to be consistent with {@link getSpec}.\n *\n * This is a *capability*, not a class. Only two recipe shapes carry it — a\n * bare leaf and a spec-override over a bare leaf — because those are the only\n * ones whose data still matches their spec. An axis-filtered recipe drops axes\n * from its spec while the underlying data keeps them, and a discovered recipe\n * only materialises after a join; neither can be read here, so neither\n * implements this interface.\n *\n * Narrow to it with `hasReachableData(recipe)` rather than testing for a concrete\n * class — which recipe classes exist is an implementation detail behind\n * `recipe.id`.\n */\nexport interface DataColumnRecipe<\n ID extends ColumnRecipeId = ColumnRecipeId,\n> extends ColumnRecipe<ID> {\n /** Column data, consistent with {@link ColumnRecipe.getSpec}. */\n getData(): ColumnData;\n}\n\n/**\n * Thrown by leaf-recipe factories when the requested column is provably\n * absent in the active render ctx — i.e. every relevant accessor reports\n * `inputsLocked` and the column did not appear. Distinct from the\n * `undefined` return that the factories still use for the \"resolving\" case\n * (the column may still appear later).\n *\n * Catch at the boundary (resolver / filter+sort wiring / data-table assembly)\n * when partial absence should be surfaced to the user rather than silently\n * producing an empty result.\n */\nexport class ColumnAbsentError extends Error {\n constructor(public readonly id: ColumnUniversalId) {\n super(`Column is absent in the active render ctx and will not appear: ${id}`);\n this.name = \"ColumnAbsentError\";\n }\n}\n\n/**\n * The leaf-recipe building block: a {@link DataColumnRecipe} whose `id` is a bare\n * {@link PObjectId} and whose readers are bound to a single tree-accessor\n * leaf. Layered encodings (Overridden / Discovered / Filtered) are reified\n * through their dedicated recipe classes and reference leaf columns by id.\n *\n * Internal — consumers hold the {@link DataColumnRecipe} interface and construct\n * through the {@link DataColumnRecipe} dispatcher.\n */\nexport class DataColumnImpl implements DataColumnRecipe<PObjectId> {\n private specCache?: { readonly value: PColumnSpec };\n private dataCache?: { readonly value: ColumnData };\n private dataStatusCache?: { readonly value: ColumnFieldStatus };\n\n private constructor(\n public readonly id: PObjectId,\n private readonly options: {\n getSpec: () => PColumnSpec;\n getData: () => ColumnData;\n getDataStatus: () => ColumnFieldStatus;\n },\n ) {}\n\n /** A leaf-recipe references exactly one column — its own id. */\n getReferencedIds(): PObjectId[] {\n return [this.id];\n }\n\n getSpec(): PColumnSpec {\n if (this.specCache === undefined) {\n this.specCache = { value: this.options.getSpec() };\n }\n return this.specCache.value;\n }\n\n /** Leaf-shaped — points straight at `this.id`. */\n getQuery(): SpecQuery {\n return { type: \"column\", column: this.id } as SpecQuery;\n }\n\n getData(): ColumnData {\n if (this.dataCache === undefined) this.dataCache = { value: this.options.getData() };\n return this.dataCache.value;\n }\n\n getDataStatus(): ColumnFieldStatus {\n if (this.dataStatusCache === undefined) {\n this.dataStatusCache = { value: this.options.getDataStatus() };\n }\n return this.dataStatusCache.value;\n }\n\n /**\n * Overlay overrides → produces a {@link ColumnOverriddenRecipe} wrapping\n * this leaf. The leaf itself stays bare (id remains a plain PObjectId);\n * layering lives entirely in the recipe wrappers.\n */\n withSpecs(overrides: SpecOverrides): ColumnRecipe {\n return ColumnOverriddenRecipe.wrap(this, overrides);\n }\n\n /**\n * Resolve via the ambient {@link ColumnRegistry}. Spec is resolved eagerly:\n * returns `undefined` if the leaf isn't reachable yet (resolving). Throws\n * {@link ColumnAbsentError} when every relevant accessor is `inputsLocked`\n * and the column did not appear — the column will not exist in this ctx.\n * Data and dataStatus stay lazy.\n */\n static fromId(\n id: PObjectId,\n { ctx }: { ctx?: GlobalCfgRenderCtx } = {},\n ): undefined | DataColumnRecipe<PObjectId> {\n const registry = new ColumnRegistry(getCtxProviders({ ctx }));\n const leaf = registry.resolve(id);\n if (isNil(leaf)) {\n if (registry.isFinal()) throw new ColumnAbsentError(id);\n return undefined;\n }\n const spec = readSpecAccessor(leaf);\n if (isNil(spec)) {\n if (leaf.accessor.getInputsLocked()) throw new ColumnAbsentError(id);\n return undefined;\n }\n if (!spec.hasData()) return undefined;\n return new DataColumnImpl(id, {\n getSpec: () => spec.getDataAsJson<PColumnSpec>(),\n getData: () => readDataAccessor(leaf),\n getDataStatus: () => readDataStatus(leaf),\n });\n }\n\n /** {@link PlRef} wrapper over {@link fromId}. */\n static fromPlRef(ref: PlRef): undefined | DataColumnRecipe<PObjectId> {\n return DataColumnImpl.fromId(createGlobalPObjectId(ref.blockId, ref.name));\n }\n\n /**\n * Bind directly to an accessor-backed {@link LeafEntry} — no registry.\n * Throws {@link ColumnAbsentError} if the leaf has no spec field and its\n * accessor is `inputsLocked`. Returns `undefined` while still resolving.\n */\n static fromAccessor(entry: LeafEntry<TreeNodeAccessor>): undefined | DataColumnRecipe<PObjectId> {\n const spec = readSpecAccessor(entry);\n if (isNil(spec)) {\n if (entry.accessor.getInputsLocked()) throw new ColumnAbsentError(entry.id);\n return undefined;\n }\n if (!spec.hasData()) return undefined;\n return new DataColumnImpl(entry.id, {\n getSpec: () => spec.getDataAsJson<PColumnSpec>(),\n getData: () => readDataAccessor(entry),\n getDataStatus: () => readDataStatus(entry),\n });\n }\n\n /**\n * Wrap a materialised {@link PColumn}. If the input is already a\n * {@link DataColumnRecipe} leaf it is returned as-is.\n */\n static fromColumn(\n column: PColumn<ColumnData> | DataColumnRecipe<PObjectId>,\n ): DataColumnRecipe<PObjectId> {\n if (column instanceof DataColumnImpl) return column;\n // `DataColumnRecipe` is an interface, so `instanceof` above does not remove it\n // from the union. The only implementation carrying a bare `PObjectId` is\n // `DataColumnImpl` (wrappers expose `ColumnUniversalId`), so anything\n // reaching here is a materialised `PColumn`.\n const pColumn = column as PColumn<ColumnData>;\n return new DataColumnImpl(pColumn.id, {\n getSpec: () => pColumn.spec,\n getData: () => pColumn.data,\n getDataStatus: () => \"present\",\n });\n }\n\n /**\n * Distinguishes `present` / `resolving` / `absent` for a {@link PObjectId}\n * in the active render ctx. Falls back to the registry's `isFinal()`\n * when the id has no entry — only then we can say `absent` instead of\n * `resolving`.\n */\n static getStatusById(\n id: PObjectId,\n { ctx }: { ctx?: GlobalCfgRenderCtx } = {},\n ): ColumnResolutionStatus {\n const registry = new ColumnRegistry(getCtxProviders({ ctx }));\n const leaf = registry.resolve(id);\n if (isNil(leaf)) return registry.isFinal() ? \"absent\" : \"resolving\";\n return getLeafEntryStatus(leaf);\n }\n\n /** {@link PlRef} wrapper over {@link getStatusById}. */\n static getStatusByPlRef(\n ref: PlRef,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n ): ColumnResolutionStatus {\n return DataColumnImpl.getStatusById(createGlobalPObjectId(ref.blockId, ref.name), opts);\n }\n\n /** No registry — reads straight off the entry's accessor. */\n static getStatusByAccessor(entry: LeafEntry<TreeNodeAccessor>): ColumnResolutionStatus {\n return getLeafEntryStatus(entry);\n }\n}\n\n/** Anything the {@link DataColumnRecipe} dispatcher can build a leaf from. */\nexport type DataColumnSource =\n | PObjectId\n | PlRef\n | LeafEntry<TreeNodeAccessor>\n | PColumn<ColumnData>\n | DataColumnRecipe<PObjectId>;\n\n/**\n * Unified dispatcher — picks the right `DataColumnImpl.fromX` by source\n * shape. For ambiguous inputs callers can still use the explicit factories\n * (also attached as properties: `DataColumn.fromId`, `.fromPlRef`,\n * `.fromAccessor`, `.fromColumn`).\n */\nfunction DataColumnDispatch(\n source: DataColumnSource,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): undefined | DataColumnRecipe<PObjectId> {\n if (typeof source === \"string\") return DataColumnImpl.fromId(source, opts);\n if (source instanceof DataColumnImpl) return source;\n // `DataColumnRecipe` is an interface — `instanceof` above cannot remove it from\n // the union, and only `DataColumnImpl` implements it with a bare id.\n const rest = source as LeafEntry<TreeNodeAccessor> | PlRef | PColumn<ColumnData>;\n if (\"accessor\" in rest) return DataColumnImpl.fromAccessor(rest);\n if (isPlRef(rest)) return DataColumnImpl.fromPlRef(rest);\n if (isPColumn(rest)) return DataColumnImpl.fromColumn(rest);\n throw new Error(\"DataColumn: unknown source shape\");\n}\n\n/**\n * Polymorphic counterpart to {@link DataColumnDispatch}: returns the\n * {@link ColumnResolutionStatus} for any factory input without constructing\n * the recipe. For already-materialised sources ({@link PColumn} value,\n * existing {@link DataColumnRecipe}) status is `present` by construction.\n */\nfunction DataColumnGetStatus(\n source: DataColumnSource,\n opts: { ctx?: GlobalCfgRenderCtx } = {},\n): ColumnResolutionStatus {\n if (typeof source === \"string\") return DataColumnImpl.getStatusById(source, opts);\n if (source instanceof DataColumnImpl) return \"present\";\n const rest = source as LeafEntry<TreeNodeAccessor> | PlRef | PColumn<ColumnData>;\n if (\"accessor\" in rest) return DataColumnImpl.getStatusByAccessor(rest);\n if (isPlRef(rest)) return DataColumnImpl.getStatusByPlRef(rest, opts);\n if (isPColumn(rest)) return \"present\";\n throw new Error(\"DataColumn.getStatus: unknown source shape\");\n}\n\nexport const DataColumn = Object.assign(DataColumnDispatch, {\n fromId: DataColumnImpl.fromId,\n fromPlRef: DataColumnImpl.fromPlRef,\n fromAccessor: DataColumnImpl.fromAccessor,\n fromColumn: DataColumnImpl.fromColumn,\n getStatus: DataColumnGetStatus,\n getStatusById: DataColumnImpl.getStatusById,\n getStatusByPlRef: DataColumnImpl.getStatusByPlRef,\n getStatusByAccessor: DataColumnImpl.getStatusByAccessor,\n});\n\n/**\n * Type-guard narrowing to a bare leaf — a {@link DataColumnRecipe} whose `id` is a\n * plain {@link PObjectId}.\n */\nexport function isDataColumn(value: unknown): value is DataColumnRecipe<PObjectId> {\n return value instanceof DataColumnImpl;\n}\n\nconst readSpecAccessor = memoizeByEntry(\n ({ accessor, name }: LeafEntry<TreeNodeAccessor>): undefined | TreeNodeAccessor =>\n accessor.traverse({ field: `${name}.spec`, assertFieldType: \"Input\", ignoreError: true }),\n);\n\n/**\n * Per-entry counterpart to {@link readDataStatus}: tells whether the leaf's\n * **spec** can be read in this ctx, and — for the negative cases —\n * distinguishes `resolving` from `absent` via `getInputsLocked()`.\n *\n * - spec field not yet on the entry's accessor + inputs locked → `absent`\n * - spec field not yet on the entry's accessor + still resolving → `resolving`\n * - spec resource present but bytes not yet written → `resolving`\n * (transient — the spec resource is connected, just unfilled)\n * - spec resource present and `hasData()` → `present`\n */\nfunction getLeafEntryStatus(entry: LeafEntry<TreeNodeAccessor>): ColumnResolutionStatus {\n const spec = readSpecAccessor(entry);\n if (isNil(spec)) return entry.accessor.getInputsLocked() ? \"absent\" : \"resolving\";\n if (!spec.hasData()) return \"resolving\";\n return \"present\";\n}\n\nconst readDataAccessor = memoizeByEntry(\n ({ accessor, name }: LeafEntry<TreeNodeAccessor>): undefined | TreeNodeAccessor =>\n accessor.traverse({ field: `${name}.data`, assertFieldType: \"Input\", ignoreError: true }),\n);\n\nconst readDataStatus = memoizeByEntry(\n ({ accessor, name }: LeafEntry<TreeNodeAccessor>): ColumnFieldStatus => {\n if (accessor.listInputFields().includes(`${name}.data`)) return \"present\";\n return accessor.getInputsLocked() ? \"absent\" : \"resolving\";\n },\n);\n\nfunction memoizeByEntry<R>(\n fn: (entry: LeafEntry<TreeNodeAccessor>) => R,\n): (entry: LeafEntry<TreeNodeAccessor>) => R {\n const cache = new LRUCache<string, { value: R }>({ max: 1000 });\n return (entry) => {\n const key = `${entry.accessor.handle}:${entry.name}`;\n let hit = cache.get(key);\n if (!hit) cache.set(key, (hit = { value: fn(entry) }));\n return hit.value;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgEA,IAAa,oBAAb,cAAuC,MAAM;CACf;CAA5B,YAAY,IAAuC;EACjD,MAAM,kEAAkE,IAAI;EADlD,KAAA,KAAA;EAE1B,KAAK,OAAO;CACd;AACF;;;;;;;;;;AAWA,IAAa,iBAAb,MAAa,eAAsD;CAM/C;CACC;CANnB;CACA;CACA;CAEA,YACE,IACA,SAKA;EANgB,KAAA,KAAA;EACC,KAAA,UAAA;CAKhB;;CAGH,mBAAgC;EAC9B,OAAO,CAAC,KAAK,EAAE;CACjB;CAEA,UAAuB;EACrB,IAAI,KAAK,cAAc,KAAA,GACrB,KAAK,YAAY,EAAE,OAAO,KAAK,QAAQ,QAAQ,EAAE;EAEnD,OAAO,KAAK,UAAU;CACxB;;CAGA,WAAsB;EACpB,OAAO;GAAE,MAAM;GAAU,QAAQ,KAAK;EAAG;CAC3C;CAEA,UAAsB;EACpB,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,EAAE,OAAO,KAAK,QAAQ,QAAQ,EAAE;EACnF,OAAO,KAAK,UAAU;CACxB;CAEA,gBAAmC;EACjC,IAAI,KAAK,oBAAoB,KAAA,GAC3B,KAAK,kBAAkB,EAAE,OAAO,KAAK,QAAQ,cAAc,EAAE;EAE/D,OAAO,KAAK,gBAAgB;CAC9B;;;;;;CAOA,UAAU,WAAwC;EAChD,OAAOA,gCAAAA,uBAAuB,KAAK,MAAM,SAAS;CACpD;;;;;;;;CASA,OAAO,OACL,IACA,EAAE,QAAsC,CAAC,GACA;EACzC,MAAM,WAAW,IAAIC,gCAAAA,eAAeC,cAAAA,gBAAgB,EAAE,IAAI,CAAC,CAAC;EAC5D,MAAM,OAAO,SAAS,QAAQ,EAAE;EAChC,KAAA,GAAIC,WAAAA,MAAAA,CAAM,IAAI,GAAG;GACf,IAAI,SAA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
import { ColumnFieldStatus, ColumnRecipe, ColumnRecipeId, ColumnResolutionStatus } from "./column_recipes/types.js";
|
|
5
5
|
import { ColumnUniversalId, LeafEntry, PColumn, PColumnSpec, PObjectId, PlRef, SpecOverrides, SpecQuery } from "@milaboratories/pl-model-common";
|
|
6
|
-
//#region src/columns/data_column.d.ts
|
|
7
6
|
export type DataColumnId = PObjectId;
|
|
8
7
|
export type ColumnData = undefined | PColumnDataUniversal;
|
|
9
8
|
/**
|
|
@@ -143,6 +142,5 @@ export declare const DataColumn: typeof DataColumnDispatch & {
|
|
|
143
142
|
* plain {@link PObjectId}.
|
|
144
143
|
*/
|
|
145
144
|
export declare function isDataColumn(value: unknown): value is DataColumnRecipe<PObjectId>;
|
|
146
|
-
//#endregion
|
|
147
145
|
export type { ColumnFieldStatus, ColumnResolutionStatus };
|
|
148
146
|
//# sourceMappingURL=data_column.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_column.d.ts","names":[],"sources":["../../src/columns/data_column.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"data_column.d.ts","names":[],"sources":["../../src/columns/data_column.ts"],"mappings":";;;;;YA2BY,eAAe;YACf,yBAAyB;;;;;;;;;;;;;;;;iBAkBpB,iBACf,WAAW,iBAAiB,wBACpB,aAAa;;EAErB,WAAW;;;;;;;;;;;;;qBAcA,0BAA0B;WACT,IAAI;EAAhC,YAA4B,IAAI;;;;;;;;;;;qBAerB,0BAA0B,iBAAiB;WAMpC,IAAI;mBACH;UANX;UACA;UACA;UAED;;EAUP,oBAAoB;EAIpB,WAAW;;EAQX,YAAY;EAIZ,WAAW;EAKX,iBAAiB;;;;;;EAYjB,UAAU,WAAW,gBAAgB;;;;;;;;SAW9B,OACL,IAAI,aACF;IAAS,MAAM;kBACJ,iBAAiB;;SAqBzB,UAAU,KAAK,oBAAoB,iBAAiB;;;;;;SASpD,aAAa,OAAO,UAAU,gCAAgC,iBAAiB;;;;;SAkB/E,WACL,QAAQ,QAAQ,cAAc,iBAAiB,aAC9C,iBAAiB;;;;;;;SAoBb,cACL,IAAI,aACF;IAAS,MAAM;MAChB;;SAQI,iBACL,KAAK,OACL;IAAQ,MAAM;MACb;;SAKI,oBAAoB,OAAO,UAAU,oBAAoB;;;YAMtD,mBACR,YACA,QACA,UAAU,oBACV,QAAQ,cACR,iBAAiB;;;;;;;iBAQZ,mBACP,QAAQ,kBACR;EAAQ,MAAM;gBACD,iBAAiB;;;;;;;iBAkBvB,oBACP,QAAQ,kBACR;EAAQ,MAAM;IACb;qBAUU,mBAAU;;;;;;;;;;;;;;wBAeP,aAAa,iBAAiB,SAAS,iBAAiB"}
|
|
@@ -3,7 +3,7 @@ import { getCtxProviders } from "./column_providers/index.js";
|
|
|
3
3
|
import { ColumnRegistry, createGlobalPObjectId, isPColumn, isPlRef } from "@milaboratories/pl-model-common";
|
|
4
4
|
import { isNil } from "es-toolkit";
|
|
5
5
|
import { LRUCache } from "lru-cache";
|
|
6
|
-
|
|
6
|
+
// src/columns/data_column.ts
|
|
7
7
|
/**
|
|
8
8
|
* Thrown by leaf-recipe factories when the requested column is provably
|
|
9
9
|
* absent in the active render ctx — i.e. every relevant accessor reports
|
|
@@ -242,7 +242,6 @@ function memoizeByEntry(fn) {
|
|
|
242
242
|
return hit.value;
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
-
//#endregion
|
|
246
245
|
export { ColumnAbsentError, DataColumn, DataColumnImpl, isDataColumn };
|
|
247
246
|
|
|
248
247
|
//# sourceMappingURL=data_column.js.map
|
|
@@ -3,7 +3,7 @@ require("../render/index.cjs");
|
|
|
3
3
|
const require_columns_collection = require("./columns_collection.cjs");
|
|
4
4
|
const require_utils = require("./utils.cjs");
|
|
5
5
|
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
6
|
-
|
|
6
|
+
// src/columns/derive_axis_values_labels.ts
|
|
7
7
|
const RT_JSON = "PColumnData/Json";
|
|
8
8
|
const RT_JSON_PARTITIONED = "PColumnData/JsonPartitioned";
|
|
9
9
|
/**
|
|
@@ -70,7 +70,6 @@ function parseLabelKeys(raw) {
|
|
|
70
70
|
return acc;
|
|
71
71
|
}, {});
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
exports.deriveAxisValuesLabels = deriveAxisValuesLabels;
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=derive_axis_values_labels.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive_axis_values_labels.cjs","names":["ColumnsCollection","isColumnsCollection","PColumnName","hasReachableData","TreeNodeAccessor"],"sources":["../../src/columns/derive_axis_values_labels.ts"],"sourcesContent":["import type { AxisId } from \"@milaboratories/pl-model-common\";\nimport { canonicalizeAxisId, getAxisId, PColumnName } from \"@milaboratories/pl-model-common\";\nimport type { ColumnsSource } from \"./column_providers\";\nimport { ColumnsCollection, isColumnsCollection } from \"./columns_collection\";\nimport type { GlobalCfgRenderCtx } from \"../render/internal\";\nimport { TreeNodeAccessor } from \"../render\";\nimport { hasReachableData } from \"./utils\";\n\nconst RT_JSON = \"PColumnData/Json\";\nconst RT_JSON_PARTITIONED = \"PColumnData/JsonPartitioned\";\n\n/**\n * Build an `axisValuesLabels` callback by discovering `pl7.app/label` columns\n * from the given source, eagerly materialising their value→label maps, and\n * keying them by canonical axis id.\n *\n * Modern replacement for `ctx.resultPool.findLabels` — uses the new\n * column-access mechanism (filtered {@link ColumnsCollection}) instead of\n * walking the raw result pool.\n *\n * Pair with {@link splitByAxes} (or any consumer expecting the\n * `(axisId) => Record<axisValue, label>` shape).\n *\n * Skips:\n * - recipes whose data is not directly readable (see `hasReachableData`);\n * - label columns whose `axesSpec.length !== 1`;\n * - label columns whose data resource type isn't `PColumnData/Json` /\n * `PColumnData/JsonPartitioned`.\n */\nexport function deriveAxisValuesLabels(\n source?: ColumnsCollection | (ColumnsCollection | ColumnsSource)[],\n opts?: { ctx?: GlobalCfgRenderCtx },\n): (axisId: AxisId) => Record<string | number, string> | undefined {\n const collection =\n source === undefined\n ? ColumnsCollection(undefined, opts)\n : isColumnsCollection(source)\n ? source\n : ColumnsCollection(source, opts);\n\n const labelCols = collection\n .filter({ include: { name: [{ type: \"exact\", value: PColumnName.Label }] } })\n .getColumns();\n\n const byAxis = labelCols.reduce<Map<string, Record<string | number, string>>>((map, col) => {\n if (!hasReachableData(col)) return map;\n const spec = col.getSpec();\n if (spec.axesSpec.length !== 1) return map;\n\n const data = col.getData();\n if (!(data instanceof TreeNodeAccessor)) return map;\n\n const labelMap = readLabelMap(data);\n if (!labelMap) return map;\n\n map.set(canonicalizeAxisId(getAxisId(spec.axesSpec[0])), labelMap);\n return map;\n }, new Map());\n\n return (axisId) => byAxis.get(canonicalizeAxisId(axisId));\n}\n\nfunction readLabelMap(acc: TreeNodeAccessor): undefined | Record<string | number, string> {\n const rt = acc.resourceType.name;\n\n if (rt === RT_JSON) {\n const json = acc.getDataAsJson<{ data?: Record<string, string> }>();\n return json?.data ? parseLabelKeys(json.data) : undefined;\n }\n\n if (rt === RT_JSON_PARTITIONED) {\n return acc.listInputFields().reduce<Record<string | number, string>>((merged, partKey) => {\n const part = acc.resolve({\n field: partKey,\n assertFieldType: \"Input\",\n ignoreError: true,\n });\n if (!part) return merged;\n const json = part.getDataAsJson<{ data?: Record<string, string> }>();\n if (!json?.data) return merged;\n return Object.assign(merged, parseLabelKeys(json.data));\n }, {});\n }\n\n return undefined;\n}\n\nfunction parseLabelKeys(raw: Record<string, string>): Record<string | number, string> {\n return Object.entries(raw).reduce<Record<string | number, string>>((acc, [k, v]) => {\n try {\n const parsed = JSON.parse(k);\n acc[Array.isArray(parsed) ? parsed[0] : parsed] = v;\n } catch {\n acc[k] = v;\n }\n return acc;\n }, {});\n}\n"],"mappings":";;;;;;AAQA,MAAM,UAAU;AAChB,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;AAoB5B,SAAgB,uBACd,QACA,MACiE;CAYjE,MAAM,UAVJ,WAAW,KAAA,IACPA,2BAAAA,kBAAkB,KAAA,GAAW,IAAI,IACjCC,2BAAAA,oBAAoB,MAAM,IACxB,SACAD,2BAAAA,kBAAkB,QAAQ,IAAI,EAAA,CAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;EAAE,MAAM;EAAS,OAAOE,gCAAAA,YAAY;CAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAC5E,WAEoB,CAAC,CAAC,QAAsD,KAAK,QAAQ;EAC1F,IAAI,CAACC,cAAAA,iBAAiB,GAAG,GAAG,OAAO;EACnC,MAAM,OAAO,IAAI,QAAQ;EACzB,IAAI,KAAK,SAAS,WAAW,GAAG,OAAO;EAEvC,MAAM,OAAO,IAAI,QAAQ;EACzB,IAAI,EAAE,gBAAgBC,iBAAAA,mBAAmB,OAAO;EAEhD,MAAM,WAAW,aAAa,IAAI;EAClC,IAAI,CAAC,UAAU,OAAO;EAEtB,IAAI,KAAA,
|
|
1
|
+
{"version":3,"file":"derive_axis_values_labels.cjs","names":["ColumnsCollection","isColumnsCollection","PColumnName","hasReachableData","TreeNodeAccessor","canonicalizeAxisId","getAxisId"],"sources":["../../src/columns/derive_axis_values_labels.ts"],"sourcesContent":["import type { AxisId } from \"@milaboratories/pl-model-common\";\nimport { canonicalizeAxisId, getAxisId, PColumnName } from \"@milaboratories/pl-model-common\";\nimport type { ColumnsSource } from \"./column_providers\";\nimport { ColumnsCollection, isColumnsCollection } from \"./columns_collection\";\nimport type { GlobalCfgRenderCtx } from \"../render/internal\";\nimport { TreeNodeAccessor } from \"../render\";\nimport { hasReachableData } from \"./utils\";\n\nconst RT_JSON = \"PColumnData/Json\";\nconst RT_JSON_PARTITIONED = \"PColumnData/JsonPartitioned\";\n\n/**\n * Build an `axisValuesLabels` callback by discovering `pl7.app/label` columns\n * from the given source, eagerly materialising their value→label maps, and\n * keying them by canonical axis id.\n *\n * Modern replacement for `ctx.resultPool.findLabels` — uses the new\n * column-access mechanism (filtered {@link ColumnsCollection}) instead of\n * walking the raw result pool.\n *\n * Pair with {@link splitByAxes} (or any consumer expecting the\n * `(axisId) => Record<axisValue, label>` shape).\n *\n * Skips:\n * - recipes whose data is not directly readable (see `hasReachableData`);\n * - label columns whose `axesSpec.length !== 1`;\n * - label columns whose data resource type isn't `PColumnData/Json` /\n * `PColumnData/JsonPartitioned`.\n */\nexport function deriveAxisValuesLabels(\n source?: ColumnsCollection | (ColumnsCollection | ColumnsSource)[],\n opts?: { ctx?: GlobalCfgRenderCtx },\n): (axisId: AxisId) => Record<string | number, string> | undefined {\n const collection =\n source === undefined\n ? ColumnsCollection(undefined, opts)\n : isColumnsCollection(source)\n ? source\n : ColumnsCollection(source, opts);\n\n const labelCols = collection\n .filter({ include: { name: [{ type: \"exact\", value: PColumnName.Label }] } })\n .getColumns();\n\n const byAxis = labelCols.reduce<Map<string, Record<string | number, string>>>((map, col) => {\n if (!hasReachableData(col)) return map;\n const spec = col.getSpec();\n if (spec.axesSpec.length !== 1) return map;\n\n const data = col.getData();\n if (!(data instanceof TreeNodeAccessor)) return map;\n\n const labelMap = readLabelMap(data);\n if (!labelMap) return map;\n\n map.set(canonicalizeAxisId(getAxisId(spec.axesSpec[0])), labelMap);\n return map;\n }, new Map());\n\n return (axisId) => byAxis.get(canonicalizeAxisId(axisId));\n}\n\nfunction readLabelMap(acc: TreeNodeAccessor): undefined | Record<string | number, string> {\n const rt = acc.resourceType.name;\n\n if (rt === RT_JSON) {\n const json = acc.getDataAsJson<{ data?: Record<string, string> }>();\n return json?.data ? parseLabelKeys(json.data) : undefined;\n }\n\n if (rt === RT_JSON_PARTITIONED) {\n return acc.listInputFields().reduce<Record<string | number, string>>((merged, partKey) => {\n const part = acc.resolve({\n field: partKey,\n assertFieldType: \"Input\",\n ignoreError: true,\n });\n if (!part) return merged;\n const json = part.getDataAsJson<{ data?: Record<string, string> }>();\n if (!json?.data) return merged;\n return Object.assign(merged, parseLabelKeys(json.data));\n }, {});\n }\n\n return undefined;\n}\n\nfunction parseLabelKeys(raw: Record<string, string>): Record<string | number, string> {\n return Object.entries(raw).reduce<Record<string | number, string>>((acc, [k, v]) => {\n try {\n const parsed = JSON.parse(k);\n acc[Array.isArray(parsed) ? parsed[0] : parsed] = v;\n } catch {\n acc[k] = v;\n }\n return acc;\n }, {});\n}\n"],"mappings":";;;;;;AAQA,MAAM,UAAU;AAChB,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;AAoB5B,SAAgB,uBACd,QACA,MACiE;CAYjE,MAAM,UAVJ,WAAW,KAAA,IACPA,2BAAAA,kBAAkB,KAAA,GAAW,IAAI,IACjCC,2BAAAA,oBAAoB,MAAM,IACxB,SACAD,2BAAAA,kBAAkB,QAAQ,IAAI,EAAA,CAGnC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC;EAAE,MAAM;EAAS,OAAOE,gCAAAA,YAAY;CAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAC5E,WAEoB,CAAC,CAAC,QAAsD,KAAK,QAAQ;EAC1F,IAAI,CAACC,cAAAA,iBAAiB,GAAG,GAAG,OAAO;EACnC,MAAM,OAAO,IAAI,QAAQ;EACzB,IAAI,KAAK,SAAS,WAAW,GAAG,OAAO;EAEvC,MAAM,OAAO,IAAI,QAAQ;EACzB,IAAI,EAAE,gBAAgBC,iBAAAA,mBAAmB,OAAO;EAEhD,MAAM,WAAW,aAAa,IAAI;EAClC,IAAI,CAAC,UAAU,OAAO;EAEtB,IAAI,KAAA,GAAIC,gCAAAA,mBAAAA,EAAAA,GAAmBC,gCAAAA,UAAAA,CAAU,KAAK,SAAS,EAAE,CAAC,GAAG,QAAQ;EACjE,OAAO;CACT,mBAAG,IAAI,IAAI,CAAC;CAEZ,QAAQ,WAAW,OAAO,KAAA,GAAID,gCAAAA,mBAAAA,CAAmB,MAAM,CAAC;AAC1D;AAEA,SAAS,aAAa,KAAoE;CACxF,MAAM,KAAK,IAAI,aAAa;CAE5B,IAAI,OAAO,SAAS;EAClB,MAAM,OAAO,IAAI,cAAiD;EAClE,OAAO,MAAM,OAAO,eAAe,KAAK,IAAI,IAAI,KAAA;CAClD;CAEA,IAAI,OAAO,qBACT,OAAO,IAAI,gBAAgB,CAAC,CAAC,QAAyC,QAAQ,YAAY;EACxF,MAAM,OAAO,IAAI,QAAQ;GACvB,OAAO;GACP,iBAAiB;GACjB,aAAa;EACf,CAAC;EACD,IAAI,CAAC,MAAM,OAAO;EAClB,MAAM,OAAO,KAAK,cAAiD;EACnE,IAAI,CAAC,MAAM,MAAM,OAAO;EACxB,OAAO,OAAO,OAAO,QAAQ,eAAe,KAAK,IAAI,CAAC;CACxD,GAAG,CAAC,CAAC;AAIT;AAEA,SAAS,eAAe,KAA8D;CACpF,OAAO,OAAO,QAAQ,GAAG,CAAC,CAAC,QAAyC,KAAK,CAAC,GAAG,OAAO;EAClF,IAAI;GACF,MAAM,SAAS,KAAK,MAAM,CAAC;GAC3B,IAAI,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK,UAAU;EACpD,QAAQ;GACN,IAAI,KAAK;EACX;EACA,OAAO;CACT,GAAG,CAAC,CAAC;AACP"}
|
|
@@ -3,7 +3,6 @@ import { ColumnsSource } from "./column_providers/types.js";
|
|
|
3
3
|
import "./column_providers/index.js";
|
|
4
4
|
import { ColumnsCollection } from "./columns_collection.js";
|
|
5
5
|
import { AxisId } from "@milaboratories/pl-model-common";
|
|
6
|
-
//#region src/columns/derive_axis_values_labels.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Build an `axisValuesLabels` callback by discovering `pl7.app/label` columns
|
|
9
8
|
* from the given source, eagerly materialising their value→label maps, and
|
|
@@ -25,5 +24,4 @@ import { AxisId } from "@milaboratories/pl-model-common";
|
|
|
25
24
|
export declare function deriveAxisValuesLabels(source?: ColumnsCollection | (ColumnsCollection | ColumnsSource)[], opts?: {
|
|
26
25
|
ctx?: GlobalCfgRenderCtx;
|
|
27
26
|
}): (axisId: AxisId) => Record<string | number, string> | undefined;
|
|
28
|
-
//#endregion
|
|
29
27
|
//# sourceMappingURL=derive_axis_values_labels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive_axis_values_labels.d.ts","names":[],"sources":["../../src/columns/derive_axis_values_labels.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"derive_axis_values_labels.d.ts","names":[],"sources":["../../src/columns/derive_axis_values_labels.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;wBA6BgB,uBACd,SAAS,qBAAqB,oBAAoB,kBAClD;EAAS,MAAM;KACb,QAAQ,WAAW"}
|
|
@@ -3,7 +3,7 @@ import "../render/index.js";
|
|
|
3
3
|
import { ColumnsCollection, isColumnsCollection } from "./columns_collection.js";
|
|
4
4
|
import { hasReachableData } from "./utils.js";
|
|
5
5
|
import { PColumnName, canonicalizeAxisId, getAxisId } from "@milaboratories/pl-model-common";
|
|
6
|
-
|
|
6
|
+
// src/columns/derive_axis_values_labels.ts
|
|
7
7
|
const RT_JSON = "PColumnData/Json";
|
|
8
8
|
const RT_JSON_PARTITIONED = "PColumnData/JsonPartitioned";
|
|
9
9
|
/**
|
|
@@ -70,7 +70,6 @@ function parseLabelKeys(raw) {
|
|
|
70
70
|
return acc;
|
|
71
71
|
}, {});
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { deriveAxisValuesLabels };
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=derive_axis_values_labels.js.map
|
package/dist/columns/index.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const require_data_column = require("./data_column.cjs");
|
|
|
7
7
|
const require_providers = require("./column_providers/providers.cjs");
|
|
8
8
|
const require_index$1 = require("./column_providers/index.cjs");
|
|
9
9
|
const require_columns_collection = require("./columns_collection.cjs");
|
|
10
|
+
const require_peer_links = require("./peer_links.cjs");
|
|
10
11
|
const require_utils = require("./utils.cjs");
|
|
11
12
|
const require_derive_axis_values_labels = require("./derive_axis_values_labels.cjs");
|
|
12
13
|
const require_split_by_axes = require("./split_by_axes.cjs");
|
|
@@ -27,11 +28,17 @@ exports.DataColumnImpl = require_data_column.DataColumnImpl;
|
|
|
27
28
|
exports.ResultPoolColumnsProvider = require_providers.ResultPoolColumnsProvider;
|
|
28
29
|
exports.ResultPoolColumnsProviderImpl = require_providers.ResultPoolColumnsProviderImpl;
|
|
29
30
|
exports._ctxProvidersCache = require_index$1._ctxProvidersCache;
|
|
31
|
+
exports.collectDatasetAxes = require_peer_links.collectDatasetAxes;
|
|
30
32
|
exports.collectLinkerColumns = require_utils.collectLinkerColumns;
|
|
31
33
|
exports.collectLinkerIds = require_utils.collectLinkerIds;
|
|
34
|
+
exports.createPeerLinkFinder = require_utils.createPeerLinkFinder;
|
|
32
35
|
exports.deriveAxisValuesLabels = require_derive_axis_values_labels.deriveAxisValuesLabels;
|
|
33
36
|
exports.deriveColumnOptions = require_utils.deriveColumnOptions;
|
|
37
|
+
exports.deriveRecipeOptions = require_utils.deriveRecipeOptions;
|
|
38
|
+
exports.describePeerLinks = require_peer_links.describePeerLinks;
|
|
39
|
+
exports.findPeerLinks = require_peer_links.findPeerLinks;
|
|
34
40
|
exports.getCtxProviders = require_index$1.getCtxProviders;
|
|
41
|
+
exports.getResultPoolDatasetAxes = require_peer_links.getResultPoolDatasetAxes;
|
|
35
42
|
exports.hasColumnData = require_utils.hasColumnData;
|
|
36
43
|
exports.hasReachableData = require_utils.hasReachableData;
|
|
37
44
|
exports.hasSingleDataColumn = require_utils.hasSingleDataColumn;
|
|
@@ -41,6 +48,7 @@ exports.isColumnProvider = require_index$1.isColumnProvider;
|
|
|
41
48
|
exports.isColumnsCollection = require_columns_collection.isColumnsCollection;
|
|
42
49
|
exports.isDataColumn = require_data_column.isDataColumn;
|
|
43
50
|
exports.isLeafColumn = require_utils.isLeafColumn;
|
|
51
|
+
exports.peerLinkedLast = require_peer_links.peerLinkedLast;
|
|
44
52
|
exports.queriesQualifications = require_utils.queriesQualifications;
|
|
45
53
|
exports.splitByAxes = require_split_by_axes.splitByAxes;
|
|
46
54
|
exports.toColumnProvider = require_index$1.toColumnProvider;
|
package/dist/columns/index.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ import { _ctxProvidersCache, getCtxProviders, isColumnProvider, toColumnProvider
|
|
|
11
11
|
import { SplitAxis, SplitByAxesOpts, splitByAxes } from "./split_by_axes.js";
|
|
12
12
|
import { ColumnsCollection, ColumnsCollectionDeps, ColumnsCollectionImpl, ColumnsSourceShorthand, isColumnsCollection } from "./columns_collection.js";
|
|
13
13
|
import { deriveAxisValuesLabels } from "./derive_axis_values_labels.js";
|
|
14
|
-
import { ColumnOption, collectLinkerColumns, collectLinkerIds, deriveColumnOptions, hasColumnData, hasReachableData, hasSingleDataColumn, hitQualifications, isLeafColumn, queriesQualifications } from "./utils.js";
|
|
15
|
-
|
|
14
|
+
import { ColumnOption, collectLinkerColumns, collectLinkerIds, createPeerLinkFinder, deriveColumnOptions, deriveRecipeOptions, hasColumnData, hasReachableData, hasSingleDataColumn, hitQualifications, isLeafColumn, queriesQualifications } from "./utils.js";
|
|
15
|
+
import { DatasetAxes, collectDatasetAxes, describePeerLinks, findPeerLinks, getResultPoolDatasetAxes, peerLinkedLast } from "./peer_links.js";
|
|
16
|
+
export { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, Column, ColumnAbsentError, ColumnData, ColumnDiscoveredRecipe, type ColumnFieldStatus, ColumnFilteredRecipe, ColumnOption, ColumnOverriddenRecipe, ColumnRecipe, type ColumnRecipeId, type ColumnResolutionStatus, ColumnSource, ColumnsCollection, ColumnsCollectionDeps, ColumnsCollectionImpl, ColumnsProvider, ColumnsSource, ColumnsSourceShorthand, DataColumn, DataColumnId, DataColumnImpl, DataColumnRecipe, DataColumnSource, DatasetAxes, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl, type SpecQuery, SplitAxis, SplitByAxesOpts, _ctxProvidersCache, collectDatasetAxes, collectLinkerColumns, collectLinkerIds, createPeerLinkFinder, deriveAxisValuesLabels, deriveColumnOptions, deriveRecipeOptions, describePeerLinks, findPeerLinks, getCtxProviders, getResultPoolDatasetAxes, hasColumnData, hasReachableData, hasSingleDataColumn, hitQualifications, isColumn, isColumnProvider, isColumnsCollection, isDataColumn, isLeafColumn, peerLinkedLast, queriesQualifications, splitByAxes, toColumnProvider };
|
package/dist/columns/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import { ColumnAbsentError, DataColumn, DataColumnImpl, isDataColumn } from "./d
|
|
|
7
7
|
import { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, ColumnsProvider, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl } from "./column_providers/providers.js";
|
|
8
8
|
import { _ctxProvidersCache, getCtxProviders, isColumnProvider, toColumnProvider } from "./column_providers/index.js";
|
|
9
9
|
import { ColumnsCollection, ColumnsCollectionImpl, isColumnsCollection } from "./columns_collection.js";
|
|
10
|
-
import {
|
|
10
|
+
import { collectDatasetAxes, describePeerLinks, findPeerLinks, getResultPoolDatasetAxes, peerLinkedLast } from "./peer_links.js";
|
|
11
|
+
import { collectLinkerColumns, collectLinkerIds, createPeerLinkFinder, deriveColumnOptions, deriveRecipeOptions, hasColumnData, hasReachableData, hasSingleDataColumn, hitQualifications, isLeafColumn, queriesQualifications } from "./utils.js";
|
|
11
12
|
import { deriveAxisValuesLabels } from "./derive_axis_values_labels.js";
|
|
12
13
|
import { splitByAxes } from "./split_by_axes.js";
|
|
13
|
-
export { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, Column, ColumnAbsentError, ColumnDiscoveredRecipe, ColumnFilteredRecipe, ColumnOverriddenRecipe, ColumnRecipe, ColumnsCollection, ColumnsCollectionImpl, ColumnsProvider, DataColumn, DataColumnImpl, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl, _ctxProvidersCache, collectLinkerColumns, collectLinkerIds, deriveAxisValuesLabels, deriveColumnOptions, getCtxProviders, hasColumnData, hasReachableData, hasSingleDataColumn, hitQualifications, isColumn, isColumnProvider, isColumnsCollection, isDataColumn, isLeafColumn, queriesQualifications, splitByAxes, toColumnProvider };
|
|
14
|
+
export { AccessorColumnsProvider, AccessorColumnsProviderImpl, ArrayColumnsProvider, Column, ColumnAbsentError, ColumnDiscoveredRecipe, ColumnFilteredRecipe, ColumnOverriddenRecipe, ColumnRecipe, ColumnsCollection, ColumnsCollectionImpl, ColumnsProvider, DataColumn, DataColumnImpl, ResultPoolColumnsProvider, ResultPoolColumnsProviderImpl, _ctxProvidersCache, collectDatasetAxes, collectLinkerColumns, collectLinkerIds, createPeerLinkFinder, deriveAxisValuesLabels, deriveColumnOptions, deriveRecipeOptions, describePeerLinks, findPeerLinks, getCtxProviders, getResultPoolDatasetAxes, hasColumnData, hasReachableData, hasSingleDataColumn, hitQualifications, isColumn, isColumnProvider, isColumnsCollection, isDataColumn, isLeafColumn, peerLinkedLast, queriesQualifications, splitByAxes, toColumnProvider };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const require_providers = require("./column_providers/providers.cjs");
|
|
2
|
+
require("./column_providers/index.cjs");
|
|
3
|
+
let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
|
|
4
|
+
let es_toolkit = require("es-toolkit");
|
|
5
|
+
// src/columns/peer_links.ts
|
|
6
|
+
/** Main axes of the datasets: the second axis of every column marked `pl7.app/isAnchor`. */
|
|
7
|
+
function collectDatasetAxes(specs) {
|
|
8
|
+
return new Set(specs.flatMap((spec) => {
|
|
9
|
+
const main = spec.axesSpec[1];
|
|
10
|
+
return (0, _milaboratories_pl_model_common.readAnnotation)(spec, _milaboratories_pl_model_common.Annotation.IsAnchor) === "true" && main !== void 0 ? [(0, _milaboratories_pl_model_common.canonicalizeAxisId)(main)] : [];
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
/** {@link collectDatasetAxes} over the result pool. */
|
|
14
|
+
function getResultPoolDatasetAxes() {
|
|
15
|
+
return collectDatasetAxes(require_providers.ResultPoolColumnsProvider().getColumns().map((c) => c.getSpec()));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Labels of the peer links on a linker path. A peer link joins two datasets' main axes, e.g. one
|
|
19
|
+
* clonotype to another, so the columns behind it describe a different clonotype than the row.
|
|
20
|
+
*/
|
|
21
|
+
function findPeerLinks(linkers, datasetAxes) {
|
|
22
|
+
return (0, es_toolkit.uniq)(linkers.flatMap((l) => {
|
|
23
|
+
const peer = l.axesSpec.every((a) => datasetAxes.has((0, _milaboratories_pl_model_common.canonicalizeAxisId)(a)));
|
|
24
|
+
const label = (0, _milaboratories_pl_model_common.readAnnotation)(l, _milaboratories_pl_model_common.Annotation.LinkLabel) ?? (0, _milaboratories_pl_model_common.readAnnotation)(l, _milaboratories_pl_model_common.Annotation.Label);
|
|
25
|
+
return peer && label ? [label] : [];
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
/** Hover text for the link icon. */
|
|
29
|
+
function describePeerLinks(links) {
|
|
30
|
+
return `Reached via ${links.join(", then ")}`;
|
|
31
|
+
}
|
|
32
|
+
/** Moves peer-linked items after the others, keeping the order within each group. */
|
|
33
|
+
function peerLinkedLast(items, isPeerLinked) {
|
|
34
|
+
return [...items.filter((i) => !isPeerLinked(i)), ...items.filter(isPeerLinked)];
|
|
35
|
+
}
|
|
36
|
+
exports.collectDatasetAxes = collectDatasetAxes;
|
|
37
|
+
exports.describePeerLinks = describePeerLinks;
|
|
38
|
+
exports.findPeerLinks = findPeerLinks;
|
|
39
|
+
exports.getResultPoolDatasetAxes = getResultPoolDatasetAxes;
|
|
40
|
+
exports.peerLinkedLast = peerLinkedLast;
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=peer_links.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peer_links.cjs","names":["readAnnotation","Annotation","canonicalizeAxisId","ResultPoolColumnsProvider","uniq"],"sources":["../../src/columns/peer_links.ts"],"sourcesContent":["import {\n Annotation,\n canonicalizeAxisId,\n readAnnotation,\n type AxisId,\n type CanonicalizedJson,\n type PColumnSpec,\n} from \"@milaboratories/pl-model-common\";\nimport { uniq } from \"es-toolkit\";\nimport { ResultPoolColumnsProvider } from \"./column_providers\";\n\nexport type DatasetAxes = Set<CanonicalizedJson<AxisId>>;\n\n/** Main axes of the datasets: the second axis of every column marked `pl7.app/isAnchor`. */\nexport function collectDatasetAxes(specs: PColumnSpec[]): DatasetAxes {\n return new Set(\n specs.flatMap((spec) => {\n const main = spec.axesSpec[1];\n return readAnnotation(spec, Annotation.IsAnchor) === \"true\" && main !== undefined\n ? [canonicalizeAxisId(main)]\n : [];\n }),\n );\n}\n\n/** {@link collectDatasetAxes} over the result pool. */\nexport function getResultPoolDatasetAxes(): DatasetAxes {\n return collectDatasetAxes(\n ResultPoolColumnsProvider()\n .getColumns()\n .map((c) => c.getSpec()),\n );\n}\n\n/**\n * Labels of the peer links on a linker path. A peer link joins two datasets' main axes, e.g. one\n * clonotype to another, so the columns behind it describe a different clonotype than the row.\n */\nexport function findPeerLinks(linkers: PColumnSpec[], datasetAxes: DatasetAxes): string[] {\n return uniq(\n linkers.flatMap((l) => {\n const peer = l.axesSpec.every((a) => datasetAxes.has(canonicalizeAxisId(a)));\n const label = readAnnotation(l, Annotation.LinkLabel) ?? readAnnotation(l, Annotation.Label);\n return peer && label ? [label] : [];\n }),\n );\n}\n\n/** Hover text for the link icon. */\nexport function describePeerLinks(links: string[]): string {\n return `Reached via ${links.join(\", then \")}`;\n}\n\n/** Moves peer-linked items after the others, keeping the order within each group. */\nexport function peerLinkedLast<T>(items: T[], isPeerLinked: (item: T) => boolean): T[] {\n return [...items.filter((i) => !isPeerLinked(i)), ...items.filter(isPeerLinked)];\n}\n"],"mappings":";;;;;;AAcA,SAAgB,mBAAmB,OAAmC;CACpE,OAAO,IAAI,IACT,MAAM,SAAS,SAAS;EACtB,MAAM,OAAO,KAAK,SAAS;EAC3B,QAAA,GAAOA,gCAAAA,eAAAA,CAAe,MAAMC,gCAAAA,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAA,IACpE,EAAA,GAACC,gCAAAA,mBAAAA,CAAmB,IAAI,CAAC,IACzB,CAAC;CACP,CAAC,CACH;AACF;;AAGA,SAAgB,2BAAwC;CACtD,OAAO,mBACLC,kBAAAA,0BAA0B,CAAC,CACxB,WAAW,CAAC,CACZ,KAAK,MAAM,EAAE,QAAQ,CAAC,CAC3B;AACF;;;;;AAMA,SAAgB,cAAc,SAAwB,aAAoC;CACxF,QAAA,GAAOC,WAAAA,KAAAA,CACL,QAAQ,SAAS,MAAM;EACrB,MAAM,OAAO,EAAE,SAAS,OAAO,MAAM,YAAY,KAAA,GAAIF,gCAAAA,mBAAAA,CAAmB,CAAC,CAAC,CAAC;EAC3E,MAAM,SAAA,GAAQF,gCAAAA,eAAAA,CAAe,GAAGC,gCAAAA,WAAW,SAAS,MAAA,GAAKD,gCAAAA,eAAAA,CAAe,GAAGC,gCAAAA,WAAW,KAAK;EAC3F,OAAO,QAAQ,QAAQ,CAAC,KAAK,IAAI,CAAC;CACpC,CAAC,CACH;AACF;;AAGA,SAAgB,kBAAkB,OAAyB;CACzD,OAAO,eAAe,MAAM,KAAK,SAAS;AAC5C;;AAGA,SAAgB,eAAkB,OAAY,cAAyC;CACrF,OAAO,CAAC,GAAG,MAAM,QAAQ,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,GAAG,MAAM,OAAO,YAAY,CAAC;AACjF"}
|