@milaboratories/graph-maker 1.1.150 → 1.1.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts +3 -10
  2. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.d.ts.map +1 -1
  3. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js +42 -83
  4. package/dist/GraphMaker/components/DragAndDrop/DnDBasketChip.vue.js.map +1 -1
  5. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts +1 -5
  6. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.d.ts.map +1 -1
  7. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js +43 -85
  8. package/dist/GraphMaker/components/DragAndDrop/DnDRangeChip.vue.js.map +1 -1
  9. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.d.ts +1 -3
  10. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.d.ts.map +1 -1
  11. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js +73 -85
  12. package/dist/GraphMaker/components/DragAndDrop/DndBasket.vue.js.map +1 -1
  13. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts +1 -5
  14. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.d.ts.map +1 -1
  15. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js +51 -91
  16. package/dist/GraphMaker/components/DragAndDrop/DndDoubleChip.vue.js.map +1 -1
  17. package/dist/GraphMaker/components/DragAndDrop/types.d.ts +0 -19
  18. package/dist/GraphMaker/components/DragAndDrop/types.d.ts.map +1 -1
  19. package/dist/GraphMaker/constantsCommon.d.ts +0 -1
  20. package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
  21. package/dist/GraphMaker/constantsCommon.js +45 -46
  22. package/dist/GraphMaker/constantsCommon.js.map +1 -1
  23. package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.d.ts.map +1 -1
  24. package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.js +115 -145
  25. package/dist/GraphMaker/forms/DataMappingForm/DendroForm.vue.js.map +1 -1
  26. package/dist/GraphMaker/forms/DataMappingForm/useBaskets.d.ts.map +1 -1
  27. package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js +95 -125
  28. package/dist/GraphMaker/forms/DataMappingForm/useBaskets.js.map +1 -1
  29. package/dist/GraphMaker/forms/DataMappingForm/utils.d.ts.map +1 -1
  30. package/dist/GraphMaker/forms/DataMappingForm/utils.js +77 -153
  31. package/dist/GraphMaker/forms/DataMappingForm/utils.js.map +1 -1
  32. package/dist/GraphMaker/store.d.ts.map +1 -1
  33. package/dist/GraphMaker/store.js +41 -43
  34. package/dist/GraphMaker/store.js.map +1 -1
  35. package/dist/GraphMaker/utils/loadDefaultSources.d.ts +1 -2
  36. package/dist/GraphMaker/utils/loadDefaultSources.d.ts.map +1 -1
  37. package/dist/GraphMaker/utils/loadDefaultSources.js +43 -47
  38. package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
  39. package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
  40. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +34 -36
  41. package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
  42. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +6 -5
  43. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -1
  44. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +146 -149
  45. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
  46. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +165 -218
  47. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
  48. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +95 -102
  49. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -1
  50. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +145 -156
  51. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js.map +1 -1
  52. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +68 -75
  53. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js.map +1 -1
  54. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +154 -159
  55. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -1
  56. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +48 -55
  57. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js.map +1 -1
  58. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +114 -122
  59. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -1
  60. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +111 -119
  61. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
  62. package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +4 -4
  63. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +70 -69
  64. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
  65. package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js +2 -2
  66. package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js.map +1 -1
  67. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +183 -187
  68. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
  69. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"dendro.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/dendro.ts"],"sourcesContent":["import {AxisSpec, PColumnSpec} from '@milaboratories/pl-model-common';\nimport canonicalize from 'canonicalize';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n DataByColumns,\n InputState,\n InputStateParent,\n} from '../../common';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport type {AxisId, ColumnId} from '../../spec';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore, PValue} from '../../store';\nimport {\n createLinkerMap,\n getAxesSpecsFromSources,\n getColumnOrAxisLabel,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates, getLinkerColumnsForSource,\n} from '../../utils';\n\nconst TREE_ID_AXIS_NAME = 'pl7.app/dendrogram/treeId';\nconst NODE_ID_AXIS_NAME = 'pl7.app/dendrogram/nodeId';\nconst PATIENT_ID_AXIS_NAME = 'pl7.app/dendrogram/donorId';\n\nconst COLUMN_NODE_ID = 'id';\n\nexport interface DendroUIState extends InputStateParent<'dendro'> {\n components: {\n value: ComponentStateSimple;\n\n height: ComponentStateSimple;\n labels: ComponentStateSimple;\n\n tableContent: ComponentStateSimple;\n\n nodeColor: ComponentStateSimple;\n nodeShape: ComponentStateSimple;\n nodeSize: ComponentStateSimple;\n lineColor: ComponentStateSimple;\n\n heatmapForSequence: ComponentStateSimple;\n\n heatmapAnnotation: ComponentStateSimple;\n heatmapAxis: ComponentStateSimple;\n heatmapGroup: ComponentStateSimple;\n\n filters: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n };\n}\n\nexport const InitialDendroState: DendroUIState = {\n type: 'dendro',\n components: {\n value: {type: 'simple', selectorStates: []},\n\n height: {type: 'simple', selectorStates: []},\n labels: {type: 'simple', selectorStates: []},\n\n tableContent: {type: 'simple', selectorStates: []},\n\n nodeColor: {type: 'simple', selectorStates: []},\n nodeShape: {type: 'simple', selectorStates: []},\n nodeSize: {type: 'simple', selectorStates: []},\n lineColor: {type: 'simple', selectorStates: []},\n\n heatmapAnnotation: {type: 'simple', selectorStates: []},\n\n heatmapForSequence: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n\n heatmapAxis: {type: 'simple', selectorStates: []},\n heatmapGroup: {type: 'simple', selectorStates: []},\n },\n dividedAxes: {},\n};\n\nexport function isDendroState(state: InputState): state is DendroUIState {\n return state.type == 'dendro';\n}\n\nexport class DendroStateController extends ControllerBase<DendroUIState> {\n readonly ignoredOptionIdNames = [NODE_ID_AXIS_NAME];\n\n constructor() {\n super(\n {\n value: new ComponentController<DendroUIState, 'value'>({\n componentName: 'value',\n allowedTypes: ['Int', 'Long'],\n annotations: {'pl7.app/dendrogram/isTopology': 'true'},\n settings: {\n isDataComponent: true,\n columnsAllowed: true,\n required: true,\n dimensionConsumer: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n height: new ComponentController<DendroUIState, 'height'>({\n componentName: 'height',\n allowedTypes: ['Int', 'Long', 'Double', 'Float'],\n annotations: {'pl7.app/dendrogram/isDistance': 'true'},\n parentComponents: ['value'],\n strictlyDependsOnParents: true,\n settings: {\n columnsAllowed: true,\n axesAllowed: false,\n dimensionConsumer: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n labels: new ComponentController<DendroUIState, 'labels'>({\n componentName: 'labels',\n allowedTypes: ['Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n tableContent: new ComponentController<DendroUIState, 'tableContent'>({\n componentName: 'tableContent',\n allowedTypes: ['Int', 'String', 'Long', 'Double', 'Float'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n multipleSelectors: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n nodeShape: new ComponentController<DendroUIState, 'nodeShape'>({\n componentName: 'nodeShape',\n allowedTypes: ['Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n nodeSize: new ComponentController<DendroUIState, 'nodeSize'>({\n componentName: 'nodeSize',\n allowedTypes: ['Double', 'Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n nodeColor: new ComponentController<DendroUIState, 'nodeColor'>({\n componentName: 'nodeColor',\n allowedTypes: ['Double', 'Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n lineColor: new ComponentController<DendroUIState, 'lineColor'>({\n componentName: 'lineColor',\n allowedTypes: ['Double', 'Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapForSequence: new ComponentController<DendroUIState, 'heatmapForSequence'>({\n componentName: 'heatmapForSequence',\n allowedTypes: ['String'],\n annotations: {'pl7.app/type': 'sequence'},\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapAnnotation: new ComponentController<DendroUIState, 'heatmapAnnotation'>({\n componentName: 'heatmapAnnotation',\n allowedTypes: ['Double', 'Int', 'Long', 'Float', 'String'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n isDataComponent: true,\n columnsAllowed: true,\n axesAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n facetBy: new ComponentController<DendroUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: true,\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapAxis: new ComponentController<DendroUIState, 'heatmapAxis'>({\n componentName: 'heatmapAxis',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['heatmapAnnotation'],\n settings: {\n dimensionConsumer: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapGroup: new ComponentController<DendroUIState, 'heatmapGroup'>({\n componentName: 'heatmapGroup',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['heatmapAnnotation'],\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n },\n {\n filters: new ComponentController<DendroUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value', 'heatmapAnnotation'],\n strictlyDependsOnParents: false,\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n tabBy: new ComponentController<DendroUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value', 'heatmapAnnotation'],\n strictlyDependsOnParents: false,\n settings: {\n dimensionConsumer: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n }\n );\n }\n\n readyDataInputs(state: DendroUIState): boolean {\n return state.components.value.selectorStates.length > 0;\n }\n\n async createTableData(\n store: DataStore,\n state: DendroUIState\n ): Promise<\n Record<\n string,\n {\n label: string;\n spec: PColumnSpec | AxisSpec;\n data: PValue[];\n }\n >\n > {\n const result: Record<string, {label: string; spec: PColumnSpec | AxisSpec; data: PValue[]}> = {};\n\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n if (!valueColumnIdString || !isColumnId(valueColumnId)) {\n throw Error('Value column is not valid');\n }\n\n const linkerMap = await createLinkerMap(store);\n\n // filters for column/axes data requests\n const filters = getFiltersFromStates([\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]);\n const filterColumns = [\n ...state.components.filters.selectorStates.map(s => columnOrAxisIdFromString(s.selectedSource)),\n ...state.components.tabBy.selectorStates.map(s => columnOrAxisIdFromString(s.selectedSource)),\n ].filter(isColumnId);\n\n const parentSources = [valueColumnIdString];\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n\n const primarySources: (ColumnId | AxisId)[] = [];\n const secondarySources: (ColumnId | AxisId)[] = [];\n const linkerColumns:ColumnId[] = [];\n\n const primaryInputs = [state.components.value];\n const secondaryInputs = [\n state.components.tableContent,\n // next components can content data mapped on tree\n state.components.labels,\n state.components.nodeColor,\n state.components.nodeSize,\n state.components.nodeShape,\n state.components.lineColor,\n ];\n\n const idMap: Record<string, string> = {};\n\n for (const primaryInput of primaryInputs) {\n for (const {selectedSource, fixedAxes} of primaryInput.selectorStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n const id = labelsColumnId ?? columnOrAxisIdFromString(selectedSource);\n idMap[id.toCanonicalString()] = selectedSource;\n primarySources.push(id);\n }\n }\n for (const secondaryInput of secondaryInputs) {\n for (const {selectedSource, fixedAxes} of secondaryInput.selectorStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n const id = labelsColumnId ?? columnOrAxisIdFromString(selectedSource);\n idMap[selectedSource] = id.toCanonicalString();\n secondarySources.push(id);\n }\n }\n\n // use outer join between primary columns - inner join can remove useful points in tree and annotations\n const data = await store.pFrameProvider.getTableOuterJoin(\n [...primarySources, ...filterColumns, ...linkerColumns],\n secondarySources,\n filters,\n false\n );\n\n for (const source of [...primarySources, ...secondarySources]) {\n const responseKey = source.toCanonicalString();\n const resultKey = idMap[source.toCanonicalString()];\n result[resultKey] = {\n data: isColumnId(source) ? data.columnsData[responseKey] : data.axesData[responseKey],\n spec: isColumnId(source) ? data.columnSpecs[responseKey] : data.axesSpecs[responseKey],\n label: await getColumnOrAxisLabel(store, resultKey, parentSources),\n };\n }\n\n const nodeIdAxis = Object.keys(data.axesData).find(\n axisIdStr => columnOrAxisIdFromString(axisIdStr)?.name === NODE_ID_AXIS_NAME\n );\n if (!nodeIdAxis) {\n console.warn('Missed node id axis in data column');\n } else {\n result[COLUMN_NODE_ID] = {\n data: data.axesData[nodeIdAxis],\n spec: {kind: 'PColumn', valueType: 'Int', name: 'Node id'} as PColumnSpec,\n label: 'Node id',\n };\n }\n return result;\n }\n\n async createDataByColumns(store: DataStore, state: DendroUIState): Promise<PlotDataAndSettings['data']> {\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n const annotationColumnIdString = state.components.heatmapAnnotation.selectorStates[0]?.selectedSource;\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n const annotationColumnId = annotationColumnIdString ? columnOrAxisIdFromString(annotationColumnIdString) : null;\n\n if (!valueColumnIdString || !isColumnId(valueColumnId)) {\n throw Error('Value column is not valid');\n }\n const dataByColumns: DataByColumns = {\n type: 'columns',\n id: canonicalize(state.components) ?? '',\n values: {},\n };\n\n const filterSelectedStates = [\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]\n // filters for column/axes data requests\n const filters = getFiltersFromStates(filterSelectedStates);\n const filterColumns = filterSelectedStates.map(s => columnOrAxisIdFromString(s.selectedSource)).filter(isColumnId);\n\n\n const parentSources = [valueColumnId, annotationColumnId]\n .filter(isColumnId)\n .map(item => item.toCanonicalString());\n\n const primarySources: (ColumnId | AxisId)[] = [];\n const secondarySources: (ColumnId | AxisId)[] = [];\n const primarySourcesFixedAxes:{idx: number, value: PValue}[][] = [];\n const secondarySourcesFixedAxes:{idx: number, value: PValue}[][] = [];\n\n const primaryInputs = [\n state.components.value,\n state.components.height,\n state.components.labels,\n state.components.nodeColor,\n state.components.nodeSize,\n state.components.nodeShape,\n state.components.lineColor,\n state.components.heatmapAnnotation,\n state.components.heatmapForSequence,\n ];\n const secondaryInputs = [\n state.components.facetBy,\n state.components.heatmapAxis,\n state.components.heatmapGroup,\n state.components.tableContent,\n ];\n for (const primaryInput of primaryInputs) {\n for (const {selectedSource, fixedAxes} of primaryInput.selectorStates) {\n primarySources.push(columnOrAxisIdFromString(selectedSource));\n primarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n primarySources.push(labelsColumnId);\n }\n }\n }\n filterSelectedStates.forEach(({fixedAxes}) => {\n primarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n });\n for (const secondaryInput of secondaryInputs) {\n for (const {selectedSource, fixedAxes} of secondaryInput.selectorStates) {\n secondarySources.push(columnOrAxisIdFromString(selectedSource));\n secondarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n\n // use outer join between primary columns - inner join can remove useful points in tree and annotations\n const data = await store.pFrameProvider.getTableOuterJoin(\n [...primarySources, ...filterColumns],\n secondarySources,\n filters,\n false,\n primarySourcesFixedAxes,\n secondarySourcesFixedAxes\n );\n\n [...primarySources, ...secondarySources].forEach(item => {\n const key = item.toCanonicalString();\n const columnData = isColumnId(item) ? data.columnsData[key] : data.axesData[key];\n dataByColumns.values[key] = [];\n dataByColumns.values[key] = columnData;\n });\n\n const nodeIdAxis = Object.keys(data.axesData).find(\n axisIdStr => columnOrAxisIdFromString(axisIdStr)?.name === NODE_ID_AXIS_NAME\n );\n\n if (!nodeIdAxis) {\n console.warn('Missed node id axis in data column');\n } else {\n dataByColumns.values[COLUMN_NODE_ID] = data.axesData[nodeIdAxis];\n }\n\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: DendroUIState): Promise<Record<string, unknown>> {\n const dataColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n const dataColumnId = columnOrAxisIdFromString(dataColumnIdString);\n if (!dataColumnIdString || !isColumnId(dataColumnId)) {\n throw Error('Data column is not valid');\n }\n\n const parentSourcesTree = [dataColumnIdString];\n\n const id = {type: 'column', value: COLUMN_NODE_ID};\n const parentId = {type: 'column', value: dataColumnIdString};\n const height = state.components.height.selectorStates.length\n ? {type: 'column', value: state.components.height.selectorStates[0].selectedSource}\n : undefined;\n const labels = state.components.labels.selectorStates.length\n ? {type: 'column', value: state.components.labels.selectorStates[0].selectedSource}\n : undefined;\n const aes: {\n nodeColor?: {columnName: {type: 'column'; value: string; label: string}};\n nodeShape?: {columnName: {type: 'column'; value: string; label: string}};\n nodeSize?: {columnName: {type: 'column'; value: string; label: string}};\n lineColor?: {columnName: {type: 'column'; value: string; label: string}};\n } = {};\n if (state.components.nodeColor.selectorStates.length) {\n const idString = state.components.nodeColor.selectorStates[0].selectedSource;\n aes.nodeColor = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n if (state.components.nodeShape.selectorStates.length) {\n const idString = state.components.nodeShape.selectorStates[0].selectedSource;\n aes.nodeShape = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n if (state.components.nodeSize.selectorStates.length) {\n const idString = state.components.nodeSize.selectorStates[0].selectedSource;\n aes.nodeSize = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n if (state.components.lineColor.selectorStates.length) {\n const idString = state.components.lineColor.selectorStates[0].selectedSource;\n aes.lineColor = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n\n let heatmapAnnotation;\n let heatmapAxis;\n let heatmapGroup;\n\n // heatmap with user axis, with not sequence as value\n if (\n state.components.heatmapAnnotation.selectorStates.length &&\n state.components.heatmapAxis.selectorStates.length\n ) {\n const annotationSource = state.components.heatmapAnnotation.selectorStates[0].selectedSource;\n heatmapAnnotation = {\n type: 'column',\n value: annotationSource,\n label: await getColumnOrAxisLabel(store, annotationSource, []),\n valueLabels: (await getColumnOrAxisValueLabelsId(store, annotationSource, []))?.toCanonicalString(),\n };\n const axisSource = state.components.heatmapAxis.selectorStates[0].selectedSource;\n heatmapAxis = {\n type: 'column',\n value: axisSource,\n label: await getColumnOrAxisLabel(store, axisSource, [annotationSource]),\n valueLabels: (\n await getColumnOrAxisValueLabelsId(store, axisSource, [annotationSource])\n )?.toCanonicalString(),\n };\n heatmapGroup = await Promise.all(\n state.components.heatmapGroup.selectorStates.map(async selectorState => {\n return {\n type: 'column',\n value: selectorState.selectedSource,\n label: await getColumnOrAxisLabel(store, selectorState.selectedSource, [annotationSource]),\n valueLabels: (\n await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, [annotationSource])\n )?.toCanonicalString(),\n };\n })\n );\n\n // heatmap containing sequence, as axis using order of sequence element\n } else if (state.components.heatmapForSequence.selectorStates.length) {\n const annotationSource = state.components.heatmapForSequence.selectorStates[0].selectedSource;\n heatmapAnnotation = {\n type: 'column',\n value: annotationSource,\n label: await getColumnOrAxisLabel(store, annotationSource, []),\n };\n }\n\n return {\n type: 'dendro',\n id,\n parentId,\n height,\n labels,\n aes,\n heatmapAnnotation,\n heatmapAxis,\n heatmapGroup,\n };\n }\n}\n"],"names":["NODE_ID_AXIS_NAME","COLUMN_NODE_ID","InitialDendroState","DendroStateController","ControllerBase","ComponentController","__publicField","state","store","result","valueColumnIdString","_a","valueColumnId","columnOrAxisIdFromString","isColumnId","linkerMap","createLinkerMap","filters","getFiltersFromStates","filterColumns","s","parentSources","parentAxesList","getAxesSpecsFromSources","primarySources","secondarySources","linkerColumns","primaryInputs","secondaryInputs","idMap","primaryInput","selectedSource","fixedAxes","getLinkerColumnsForSource","id","getColumnOrAxisValueLabelsId","secondaryInput","data","source","responseKey","resultKey","getColumnOrAxisLabel","nodeIdAxis","axisIdStr","annotationColumnIdString","_b","annotationColumnId","dataByColumns","canonicalize","filterSelectedStates","item","primarySourcesFixedAxes","secondarySourcesFixedAxes","axisIdx","axisValue","labelsColumnId","key","columnData","dataColumnIdString","dataColumnId","parentSourcesTree","parentId","height","labels","aes","idString","heatmapAnnotation","heatmapAxis","heatmapGroup","annotationSource","axisSource","_c","selectorState"],"mappings":";;;;;;AAuBA,MAAMA,IAAoB,6BAGpBC,IAAiB,MA4BVC,IAAoC;AAAA,EAC7C,MAAM;AAAA,EACN,YAAY;AAAA,IACR,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAExC,QAAQ,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACzC,QAAQ,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAEzC,cAAc,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAE/C,WAAW,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAA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,EAAqBjC,GAAOgE,EAAc,gBAAgB,CAACH,CAAgB,CAAC;AAAA,YACzF,cACI1D,IAAA,MAAMwB,EAA6B3B,GAAOgE,EAAc,gBAAgB,CAACH,CAAgB,CAAC,MAA1F,OAAA,SAAA1D,EACD,kBAAA;AAAA,UAAA;AAAA,QAEV,CAAA;AAAA,MAAA;AAAA,IAIE,WAAAJ,EAAM,WAAW,mBAAmB,eAAe,QAAQ;AAClE,YAAM8D,IAAmB9D,EAAM,WAAW,mBAAmB,eAAe,CAAC,EAAE;AAC3D2D,MAAAA,IAAA;AAAA,QAChB,MAAM;AAAA,QACN,OAAOG;AAAAA,QACP,OAAO,MAAM5B,EAAqBjC,GAAO6D,GAAkB,CAAA,CAAE;AAAA,MAAA;AAAA,IACjE;AAGG,WAAA;AAAA,MACH,MAAM;AAAA,MACN,IAAAnC;AAAAA,MACA,UAAA2B;AAAAA,MACA,QAAAC;AAAAA,MACA,QAAAC;AAAAA,MACA,KAAAC;AAAAA,MACA,mBAAAE;AAAAA,MACA,aAAAC;AAAAA,MACA,cAAAC;AAAAA,IAAA;AAAA,EACJ;AAER;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"dendro.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/dendro.ts"],"sourcesContent":["import {AxisSpec, PColumnSpec} from '@milaboratories/pl-model-common';\nimport canonicalize from 'canonicalize';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n DataByColumns,\n InputState,\n InputStateParent,\n} from '../../common';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport type {AxisId, ColumnId} from '../../spec';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore, PValue} from '../../store';\nimport {\n createLinkerMap,\n createMultipliesByMap,\n getAxesSpecsFromSources,\n getColumnOrAxisLabel,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates, getLinkerColumnsForSource,\n} from '../../utils';\n\nconst TREE_ID_AXIS_NAME = 'pl7.app/dendrogram/treeId';\nconst NODE_ID_AXIS_NAME = 'pl7.app/dendrogram/nodeId';\nconst PATIENT_ID_AXIS_NAME = 'pl7.app/dendrogram/donorId';\n\nconst COLUMN_NODE_ID = 'id';\n\nexport interface DendroUIState extends InputStateParent<'dendro'> {\n components: {\n value: ComponentStateSimple;\n\n height: ComponentStateSimple;\n labels: ComponentStateSimple;\n\n tableContent: ComponentStateSimple;\n\n nodeColor: ComponentStateSimple;\n nodeShape: ComponentStateSimple;\n nodeSize: ComponentStateSimple;\n lineColor: ComponentStateSimple;\n\n heatmapForSequence: ComponentStateSimple;\n\n heatmapAnnotation: ComponentStateSimple;\n heatmapAxis: ComponentStateSimple;\n heatmapGroup: ComponentStateSimple;\n\n filters: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n };\n}\n\nexport const InitialDendroState: DendroUIState = {\n type: 'dendro',\n components: {\n value: {type: 'simple', selectorStates: []},\n\n height: {type: 'simple', selectorStates: []},\n labels: {type: 'simple', selectorStates: []},\n\n tableContent: {type: 'simple', selectorStates: []},\n\n nodeColor: {type: 'simple', selectorStates: []},\n nodeShape: {type: 'simple', selectorStates: []},\n nodeSize: {type: 'simple', selectorStates: []},\n lineColor: {type: 'simple', selectorStates: []},\n\n heatmapAnnotation: {type: 'simple', selectorStates: []},\n\n heatmapForSequence: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n\n heatmapAxis: {type: 'simple', selectorStates: []},\n heatmapGroup: {type: 'simple', selectorStates: []},\n },\n dividedAxes: {},\n};\n\nexport function isDendroState(state: InputState): state is DendroUIState {\n return state.type == 'dendro';\n}\n\nexport class DendroStateController extends ControllerBase<DendroUIState> {\n readonly ignoredOptionIdNames = [NODE_ID_AXIS_NAME];\n\n constructor() {\n super(\n {\n value: new ComponentController<DendroUIState, 'value'>({\n componentName: 'value',\n allowedTypes: ['Int', 'Long'],\n annotations: {'pl7.app/dendrogram/isTopology': 'true'},\n settings: {\n isDataComponent: true,\n columnsAllowed: true,\n required: true,\n dimensionConsumer: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n height: new ComponentController<DendroUIState, 'height'>({\n componentName: 'height',\n allowedTypes: ['Int', 'Long', 'Double', 'Float'],\n annotations: {'pl7.app/dendrogram/isDistance': 'true'},\n parentComponents: ['value'],\n strictlyDependsOnParents: true,\n settings: {\n columnsAllowed: true,\n axesAllowed: false,\n dimensionConsumer: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n labels: new ComponentController<DendroUIState, 'labels'>({\n componentName: 'labels',\n allowedTypes: ['Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n tableContent: new ComponentController<DendroUIState, 'tableContent'>({\n componentName: 'tableContent',\n allowedTypes: ['Int', 'String', 'Long', 'Double', 'Float'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n multipleSelectors: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n nodeShape: new ComponentController<DendroUIState, 'nodeShape'>({\n componentName: 'nodeShape',\n allowedTypes: ['Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n nodeSize: new ComponentController<DendroUIState, 'nodeSize'>({\n componentName: 'nodeSize',\n allowedTypes: ['Double', 'Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n nodeColor: new ComponentController<DendroUIState, 'nodeColor'>({\n componentName: 'nodeColor',\n allowedTypes: ['Double', 'Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n lineColor: new ComponentController<DendroUIState, 'lineColor'>({\n componentName: 'lineColor',\n allowedTypes: ['Double', 'Int', 'String', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapForSequence: new ComponentController<DendroUIState, 'heatmapForSequence'>({\n componentName: 'heatmapForSequence',\n allowedTypes: ['String'],\n annotations: {'pl7.app/type': 'sequence'},\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapAnnotation: new ComponentController<DendroUIState, 'heatmapAnnotation'>({\n componentName: 'heatmapAnnotation',\n allowedTypes: ['Double', 'Int', 'Long', 'Float', 'String'],\n parentComponents: ['value'],\n strictlyDependsOnParents: false,\n settings: {\n isDataComponent: true,\n columnsAllowed: true,\n axesAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n facetBy: new ComponentController<DendroUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value'],\n strictlyDependsOnParents: true,\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapAxis: new ComponentController<DendroUIState, 'heatmapAxis'>({\n componentName: 'heatmapAxis',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['heatmapAnnotation'],\n settings: {\n dimensionConsumer: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n heatmapGroup: new ComponentController<DendroUIState, 'heatmapGroup'>({\n componentName: 'heatmapGroup',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['heatmapAnnotation'],\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n },\n {\n filters: new ComponentController<DendroUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value', 'heatmapAnnotation'],\n strictlyDependsOnParents: false,\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n tabBy: new ComponentController<DendroUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value', 'heatmapAnnotation'],\n strictlyDependsOnParents: false,\n settings: {\n dimensionConsumer: true,\n axesAllowed: true,\n columnsAllowed: false,\n columnsWithExtraAxesAllowed: false\n },\n }),\n }\n );\n }\n\n readyDataInputs(state: DendroUIState): boolean {\n return state.components.value.selectorStates.length > 0;\n }\n\n async createTableData(\n store: DataStore,\n state: DendroUIState\n ): Promise<\n Record<\n string,\n {\n label: string;\n spec: PColumnSpec | AxisSpec;\n data: PValue[];\n }\n >\n > {\n const result: Record<string, {label: string; spec: PColumnSpec | AxisSpec; data: PValue[]}> = {};\n\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n if (!valueColumnIdString || !isColumnId(valueColumnId)) {\n throw Error('Value column is not valid');\n }\n\n const linkerMap = await createLinkerMap(store);\n\n // filters for column/axes data requests\n const filters = getFiltersFromStates([\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]);\n const filterColumns = [\n ...state.components.filters.selectorStates.map(s => columnOrAxisIdFromString(s.selectedSource)),\n ...state.components.tabBy.selectorStates.map(s => columnOrAxisIdFromString(s.selectedSource)),\n ].filter(isColumnId);\n\n const parentSources = [valueColumnIdString];\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n\n const primarySources: (ColumnId | AxisId)[] = [];\n const secondarySources: (ColumnId | AxisId)[] = [];\n const linkerColumns:ColumnId[] = [];\n const multipliesByMap = await createMultipliesByMap(store);\n\n const primaryInputs = [state.components.value];\n const secondaryInputs = [\n state.components.tableContent,\n // next components can content data mapped on tree\n state.components.labels,\n state.components.nodeColor,\n state.components.nodeSize,\n state.components.nodeShape,\n state.components.lineColor,\n ];\n\n const idMap: Record<string, string> = {};\n\n for (const primaryInput of primaryInputs) {\n for (const {selectedSource} of primaryInput.selectorStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n multipliesByMap,\n parentAxesList,\n selectedSource\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n const id = labelsColumnId ?? columnOrAxisIdFromString(selectedSource);\n idMap[id.toCanonicalString()] = selectedSource;\n primarySources.push(id);\n }\n }\n for (const secondaryInput of secondaryInputs) {\n for (const {selectedSource} of secondaryInput.selectorStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n multipliesByMap,\n parentAxesList,\n selectedSource\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n const id = labelsColumnId ?? columnOrAxisIdFromString(selectedSource);\n idMap[selectedSource] = id.toCanonicalString();\n secondarySources.push(id);\n }\n }\n\n // use outer join between primary columns - inner join can remove useful points in tree and annotations\n const data = await store.pFrameProvider.getTableOuterJoin(\n [...primarySources, ...filterColumns, ...linkerColumns],\n secondarySources,\n filters,\n false\n );\n\n for (const source of [...primarySources, ...secondarySources]) {\n const responseKey = source.toCanonicalString();\n const resultKey = idMap[source.toCanonicalString()];\n result[resultKey] = {\n data: isColumnId(source) ? data.columnsData[responseKey] : data.axesData[responseKey],\n spec: isColumnId(source) ? data.columnSpecs[responseKey] : data.axesSpecs[responseKey],\n label: await getColumnOrAxisLabel(store, resultKey, parentSources),\n };\n }\n\n const nodeIdAxis = Object.keys(data.axesData).find(\n axisIdStr => columnOrAxisIdFromString(axisIdStr)?.name === NODE_ID_AXIS_NAME\n );\n if (!nodeIdAxis) {\n console.warn('Missed node id axis in data column');\n } else {\n result[COLUMN_NODE_ID] = {\n data: data.axesData[nodeIdAxis],\n spec: {kind: 'PColumn', valueType: 'Int', name: 'Node id'} as PColumnSpec,\n label: 'Node id',\n };\n }\n return result;\n }\n\n async createDataByColumns(store: DataStore, state: DendroUIState): Promise<PlotDataAndSettings['data']> {\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n const annotationColumnIdString = state.components.heatmapAnnotation.selectorStates[0]?.selectedSource;\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n const annotationColumnId = annotationColumnIdString ? columnOrAxisIdFromString(annotationColumnIdString) : null;\n\n if (!valueColumnIdString || !isColumnId(valueColumnId)) {\n throw Error('Value column is not valid');\n }\n const dataByColumns: DataByColumns = {\n type: 'columns',\n id: canonicalize(state.components) ?? '',\n values: {},\n };\n\n const filterSelectedStates = [\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]\n // filters for column/axes data requests\n const filters = getFiltersFromStates(filterSelectedStates);\n const filterColumns = filterSelectedStates.map(s => columnOrAxisIdFromString(s.selectedSource)).filter(isColumnId);\n\n\n const parentSources = [valueColumnId, annotationColumnId]\n .filter(isColumnId)\n .map(item => item.toCanonicalString());\n\n const primarySources: (ColumnId | AxisId)[] = [];\n const secondarySources: (ColumnId | AxisId)[] = [];\n\n const primaryInputs = [\n state.components.value,\n state.components.height,\n state.components.labels,\n state.components.nodeColor,\n state.components.nodeSize,\n state.components.nodeShape,\n state.components.lineColor,\n state.components.heatmapAnnotation,\n state.components.heatmapForSequence,\n ];\n const secondaryInputs = [\n state.components.facetBy,\n state.components.heatmapAxis,\n state.components.heatmapGroup,\n state.components.tableContent,\n ];\n for (const primaryInput of primaryInputs) {\n for (const {selectedSource} of primaryInput.selectorStates) {\n primarySources.push(columnOrAxisIdFromString(selectedSource));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n primarySources.push(labelsColumnId);\n }\n }\n }\n for (const secondaryInput of secondaryInputs) {\n for (const {selectedSource} of secondaryInput.selectorStates) {\n secondarySources.push(columnOrAxisIdFromString(selectedSource));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n\n // use outer join between primary columns - inner join can remove useful points in tree and annotations\n const data = await store.pFrameProvider.getTableOuterJoin(\n [...primarySources, ...filterColumns],\n secondarySources,\n filters,\n false\n );\n\n [...primarySources, ...secondarySources].forEach(item => {\n const key = item.toCanonicalString();\n const columnData = isColumnId(item) ? data.columnsData[key] : data.axesData[key];\n dataByColumns.values[key] = [];\n dataByColumns.values[key] = columnData;\n });\n\n const nodeIdAxis = Object.keys(data.axesData).find(\n axisIdStr => columnOrAxisIdFromString(axisIdStr)?.name === NODE_ID_AXIS_NAME\n );\n\n if (!nodeIdAxis) {\n console.warn('Missed node id axis in data column');\n } else {\n dataByColumns.values[COLUMN_NODE_ID] = data.axesData[nodeIdAxis];\n }\n\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: DendroUIState): Promise<Record<string, unknown>> {\n const dataColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n const dataColumnId = columnOrAxisIdFromString(dataColumnIdString);\n if (!dataColumnIdString || !isColumnId(dataColumnId)) {\n throw Error('Data column is not valid');\n }\n\n const parentSourcesTree = [dataColumnIdString];\n\n const id = {type: 'column', value: COLUMN_NODE_ID};\n const parentId = {type: 'column', value: dataColumnIdString};\n const height = state.components.height.selectorStates.length\n ? {type: 'column', value: state.components.height.selectorStates[0].selectedSource}\n : undefined;\n const labels = state.components.labels.selectorStates.length\n ? {type: 'column', value: state.components.labels.selectorStates[0].selectedSource}\n : undefined;\n const aes: {\n nodeColor?: {columnName: {type: 'column'; value: string; label: string}};\n nodeShape?: {columnName: {type: 'column'; value: string; label: string}};\n nodeSize?: {columnName: {type: 'column'; value: string; label: string}};\n lineColor?: {columnName: {type: 'column'; value: string; label: string}};\n } = {};\n if (state.components.nodeColor.selectorStates.length) {\n const idString = state.components.nodeColor.selectorStates[0].selectedSource;\n aes.nodeColor = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n if (state.components.nodeShape.selectorStates.length) {\n const idString = state.components.nodeShape.selectorStates[0].selectedSource;\n aes.nodeShape = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n if (state.components.nodeSize.selectorStates.length) {\n const idString = state.components.nodeSize.selectorStates[0].selectedSource;\n aes.nodeSize = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n if (state.components.lineColor.selectorStates.length) {\n const idString = state.components.lineColor.selectorStates[0].selectedSource;\n aes.lineColor = {\n columnName: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSourcesTree),\n },\n };\n }\n\n let heatmapAnnotation;\n let heatmapAxis;\n let heatmapGroup;\n\n // heatmap with user axis, with not sequence as value\n if (\n state.components.heatmapAnnotation.selectorStates.length &&\n state.components.heatmapAxis.selectorStates.length\n ) {\n const annotationSource = state.components.heatmapAnnotation.selectorStates[0].selectedSource;\n heatmapAnnotation = {\n type: 'column',\n value: annotationSource,\n label: await getColumnOrAxisLabel(store, annotationSource, []),\n valueLabels: (await getColumnOrAxisValueLabelsId(store, annotationSource, []))?.toCanonicalString(),\n };\n const axisSource = state.components.heatmapAxis.selectorStates[0].selectedSource;\n heatmapAxis = {\n type: 'column',\n value: axisSource,\n label: await getColumnOrAxisLabel(store, axisSource, [annotationSource]),\n valueLabels: (\n await getColumnOrAxisValueLabelsId(store, axisSource, [annotationSource])\n )?.toCanonicalString(),\n };\n heatmapGroup = await Promise.all(\n state.components.heatmapGroup.selectorStates.map(async selectorState => {\n return {\n type: 'column',\n value: selectorState.selectedSource,\n label: await getColumnOrAxisLabel(store, selectorState.selectedSource, [annotationSource]),\n valueLabels: (\n await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, [annotationSource])\n )?.toCanonicalString(),\n };\n })\n );\n\n // heatmap containing sequence, as axis using order of sequence element\n } else if (state.components.heatmapForSequence.selectorStates.length) {\n const annotationSource = state.components.heatmapForSequence.selectorStates[0].selectedSource;\n heatmapAnnotation = {\n type: 'column',\n value: annotationSource,\n label: await getColumnOrAxisLabel(store, annotationSource, []),\n };\n }\n\n return {\n type: 'dendro',\n id,\n parentId,\n height,\n labels,\n aes,\n heatmapAnnotation,\n heatmapAxis,\n heatmapGroup,\n };\n }\n}\n"],"names":["NODE_ID_AXIS_NAME","COLUMN_NODE_ID","InitialDendroState","DendroStateController","ControllerBase","ComponentController","__publicField","state","store","result","valueColumnIdString","_a","valueColumnId","columnOrAxisIdFromString","isColumnId","linkerMap","createLinkerMap","filters","getFiltersFromStates","filterColumns","s","parentSources","parentAxesList","getAxesSpecsFromSources","primarySources","secondarySources","linkerColumns","multipliesByMap","createMultipliesByMap","primaryInputs","secondaryInputs","idMap","primaryInput","selectedSource","getLinkerColumnsForSource","id","getColumnOrAxisValueLabelsId","secondaryInput","data","source","responseKey","resultKey","getColumnOrAxisLabel","nodeIdAxis","axisIdStr","annotationColumnIdString","_b","annotationColumnId","dataByColumns","canonicalize","filterSelectedStates","item","labelsColumnId","key","columnData","dataColumnIdString","dataColumnId","parentSourcesTree","parentId","height","labels","aes","idString","heatmapAnnotation","heatmapAxis","heatmapGroup","annotationSource","axisSource","_c","selectorState"],"mappings":";;;;;;AAwBA,MAAMA,IAAoB,6BAGpBC,IAAiB,MA4BVC,IAAoC;AAAA,EAC7C,MAAM;AAAA,EACN,YAAY;AAAA,IACR,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AA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AChB,MAAM;AAAA,QACN,OAAOG;AAAAA,QACP,OAAO,MAAMxB,EAAqBlC,GAAO0D,GAAkB,CAAA,CAAE;AAAA,MAAA;AAAA,IACjE;AAGG,WAAA;AAAA,MACH,MAAM;AAAA,MACN,IAAA/B;AAAAA,MACA,UAAAuB;AAAAA,MACA,QAAAC;AAAAA,MACA,QAAAC;AAAAA,MACA,KAAAC;AAAAA,MACA,mBAAAE;AAAAA,MACA,aAAAC;AAAAA,MACA,cAAAC;AAAAA,IAAA;AAAA,EACJ;AAER;","x_google_ignoreList":[0]}
@@ -1,10 +1,10 @@
1
- import F from "../../_virtual/canonicalize.js";
2
- import { ControllerBase as N } from "../ControllerBase.js";
3
- import { ComponentController as u } from "../ComponentController.js";
4
- import { columnOrAxisIdFromString as C, isColumnId as v } from "../../spec.js";
5
- import { checkSourceBySpecForFilters as P, createLinkerMap as T, getFiltersFromStates as k, getAxesSpecsFromSources as E, getLinkerColumnsForSource as D, getColumnOrAxisValueLabelsId as x, getColumnOrAxisLabel as b } from "../../utils.js";
6
- var V = Object.defineProperty, j = (c, e, t) => e in c ? V(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t, O = (c, e, t) => j(c, typeof e != "symbol" ? e + "" : e, t);
7
- const J = {
1
+ import x from "../../_virtual/canonicalize.js";
2
+ import { ControllerBase as A } from "../ControllerBase.js";
3
+ import { ComponentController as p } from "../ComponentController.js";
4
+ import { columnOrAxisIdFromString as f, isColumnId as C } from "../../spec.js";
5
+ import { createLinkerMap as I, createMultipliesByMap as L, getFiltersFromStates as F, getAxesSpecsFromSources as N, getLinkerColumnsForSource as D, getColumnOrAxisValueLabelsId as v, getColumnOrAxisLabel as b } from "../../utils.js";
6
+ var P = Object.defineProperty, T = (i, e, t) => e in i ? P(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, O = (i, e, t) => T(i, typeof e != "symbol" ? e + "" : e, t);
7
+ const Y = {
8
8
  type: "discrete",
9
9
  components: {
10
10
  y: { type: "simple", selectorStates: [] },
@@ -16,16 +16,16 @@ const J = {
16
16
  },
17
17
  dividedAxes: {}
18
18
  };
19
- class M extends N {
19
+ class j extends A {
20
20
  constructor() {
21
21
  super(
22
22
  {
23
- y: new u({
23
+ y: new p({
24
24
  componentName: "y",
25
25
  allowedTypes: ["Int", "Double", "Long", "Float"],
26
26
  settings: { isDataComponent: !0 }
27
27
  }),
28
- primaryGrouping: new u({
28
+ primaryGrouping: new p({
29
29
  componentName: "primaryGrouping",
30
30
  allowedTypes: ["String", "Int", "Long"],
31
31
  strictlyDependsOnParents: !0,
@@ -36,7 +36,7 @@ class M extends N {
36
36
  homogeneous: !0
37
37
  }
38
38
  }),
39
- secondaryGrouping: new u({
39
+ secondaryGrouping: new p({
40
40
  componentName: "secondaryGrouping",
41
41
  allowedTypes: ["String", "Int", "Long"],
42
42
  strictlyDependsOnParents: !0,
@@ -47,7 +47,7 @@ class M extends N {
47
47
  homogeneous: !0
48
48
  }
49
49
  }),
50
- facetBy: new u({
50
+ facetBy: new p({
51
51
  componentName: "facetBy",
52
52
  allowedTypes: ["String", "Int", "Long"],
53
53
  strictlyDependsOnParents: !0,
@@ -61,7 +61,7 @@ class M extends N {
61
61
  })
62
62
  },
63
63
  {
64
- filters: new u({
64
+ filters: new p({
65
65
  componentName: "filters",
66
66
  allowedTypes: ["String", "Int", "Long", "Double", "Float"],
67
67
  strictlyDependsOnParents: !0,
@@ -71,10 +71,9 @@ class M extends N {
71
71
  axesAllowed: !0,
72
72
  dimensionConsumer: !0,
73
73
  multipleSelectors: !0
74
- },
75
- checkSourceBySpec: P
74
+ }
76
75
  }),
77
- tabBy: new u({
76
+ tabBy: new p({
78
77
  componentName: "tabBy",
79
78
  allowedTypes: ["String", "Int"],
80
79
  strictlyDependsOnParents: !0,
@@ -89,115 +88,109 @@ class M extends N {
89
88
  ), O(this, "dataInputs", ["y"]), O(this, "dontAllowUnfilteredHighCardinality", !0);
90
89
  }
91
90
  async createDataByColumns(e, t) {
92
- const p = t.components.y.selectorStates[0].selectedSource, l = C(p);
93
- if (!p || !v(l))
91
+ const c = t.components.y.selectorStates[0].selectedSource, a = f(c);
92
+ if (!c || !C(a))
94
93
  throw Error("Y column is not valid");
95
94
  const s = {
96
95
  type: "columns",
97
- id: F(t.components) ?? "",
96
+ id: x(t.components) ?? "",
98
97
  values: {}
99
- }, d = await T(e), m = [
98
+ }, u = await I(e), m = await L(e), n = [
100
99
  ...t.components.filters.selectorStates,
101
100
  ...t.components.tabBy.selectorStates
102
- ], r = k(m), g = m.map((a) => C(a.selectedSource)).filter(v), y = [p], S = await E(e, y), o = [t.components.primaryGrouping, t.components.secondaryGrouping, t.components.facetBy], i = [], A = [[]], B = [], h = [];
103
- for (const { selectedSource: a, fixedAxes: n } of m)
101
+ ], y = F(n), d = n.map((r) => f(r.selectedSource)).filter(C), g = [c], o = await N(e, g), S = [t.components.primaryGrouping, t.components.secondaryGrouping, t.components.facetBy], w = [], h = [];
102
+ for (const { selectedSource: r } of n)
104
103
  h.push(...await D(
105
104
  e,
106
- d,
107
- S,
108
- a,
109
- n
110
- )), A.push(
111
- (n ?? []).map(({ axisIdx: f, axisValue: w }) => ({ idx: f, value: w }))
112
- );
113
- for (const a of o)
114
- for (const { selectedSource: n, fixedAxes: f } of a.selectorStates) {
115
- i.push(C(n)), B.push(
116
- (f ?? []).map(({ axisIdx: I, axisValue: L }) => ({ idx: I, value: L }))
117
- ), h.push(...await D(
105
+ u,
106
+ m,
107
+ o,
108
+ r
109
+ ));
110
+ for (const r of S)
111
+ for (const { selectedSource: l } of r.selectorStates) {
112
+ w.push(f(l)), h.push(...await D(
118
113
  e,
119
- d,
120
- S,
121
- n,
122
- f
114
+ u,
115
+ m,
116
+ o,
117
+ l
123
118
  ));
124
- const w = await x(e, n, y);
125
- w && i.push(w);
119
+ const B = await v(e, l, g);
120
+ B && w.push(B);
126
121
  }
127
122
  const G = await e.pFrameProvider.getTableOuterJoin(
128
- [l, ...h, ...g],
129
- i,
130
- r,
131
- !0,
132
- A,
133
- B
123
+ [a, ...h, ...d],
124
+ w,
125
+ y,
126
+ !0
134
127
  );
135
- return i.forEach((a) => {
136
- const n = a.toCanonicalString();
137
- s.values[n] = v(a) ? G.columnsData[n] : G.axesData[n];
138
- }), s.values[l.toCanonicalString()] = G.columnsData[l.toCanonicalString()], { byColumns: s };
128
+ return w.forEach((r) => {
129
+ const l = r.toCanonicalString();
130
+ s.values[l] = C(r) ? G.columnsData[l] : G.axesData[l];
131
+ }), s.values[a.toCanonicalString()] = G.columnsData[a.toCanonicalString()], { byColumns: s };
139
132
  }
140
133
  async createChartSettings(e, t) {
141
- var p, l;
142
- const s = t.components.y.selectorStates[0].selectedSource, d = C(s);
143
- if (!s || !v(d))
134
+ var c, a;
135
+ const s = t.components.y.selectorStates[0].selectedSource, u = f(s);
136
+ if (!s || !C(u))
144
137
  throw Error("Y column is not valid");
145
138
  const m = {
146
139
  type: "column",
147
140
  value: s,
148
141
  label: await b(e, s, [])
149
- }, r = [s];
150
- let g;
142
+ }, n = [s];
143
+ let y;
151
144
  if (t.components.primaryGrouping.selectorStates.length) {
152
145
  const { selectedSource: o } = t.components.primaryGrouping.selectorStates[0];
153
- g = {
146
+ y = {
154
147
  columnName: {
155
148
  type: "column",
156
149
  value: o,
157
- label: await b(e, o, r),
158
- valueLabels: (p = await x(
150
+ label: await b(e, o, n),
151
+ valueLabels: (c = await v(
159
152
  e,
160
153
  o,
161
- r
162
- )) == null ? void 0 : p.toCanonicalString()
154
+ n
155
+ )) == null ? void 0 : c.toCanonicalString()
163
156
  }
164
157
  };
165
158
  }
166
- let y;
159
+ let d;
167
160
  if (t.components.secondaryGrouping.selectorStates.length) {
168
161
  const { selectedSource: o } = t.components.secondaryGrouping.selectorStates[0];
169
- y = {
162
+ d = {
170
163
  columnName: {
171
164
  type: "column",
172
165
  value: o,
173
- label: await b(e, o, r),
174
- valueLabels: (l = await x(
166
+ label: await b(e, o, n),
167
+ valueLabels: (a = await v(
175
168
  e,
176
169
  o,
177
- r
178
- )) == null ? void 0 : l.toCanonicalString()
170
+ n
171
+ )) == null ? void 0 : a.toCanonicalString()
179
172
  }
180
173
  };
181
174
  }
182
- const S = await Promise.all(t.components.facetBy.selectorStates.map(async (o) => {
183
- var i;
175
+ const g = await Promise.all(t.components.facetBy.selectorStates.map(async (o) => {
176
+ var S;
184
177
  return {
185
178
  type: "column",
186
- value: ((i = await x(e, o.selectedSource, r)) == null ? void 0 : i.toCanonicalString()) ?? o.selectedSource,
187
- label: await b(e, o.selectedSource, r)
179
+ value: ((S = await v(e, o.selectedSource, n)) == null ? void 0 : S.toCanonicalString()) ?? o.selectedSource,
180
+ label: await b(e, o.selectedSource, n)
188
181
  };
189
182
  }));
190
183
  return {
191
184
  type: "discrete",
192
185
  y: m,
193
- primaryGrouping: g,
194
- secondaryGrouping: y,
195
- facetBy: S
186
+ primaryGrouping: y,
187
+ secondaryGrouping: d,
188
+ facetBy: g
196
189
  };
197
190
  }
198
191
  }
199
192
  export {
200
- M as DiscreteStateController,
201
- J as InitialDiscreteState
193
+ j as DiscreteStateController,
194
+ Y as InitialDiscreteState
202
195
  };
203
196
  //# sourceMappingURL=discrete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"discrete.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/discrete.ts"],"sourcesContent":["import canonicalize from 'canonicalize';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n DataByColumns,\n InputState,\n InputStateParent,\n} from '../../common';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport type {AxisId, ColumnId} from '../../spec';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore, PValue} from '../../store';\nimport {\n checkSourceBySpecForFilters, createLinkerMap, getAxesSpecsFromSources,\n getColumnOrAxisLabel,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates, getLinkerColumnsForSource,\n} from '../../utils';\n\nexport interface DiscreteUIState extends InputStateParent<'discrete'> {\n type: 'discrete';\n components: {\n y: ComponentStateSimple;\n filters: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n primaryGrouping: ComponentStateSimple;\n secondaryGrouping: ComponentStateSimple;\n };\n}\n\nexport const InitialDiscreteState: DiscreteUIState = {\n type: 'discrete',\n components: {\n y: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n primaryGrouping: {type: 'simple', selectorStates: []},\n secondaryGrouping: {type: 'simple', selectorStates: []},\n },\n dividedAxes: {},\n};\n\nexport function isDiscreteState(state: InputState): state is DiscreteUIState {\n return state.type == 'discrete';\n}\n\nexport class DiscreteStateController extends ControllerBase<DiscreteUIState> {\n dataInputs = ['y'];\n dontAllowUnfilteredHighCardinality = true;\n\n constructor() {\n super(\n {\n y: new ComponentController<DiscreteUIState, 'y'>({\n componentName: 'y',\n allowedTypes: ['Int', 'Double', 'Long', 'Float'],\n settings: { isDataComponent: true },\n }),\n primaryGrouping: new ComponentController<DiscreteUIState, 'primaryGrouping'>({\n componentName: 'primaryGrouping',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n homogeneous: true,\n },\n }),\n secondaryGrouping: new ComponentController<DiscreteUIState, 'secondaryGrouping'>({\n componentName: 'secondaryGrouping',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['primaryGrouping'],\n settings: {\n axesAllowed: true,\n homogeneous: true,\n },\n }),\n facetBy: new ComponentController<DiscreteUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n }),\n },\n {\n filters: new ComponentController<DiscreteUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters\n }),\n tabBy: new ComponentController<DiscreteUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n },\n }),\n },\n );\n }\n\n async createDataByColumns(store: DataStore, state: DiscreteUIState): Promise<PlotDataAndSettings['data']> {\n const yColumnIdString = state.components.y.selectorStates[0].selectedSource;\n const yColumnIdWithQ = columnOrAxisIdFromString(yColumnIdString);\n if (!yColumnIdString || !isColumnId(yColumnIdWithQ)) {\n throw Error('Y column is not valid');\n }\n const dataByColumns: DataByColumns = {\n type: 'columns',\n id: canonicalize(state.components) ?? '',\n values: {},\n };\n\n const linkerMap = await createLinkerMap(store);\n\n const filterSelectedStates = [\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]\n // filters for column/axes data requests\n const filters = getFiltersFromStates(filterSelectedStates);\n const filterColumns = filterSelectedStates.map(s => columnOrAxisIdFromString(s.selectedSource)).filter(isColumnId);\n\n const parentSources = [yColumnIdString];\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n const inputs = [state.components.primaryGrouping, state.components.secondaryGrouping, state.components.facetBy];\n\n const secondarySources: (ColumnId | AxisId)[] = []; // primary sources are the only Y column\n const primarySourcesFixedAxes:{idx: number, value: PValue}[][] = [[]];\n const secondarySourcesFixedAxes:{idx: number, value: PValue}[][] = [];\n const linkerColumns:ColumnId[] = [];\n\n for (const {selectedSource, fixedAxes} of filterSelectedStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n primarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n }\n\n for (const input of inputs) {\n for (const {selectedSource, fixedAxes} of input.selectorStates) {\n secondarySources.push(columnOrAxisIdFromString(selectedSource)!);\n secondarySourcesFixedAxes.push(\n (fixedAxes ?? []).map(({axisIdx, axisValue}) => ({idx: axisIdx, value: axisValue as PValue}))\n );\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n parentAxesList,\n selectedSource,\n fixedAxes\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n const data = await store.pFrameProvider.getTableOuterJoin(\n [yColumnIdWithQ, ...linkerColumns, ...filterColumns],\n secondarySources,\n filters,\n true,\n primarySourcesFixedAxes,\n secondarySourcesFixedAxes\n );\n\n secondarySources.forEach(item => {\n const key = item.toCanonicalString();\n dataByColumns.values[key] = isColumnId(item)\n ? data.columnsData[key]\n : data.axesData[key];\n });\n dataByColumns.values[yColumnIdWithQ.toCanonicalString()] = data.columnsData[yColumnIdWithQ.toCanonicalString()];\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: DiscreteUIState): Promise<Record<string, unknown>> {\n const yColumnIdString = state.components.y.selectorStates[0].selectedSource;\n const yColumnId = columnOrAxisIdFromString(yColumnIdString);\n if (!yColumnIdString || !isColumnId(yColumnId)) {\n throw Error('Y column is not valid');\n }\n const y = {\n type: 'column',\n value: yColumnIdString,\n label: await getColumnOrAxisLabel(store, yColumnIdString, []),\n };\n\n const parentSources = [yColumnIdString];\n\n let primaryGrouping;\n if (state.components.primaryGrouping.selectorStates.length) {\n const {selectedSource} = state.components.primaryGrouping.selectorStates[0];\n primaryGrouping = {\n columnName: {\n type: 'column',\n value: selectedSource,\n label: await getColumnOrAxisLabel(store, selectedSource, parentSources),\n valueLabels: (await getColumnOrAxisValueLabelsId(\n store,\n selectedSource,\n parentSources,\n ))?.toCanonicalString(),\n },\n };\n }\n let secondaryGrouping;\n if (state.components.secondaryGrouping.selectorStates.length) {\n const {selectedSource} = state.components.secondaryGrouping.selectorStates[0];\n secondaryGrouping = {\n columnName: {\n type: 'column',\n value: selectedSource,\n label: await getColumnOrAxisLabel(store, selectedSource, parentSources),\n valueLabels: (await getColumnOrAxisValueLabelsId(\n store,\n selectedSource,\n parentSources,\n ))?.toCanonicalString(),\n },\n };\n }\n const facetBy = await Promise.all(state.components.facetBy.selectorStates.map(async state => ({\n type: 'column',\n value:\n (await getColumnOrAxisValueLabelsId(store, state.selectedSource, parentSources))?.toCanonicalString() ??\n state.selectedSource,\n label: await getColumnOrAxisLabel(store, state.selectedSource, parentSources),\n })));\n\n return {\n type: 'discrete',\n y,\n primaryGrouping,\n secondaryGrouping,\n facetBy,\n };\n }\n}\n"],"names":["InitialDiscreteState","DiscreteStateController","ControllerBase","ComponentController","checkSourceBySpecForFilters","__publicField","store","state","yColumnIdString","yColumnIdWithQ","columnOrAxisIdFromString","isColumnId","dataByColumns","canonicalize","linkerMap","createLinkerMap","filterSelectedStates","filters","getFiltersFromStates","filterColumns","s","parentSources","parentAxesList","getAxesSpecsFromSources","inputs","secondarySources","primarySourcesFixedAxes","secondarySourcesFixedAxes","linkerColumns","selectedSource","fixedAxes","getLinkerColumnsForSource","axisIdx","axisValue","input","labelsColumnId","getColumnOrAxisValueLabelsId","data","item","key","yColumnId","y","getColumnOrAxisLabel","primaryGrouping","_a","secondaryGrouping","_b","facetBy"],"mappings":";;;;;;AAgCO,MAAMA,IAAwC;AAAA,EACjD,MAAM;AAAA,EACN,YAAY;AAAA,IACR,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,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QAAA;AAAA,MAAkB;AAAA,IAE9B;AAEA,QAAAC;AACJ,QAAItC,EAAM,WAAW,kBAAkB,eAAe,QAAQ;AAC1D,YAAM,EAAC,gBAAAsB,MAAkBtB,EAAM,WAAW,kBAAkB,eAAe,CAAC;AACxDsC,MAAAA,IAAA;AAAA,QAChB,YAAY;AAAA,UACR,MAAM;AAAA,UACN,OAAOhB;AAAAA,UACP,OAAO,MAAMa,EAAqBpC,GAAOuB,GAAgBR,CAAa;AAAA,UACtE,cAAcyB,IAAA,MAAMV;AAAAA,YAChB9B;AAAAA,YACAuB;AAAAA,YACAR;AAAAA,UAAA,MAHU,gBAAAyB,EAIV,kBAAA;AAAA,QAAA;AAAA,MAAkB;AAAA,IAE9B;AAEE,UAAAC,IAAU,MAAM,QAAQ,IAAIxC,EAAM,WAAW,QAAQ,eAAe,IAAI,OAAMA,MAAU;;AAAA,aAAA;AAAA,QAC1F,MAAM;AAAA,QACN,SACKqC,IAAA,MAAMR,EAA6B9B,GAAOC,EAAM,gBAAgBc,CAAa,MAA7E,OAAA,SAAAuB,EAAiF,kBAAA,MAClFrC,EAAM;AAAA,QACV,OAAO,MAAMmC,EAAqBpC,GAAOC,EAAM,gBAAgBc,CAAa;AAAA,MAAA;AAAA,KAC9E,CAAC;AAEI,WAAA;AAAA,MACH,MAAM;AAAA,MACN,GAAAoB;AAAA,MACA,iBAAAE;AAAAA,MACA,mBAAAE;AAAAA,MACA,SAAAE;AAAAA,IAAA;AAAA,EACJ;AAER;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"discrete.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/discrete.ts"],"sourcesContent":["import canonicalize from 'canonicalize';\nimport type {\n ComponentStateFilter,\n ComponentStateSimple,\n DataByColumns,\n InputState,\n InputStateParent,\n} from '../../common';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport type {AxisId, ColumnId} from '../../spec';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore, PValue} from '../../store';\nimport {\n createLinkerMap, createMultipliesByMap, getAxesSpecsFromSources,\n getColumnOrAxisLabel,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates, getLinkerColumnsForSource,\n} from '../../utils';\n\nexport interface DiscreteUIState extends InputStateParent<'discrete'> {\n type: 'discrete';\n components: {\n y: ComponentStateSimple;\n filters: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n primaryGrouping: ComponentStateSimple;\n secondaryGrouping: ComponentStateSimple;\n };\n}\n\nexport const InitialDiscreteState: DiscreteUIState = {\n type: 'discrete',\n components: {\n y: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n primaryGrouping: {type: 'simple', selectorStates: []},\n secondaryGrouping: {type: 'simple', selectorStates: []},\n },\n dividedAxes: {},\n};\n\nexport function isDiscreteState(state: InputState): state is DiscreteUIState {\n return state.type == 'discrete';\n}\n\nexport class DiscreteStateController extends ControllerBase<DiscreteUIState> {\n dataInputs = ['y'];\n dontAllowUnfilteredHighCardinality = true;\n\n constructor() {\n super(\n {\n y: new ComponentController<DiscreteUIState, 'y'>({\n componentName: 'y',\n allowedTypes: ['Int', 'Double', 'Long', 'Float'],\n settings: { isDataComponent: true },\n }),\n primaryGrouping: new ComponentController<DiscreteUIState, 'primaryGrouping'>({\n componentName: 'primaryGrouping',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n homogeneous: true,\n },\n }),\n secondaryGrouping: new ComponentController<DiscreteUIState, 'secondaryGrouping'>({\n componentName: 'secondaryGrouping',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['primaryGrouping'],\n settings: {\n axesAllowed: true,\n homogeneous: true,\n },\n }),\n facetBy: new ComponentController<DiscreteUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n }),\n },\n {\n filters: new ComponentController<DiscreteUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n }\n }),\n tabBy: new ComponentController<DiscreteUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int'],\n strictlyDependsOnParents: true,\n parentComponents: ['y'],\n dependsOn: ['y'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n },\n }),\n },\n );\n }\n\n async createDataByColumns(store: DataStore, state: DiscreteUIState): Promise<PlotDataAndSettings['data']> {\n const yColumnIdString = state.components.y.selectorStates[0].selectedSource;\n const yColumnIdWithQ = columnOrAxisIdFromString(yColumnIdString);\n if (!yColumnIdString || !isColumnId(yColumnIdWithQ)) {\n throw Error('Y column is not valid');\n }\n const dataByColumns: DataByColumns = {\n type: 'columns',\n id: canonicalize(state.components) ?? '',\n values: {},\n };\n\n const linkerMap = await createLinkerMap(store);\n const multipliesByMap = await createMultipliesByMap(store);\n\n const filterSelectedStates = [\n ...state.components.filters.selectorStates,\n ...state.components.tabBy.selectorStates\n ]\n // filters for column/axes data requests\n const filters = getFiltersFromStates(filterSelectedStates);\n const filterColumns = filterSelectedStates.map(s => columnOrAxisIdFromString(s.selectedSource)).filter(isColumnId);\n\n const parentSources = [yColumnIdString];\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n const inputs = [state.components.primaryGrouping, state.components.secondaryGrouping, state.components.facetBy];\n\n const secondarySources: (ColumnId | AxisId)[] = []; // primary sources are the only Y column\n const linkerColumns:ColumnId[] = [];\n\n for (const {selectedSource} of filterSelectedStates) {\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n multipliesByMap,\n parentAxesList,\n selectedSource\n ));\n }\n\n for (const input of inputs) {\n for (const {selectedSource} of input.selectorStates) {\n secondarySources.push(columnOrAxisIdFromString(selectedSource)!);\n linkerColumns.push(...await getLinkerColumnsForSource(\n store,\n linkerMap,\n multipliesByMap,\n parentAxesList,\n selectedSource\n ));\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n const data = await store.pFrameProvider.getTableOuterJoin(\n [yColumnIdWithQ, ...linkerColumns, ...filterColumns],\n secondarySources,\n filters,\n true\n );\n\n secondarySources.forEach(item => {\n const key = item.toCanonicalString();\n dataByColumns.values[key] = isColumnId(item)\n ? data.columnsData[key]\n : data.axesData[key];\n });\n dataByColumns.values[yColumnIdWithQ.toCanonicalString()] = data.columnsData[yColumnIdWithQ.toCanonicalString()];\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: DiscreteUIState): Promise<Record<string, unknown>> {\n const yColumnIdString = state.components.y.selectorStates[0].selectedSource;\n const yColumnId = columnOrAxisIdFromString(yColumnIdString);\n if (!yColumnIdString || !isColumnId(yColumnId)) {\n throw Error('Y column is not valid');\n }\n const y = {\n type: 'column',\n value: yColumnIdString,\n label: await getColumnOrAxisLabel(store, yColumnIdString, []),\n };\n\n const parentSources = [yColumnIdString];\n\n let primaryGrouping;\n if (state.components.primaryGrouping.selectorStates.length) {\n const {selectedSource} = state.components.primaryGrouping.selectorStates[0];\n primaryGrouping = {\n columnName: {\n type: 'column',\n value: selectedSource,\n label: await getColumnOrAxisLabel(store, selectedSource, parentSources),\n valueLabels: (await getColumnOrAxisValueLabelsId(\n store,\n selectedSource,\n parentSources,\n ))?.toCanonicalString(),\n },\n };\n }\n let secondaryGrouping;\n if (state.components.secondaryGrouping.selectorStates.length) {\n const {selectedSource} = state.components.secondaryGrouping.selectorStates[0];\n secondaryGrouping = {\n columnName: {\n type: 'column',\n value: selectedSource,\n label: await getColumnOrAxisLabel(store, selectedSource, parentSources),\n valueLabels: (await getColumnOrAxisValueLabelsId(\n store,\n selectedSource,\n parentSources,\n ))?.toCanonicalString(),\n },\n };\n }\n const facetBy = await Promise.all(state.components.facetBy.selectorStates.map(async state => ({\n type: 'column',\n value:\n (await getColumnOrAxisValueLabelsId(store, state.selectedSource, parentSources))?.toCanonicalString() ??\n state.selectedSource,\n label: await getColumnOrAxisLabel(store, state.selectedSource, parentSources),\n })));\n\n return {\n type: 'discrete',\n y,\n primaryGrouping,\n secondaryGrouping,\n facetBy,\n };\n }\n}\n"],"names":["InitialDiscreteState","DiscreteStateController","ControllerBase","ComponentController","__publicField","store","state","yColumnIdString","yColumnIdWithQ","columnOrAxisIdFromString","isColumnId","dataByColumns","canonicalize","linkerMap","createLinkerMap","multipliesByMap","createMultipliesByMap","filterSelectedStates","filters","getFiltersFromStates","filterColumns","s","parentSources","parentAxesList","getAxesSpecsFromSources","inputs","secondarySources","linkerColumns","selectedSource","getLinkerColumnsForSource","input","labelsColumnId","getColumnOrAxisValueLabelsId","data","item","key","yColumnId","y","getColumnOrAxisLabel","primaryGrouping","_a","secondaryGrouping","_b","facetBy"],"mappings":";;;;;;AAgCO,MAAMA,IAAwC;AAAA,EACjD,MAAM;AAAA,EACN,YAAY;AAAA,IACR,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACxC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,iBAAiB,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAClD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