@milaboratories/graph-maker 1.1.166 → 1.1.167

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 (91) hide show
  1. package/dist/GraphMaker/constantsCommon.d.ts +0 -9
  2. package/dist/GraphMaker/constantsCommon.d.ts.map +1 -1
  3. package/dist/GraphMaker/constantsCommon.js +74 -81
  4. package/dist/GraphMaker/constantsCommon.js.map +1 -1
  5. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js +8 -2
  6. package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
  7. package/dist/GraphMaker/forms/DataMappingForm/DiscreteForm.vue.js +26 -20
  8. package/dist/GraphMaker/forms/DataMappingForm/DiscreteForm.vue.js.map +1 -1
  9. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot/Scatter.vue.d.ts.map +1 -1
  10. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot/Scatter.vue.js +37 -31
  11. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot/Scatter.vue.js.map +1 -1
  12. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot-umap/Scatter.vue.js +30 -24
  13. package/dist/GraphMaker/forms/LayersForm/Layer/scatterplot-umap/Scatter.vue.js.map +1 -1
  14. package/dist/GraphMaker/forms/StatisticsForm/DiscreteStatisticsForm.vue.js +33 -27
  15. package/dist/GraphMaker/forms/StatisticsForm/DiscreteStatisticsForm.vue.js.map +1 -1
  16. package/dist/GraphMaker/index.vue.js +8 -2
  17. package/dist/GraphMaker/index.vue.js.map +1 -1
  18. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.js +22 -16
  19. package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.js.map +1 -1
  20. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js +17 -11
  21. package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js.map +1 -1
  22. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js +26 -20
  23. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.js.map +1 -1
  24. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.js +29 -23
  25. package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.js.map +1 -1
  26. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
  27. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +83 -68
  28. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
  29. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +25 -19
  30. package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
  31. package/dist/GraphMaker/utils/getUsedAesInMapping.js +37 -31
  32. package/dist/GraphMaker/utils/getUsedAesInMapping.js.map +1 -1
  33. package/dist/GraphMaker/utils/loadDefaultSources.d.ts.map +1 -1
  34. package/dist/GraphMaker/utils/loadDefaultSources.js +36 -31
  35. package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
  36. package/dist/_virtual/stringify.js +5 -0
  37. package/dist/_virtual/stringify.js.map +1 -0
  38. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +106 -107
  39. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -1
  40. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +120 -121
  41. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -1
  42. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +83 -84
  43. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -1
  44. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +4 -4
  45. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +11 -11
  46. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +123 -124
  47. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -1
  48. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +8 -8
  49. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +88 -89
  50. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -1
  51. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +103 -105
  52. package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -1
  53. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +148 -119
  54. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -1
  55. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/components/PlDataTable.js +4 -4
  56. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +5 -5
  57. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +8 -0
  58. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -0
  59. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +182 -0
  60. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -0
  61. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/errors.js +18 -0
  62. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/errors.js.map +1 -0
  63. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/json.js +12 -0
  64. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/json.js.map +1 -0
  65. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/plid.js +7 -0
  66. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/plid.js.map +1 -0
  67. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/ref.js +8 -0
  68. package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/ref.js.map +1 -0
  69. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +105 -111
  70. package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -1
  71. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +158 -163
  72. package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -1
  73. package/dist/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js +36 -0
  74. package/dist/node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js.map +1 -0
  75. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js +8 -0
  76. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js.map +1 -0
  77. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js +52 -0
  78. package/dist/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js.map +1 -0
  79. package/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js +7 -0
  80. package/dist/node_modules/@milaboratories/pl-model-common/dist/plid.js.map +1 -0
  81. package/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js +8 -0
  82. package/dist/node_modules/@milaboratories/pl-model-common/dist/ref.js.map +1 -0
  83. package/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js +16 -0
  84. package/dist/node_modules/@platforma-sdk/model/dist/render/util/label.js.map +1 -0
  85. package/dist/node_modules/json-stringify-safe/stringify.js +20 -0
  86. package/dist/node_modules/json-stringify-safe/stringify.js.map +1 -0
  87. package/dist/node_modules/zod/lib/index.js +2978 -0
  88. package/dist/node_modules/zod/lib/index.js.map +1 -0
  89. package/package.json +3 -3
  90. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +0 -18
  91. package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentController.js","sources":["../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/ComponentController.ts"],"sourcesContent":["import { getNormalizedAxesList, isLabelColumn } from '@platforma-sdk/model';\nimport type {\n ColumnData,\n ComponentGuideSimple,\n ComponentState,\n InputState,\n SelectorState,\n SelectorStateFilter,\n SelectorStateSimple,\n SourceOption,\n} from '../common';\nimport {\n COLUMN_LABEL_KEY,\n DISCRETE_FILTER_KEY,\n IS_LINKER_COLUMN,\n SUBSET_FILTER_KEY,\n} from '../constants';\nimport type { DataStore } from '../store';\nimport { AxesSet, ColumnId, ColumnOrAxisIdString } from '../spec';\nimport { AxisId, columnOrAxisIdFromString, isColumnId } from '../spec';\nimport { AxisSpec, LinkerMap, PColumnSpec, ValueType } from '@milaboratories/pl-model-common';\nimport { axisIsNonHomogenous, getColumnOrAxisLabel, getNotAllowedAxes, getStateCopy, MultipliesByMap } from '../utils';\n\nconst isLinkerColumn = (columnSpec: PColumnSpec) => columnSpec?.annotations?.[IS_LINKER_COLUMN] === 'true';\n\ninterface ComponentControllerSettings {\n isDataComponent: boolean; // X, Y, Data source etc.\n multipleSelectors: boolean; // more than 1 selected column in input\n required: boolean;\n homogeneous: boolean;\n axesAllowed: boolean;\n columnsAllowed: boolean;\n columnsWithExtraAxesAllowed: boolean; // can contain column with extra axes with fixed values\n dimensionConsumer: boolean; // remove extra dimension from data-mapping after selecting a heterogeneous axis\n}\n\ninterface FieldControllerOptions<State extends InputState, Field extends keyof State['components']> {\n componentName: Field;\n allowedTypes: ValueType[];\n checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean; // for more complicated logic than type is in allowed types and annotation exists\n annotations?: Record<string, string>;\n parentComponents?: (keyof State['components'])[];\n dependsOn?: (keyof State['components'])[];\n strictlyDependsOnParents?: boolean;\n ignoredOptionIds?: string[];\n settings: Partial<ComponentControllerSettings>;\n}\n\nexport class ComponentController<State extends InputState, Field extends keyof State['components']> {\n private static DefaultSettings: ComponentControllerSettings = {\n isDataComponent: false,\n multipleSelectors: false,\n required: false,\n homogeneous: false,\n axesAllowed: false,\n columnsAllowed: true,\n columnsWithExtraAxesAllowed: true,\n dimensionConsumer: false,\n };\n\n readonly componentName: Field;\n readonly allowedTypes: ValueType[];\n readonly settings: ComponentControllerSettings;\n private readonly dependsOn: (keyof State['components'])[];\n private readonly parentComponents: (keyof State['components'])[];\n private readonly strictlyDependsOnParents: boolean;\n private readonly annotations: Record<string, string>;\n private readonly checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean;\n\n constructor({\n componentName,\n allowedTypes,\n settings,\n strictlyDependsOnParents,\n dependsOn = [],\n parentComponents = [],\n annotations = {},\n checkSourceBySpec,\n }: FieldControllerOptions<State, Field>) {\n this.componentName = componentName;\n this.allowedTypes = [...allowedTypes];\n this.settings = { ...ComponentController.DefaultSettings, ...settings };\n this.dependsOn = [...dependsOn];\n this.parentComponents = [...parentComponents]; // corresponding data components for meta or X for Y in scatterplot\n this.strictlyDependsOnParents = strictlyDependsOnParents ?? true; // meta-inputs are strictly-depending on parents, X by Y (Y by X) - don't\n this.annotations = { ...annotations };\n if (checkSourceBySpec) {\n this.checkSourceBySpec = checkSourceBySpec;\n }\n }\n\n get isRequired(): boolean {\n return this.settings.required;\n }\n\n get isDimensionsConsumer(): boolean {\n return this.settings.dimensionConsumer;\n }\n\n addSelected(state: State, selectorState: SelectorStateSimple | SelectorStateFilter) {\n const nextState = getStateCopy(state);\n nextState.components[this.componentName].selectorStates.push(selectorState as SelectorStateFilter);\n\n // ***\n // here should be logic for possibly parent qualifications updating\n // ***\n\n return nextState;\n }\n\n deleteSelected(state: State, selectedSourceStr: ColumnOrAxisIdString) {\n const nextState = getStateCopy(state);\n // ***\n // here should be logic for removing unnecessary qualifications (it can appear when some sources are deleted)\n // ***\n nextState.components[this.componentName].selectorStates = (\n nextState.components[this.componentName].selectorStates as SelectorState[]\n ).filter(item => item.selectedSource !== selectedSourceStr);\n return nextState;\n }\n\n getParentSelectedSources(state: State): (ColumnId | AxisId)[] {\n const selectedSources = this.parentComponents.reduce((res: (ColumnId | AxisId)[], item) => {\n const selectedHere = state.components[item].selectorStates.map(s =>\n columnOrAxisIdFromString(s.selectedSource)\n );\n res.push(...selectedHere);\n return res;\n }, []);\n\n // ***\n // consider parent qualifications without selected here\n // ***\n return selectedSources;\n }\n\n async getParentsAxes(store: DataStore, state: State) {\n const parentSelectedSources = this.getParentSelectedSources(state);\n const parentAxes = new Map<ColumnOrAxisIdString, { parentSource: ColumnOrAxisIdString, spec: AxisSpec }>();\n for (const source of parentSelectedSources) {\n if (isColumnId(source)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(source);\n for (const spec of columnSpec?.axesSpec ?? []) {\n const id = AxisId.fromAxisSpec(spec);\n const idStr = id.toCanonicalString();\n if (parentAxes.has(idStr)) {\n continue;\n }\n parentAxes.set(idStr, { parentSource: source.toCanonicalString(), spec });\n }\n }\n }\n\n return parentAxes;\n }\n\n async getParentAndHangingAxes(store: DataStore, state: State, linkerMap: LinkerMap, multipliesByMap: MultipliesByMap): Promise<{\n parentsAxes: AxesSet,\n hangingAxes: AxesSet,\n }> {\n const parentsAxes = await this.getParentsAxes(store, state);\n const hangingAxes: AxesSet = new Map();\n\n if (!this.settings.isDataComponent) {\n const thisState: ComponentState = state.components[this.componentName];\n const selectedHereSources = thisState.selectorStates.map((v) => v.selectedSource);\n for (const source of selectedHereSources) {\n const id = columnOrAxisIdFromString(source);\n if (!isColumnId(id)) {\n continue;\n }\n const columnSpec = await store.pFrameProvider.getColumnSpecById(id);\n if (!columnSpec) {\n continue;\n }\n const extraAxesSpecs = getNotAllowedAxes(columnSpec, Array.from(parentsAxes.values()).map(v => v.spec), linkerMap, multipliesByMap);\n\n for (const spec of extraAxesSpecs) {\n hangingAxes.set(AxisId.fromAxisSpec(spec).toCanonicalString(), { parentSource: source, spec });\n }\n }\n }\n\n return { parentsAxes, hangingAxes };\n }\n\n /** Get axes to check available columns compatibility: all parents axes + available with these parent axes linker axes */\n getColumnSourceAxes(\n allParentsAndHangingAxes: Record<keyof State['components'], { parentsAxes: AxesSet, hangingAxes: AxesSet }>,\n linkerMap: LinkerMap,\n multipliesByMap: MultipliesByMap,\n ): AxesSet {\n const result = new Map();\n const { parentsAxes } = allParentsAndHangingAxes[this.componentName];\n\n for (const v of parentsAxes) {\n result.set(...v);\n }\n\n if (this.settings.isDataComponent) {\n return result;\n }\n\n // normalized list concider axes parents (not component parents)\n const normalizedAxes = getNormalizedAxesList(Array.from(parentsAxes.values()).map((v) => v.spec));\n const axesAvailableWithLinkers = getNormalizedAxesList(linkerMap.getReachableByLinkersAxesFromAxes(normalizedAxes));\n\n for (const axisSpec of axesAvailableWithLinkers) {\n const key = LinkerMap.getLinkerKeyFromAxisSpec(axisSpec);\n const linkerRecord = linkerMap.data.get(key);\n const linked = Array.from(linkerRecord?.linkWith.keys() ?? []);\n const linkerColumn = linkerRecord?.linkWith.get(linked[0]);\n\n if (linkerColumn) {\n const axisId = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n const linkerColumnId = new ColumnId({ name: linkerColumn.columnId, type: linkerColumn.spec.valueType }).toCanonicalString();\n result.set(axisId, { parentSource: linkerColumnId, spec: axisSpec });\n }\n }\n\n for (const [id] of parentsAxes) {\n const multipliesByNode = multipliesByMap.get(id);\n const multipliesByKeys = Array.from(multipliesByNode?.keys() ?? []);\n if (multipliesByNode && multipliesByKeys.length) {\n for (const key of multipliesByKeys) {\n const el = multipliesByNode.get(key)!;\n const axisId = AxisId.fromAxisSpec(el.spec).toCanonicalString()\n result.set(axisId, { parentSource: el.parentSource, spec: el.spec });\n }\n }\n }\n\n return result;\n }\n\n /** Allowed: all axes from parent (data) inputs + hanging axes from another (not data) inputs + axes from linkers;\n * these are all axes that can be in a compatible columns + hanging axes.\n */\n getAllowedAxes(\n allParentsAndHangingAxes: Record<keyof State['components'], { parentsAxes: AxesSet, hangingAxes: AxesSet }>,\n linkerMap: LinkerMap,\n multipliesByMap: MultipliesByMap,\n ): AxesSet {\n const result = this.getColumnSourceAxes(allParentsAndHangingAxes, linkerMap, multipliesByMap);\n\n for (const [input, data] of Object.entries(allParentsAndHangingAxes)) {\n if (input === this.componentName && !this.settings.multipleSelectors) {\n continue;\n }\n for (const v of data.hangingAxes) {\n result.set(...v);\n }\n }\n return result;\n }\n\n checkStateConsistency(state: State, options: SourceOption[]) {\n const thisState: ComponentState = state.components[this.componentName];\n\n return thisState.selectorStates.reduce((res, v) => {\n res[v.selectedSource] = options.some(op => op.value === v.selectedSource);\n return res;\n }, {} as Record<string, boolean>);\n }\n\n\n async getOptions(\n store: DataStore,\n state: State,\n linkerMap: LinkerMap,\n multipliesByMap: MultipliesByMap,\n allParentAndHangingAxes: Record<keyof State['components'], { parentsAxes: AxesSet, hangingAxes: AxesSet }>, // hanging axes from all the inputs\n dataColumnPredicate: (spec: PColumnSpec) => boolean,\n ignoredNamesSet: Set<string> = new Set(),\n fixedSelectedSet: Set<ColumnOrAxisIdString> = new Set()\n ): Promise<ComponentGuideSimple> {\n const multipleSelectors = this.settings.multipleSelectors;\n const required = this.settings.required;\n const optionsInfo = new Map();\n\n if (this.dependsOn.length && this.dependsOn.some(dep => state.components[dep].selectorStates.length === 0)) {\n return { multipleSelectors, required, stateConsistency: this.checkStateConsistency(state, []), options: [], optionsInfo };\n }\n\n if (\n this.strictlyDependsOnParents &&\n !this.settings.isDataComponent &&\n this.parentComponents.some(name => state.components[name].selectorStates.length === 0)\n ) {\n return { multipleSelectors, required, stateConsistency: this.checkStateConsistency(state, []), options: [], optionsInfo };\n }\n\n const options: SourceOption[] = [];\n if (this.settings.axesAllowed) {\n const allowedAxes = this.getAllowedAxes(allParentAndHangingAxes, linkerMap, multipliesByMap);\n for (const [idStr, { spec, parentSource }] of allowedAxes.entries()) {\n const id = columnOrAxisIdFromString(idStr) as AxisId;\n\n const isNonHomogenous = axisIsNonHomogenous(spec);\n\n const typeOK = this.allowedTypes.includes(spec.type);\n const annotationsOK = Object.entries(this.annotations).every(\n ([k, v]) => spec.annotations?.[k] === v\n );\n const checkBySpecOK = this.checkSourceBySpec ? this.checkSourceBySpec(spec, state) : true;\n const axisNatureOK = !this.settings.homogeneous || !isNonHomogenous;\n const ignored = ignoredNamesSet.has(id.name) || fixedSelectedSet.has(idStr);\n\n optionsInfo.set(idStr, {\n kind: 'axis',\n name: spec.name,\n label: await getColumnOrAxisLabel(store, idStr, [parentSource]),\n type: spec.type,\n mustBeConsumed: false,\n dividable: false,\n spec,\n annotations: spec.annotations,\n isNonHomogenous,\n isSubsetFilter: spec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter: spec.type === 'String' || spec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n parentSources: [parentSource],\n });\n\n if (typeOK && annotationsOK && checkBySpecOK && axisNatureOK && !ignored) {\n options.push({ value: idStr });\n }\n }\n }\n\n if (this.settings.columnsAllowed) {\n const allowedColumns = await store.pFrameProvider.getColumns([], false, this.allowedTypes, undefined, this.annotations);\n const strictlyCompatible = !this.settings.columnsWithExtraAxesAllowed && this.strictlyDependsOnParents;\n const columnSourceAxes = this.getColumnSourceAxes(allParentAndHangingAxes, linkerMap, multipliesByMap);\n\n for (const columnId of allowedColumns) {\n const columnIdString = columnId.toCanonicalString();\n\n const columnSpec = await store.pFrameProvider.getColumnSpecById(columnId);\n if (!columnSpec) {\n continue;\n }\n const parentsAxes = allParentAndHangingAxes[this.componentName].parentsAxes;\n const columnAxesIds = columnSpec.axesSpec.map((spec) => AxisId.fromAxisSpec(spec).toCanonicalString());\n if (\n // do not add to available options label columns, or columns that are not fit by custom spec condition, or columns that are not fit by condition for data inputs\n isLabelColumn(columnSpec) || isLinkerColumn(columnSpec) ||\n (this.checkSourceBySpec && !this.checkSourceBySpec(columnSpec, state)) ||\n (this.settings.isDataComponent && !dataColumnPredicate(columnSpec)) ||\n strictlyCompatible && columnSourceAxes.size && columnAxesIds.some((id) => !columnSourceAxes.has(id)) ||\n parentsAxes.size && !(columnAxesIds.some((id) => parentsAxes.has(id)) || columnAxesIds.every((id) => columnSourceAxes.has(id)))\n ) {\n continue;\n }\n\n const columnInfo: ColumnData = {\n kind: 'column',\n name: columnSpec.name,\n label: columnSpec.annotations?.[COLUMN_LABEL_KEY] ?? columnSpec.name,\n type: columnSpec.valueType,\n spec: columnSpec,\n annotations: columnSpec.annotations,\n isSubsetFilter: columnSpec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter:\n columnSpec.valueType === 'String' ||\n columnSpec.annotations?.[DISCRETE_FILTER_KEY] === 'true'\n };\n optionsInfo.set(columnIdString, columnInfo);\n\n const ignored = ignoredNamesSet.has(columnId.name) || fixedSelectedSet.has(columnIdString);\n if (!ignored) {\n options.push({ value: columnIdString });\n }\n }\n }\n return {\n multipleSelectors,\n required,\n stateConsistency: this.checkStateConsistency(state, options),\n options,\n optionsInfo\n };\n }\n}\n"],"names":["isLinkerColumn","columnSpec","_a","IS_LINKER_COLUMN","_ComponentController","componentName","allowedTypes","settings","strictlyDependsOnParents","dependsOn","parentComponents","annotations","checkSourceBySpec","__publicField","state","selectorState","nextState","getStateCopy","selectedSourceStr","item","res","selectedHere","s","columnOrAxisIdFromString","store","parentSelectedSources","parentAxes","source","isColumnId","spec","idStr","AxisId","linkerMap","multipliesByMap","parentsAxes","hangingAxes","selectedHereSources","v","id","extraAxesSpecs","getNotAllowedAxes","allParentsAndHangingAxes","result","normalizedAxes","getNormalizedAxesList","axesAvailableWithLinkers","axisSpec","key","LinkerMap","linkerRecord","linked","linkerColumn","axisId","linkerColumnId","ColumnId","multipliesByNode","multipliesByKeys","el","input","data","options","op","allParentAndHangingAxes","dataColumnPredicate","ignoredNamesSet","fixedSelectedSet","multipleSelectors","required","optionsInfo","dep","name","allowedAxes","parentSource","isNonHomogenous","axisIsNonHomogenous","typeOK","annotationsOK","k","checkBySpecOK","axisNatureOK","ignored","getColumnOrAxisLabel","SUBSET_FILTER_KEY","_b","DISCRETE_FILTER_KEY","allowedColumns","strictlyCompatible","columnSourceAxes","columnId","columnIdString","columnAxesIds","isLabelColumn","columnInfo","_c","COLUMN_LABEL_KEY","_d","_e","ComponentController"],"mappings":";;;;;;;;;;;;;AAuBA,MAAMA,IAAiB,CAACC,MAA4B;;AAAA,WAAAC,IAAAD,KAAA,OAAA,SAAAA,EAAY,gBAAZ,OAAA,SAAAC,EAA0BC,CAAAA,OAAsB;AAAA,GAyBvFC,IAAN,MAAMA,EAAuF;AAAA,EAqBhG,YAAY;AAAA,IACR,eAAAC;AAAAA,IACA,cAAAC;AAAAA,IACA,UAAAC;AAAAA,IACA,0BAAAC;AAAAA,IACA,WAAAC,IAAY,CAAA;AAAA,IACZ,kBAAAC,IAAmB,CAAA;AAAA,IACnB,aAAAC,IAAc,CAAA;AAAA,IACd,mBAAAC;AAAAA,EAAA,GACqC;AAlBhCC,I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D,IAAyB;AAAA,UAC3B,MAAM;AAAA,UACN,MAAM3F,EAAW;AAAA,UACjB,SAAO4F,IAAA5F,EAAW,gBAAX,OAAA,SAAA4F,EAAyBC,OAAqB7F,EAAW;AAAA,UAChE,MAAMA,EAAW;AAAA,UACjB,MAAMA;AAAAA,UACN,aAAaA,EAAW;AAAA,UACxB,kBAAgB8F,IAAA9F,EAAW,gBAAX,OAAA,SAAA8F,EAAyBb,CAAAA,OAAuB;AAAA,UAChE,kBACIjF,EAAW,cAAc,cACzB+F,IAAA/F,EAAW,gBAAX,OAAA,SAAA+F,EAAyBZ,CAAAA,OAAyB;AAAA,QAAA;AAE9ChB,QAAAA,EAAA,IAAIqB,GAAgBG,CAAU,GAE1B5B,EAAgB,IAAIwB,EAAS,IAAI,KAAKvB,EAAiB,IAAIwB,CAAc,KAErF7B,EAAQ,KAAK,EAAE,OAAO6B,GAAgB;AAAA,MAC1C;AAAA,IACJ;AAEG,WAAA;AAAA,MACH,mBAAAvB;AAAAA,MACA,UAAAC;AAAAA,MACA,kBAAkB,KAAK,sBAAsBrD,GAAO8C,CAAO;AAAA,MAC3D,SAAAA;AAAAA,MACA,aAAAQ;AAAAA,IAAA;AAAA,EACJ;AAER;AA7UIvD,EADST,GACM,mBAA+C;AAAA,EAC1D,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,6BAA6B;AAAA,EAC7B,mBAAmB;AACvB,CAAA;AAVG,IAAM6F,KAAN7F;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ComponentController.js","sources":["../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/ComponentController.ts"],"sourcesContent":["import { getNormalizedAxesList, isLabelColumn } from '@platforma-sdk/model';\nimport type {\n ColumnData,\n ComponentGuideSimple,\n ComponentState,\n InputState,\n SelectorState,\n SelectorStateFilter,\n SelectorStateSimple,\n SourceOption,\n} from '../common';\nimport type { DataStore } from '../store';\nimport { AxesSet, ColumnId, ColumnOrAxisIdString } from '../spec';\nimport { AxisId, columnOrAxisIdFromString, isColumnId } from '../spec';\nimport { Annotation, AxisSpec, LinkerMap, PColumnSpec, readAnnotation, ValueType } from '@milaboratories/pl-model-common';\nimport { axisIsNonHomogenous, getColumnOrAxisLabel, getNotAllowedAxes, getStateCopy, MultipliesByMap } from '../utils';\n\nconst isLinkerColumn = (columnSpec: PColumnSpec) => readAnnotation(columnSpec, Annotation.IsLinkerColumn) === 'true';\n\ninterface ComponentControllerSettings {\n isDataComponent: boolean; // X, Y, Data source etc.\n multipleSelectors: boolean; // more than 1 selected column in input\n required: boolean;\n homogeneous: boolean;\n axesAllowed: boolean;\n columnsAllowed: boolean;\n columnsWithExtraAxesAllowed: boolean; // can contain column with extra axes with fixed values\n dimensionConsumer: boolean; // remove extra dimension from data-mapping after selecting a heterogeneous axis\n}\n\ninterface FieldControllerOptions<State extends InputState, Field extends keyof State['components']> {\n componentName: Field;\n allowedTypes: ValueType[];\n checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean; // for more complicated logic than type is in allowed types and annotation exists\n annotations?: Record<string, string>;\n parentComponents?: (keyof State['components'])[];\n dependsOn?: (keyof State['components'])[];\n strictlyDependsOnParents?: boolean;\n ignoredOptionIds?: string[];\n settings: Partial<ComponentControllerSettings>;\n}\n\nexport class ComponentController<State extends InputState, Field extends keyof State['components']> {\n private static DefaultSettings: ComponentControllerSettings = {\n isDataComponent: false,\n multipleSelectors: false,\n required: false,\n homogeneous: false,\n axesAllowed: false,\n columnsAllowed: true,\n columnsWithExtraAxesAllowed: true,\n dimensionConsumer: false,\n };\n\n readonly componentName: Field;\n readonly allowedTypes: ValueType[];\n readonly settings: ComponentControllerSettings;\n private readonly dependsOn: (keyof State['components'])[];\n private readonly parentComponents: (keyof State['components'])[];\n private readonly strictlyDependsOnParents: boolean;\n private readonly annotations: Record<string, string>;\n private readonly checkSourceBySpec?: (spec: AxisSpec | PColumnSpec, state: State) => boolean;\n\n constructor({\n componentName,\n allowedTypes,\n settings,\n strictlyDependsOnParents,\n dependsOn = [],\n parentComponents = [],\n annotations = {},\n checkSourceBySpec,\n }: FieldControllerOptions<State, Field>) {\n this.componentName = componentName;\n this.allowedTypes = [...allowedTypes];\n this.settings = { ...ComponentController.DefaultSettings, ...settings };\n this.dependsOn = [...dependsOn];\n this.parentComponents = [...parentComponents]; // corresponding data components for meta or X for Y in scatterplot\n this.strictlyDependsOnParents = strictlyDependsOnParents ?? true; // meta-inputs are strictly-depending on parents, X by Y (Y by X) - don't\n this.annotations = { ...annotations };\n if (checkSourceBySpec) {\n this.checkSourceBySpec = checkSourceBySpec;\n }\n }\n\n get isRequired(): boolean {\n return this.settings.required;\n }\n\n get isDimensionsConsumer(): boolean {\n return this.settings.dimensionConsumer;\n }\n\n addSelected(state: State, selectorState: SelectorStateSimple | SelectorStateFilter) {\n const nextState = getStateCopy(state);\n nextState.components[this.componentName].selectorStates.push(selectorState as SelectorStateFilter);\n\n // ***\n // here should be logic for possibly parent qualifications updating\n // ***\n\n return nextState;\n }\n\n deleteSelected(state: State, selectedSourceStr: ColumnOrAxisIdString) {\n const nextState = getStateCopy(state);\n // ***\n // here should be logic for removing unnecessary qualifications (it can appear when some sources are deleted)\n // ***\n nextState.components[this.componentName].selectorStates = (\n nextState.components[this.componentName].selectorStates as SelectorState[]\n ).filter(item => item.selectedSource !== selectedSourceStr);\n return nextState;\n }\n\n getParentSelectedSources(state: State): (ColumnId | AxisId)[] {\n const selectedSources = this.parentComponents.reduce((res: (ColumnId | AxisId)[], item) => {\n const selectedHere = state.components[item].selectorStates.map(s =>\n columnOrAxisIdFromString(s.selectedSource)\n );\n res.push(...selectedHere);\n return res;\n }, []);\n\n // ***\n // consider parent qualifications without selected here\n // ***\n return selectedSources;\n }\n\n async getParentsAxes(store: DataStore, state: State) {\n const parentSelectedSources = this.getParentSelectedSources(state);\n const parentAxes = new Map<ColumnOrAxisIdString, { parentSource: ColumnOrAxisIdString, spec: AxisSpec }>();\n for (const source of parentSelectedSources) {\n if (isColumnId(source)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(source);\n for (const spec of columnSpec?.axesSpec ?? []) {\n const id = AxisId.fromAxisSpec(spec);\n const idStr = id.toCanonicalString();\n if (parentAxes.has(idStr)) {\n continue;\n }\n parentAxes.set(idStr, { parentSource: source.toCanonicalString(), spec });\n }\n }\n }\n\n return parentAxes;\n }\n\n async getParentAndHangingAxes(store: DataStore, state: State, linkerMap: LinkerMap, multipliesByMap: MultipliesByMap): Promise<{\n parentsAxes: AxesSet,\n hangingAxes: AxesSet,\n }> {\n const parentsAxes = await this.getParentsAxes(store, state);\n const hangingAxes: AxesSet = new Map();\n\n if (!this.settings.isDataComponent) {\n const thisState: ComponentState = state.components[this.componentName];\n const selectedHereSources = thisState.selectorStates.map((v) => v.selectedSource);\n for (const source of selectedHereSources) {\n const id = columnOrAxisIdFromString(source);\n if (!isColumnId(id)) {\n continue;\n }\n const columnSpec = await store.pFrameProvider.getColumnSpecById(id);\n if (!columnSpec) {\n continue;\n }\n const extraAxesSpecs = getNotAllowedAxes(columnSpec, Array.from(parentsAxes.values()).map(v => v.spec), linkerMap, multipliesByMap);\n\n for (const spec of extraAxesSpecs) {\n hangingAxes.set(AxisId.fromAxisSpec(spec).toCanonicalString(), { parentSource: source, spec });\n }\n }\n }\n\n return { parentsAxes, hangingAxes };\n }\n\n /** Get axes to check available columns compatibility: all parents axes + available with these parent axes linker axes */\n getColumnSourceAxes(\n allParentsAndHangingAxes: Record<keyof State['components'], { parentsAxes: AxesSet, hangingAxes: AxesSet }>,\n linkerMap: LinkerMap,\n multipliesByMap: MultipliesByMap,\n ): AxesSet {\n const result = new Map();\n const { parentsAxes } = allParentsAndHangingAxes[this.componentName];\n\n for (const v of parentsAxes) {\n result.set(...v);\n }\n\n if (this.settings.isDataComponent) {\n return result;\n }\n\n // normalized list concider axes parents (not component parents)\n const normalizedAxes = getNormalizedAxesList(Array.from(parentsAxes.values()).map((v) => v.spec));\n const axesAvailableWithLinkers = getNormalizedAxesList(linkerMap.getReachableByLinkersAxesFromAxes(normalizedAxes));\n\n for (const axisSpec of axesAvailableWithLinkers) {\n const key = LinkerMap.getLinkerKeyFromAxisSpec(axisSpec);\n const linkerRecord = linkerMap.data.get(key);\n const linked = Array.from(linkerRecord?.linkWith.keys() ?? []);\n const linkerColumn = linkerRecord?.linkWith.get(linked[0]);\n\n if (linkerColumn) {\n const axisId = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n const linkerColumnId = new ColumnId({ name: linkerColumn.columnId, type: linkerColumn.spec.valueType }).toCanonicalString();\n result.set(axisId, { parentSource: linkerColumnId, spec: axisSpec });\n }\n }\n\n for (const [id] of parentsAxes) {\n const multipliesByNode = multipliesByMap.get(id);\n const multipliesByKeys = Array.from(multipliesByNode?.keys() ?? []);\n if (multipliesByNode && multipliesByKeys.length) {\n for (const key of multipliesByKeys) {\n const el = multipliesByNode.get(key)!;\n const axisId = AxisId.fromAxisSpec(el.spec).toCanonicalString()\n result.set(axisId, { parentSource: el.parentSource, spec: el.spec });\n }\n }\n }\n\n return result;\n }\n\n /** Allowed: all axes from parent (data) inputs + hanging axes from another (not data) inputs + axes from linkers;\n * these are all axes that can be in a compatible columns + hanging axes.\n */\n getAllowedAxes(\n allParentsAndHangingAxes: Record<keyof State['components'], { parentsAxes: AxesSet, hangingAxes: AxesSet }>,\n linkerMap: LinkerMap,\n multipliesByMap: MultipliesByMap,\n ): AxesSet {\n const result = this.getColumnSourceAxes(allParentsAndHangingAxes, linkerMap, multipliesByMap);\n\n for (const [input, data] of Object.entries(allParentsAndHangingAxes)) {\n if (input === this.componentName && !this.settings.multipleSelectors) {\n continue;\n }\n for (const v of data.hangingAxes) {\n result.set(...v);\n }\n }\n return result;\n }\n\n checkStateConsistency(state: State, options: SourceOption[]) {\n const thisState: ComponentState = state.components[this.componentName];\n\n return thisState.selectorStates.reduce((res, v) => {\n res[v.selectedSource] = options.some(op => op.value === v.selectedSource);\n return res;\n }, {} as Record<string, boolean>);\n }\n\n\n async getOptions(\n store: DataStore,\n state: State,\n linkerMap: LinkerMap,\n multipliesByMap: MultipliesByMap,\n allParentAndHangingAxes: Record<keyof State['components'], { parentsAxes: AxesSet, hangingAxes: AxesSet }>, // hanging axes from all the inputs\n dataColumnPredicate: (spec: PColumnSpec) => boolean,\n ignoredNamesSet: Set<string> = new Set(),\n fixedSelectedSet: Set<ColumnOrAxisIdString> = new Set()\n ): Promise<ComponentGuideSimple> {\n const multipleSelectors = this.settings.multipleSelectors;\n const required = this.settings.required;\n const optionsInfo = new Map();\n\n if (this.dependsOn.length && this.dependsOn.some(dep => state.components[dep].selectorStates.length === 0)) {\n return { multipleSelectors, required, stateConsistency: this.checkStateConsistency(state, []), options: [], optionsInfo };\n }\n\n if (\n this.strictlyDependsOnParents &&\n !this.settings.isDataComponent &&\n this.parentComponents.some(name => state.components[name].selectorStates.length === 0)\n ) {\n return { multipleSelectors, required, stateConsistency: this.checkStateConsistency(state, []), options: [], optionsInfo };\n }\n\n const options: SourceOption[] = [];\n if (this.settings.axesAllowed) {\n const allowedAxes = this.getAllowedAxes(allParentAndHangingAxes, linkerMap, multipliesByMap);\n for (const [idStr, { spec, parentSource }] of allowedAxes.entries()) {\n const id = columnOrAxisIdFromString(idStr) as AxisId;\n\n const isNonHomogenous = axisIsNonHomogenous(spec);\n\n const typeOK = this.allowedTypes.includes(spec.type);\n const annotationsOK = Object.entries(this.annotations).every(\n ([k, v]) => spec.annotations?.[k] === v\n );\n const checkBySpecOK = this.checkSourceBySpec ? this.checkSourceBySpec(spec, state) : true;\n const axisNatureOK = !this.settings.homogeneous || !isNonHomogenous;\n const ignored = ignoredNamesSet.has(id.name) || fixedSelectedSet.has(idStr);\n\n optionsInfo.set(idStr, {\n kind: 'axis',\n name: spec.name,\n label: await getColumnOrAxisLabel(store, idStr, [parentSource]),\n type: spec.type,\n mustBeConsumed: false,\n dividable: false,\n spec,\n annotations: spec.annotations,\n isNonHomogenous,\n isSubsetFilter: readAnnotation(spec, Annotation.IsSubset),\n isDiscreteFilter: spec.type === 'String' || readAnnotation(spec, Annotation.IsDiscreteFilter) === 'true',\n parentSources: [parentSource],\n });\n\n if (typeOK && annotationsOK && checkBySpecOK && axisNatureOK && !ignored) {\n options.push({ value: idStr });\n }\n }\n }\n\n if (this.settings.columnsAllowed) {\n const allowedColumns = await store.pFrameProvider.getColumns([], false, this.allowedTypes, undefined, this.annotations);\n const strictlyCompatible = !this.settings.columnsWithExtraAxesAllowed && this.strictlyDependsOnParents;\n const columnSourceAxes = this.getColumnSourceAxes(allParentAndHangingAxes, linkerMap, multipliesByMap);\n\n for (const columnId of allowedColumns) {\n const columnIdString = columnId.toCanonicalString();\n\n const columnSpec = await store.pFrameProvider.getColumnSpecById(columnId);\n if (!columnSpec) {\n continue;\n }\n const parentsAxes = allParentAndHangingAxes[this.componentName].parentsAxes;\n const columnAxesIds = columnSpec.axesSpec.map((spec) => AxisId.fromAxisSpec(spec).toCanonicalString());\n if (\n // do not add to available options label columns, or columns that are not fit by custom spec condition, or columns that are not fit by condition for data inputs\n isLabelColumn(columnSpec) || isLinkerColumn(columnSpec) ||\n (this.checkSourceBySpec && !this.checkSourceBySpec(columnSpec, state)) ||\n (this.settings.isDataComponent && !dataColumnPredicate(columnSpec)) ||\n strictlyCompatible && columnSourceAxes.size && columnAxesIds.some((id) => !columnSourceAxes.has(id)) ||\n parentsAxes.size && !(columnAxesIds.some((id) => parentsAxes.has(id)) || columnAxesIds.every((id) => columnSourceAxes.has(id)))\n ) {\n continue;\n }\n\n const columnInfo: ColumnData = {\n kind: 'column',\n name: columnSpec.name,\n label: readAnnotation(columnSpec, Annotation.Label) ?? columnSpec.name,\n type: columnSpec.valueType,\n spec: columnSpec,\n annotations: columnSpec.annotations,\n isSubsetFilter: readAnnotation(columnSpec, Annotation.IsSubset) === 'true',\n isDiscreteFilter: columnSpec.valueType === 'String' || readAnnotation(columnSpec, Annotation.IsDiscreteFilter) === 'true'\n };\n optionsInfo.set(columnIdString, columnInfo);\n\n const ignored = ignoredNamesSet.has(columnId.name) || fixedSelectedSet.has(columnIdString);\n if (!ignored) {\n options.push({ value: columnIdString });\n }\n }\n }\n return {\n multipleSelectors,\n required,\n stateConsistency: this.checkStateConsistency(state, options),\n options,\n optionsInfo\n };\n }\n}\n"],"names":["isLinkerColumn","columnSpec","readAnnotation","Annotation","_ComponentController","componentName","allowedTypes","settings","strictlyDependsOnParents","dependsOn","parentComponents","annotations","checkSourceBySpec","__publicField","state","selectorState","nextState","getStateCopy","selectedSourceStr","item","res","selectedHere","s","columnOrAxisIdFromString","store","parentSelectedSources","parentAxes","source","isColumnId","spec","idStr","AxisId","linkerMap","multipliesByMap","parentsAxes","hangingAxes","selectedHereSources","v","id","extraAxesSpecs","getNotAllowedAxes","allParentsAndHangingAxes","result","normalizedAxes","getNormalizedAxesList","axesAvailableWithLinkers","axisSpec","key","LinkerMap","linkerRecord","linked","linkerColumn","axisId","linkerColumnId","ColumnId","multipliesByNode","multipliesByKeys","el","input","data","options","op","allParentAndHangingAxes","dataColumnPredicate","ignoredNamesSet","fixedSelectedSet","multipleSelectors","required","optionsInfo","dep","name","allowedAxes","parentSource","isNonHomogenous","axisIsNonHomogenous","typeOK","annotationsOK","k","_a","checkBySpecOK","axisNatureOK","ignored","getColumnOrAxisLabel","allowedColumns","strictlyCompatible","columnSourceAxes","columnId","columnIdString","columnAxesIds","isLabelColumn","columnInfo","ComponentController"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAMA,IAAiB,CAACC,MAA4BC,EAAeD,GAAYE,EAAW,cAAc,MAAM,QAyBjGC,IAAN,MAAMA,EAAuF;AAAA,EAqBhG,YAAY;AAAA,IACR,eAAAC;AAAAA,IACA,cAAAC;AAAAA,IACA,UAAAC;AAAAA,IACA,0BAAAC;AAAAA,IACA,WAAAC,IAAY,CAAA;AAAA,IACZ,kBAAAC,IAAmB,CAAA;AAAA,IACnB,aAAAC,IA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,IAAyB;AAAA,UAC3B,MAAM;AAAA,UACN,MAAMzF,EAAW;AAAA,UACjB,OAAOC,EAAeD,GAAYE,EAAW,KAAK,KAAKF,EAAW;AAAA,UAClE,MAAMA,EAAW;AAAA,UACjB,MAAMA;AAAAA,UACN,aAAaA,EAAW;AAAA,UACxB,gBAAgBC,EAAeD,GAAYE,EAAW,QAAQ,MAAM;AAAA,UACpE,kBAAkBF,EAAW,cAAc,YAAYC,EAAeD,GAAYE,EAAW,gBAAgB,MAAM;AAAA,QAAA;AAE3GiE,UAAA,IAAImB,GAAgBG,CAAU,GAE1B1B,EAAgB,IAAIsB,EAAS,IAAI,KAAKrB,EAAiB,IAAIsB,CAAc,KAErF3B,EAAQ,KAAK,EAAE,OAAO2B,GAAgB;AAAA,MAC1C;AAAA,IACJ;AAEG,WAAA;AAAA,MACH,mBAAArB;AAAAA,MACA,UAAAC;AAAAA,MACA,kBAAkB,KAAK,sBAAsBrD,GAAO8C,CAAO;AAAA,MAC3D,SAAAA;AAAAA,MACA,aAAAQ;AAAAA,IAAA;AAAA,EACJ;AAER;AA3UIvD,EADST,GACM,mBAA+C;AAAA,EAC1D,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,aAAa;AAAA,EACb,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,6BAA6B;AAAA,EAC7B,mBAAmB;AACvB,CAAA;AAVG,IAAMuF,KAANvF;","x_google_ignoreList":[0]}
@@ -1,17 +1,20 @@
1
- import { DISCRETE_VALUES_KEY as E, HIGH_CARDINALITY as D } from "../constants.js";
2
- import { AxisId as w, columnOrAxisIdFromString as A } from "../spec.js";
3
- import { getStateCopy as k, getDefaultInfo as O, dataColumnPredicateDefault as B, createLinkerMap as P, createMultipliesByMap as j, getColumnOrAxisValueLabelsId as F } from "../utils.js";
4
1
  import "../node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
5
- import "../node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
2
+ import { readAnnotation as I, Annotation as k } from "../node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
6
3
  import "../_virtual/canonicalize.js";
7
4
  import "../node_modules/@milaboratories/pl-model-common/dist/plid.js";
8
5
  import "../node_modules/@milaboratories/pl-model-common/dist/ref.js";
6
+ import { AxisId as b, columnOrAxisIdFromString as A } from "../spec.js";
7
+ import { getStateCopy as O, getDefaultInfo as D, dataColumnPredicateDefault as B, createLinkerMap as E, createMultipliesByMap as P, getColumnOrAxisValueLabelsId as j } from "../utils.js";
8
+ import "../node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/blob.js";
9
+ import "../node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/spec.js";
10
+ import "../node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/plid.js";
11
+ import "../node_modules/@platforma-sdk/model/node_modules/@milaboratories/pl-model-common/dist/ref.js";
9
12
  import { deriveLabels as M } from "../node_modules/@platforma-sdk/model/dist/render/util/label.js";
10
13
  import "../node_modules/@milaboratories/pl-error-like/dist/error_like_shape.js";
11
- var V = Object.defineProperty, H = (h, e, t) => e in h ? V(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t, x = (h, e, t) => H(h, typeof e != "symbol" ? e + "" : e, t);
12
- class W {
14
+ var F = Object.defineProperty, V = (g, e, t) => e in g ? F(g, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[e] = t, w = (g, e, t) => V(g, typeof e != "symbol" ? e + "" : e, t);
15
+ class z {
13
16
  constructor(e, t) {
14
- x(this, "ignoredOptionIdNames", []), x(this, "dataInputs", []), x(this, "dontAllowUnfilteredHighCardinality", !1), x(this, "allowHangingAxes", !1), this.simpleComponentControllers = e, this.filterComponentControllers = t;
17
+ w(this, "ignoredOptionIdNames", []), w(this, "dataInputs", []), w(this, "dontAllowUnfilteredHighCardinality", !1), w(this, "allowHangingAxes", !1), this.simpleComponentControllers = e, this.filterComponentControllers = t;
15
18
  }
16
19
  addSelected(e, t, o) {
17
20
  if (e in this.simpleComponentControllers)
@@ -28,20 +31,20 @@ class W {
28
31
  throw Error(`Unknown input name: ${String(e)}`);
29
32
  }
30
33
  changeSelected(e, t, o, r) {
31
- const n = o.components[e].selectorStates, a = n.filter((s) => !r.find((l) => l.selectedSource === s.selectedSource)), d = r.filter((s) => !n.find((l) => l.selectedSource === s.selectedSource));
32
- let m = k(o);
33
- return a.forEach((s) => {
34
- m = this.deleteSelected(e, t, m, s);
35
- }), d.forEach((s) => {
36
- m = this.addSelected(e, m, s);
34
+ const s = o.components[e].selectorStates, a = s.filter((i) => !r.find((n) => n.selectedSource === i.selectedSource)), c = r.filter((i) => !s.find((n) => n.selectedSource === i.selectedSource));
35
+ let u = O(o);
36
+ return a.forEach((i) => {
37
+ u = this.deleteSelected(e, t, u, i);
38
+ }), c.forEach((i) => {
39
+ u = this.addSelected(e, u, i);
37
40
  }), o.components[e].selectorStates = r.map(
38
- (s) => o.components[e].selectorStates.find(
39
- (l) => l.selectedSource === s.selectedSource
41
+ (i) => o.components[e].selectorStates.find(
42
+ (n) => n.selectedSource === i.selectedSource
40
43
  )
41
- ).filter(Boolean), m;
44
+ ).filter(Boolean), u;
42
45
  }
43
46
  switchDividableAxis(e, t) {
44
- return k(e);
47
+ return O(e);
45
48
  }
46
49
  createEmptyComponentsGuide(e) {
47
50
  return Object.fromEntries(
@@ -62,7 +65,7 @@ class W {
62
65
  getEmptyInputGuide(e) {
63
66
  return {
64
67
  components: this.createEmptyComponentsGuide(e),
65
- getSourceInfo: (t) => O(t),
68
+ getSourceInfo: (t) => D(t),
66
69
  fullOptionsSet: /* @__PURE__ */ new Set(),
67
70
  readyData: !1,
68
71
  ready: !1,
@@ -77,14 +80,14 @@ class W {
77
80
  t.add(r);
78
81
  for (const o of Object.keys(this.filterComponentControllers))
79
82
  if (this.filterComponentControllers[o].isDimensionsConsumer)
80
- for (const { selectedSource: r, type: n, selectedFilterValues: a } of e.components[o].selectorStates)
81
- n === "equals" && (a == null ? void 0 : a.length) === 1 && t.add(r);
83
+ for (const { selectedSource: r, type: s, selectedFilterValues: a } of e.components[o].selectorStates)
84
+ s === "equals" && (a == null ? void 0 : a.length) === 1 && t.add(r);
82
85
  return t;
83
86
  }
84
87
  async getParentAndHangingAxesByInputs(e, t, o, r) {
85
- const n = { ...this.simpleComponentControllers, ...this.filterComponentControllers }, a = {};
86
- for (const [d, m] of Object.entries(n))
87
- a[d] = await m.getParentAndHangingAxes(e, t, o, r);
88
+ const s = { ...this.simpleComponentControllers, ...this.filterComponentControllers }, a = {};
89
+ for (const [c, u] of Object.entries(s))
90
+ a[c] = await u.getParentAndHangingAxes(e, t, o, r);
88
91
  return a;
89
92
  }
90
93
  /** Depends on chart type. */
@@ -94,53 +97,50 @@ class W {
94
97
  /** Axes that go to the "Drag to build the chart" section.
95
98
  * If some of them is not moved to 'filters', 'tabBy' or 'facetBy' (dimension reducers) chart can't be rendered */
96
99
  markMustBeConsumedAxes(e, t, o, r) {
97
- var n;
98
- const a = this.getConsumedOptionsSet(e), d = (s) => {
99
- const l = t.get(s);
100
- l && l.kind === "axis" && (l.mustBeConsumed = !0);
101
- }, m = this.getMustBeConsumedAxes(e, t);
102
- for (const s of m)
103
- a.has(s) || d(s);
104
- this.allowHangingAxes || Object.entries(r).forEach(([s, { hangingAxes: l }]) => {
105
- for (const i of l.keys())
106
- a.has(i) || d(i);
100
+ var s;
101
+ const a = this.getConsumedOptionsSet(e), c = (i) => {
102
+ const n = t.get(i);
103
+ n && n.kind === "axis" && (n.mustBeConsumed = !0);
104
+ }, u = this.getMustBeConsumedAxes(e, t);
105
+ for (const i of u)
106
+ a.has(i) || c(i);
107
+ this.allowHangingAxes || Object.entries(r).forEach(([i, { hangingAxes: n }]) => {
108
+ for (const l of n.keys())
109
+ a.has(l) || c(l);
107
110
  });
108
- for (const s of o) {
109
- const l = t.get(s);
110
- (l == null ? void 0 : l.kind) === "axis" && l.isNonHomogenous && !a.has(s) && d(s);
111
+ for (const i of o) {
112
+ const n = t.get(i);
113
+ (n == null ? void 0 : n.kind) === "axis" && n.isNonHomogenous && !a.has(i) && c(i);
111
114
  }
112
115
  if (this.dontAllowUnfilteredHighCardinality) {
113
- const s = (i) => {
114
- var c;
115
- return ((c = i == null ? void 0 : i.annotations) == null ? void 0 : c[D]) === "true";
116
- }, l = ((n = e.components.filters) == null ? void 0 : n.selectorStates.reduce((i, c) => {
116
+ const i = (l) => I(l, k.Graph.Axis.HighCardinality) === "true", n = ((s = e.components.filters) == null ? void 0 : s.selectorStates.reduce((l, m) => {
117
117
  var p;
118
- if (((p = c == null ? void 0 : c.selectedFilterValues) == null ? void 0 : p.length) !== 1 && c.type !== "subset")
119
- return i;
120
- const u = t.get(c.selectedSource);
121
- return (u == null ? void 0 : u.kind) === "column" && u.spec.axesSpec.filter(s).forEach((f) => i.add(w.fromAxisSpec(f).toCanonicalString())), (u == null ? void 0 : u.kind) === "axis" && s(u.spec) && i.add(w.fromAxisSpec(u.spec).toCanonicalString()), i;
118
+ if (((p = m == null ? void 0 : m.selectedFilterValues) == null ? void 0 : p.length) !== 1 && m.type !== "subset")
119
+ return l;
120
+ const d = t.get(m.selectedSource);
121
+ return (d == null ? void 0 : d.kind) === "column" && d.spec.axesSpec.filter(i).forEach((f) => l.add(b.fromAxisSpec(f).toCanonicalString())), (d == null ? void 0 : d.kind) === "axis" && i(d.spec) && l.add(b.fromAxisSpec(d.spec).toCanonicalString()), l;
122
122
  }, /* @__PURE__ */ new Set())) ?? /* @__PURE__ */ new Set();
123
- this.dataInputs.forEach((i) => {
124
- for (const { selectedSource: c } of e.components[i].selectorStates) {
125
- const p = t.get(c);
126
- if ((p == null ? void 0 : p.kind) === "column" && p.spec.axesSpec.filter(s).forEach((u) => {
127
- const f = w.fromAxisSpec(u).toCanonicalString();
128
- l.has(f) || d(f);
129
- }), (p == null ? void 0 : p.kind) === "axis" && s(p.spec)) {
130
- const u = w.fromAxisSpec(p.spec).toCanonicalString();
131
- l.has(u) || d(u);
123
+ this.dataInputs.forEach((l) => {
124
+ for (const { selectedSource: m } of e.components[l].selectorStates) {
125
+ const p = t.get(m);
126
+ if ((p == null ? void 0 : p.kind) === "column" && p.spec.axesSpec.filter(i).forEach((d) => {
127
+ const f = b.fromAxisSpec(d).toCanonicalString();
128
+ n.has(f) || c(f);
129
+ }), (p == null ? void 0 : p.kind) === "axis" && i(p.spec)) {
130
+ const d = b.fromAxisSpec(p.spec).toCanonicalString();
131
+ n.has(d) || c(d);
132
132
  }
133
133
  }
134
134
  });
135
135
  }
136
136
  }
137
137
  setColumnLabels(e, t) {
138
- const o = [...e].filter((n) => {
138
+ const o = [...e].filter((s) => {
139
139
  var a;
140
- return ((a = t.get(n)) == null ? void 0 : a.kind) === "column";
141
- }), r = M(o, (n) => t.get(n).spec);
142
- o.forEach((n, a) => {
143
- t.get(n).label = r[a].label;
140
+ return ((a = t.get(s)) == null ? void 0 : a.kind) === "column";
141
+ }), r = M(o, (s) => t.get(s).spec);
142
+ o.forEach((s, a) => {
143
+ t.get(s).label = r[a].label;
144
144
  });
145
145
  }
146
146
  /** Calculates information for data-mapping interface:
@@ -148,121 +148,120 @@ class W {
148
148
  * information for every option (label, value type, must be consumed etc),
149
149
  * information about full data-mapping state (ready to data loading and rendering or not, contains inconsistency or not) */
150
150
  async calculateOptions(e, t, o = [], r = B) {
151
- const n = this.createEmptyComponentsGuide(t), a = new Set(this.ignoredOptionIdNames), d = new Set(o), m = await P(e), s = await j(e), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), c = await this.getParentAndHangingAxesByInputs(e, t, m, s), p = { ...this.simpleComponentControllers, ...this.filterComponentControllers };
152
- for (const [C, y] of Object.entries(p)) {
153
- const S = await y.getOptions(
151
+ const s = this.createEmptyComponentsGuide(t), a = new Set(this.ignoredOptionIdNames), c = new Set(o), u = await E(e), i = await P(e), n = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), m = await this.getParentAndHangingAxesByInputs(e, t, u, i), p = { ...this.simpleComponentControllers, ...this.filterComponentControllers };
152
+ for (const [S, h] of Object.entries(p)) {
153
+ const y = await h.getOptions(
154
154
  e,
155
155
  t,
156
+ u,
157
+ i,
156
158
  m,
157
- s,
158
- c,
159
159
  r,
160
160
  a,
161
- d
161
+ c
162
162
  );
163
- for (const g of S.options)
164
- i.add(g.value);
165
- for (const g of S.optionsInfo)
166
- l.set(...g);
167
- n[C] = S;
163
+ for (const C of y.options)
164
+ l.add(C.value);
165
+ for (const C of y.optionsInfo)
166
+ n.set(...C);
167
+ s[S] = y;
168
168
  }
169
- this.markMustBeConsumedAxes(t, l, i, c), this.setColumnLabels(i, l);
170
- const u = this.isConsistent(t, n), f = (C) => l.get(C) ?? O(C);
169
+ this.markMustBeConsumedAxes(t, n, l, m), this.setColumnLabels(l, n);
170
+ const d = this.isConsistent(t, s), f = (S) => n.get(S) ?? D(S);
171
171
  return {
172
- components: n,
172
+ components: s,
173
173
  getSourceInfo: f,
174
- fullOptionsSet: i,
174
+ fullOptionsSet: l,
175
175
  readyData: this.readyDataInputs(t),
176
- ready: this.readyForPlotBuilding(t, u, i, f),
177
- consistent: u
176
+ ready: this.readyForPlotBuilding(t, d, l, f),
177
+ consistent: d
178
178
  };
179
179
  }
180
- async getUniqueSourceValuesWithLabels(e, t, o, r, n, a) {
181
- var d;
182
- const m = (i) => i.sort((c, p) => c.label.localeCompare(p.label, "en", { numeric: !0 })), s = t.getSourceInfo(o), l = (d = s.annotations) == null ? void 0 : d[E];
180
+ async getUniqueSourceValuesWithLabels(e, t, o, r, s, a) {
181
+ const c = (n) => n.sort((l, m) => l.label.localeCompare(m.label, "en", { numeric: !0 })), u = t.getSourceInfo(o), i = I(u.spec, k.DiscreteValues);
183
182
  try {
184
- const i = l ? JSON.parse(l).map((c) => String(c)) : null;
185
- if (i) {
186
- const c = i.map((p) => ({ value: p, label: p }));
187
- return m(c), { values: c, overflow: !1 };
183
+ const n = i ? JSON.parse(i).map((l) => String(l)) : null;
184
+ if (n) {
185
+ const l = n.map((m) => ({ value: m, label: m }));
186
+ return c(l), { values: l, overflow: !1 };
188
187
  }
189
188
  } catch {
190
- console.error(`Parsing error: discrete values annotation ${l} in ${o}`);
189
+ console.error(`Parsing error: discrete values annotation ${i} in ${o}`);
191
190
  }
192
- if (s.kind === "axis") {
193
- const i = A(o), c = s.parentSources.map(A), p = await F(e, o, s.parentSources);
194
- let u = [];
195
- if (p) {
196
- n && (u = [{
191
+ if (u.kind === "axis") {
192
+ const n = A(o), l = u.parentSources.map(A), m = await j(e, o, u.parentSources);
193
+ let p = [];
194
+ if (m) {
195
+ s && (p = [{
197
196
  type: "bySingleColumnV2",
198
197
  column: {
199
198
  type: "column",
200
- id: p.name
199
+ id: m.name
201
200
  },
202
201
  predicate: {
203
202
  operator: "StringIContains",
204
- substring: n
203
+ substring: s
205
204
  }
206
- }]), a && (u = [{
205
+ }]), a && (p = [{
207
206
  type: "bySingleColumnV2",
208
207
  column: {
209
208
  type: "axis",
210
- id: i.toPFrameId()
209
+ id: n.toPFrameId()
211
210
  },
212
211
  predicate: {
213
212
  operator: "StringIContains",
214
213
  substring: a
215
214
  }
216
215
  }]);
217
- const { data: S, axesData: g } = await e.pFrameProvider.getSingleColumnData(p, u), v = g[i.toCanonicalString()], I = [];
218
- for (let b = 0; b < Math.min(v.length, r ?? v.length); b++)
219
- I.push({ value: String(v[b]), label: String(S[b]) });
220
- return m(I), { values: I, overflow: !(r === void 0 || v.length < r) };
216
+ const { data: h, axesData: y } = await e.pFrameProvider.getSingleColumnData(m, p), C = y[n.toCanonicalString()], x = [];
217
+ for (let v = 0; v < Math.min(C.length, r ?? C.length); v++)
218
+ x.push({ value: String(C[v]), label: String(h[v]) });
219
+ return c(x), { values: x, overflow: !(r === void 0 || C.length < r) };
221
220
  }
222
- const f = n ?? a;
223
- f && (u = [{
221
+ const d = s ?? a;
222
+ d && (p = [{
224
223
  type: "bySingleColumnV2",
225
224
  column: {
226
225
  type: "axis",
227
- id: i.toPFrameId()
226
+ id: n.toPFrameId()
228
227
  },
229
228
  predicate: {
230
229
  operator: "StringIContains",
231
- substring: f
230
+ substring: d
232
231
  }
233
232
  }]);
234
- const C = await e.pFrameProvider.getAxisUniqueValues(i, [c[0]], r, u), y = C.values.map((S) => ({ value: String(S), label: String(S) }));
235
- return m(y), { values: y, overflow: C.overflow };
233
+ const f = await e.pFrameProvider.getAxisUniqueValues(n, [l[0]], r, p), S = f.values.map((h) => ({ value: String(h), label: String(h) }));
234
+ return c(S), { values: S, overflow: f.overflow };
236
235
  }
237
- if (s.kind === "column") {
238
- const i = n ?? a, c = A(o), p = i ? [{
236
+ if (u.kind === "column") {
237
+ const n = s ?? a, l = A(o), m = n ? [{
239
238
  type: "bySingleColumnV2",
240
239
  column: {
241
240
  type: "column",
242
- id: c.name
241
+ id: l.name
243
242
  },
244
243
  predicate: {
245
244
  operator: "StringIContains",
246
- substring: i
245
+ substring: n
247
246
  }
248
- }] : [], u = await e.pFrameProvider.getColumnUniqueValues(c, r, p), f = u.values.map((C) => ({ value: String(C), label: String(C) }));
249
- return m(f), { values: f, overflow: u.overflow };
247
+ }] : [], p = await e.pFrameProvider.getColumnUniqueValues(l, r, m), d = p.values.map((f) => ({ value: String(f), label: String(f) }));
248
+ return c(d), { values: d, overflow: p.overflow };
250
249
  }
251
250
  return { values: [], overflow: !1 };
252
251
  }
253
252
  checkStateConsistency(e, t) {
254
253
  const o = /* @__PURE__ */ new Map(), r = { ...this.simpleComponentControllers, ...this.filterComponentControllers };
255
- for (const n of Object.keys(r))
254
+ for (const s of Object.keys(r))
256
255
  o.set(
257
- n,
258
- r[n].checkStateConsistency(e, t[n].options)
256
+ s,
257
+ r[s].checkStateConsistency(e, t[s].options)
259
258
  );
260
259
  return o;
261
260
  }
262
261
  isConsistent(e, t) {
263
262
  const o = this.checkStateConsistency(e, t);
264
263
  for (const r of o.values())
265
- if (Object.values(r).some((n) => !n))
264
+ if (Object.values(r).some((s) => !s))
266
265
  return !1;
267
266
  return !0;
268
267
  }
@@ -272,18 +271,18 @@ class W {
272
271
  readyForPlotBuilding(e, t, o, r) {
273
272
  if (!t || !this.readyDataInputs(e))
274
273
  return !1;
275
- let n = !1;
276
- for (const d of o) {
277
- const m = r(d);
278
- if (m && m.kind === "axis" && m.mustBeConsumed) {
279
- n = !0;
274
+ let s = !1;
275
+ for (const c of o) {
276
+ const u = r(c);
277
+ if (u && u.kind === "axis" && u.mustBeConsumed) {
278
+ s = !0;
280
279
  break;
281
280
  }
282
281
  }
283
282
  const a = [];
284
- for (const d of Object.keys(this.simpleComponentControllers))
285
- this.simpleComponentControllers[d].isRequired && a.push(d);
286
- return a.every((d) => e.components[d].selectorStates.length > 0) && !n;
283
+ for (const c of Object.keys(this.simpleComponentControllers))
284
+ this.simpleComponentControllers[c].isRequired && a.push(c);
285
+ return a.every((c) => e.components[c].selectorStates.length > 0) && !s;
287
286
  }
288
287
  async createDataForPlot(e, t) {
289
288
  return {
@@ -293,6 +292,6 @@ class W {
293
292
  }
294
293
  }
295
294
  export {
296
- W as ControllerBase
295
+ z as ControllerBase
297
296
  };
298
297
  //# sourceMappingURL=ControllerBase.js.map