@milaboratories/graph-maker 1.1.139 → 1.1.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GraphMaker/components/Chart.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/Chart.vue.js +1 -0
- package/dist/GraphMaker/components/Chart.vue.js.map +1 -1
- package/dist/GraphMaker/dataBindAes.d.ts +5 -5
- package/dist/GraphMaker/dataBindAes.d.ts.map +1 -1
- package/dist/GraphMaker/dataBindAes.js +52 -49
- package/dist/GraphMaker/dataBindAes.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +14 -14
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.d.ts.map +1 -1
- package/dist/GraphMaker/index.vue.js +115 -113
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/store.js +9 -9
- package/dist/GraphMaker/types.d.ts +1 -1
- package/dist/GraphMaker/types.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeBubbleSettings.d.ts +3 -3
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts +4 -8
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeChartSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDendroSettings.d.ts +2 -2
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts +5 -5
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHeatmapSettings.d.ts +7 -7
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts +9 -9
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeHistogramSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts +20 -16
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +65 -69
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts +20 -16
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js +20 -19
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotUmapSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +4 -3
- package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +57 -54
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -5
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/lib.js +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js +5 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/AbstractChart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js +8 -5
- package/dist/node_modules/@milaboratories/miplots4/dist/MiPlots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js +22 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/bubble/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js +4 -22
- package/dist/node_modules/@milaboratories/miplots4/dist/common/Error.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js +53 -53
- package/dist/node_modules/@milaboratories/miplots4/dist/dendro/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/ChartRenderer.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js +45 -45
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js +71 -70
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js +117 -112
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/components/ChartsGroup.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js +6 -6
- package/dist/node_modules/@milaboratories/miplots4/dist/heatmap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js +36 -36
- package/dist/node_modules/@milaboratories/miplots4/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js +24 -24
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js +23 -26
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/dots.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js +13 -10
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/getLayersData.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js +67 -73
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +44 -39
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js +18 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/sortDotsByGrouping.js.map +1 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js +14 -14
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/SettingsImpl.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js +68 -64
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot-umap.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js +23 -17
- package/dist/node_modules/@milaboratories/miplots4/dist/types/scatterplot.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js +7 -0
- package/dist/node_modules/@milaboratories/miplots4/dist/utils/arraysAreDifferent.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/_commonjsHelpers.js +9 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/canonicalize.js +8 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/canonicalize.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/lodash.js +8 -0
- package/dist/{_virtual → node_modules/@milaboratories/pf-plots/dist/_virtual}/lodash.js.map +1 -1
- package/dist/{_virtual/lodash.js → node_modules/@milaboratories/pf-plots/dist/_virtual/lodash2.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/lodash2.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/stringify.js +3 -0
- package/dist/{_virtual → node_modules/@milaboratories/pf-plots/dist/_virtual}/stringify.js.map +1 -1
- package/dist/{_virtual/stringify.js → node_modules/@milaboratories/pf-plots/dist/_virtual/stringify2.js} +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/_virtual/stringify2.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js +15 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/constants.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js +198 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ComponentController.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js +342 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/ControllerBase.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js +278 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/bubble.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js +453 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/dendro.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js +203 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/discrete.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js +432 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/heatmap.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js +170 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/histogram.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js +315 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot-umap.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js +323 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/controllers/controllersByChartType/scatterplot.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/demoStore.js +11 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/demoStore.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js +36 -3420
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/{pl-error-like → pf-plots/dist/node_modules/@milaboratories/pl-error-like}/dist/index.js +1 -1
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +979 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js +1599 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/@platforma-sdk/model/dist/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/canonicalize/lib/canonicalize.js +19 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/canonicalize/lib/canonicalize.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/json-stringify-safe/stringify.js +26 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/json-stringify-safe/stringify.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/lodash/lodash.js +3678 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/lodash/lodash.js.map +1 -0
- package/dist/node_modules/{zod → @milaboratories/pf-plots/dist/node_modules/zod}/lib/index.js +1141 -1141
- package/dist/node_modules/@milaboratories/pf-plots/dist/node_modules/zod/lib/index.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js +247 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/pframe/ColumnsProvider.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js +62 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/spec.js.map +1 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js +286 -0
- package/dist/node_modules/@milaboratories/pf-plots/dist/utils.js.map +1 -0
- package/package.json +3 -3
- package/dist/node_modules/@milaboratories/pl-error-like/dist/index.js.map +0 -1
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +0 -584
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +0 -1
- package/dist/node_modules/@platforma-sdk/model/dist/index.js +0 -1559
- package/dist/node_modules/@platforma-sdk/model/dist/index.js.map +0 -1
- package/dist/node_modules/json-stringify-safe/stringify.js +0 -20
- package/dist/node_modules/json-stringify-safe/stringify.js.map +0 -1
- package/dist/node_modules/lodash/lodash.js +0 -3678
- package/dist/node_modules/lodash/lodash.js.map +0 -1
- package/dist/node_modules/zod/lib/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/heatmap.ts"],"sourcesContent":["import {AxisSpec, PColumnSpec} from '@milaboratories/pl-model-common';\nimport canonicalize from 'canonicalize';\nimport type {ComponentStateFilter, ComponentStateSimple, DataByColumns, InputStateParent} from '../../common';\nimport {FORMAT} from '../../constants';\nimport {PValue} from '../../store';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore} from '../../store';\nimport {\n checkSourceBySpecForFilters, createLinkerMap, getAxesSpecsFromSources,\n getColumnOrAxisLabel, getColumnOrAxisSpec,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates, getLinkerColumnsForSource,\n} from '../../utils';\nimport {AxisId, ColumnId} from '../../spec';\nimport type {ColumnsProvider} from '../../pframe/ColumnsProvider';\n\nexport interface HeatmapUIState extends InputStateParent<'heatmap'> {\n type: 'heatmap';\n components: {\n value: ComponentStateSimple;\n x: ComponentStateSimple;\n y: ComponentStateSimple;\n xGroupBy: ComponentStateSimple;\n yGroupBy: ComponentStateSimple;\n filters: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n annotationsX: ComponentStateSimple;\n annotationsY: ComponentStateSimple;\n tooltipContent: ComponentStateSimple;\n };\n}\n\nexport const InitialHeatmapState: HeatmapUIState = {\n type: 'heatmap',\n components: {\n value: {type: 'simple', selectorStates: []},\n x: {type: 'simple', selectorStates: []},\n y: {type: 'simple', selectorStates: []},\n xGroupBy: {type: 'simple', selectorStates: []},\n yGroupBy: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n annotationsX: {type: 'simple', selectorStates: []},\n annotationsY: {type: 'simple', selectorStates: []},\n tooltipContent: {type: 'simple', selectorStates: []},\n },\n dividedAxes: {},\n};\n\nfunction isDiscreteData(spec: PColumnSpec | AxisSpec | null) {\n if (!spec) {\n return true;\n }\n if ('kind' in spec && spec.kind === 'PColumn') {\n return spec.valueType === 'String';\n }\n return (spec as AxisSpec).type === 'String';\n}\n\nfunction getMultiSourceColumn(\n data: Awaited<ReturnType<ColumnsProvider['getTableOuterJoin']>>,\n selectedSources: string[]\n) {\n if (!selectedSources.length) {\n return [];\n }\n const selectedIds = selectedSources.map(str => columnOrAxisIdFromString(str));\n const n = Object.values(data.columnsData)[0].length;\n const result: string[] = [];\n for (let i = 0; i < n; i++) {\n const value = selectedIds\n .map(id => {\n const key = id.toCanonicalString();\n return isColumnId(id) ? data.columnsData[key][i] : data.axesData[key][i];\n })\n .join(', ');\n result.push(value);\n }\n return result;\n}\n\nexport class HeatmapStateController extends ControllerBase<HeatmapUIState> {\n dataInputs = ['value'];\n dontAllowUnfilteredHighCardinality = true;\n\n constructor() {\n super(\n {\n value: new ComponentController<HeatmapUIState, 'value'>({\n componentName: 'value',\n allowedTypes: ['Int', 'Long', 'Double', 'Float', 'String'],\n settings: {\n isDataComponent: true,\n columnsAllowed: true,\n axesAllowed: false,\n required: true,\n },\n }),\n x: new ComponentController<HeatmapUIState, 'x'>({\n componentName: 'x',\n allowedTypes: ['Int', 'String', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n settings: {\n required: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: false,\n },\n }),\n xGroupBy: new ComponentController<HeatmapUIState, 'xGroupBy'>({\n componentName: 'xGroupBy',\n allowedTypes: ['Int', 'String', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n dependsOn: ['x'],\n checkSourceBySpec: (spec, state) => {\n const allowedAxes = new Set([\n ...state.components.x.selectorStates.map(s => s.selectedSource),\n ...state.components.xGroupBy.selectorStates.map(s => s.selectedSource),\n ]);\n\n if ('kind' in spec && spec.kind === 'PColumn') {\n return AxisId.fromAxesSpec(spec.axesSpec).every(id =>\n allowedAxes.has(id.toCanonicalString())\n );\n }\n return true;\n },\n }),\n y: new ComponentController<HeatmapUIState, 'y'>({\n componentName: 'y',\n allowedTypes: ['Int', 'String', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n settings: {\n required: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n }),\n yGroupBy: new ComponentController<HeatmapUIState, 'yGroupBy'>({\n componentName: 'yGroupBy',\n allowedTypes: ['Int', 'String', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n settings: {\n dimensionConsumer: true,\n multipleSelectors: true,\n axesAllowed: true,\n columnsAllowed: true,\n },\n dependsOn: ['y'],\n checkSourceBySpec: (spec, state) => {\n const allowedAxes = new Set([\n ...state.components.y.selectorStates.map(s => s.selectedSource),\n ...state.components.yGroupBy.selectorStates.map(s => s.selectedSource),\n ]);\n\n if ('kind' in spec && spec.kind === 'PColumn') {\n return AxisId.fromAxesSpec(spec.axesSpec).every(id =>\n allowedAxes.has(id.toCanonicalString())\n );\n }\n return true;\n },\n }),\n tooltipContent: new ComponentController<HeatmapUIState, 'tooltipContent'>({\n componentName: 'tooltipContent',\n allowedTypes: ['String', 'Int', 'Long', 'Float', 'Double'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n multipleSelectors: true,\n },\n }),\n facetBy: new ComponentController<HeatmapUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n }),\n annotationsX: new ComponentController<HeatmapUIState, 'annotationsX'>({\n componentName: 'annotationsX',\n allowedTypes: ['Int', 'Long', 'Double', 'Float', 'String'],\n parentComponents: ['value'],\n settings: {\n axesAllowed: true,\n multipleSelectors: true,\n },\n dependsOn: ['x'],\n checkSourceBySpec: (spec, state) => {\n const allowedAxes = new Set([\n ...state.components.x.selectorStates.map(s => s.selectedSource),\n ...state.components.xGroupBy.selectorStates.map(s => s.selectedSource),\n ]);\n\n if ('kind' in spec && spec.kind === 'PColumn') {\n return AxisId.fromAxesSpec(spec.axesSpec).every(id =>\n allowedAxes.has(id.toCanonicalString())\n );\n }\n return allowedAxes.has(AxisId.fromAxisSpec(spec as AxisSpec).toCanonicalString());\n },\n }),\n annotationsY: new ComponentController<HeatmapUIState, 'annotationsY'>({\n componentName: 'annotationsY',\n allowedTypes: ['Int', 'Long', 'Double', 'Float', 'String'],\n parentComponents: ['value'],\n settings: {\n axesAllowed: true,\n multipleSelectors: true,\n },\n dependsOn: ['y'],\n checkSourceBySpec: (spec, state) => {\n const allowedAxes = new Set([\n ...state.components.y.selectorStates.map(s => s.selectedSource),\n ...state.components.yGroupBy.selectorStates.map(s => s.selectedSource),\n ]);\n\n if ('kind' in spec && spec.kind === 'PColumn') {\n return AxisId.fromAxesSpec(spec.axesSpec).every(id =>\n allowedAxes.has(id.toCanonicalString())\n );\n }\n return allowedAxes.has(AxisId.fromAxisSpec(spec as AxisSpec).toCanonicalString());\n },\n }),\n },\n {\n filters: new ComponentController<HeatmapUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Long'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters,\n }),\n tabBy: new ComponentController<HeatmapUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int'],\n strictlyDependsOnParents: true,\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n dimensionConsumer: true,\n },\n }),\n }\n );\n }\n\n async getMustBeConsumedAxes(store: DataStore, state: HeatmapUIState): Promise<Set<string>> {\n if (!state.components.value.selectorStates.length) {\n return new Set<string>();\n }\n const sourceId = state.components.value.selectorStates[0].selectedSource;\n const spec = await store.pFrameProvider.getColumnSpecById(columnOrAxisIdFromString(sourceId));\n if (!spec) {\n return new Set<string>();\n }\n return new Set(spec.axesSpec.map(s => AxisId.fromAxisSpec(s).toCanonicalString()));\n }\n\n async createDataByColumns(store: DataStore, state: HeatmapUIState): Promise<PlotDataAndSettings['data']> {\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n if (!valueColumnIdString) {\n throw Error('Value column is not valid');\n }\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n if (!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 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 = [valueColumnIdString];\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n const inputs = [\n state.components.facetBy,\n state.components.annotationsX,\n state.components.annotationsY,\n state.components.x,\n state.components.y,\n state.components.xGroupBy,\n state.components.yGroupBy,\n state.components.tooltipContent,\n ];\n const secondarySources: (ColumnId | AxisId)[] = []; // primary sources are the only value 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\n const data = await store.pFrameProvider.getTableOuterJoin(\n [valueColumnId, ...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) ? data.columnsData[key] : data.axesData[key];\n });\n dataByColumns.values[valueColumnId.toCanonicalString()] = data.columnsData[valueColumnId.toCanonicalString()];\n\n // x column should contain xGroup axes\n const xAxes = state.components.x.selectorStates\n .concat(state.components.xGroupBy.selectorStates)\n .map(state => state.selectedSource);\n const xKey = xAxes.join(', ');\n dataByColumns.values[xKey] = getMultiSourceColumn(data, xAxes);\n\n // if grouping is not empty x keys will include grouping keys, but grouping keys should be excluded from x labels\n const xVisibleAxes = state.components.x.selectorStates.map(state => state.selectedSource);\n const xAxesLabeled = await Promise.all(\n xVisibleAxes.map(\n async id => (await getColumnOrAxisValueLabelsId(store, id, parentSources))?.toCanonicalString() ?? id\n )\n );\n dataByColumns.values.xLabelsKey = getMultiSourceColumn(data, xAxesLabeled);\n\n // y column should contain yGroup axes\n const yAxes = state.components.y.selectorStates\n .concat(state.components.yGroupBy.selectorStates)\n .map(state => state.selectedSource);\n const yKey = yAxes.join(', ');\n dataByColumns.values[yKey] = getMultiSourceColumn(data, yAxes);\n\n // column for labels - without grouping data in labels\n const yVisibleAxes = state.components.y.selectorStates.map(state => state.selectedSource);\n const yAxesLabeled = await Promise.all(\n yVisibleAxes.map(\n async id => (await getColumnOrAxisValueLabelsId(store, id, parentSources))?.toCanonicalString() ?? id\n )\n );\n dataByColumns.values.yLabelsKey = getMultiSourceColumn(data, yAxesLabeled);\n\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: HeatmapUIState): Promise<Record<string, unknown>> {\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n if (!valueColumnIdString) {\n throw Error('Value column is not valid');\n }\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n if (!isColumnId(valueColumnId)) {\n throw Error('Value column is not valid');\n }\n\n const parentSources = [valueColumnIdString];\n const value = {\n type: 'column',\n value: valueColumnIdString,\n label: await getColumnOrAxisLabel(store, valueColumnIdString, []),\n };\n const xAxes = state.components.x.selectorStates\n .concat(state.components.xGroupBy.selectorStates)\n .map(({selectedSource}) => columnOrAxisIdFromString(selectedSource))\n .map(id => id.toCanonicalString());\n const xKey = xAxes.join(', ');\n\n const yAxes = state.components.y.selectorStates\n .concat(state.components.yGroupBy.selectorStates)\n .map(({selectedSource}) => columnOrAxisIdFromString(selectedSource))\n .map(id => id.toCanonicalString());\n const yKey = yAxes.join(', ');\n const facetBy = await Promise.all(\n state.components.facetBy.selectorStates.map(async selectorState => ({\n type: 'column',\n value:\n (\n await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, parentSources)\n )?.toCanonicalString() ?? selectorState.selectedSource,\n }))\n );\n const xGroupBy = await Promise.all(\n state.components.xGroupBy.selectorStates.map(async selectorState => ({\n type: 'column',\n label: await getColumnOrAxisLabel(store, selectorState.selectedSource, parentSources),\n value: selectorState.selectedSource,\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, parentSources))?.toCanonicalString() ??\n selectorState.selectedSource,\n }))\n );\n const yGroupBy = await Promise.all(\n state.components.yGroupBy.selectorStates.map(async selectorState => ({\n type: 'column',\n label: await getColumnOrAxisLabel(store, selectorState.selectedSource, parentSources),\n value: selectorState.selectedSource,\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, parentSources))?.toCanonicalString() ??\n selectorState.selectedSource,\n }))\n );\n const valueSpec = await store.pFrameProvider.getColumnSpecById(valueColumnId);\n const annotationsX = await Promise.all(\n state.components.annotationsX.selectorStates.map(async selectorState => {\n const idString = selectorState.selectedSource;\n const id = columnOrAxisIdFromString(idString);\n const spec: PColumnSpec | AxisSpec | null = isColumnId(id)\n ? await store.pFrameProvider.getColumnSpecById(id)\n : ((valueSpec?.axesSpec as AxisSpec[])?.find(\n (axisSpec: AxisSpec) => AxisId.fromAxisSpec(axisSpec).toCanonicalString() === idString\n ) ?? null);\n return {\n axis: 'x',\n valueColumn: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSources),\n },\n type: isDiscreteData(spec) ? 'discrete' : 'continuous',\n };\n })\n );\n const annotationsY = await Promise.all(\n state.components.annotationsY.selectorStates.map(async selectorState => {\n const idString = selectorState.selectedSource;\n const id = columnOrAxisIdFromString(idString);\n const spec: PColumnSpec | AxisSpec | null = isColumnId(id)\n ? await store.pFrameProvider.getColumnSpecById(id)\n : ((valueSpec?.axesSpec as AxisSpec[])?.find(\n (axisSpec: AxisSpec) => AxisId.fromAxisSpec(axisSpec).toCanonicalString() === idString\n ) ?? null);\n return {\n axis: 'y',\n valueColumn: {\n type: 'column',\n value: idString,\n label: await getColumnOrAxisLabel(store, idString, parentSources),\n },\n type: isDiscreteData(spec) ? 'discrete' : 'continuous',\n };\n })\n );\n\n const xAxisTitle = (\n await Promise.all(\n state.components.x.selectorStates.map(state =>\n getColumnOrAxisLabel(store, state.selectedSource, parentSources)\n )\n )\n ).join(', ');\n const yAxisTitle = (\n await Promise.all(\n state.components.y.selectorStates.map(state =>\n getColumnOrAxisLabel(store, state.selectedSource, parentSources)\n )\n )\n ).join(', ');\n\n const tooltipContent = await Promise.all(\n state.components.tooltipContent.selectorStates.map(async selectorState => {\n const source = selectorState.selectedSource;\n const spec = await getColumnOrAxisSpec(store, source, parentSources);\n return {\n type: 'column',\n label: (await getColumnOrAxisLabel(store, source, parentSources)) || source,\n value: source,\n valueLabels:\n (await getColumnOrAxisValueLabelsId(store, source, parentSources))?.toCanonicalString() ??\n source,\n format: spec?.annotations?.[FORMAT] ?? '.0%'\n };\n })\n );\n\n return {\n type: 'heatmap',\n valueColumn: value,\n valueType: isDiscreteData(valueSpec) ? 'discrete' : 'continuous',\n xColumn: {\n type: 'column',\n value: xKey,\n label: xAxisTitle,\n valueLabels: 'xLabelsKey',\n },\n yColumn: {\n type: 'column',\n value: yKey,\n label: yAxisTitle,\n valueLabels: 'yLabelsKey',\n },\n facetBy,\n xGroupBy,\n yGroupBy,\n annotations: [...annotationsX, ...annotationsY],\n tooltips: {\n show: true,\n content: tooltipContent,\n },\n };\n }\n}\n"],"names":["InitialHeatmapState","isDiscreteData","spec","getMultiSourceColumn","data","selectedSources","selectedIds","str","columnOrAxisIdFromString","n","result","i","value","id","key","isColumnId","HeatmapStateController","ControllerBase","ComponentController","state","allowedAxes","s","AxisId","checkSourceBySpecForFilters","__publicField","store","sourceId","valueColumnIdString","_a","valueColumnId","dataByColumns","canonicalize","linkerMap","createLinkerMap","filterSelectedStates","filters","getFiltersFromStates","filterColumns","parentSources","parentAxesList","getAxesSpecsFromSources","inputs","secondarySources","primarySourcesFixedAxes","secondarySourcesFixedAxes","linkerColumns","selectedSource","fixedAxes","getLinkerColumnsForSource","axisIdx","axisValue","input","labelsColumnId","getColumnOrAxisValueLabelsId","item","xAxes","xKey","xVisibleAxes","xAxesLabeled","yAxes","yKey","yVisibleAxes","yAxesLabeled","getColumnOrAxisLabel","facetBy","selectorState","xGroupBy","yGroupBy","valueSpec","annotationsX","idString","axisSpec","annotationsY","xAxisTitle","yAxisTitle","tooltipContent","source","getColumnOrAxisSpec","_b","FORMAT"],"mappings":";;;;;;;AAmCO,MAAMA,KAAsC;AAAA,EAC/C,MAAM;AAAA,EACN,YAAY;AAAA,IACR,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACxC,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,GAAG,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACpC,UAAU,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC3C,UAAU,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC3C,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,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D,EAAM,WAAW,eAAe,eAAe,IAAI,OAAM8C,MAAiB;;AACtE,cAAMW,IAASX,EAAc,gBACvB/D,IAAO,MAAM2E,EAAoBpD,GAAOmD,GAAQtC,CAAa;AAC5D,eAAA;AAAA,UACH,MAAM;AAAA,UACN,OAAQ,MAAMyB,EAAqBtC,GAAOmD,GAAQtC,CAAa,KAAMsC;AAAAA,UACrE,OAAOA;AAAAA,UACP,eACKhD,IAAA,MAAMyB,EAA6B5B,GAAOmD,GAAQtC,CAAa,MAA/D,OAAA,SAAAV,EAAmE,kBAAA,MACpEgD;AAAAA,UACJ,UAAQE,IAAA5E,KAAA,OAAA,SAAAA,EAAM,gBAAN,OAAA,SAAA4E,EAAoBC,CAAAA,MAAW;AAAA,QAAA;AAAA,MAE9C,CAAA;AAAA,IAAA;AAGE,WAAA;AAAA,MACH,MAAM;AAAA,MACN,aAAanE;AAAAA,MACb,WAAWX,EAAemE,CAAS,IAAI,aAAa;AAAA,MACpD,SAAS;AAAA,QACL,MAAM;AAAA,QACN,OAAOZ;AAAAA,QACP,OAAOiB;AAAAA,QACP,aAAa;AAAA,MAAA;AAAA,MAEjB,SAAS;AAAA,QACL,MAAM;AAAA,QACN,OAAOb;AAAAA,QACP,OAAOc;AAAAA,QACP,aAAa;AAAA,MAAA;AAAA,MAEjB,SAAAV;AAAAA,MACA,UAAAE;AAAAA,MACA,UAAAC;AAAAA,MACA,aAAa,CAAC,GAAGE,GAAc,GAAGG,CAAY;AAAA,MAC9C,UAAU;AAAA,QACN,MAAM;AAAA,QACN,SAASG;AAAAA,MAAA;AAAA,IAAA;AAAA,EAEjB;AAER;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import E from "../../_virtual/canonicalize.js";
|
|
2
|
+
import { ControllerBase as N } from "../ControllerBase.js";
|
|
3
|
+
import { ComponentController as d } from "../ComponentController.js";
|
|
4
|
+
import { columnOrAxisIdFromString as w, isColumnId as y } from "../../spec.js";
|
|
5
|
+
import { checkSourceBySpecForFilters as V, createLinkerMap as T, getFiltersFromStates as k, getAxesSpecsFromSources as P, getLinkerColumnsForSource as I, getColumnOrAxisValueLabelsId as b, getColumnOrAxisLabel as F } from "../../utils.js";
|
|
6
|
+
var H = Object.defineProperty, U = (l, e, t) => e in l ? H(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, j = (l, e, t) => U(l, e + "", t);
|
|
7
|
+
const $ = {
|
|
8
|
+
type: "histogram",
|
|
9
|
+
components: {
|
|
10
|
+
value: { type: "simple", selectorStates: [] },
|
|
11
|
+
grouping: { type: "simple", selectorStates: [] },
|
|
12
|
+
filters: { type: "filter", selectorStates: [] },
|
|
13
|
+
tabBy: { type: "filter", selectorStates: [] },
|
|
14
|
+
facetBy: { type: "simple", selectorStates: [] }
|
|
15
|
+
},
|
|
16
|
+
dividedAxes: {}
|
|
17
|
+
};
|
|
18
|
+
class G extends N {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(
|
|
21
|
+
{
|
|
22
|
+
value: new d({
|
|
23
|
+
componentName: "value",
|
|
24
|
+
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
25
|
+
settings: {
|
|
26
|
+
isDataComponent: !0,
|
|
27
|
+
columnsAllowed: !0,
|
|
28
|
+
axesAllowed: !1,
|
|
29
|
+
required: !0
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
32
|
+
grouping: new d({
|
|
33
|
+
componentName: "grouping",
|
|
34
|
+
allowedTypes: ["String", "Int", "Long"],
|
|
35
|
+
parentComponents: ["value"],
|
|
36
|
+
dependsOn: ["value"],
|
|
37
|
+
settings: {
|
|
38
|
+
axesAllowed: !0,
|
|
39
|
+
multipleSelectors: !1
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
facetBy: new d({
|
|
43
|
+
componentName: "facetBy",
|
|
44
|
+
allowedTypes: ["String", "Int", "Long"],
|
|
45
|
+
parentComponents: ["value"],
|
|
46
|
+
dependsOn: ["value"],
|
|
47
|
+
settings: {
|
|
48
|
+
axesAllowed: !0,
|
|
49
|
+
dimensionConsumer: !0,
|
|
50
|
+
multipleSelectors: !0
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
filters: new d({
|
|
56
|
+
componentName: "filters",
|
|
57
|
+
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
58
|
+
parentComponents: ["value"],
|
|
59
|
+
dependsOn: ["value"],
|
|
60
|
+
settings: {
|
|
61
|
+
columnsAllowed: !0,
|
|
62
|
+
axesAllowed: !0,
|
|
63
|
+
dimensionConsumer: !0,
|
|
64
|
+
multipleSelectors: !0
|
|
65
|
+
},
|
|
66
|
+
checkSourceBySpec: V
|
|
67
|
+
}),
|
|
68
|
+
tabBy: new d({
|
|
69
|
+
componentName: "tabBy",
|
|
70
|
+
allowedTypes: ["String", "Int"],
|
|
71
|
+
parentComponents: ["value"],
|
|
72
|
+
dependsOn: ["value"],
|
|
73
|
+
settings: {
|
|
74
|
+
columnsAllowed: !0,
|
|
75
|
+
axesAllowed: !0,
|
|
76
|
+
dimensionConsumer: !0
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
), j(this, "dataInputs", ["value"]);
|
|
81
|
+
}
|
|
82
|
+
async createDataByColumns(e, t) {
|
|
83
|
+
var i;
|
|
84
|
+
const r = (i = t.components.value.selectorStates[0]) == null ? void 0 : i.selectedSource;
|
|
85
|
+
if (!r)
|
|
86
|
+
throw Error("Value column is not valid");
|
|
87
|
+
const o = w(r);
|
|
88
|
+
if (!y(o))
|
|
89
|
+
throw Error("Value column is not valid");
|
|
90
|
+
const c = {
|
|
91
|
+
type: "columns",
|
|
92
|
+
id: E(t.components) ?? "",
|
|
93
|
+
values: {}
|
|
94
|
+
}, u = await T(e), m = [
|
|
95
|
+
...t.components.filters.selectorStates,
|
|
96
|
+
...t.components.tabBy.selectorStates
|
|
97
|
+
], x = k(m), g = m.map((s) => w(s.selectedSource)).filter(y), n = [r], p = await P(e, n), L = [t.components.facetBy, t.components.grouping], S = [], A = [[]], B = [], C = [];
|
|
98
|
+
for (const { selectedSource: s, fixedAxes: a } of m)
|
|
99
|
+
C.push(
|
|
100
|
+
...await I(e, u, p, s, a)
|
|
101
|
+
), A.push(
|
|
102
|
+
(a ?? []).map(({ axisIdx: v, axisValue: f }) => ({ idx: v, value: f }))
|
|
103
|
+
);
|
|
104
|
+
for (const s of L)
|
|
105
|
+
for (const { selectedSource: a, fixedAxes: v } of s.selectorStates) {
|
|
106
|
+
S.push(w(a)), B.push(
|
|
107
|
+
(v ?? []).map(({ axisIdx: O, axisValue: D }) => ({ idx: O, value: D }))
|
|
108
|
+
), C.push(
|
|
109
|
+
...await I(e, u, p, a, v)
|
|
110
|
+
);
|
|
111
|
+
const f = await b(e, a, n);
|
|
112
|
+
f && S.push(f);
|
|
113
|
+
}
|
|
114
|
+
const h = await e.pFrameProvider.getTableOuterJoin(
|
|
115
|
+
[o, ...C, ...g],
|
|
116
|
+
S,
|
|
117
|
+
x,
|
|
118
|
+
!0,
|
|
119
|
+
A,
|
|
120
|
+
B
|
|
121
|
+
);
|
|
122
|
+
return S.forEach((s) => {
|
|
123
|
+
const a = s.toCanonicalString();
|
|
124
|
+
c.values[a] = y(s) ? h.columnsData[a] : h.axesData[a];
|
|
125
|
+
}), c.values[o.toCanonicalString()] = h.columnsData[o.toCanonicalString()], { byColumns: c };
|
|
126
|
+
}
|
|
127
|
+
async createChartSettings(e, t) {
|
|
128
|
+
var i, r;
|
|
129
|
+
const o = (i = t.components.value.selectorStates[0]) == null ? void 0 : i.selectedSource;
|
|
130
|
+
if (!o)
|
|
131
|
+
throw Error("Value column is not valid");
|
|
132
|
+
const c = w(o);
|
|
133
|
+
if (!y(c))
|
|
134
|
+
throw Error("Value column is not valid");
|
|
135
|
+
const u = [o], m = {
|
|
136
|
+
type: "column",
|
|
137
|
+
value: o,
|
|
138
|
+
label: await F(e, o, [])
|
|
139
|
+
}, x = await Promise.all(
|
|
140
|
+
t.components.facetBy.selectorStates.map(async (n) => {
|
|
141
|
+
var p;
|
|
142
|
+
return {
|
|
143
|
+
type: "column",
|
|
144
|
+
value: ((p = await b(e, n.selectedSource, u)) == null ? void 0 : p.toCanonicalString()) ?? n.selectedSource
|
|
145
|
+
};
|
|
146
|
+
})
|
|
147
|
+
);
|
|
148
|
+
let g;
|
|
149
|
+
if (t.components.grouping.selectorStates.length) {
|
|
150
|
+
const { selectedSource: n } = t.components.grouping.selectorStates[0];
|
|
151
|
+
g = {
|
|
152
|
+
type: "column",
|
|
153
|
+
value: n,
|
|
154
|
+
label: await F(e, n, u),
|
|
155
|
+
valueLabels: (r = await b(e, n, u)) == null ? void 0 : r.toCanonicalString()
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
type: "histogram",
|
|
160
|
+
valueColumn: m,
|
|
161
|
+
facetBy: x,
|
|
162
|
+
grouping: g
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
export {
|
|
167
|
+
G as HistogramStateController,
|
|
168
|
+
$ as InitialHistogramState
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=histogram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"histogram.js","sources":["../../../../../../../node_modules/@milaboratories/pf-plots/src/controllers/controllersByChartType/histogram.ts"],"sourcesContent":["import canonicalize from 'canonicalize';\nimport type {ComponentStateFilter, ComponentStateSimple, DataByColumns, InputStateParent} from '../../common';\nimport {PValue} from '../../store';\nimport {ControllerBase, PlotDataAndSettings} from '../ControllerBase';\nimport {ComponentController} from '../ComponentController';\nimport {columnOrAxisIdFromString, isColumnId} from '../../spec';\nimport type {DataStore} from '../../store';\nimport {\n checkSourceBySpecForFilters,\n createLinkerMap,\n getAxesSpecsFromSources,\n getColumnOrAxisLabel,\n getColumnOrAxisValueLabelsId,\n getFiltersFromStates,\n getLinkerColumnsForSource,\n} from '../../utils';\nimport {AxisId, ColumnId} from '../../spec';\n\nexport interface HistogramUIState extends InputStateParent<'histogram'> {\n type: 'histogram';\n components: {\n value: ComponentStateSimple;\n grouping: ComponentStateSimple;\n filters: ComponentStateFilter;\n tabBy: ComponentStateFilter;\n facetBy: ComponentStateSimple;\n };\n}\n\nexport const InitialHistogramState: HistogramUIState = {\n type: 'histogram',\n components: {\n value: {type: 'simple', selectorStates: []},\n grouping: {type: 'simple', selectorStates: []},\n filters: {type: 'filter', selectorStates: []},\n tabBy: {type: 'filter', selectorStates: []},\n facetBy: {type: 'simple', selectorStates: []},\n },\n dividedAxes: {},\n};\n\nexport class HistogramStateController extends ControllerBase<HistogramUIState> {\n dataInputs = ['value'];\n\n constructor() {\n super(\n {\n value: new ComponentController<HistogramUIState, 'value'>({\n componentName: 'value',\n allowedTypes: ['Int', 'Long', 'Double', 'Float'],\n settings: {\n isDataComponent: true,\n columnsAllowed: true,\n axesAllowed: false,\n required: true,\n },\n }),\n grouping: new ComponentController<HistogramUIState, 'grouping'>({\n componentName: 'grouping',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n axesAllowed: true,\n multipleSelectors: false,\n },\n }),\n facetBy: new ComponentController<HistogramUIState, 'facetBy'>({\n componentName: 'facetBy',\n allowedTypes: ['String', 'Int', 'Long'],\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n }),\n },\n {\n filters: new ComponentController<HistogramUIState, 'filters'>({\n componentName: 'filters',\n allowedTypes: ['String', 'Int', 'Long', 'Double', 'Float'],\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n dimensionConsumer: true,\n multipleSelectors: true,\n },\n checkSourceBySpec: checkSourceBySpecForFilters,\n }),\n tabBy: new ComponentController<HistogramUIState, 'tabBy'>({\n componentName: 'tabBy',\n allowedTypes: ['String', 'Int'],\n parentComponents: ['value'],\n dependsOn: ['value'],\n settings: {\n columnsAllowed: true,\n axesAllowed: true,\n dimensionConsumer: true,\n },\n }),\n }\n );\n }\n\n async createDataByColumns(store: DataStore, state: HistogramUIState): Promise<PlotDataAndSettings['data']> {\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n if (!valueColumnIdString) {\n throw Error('Value column is not valid');\n }\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n if (!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 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\n .map(s => columnOrAxisIdFromString(s.selectedSource))\n .filter(isColumnId);\n\n const parentSources = [valueColumnIdString];\n const parentAxesList = await getAxesSpecsFromSources(store, parentSources);\n\n const inputs = [state.components.facetBy, state.components.grouping];\n const secondarySources: (ColumnId | AxisId)[] = []; // primary sources are the only value 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(\n ...(await getLinkerColumnsForSource(store, linkerMap, parentAxesList, selectedSource, 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(\n ...(await getLinkerColumnsForSource(store, linkerMap, parentAxesList, selectedSource, fixedAxes))\n );\n const labelsColumnId = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n if (labelsColumnId) {\n secondarySources.push(labelsColumnId);\n }\n }\n }\n\n const data = await store.pFrameProvider.getTableOuterJoin(\n [valueColumnId, ...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) ? data.columnsData[key] : data.axesData[key];\n });\n dataByColumns.values[valueColumnId.toCanonicalString()] = data.columnsData[valueColumnId.toCanonicalString()];\n\n return {byColumns: dataByColumns};\n }\n\n async createChartSettings(store: DataStore, state: HistogramUIState): Promise<Record<string, unknown>> {\n const valueColumnIdString = state.components.value.selectorStates[0]?.selectedSource;\n if (!valueColumnIdString) {\n throw Error('Value column is not valid');\n }\n const valueColumnId = columnOrAxisIdFromString(valueColumnIdString);\n if (!isColumnId(valueColumnId)) {\n throw Error('Value column is not valid');\n }\n\n const parentSources = [valueColumnIdString];\n const value = {\n type: 'column',\n value: valueColumnIdString,\n label: await getColumnOrAxisLabel(store, valueColumnIdString, []),\n };\n const facetBy = await Promise.all(\n state.components.facetBy.selectorStates.map(async selectorState => ({\n type: 'column',\n value:\n (\n await getColumnOrAxisValueLabelsId(store, selectorState.selectedSource, parentSources)\n )?.toCanonicalString() ?? selectorState.selectedSource,\n }))\n );\n let grouping;\n if (state.components.grouping.selectorStates.length) {\n const {selectedSource} = state.components.grouping.selectorStates[0];\n grouping = {\n type: 'column',\n value: selectedSource,\n label: await getColumnOrAxisLabel(store, selectedSource, parentSources),\n valueLabels: (\n await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources)\n )?.toCanonicalString(),\n };\n }\n return {\n type: 'histogram',\n valueColumn: value,\n facetBy,\n grouping,\n };\n }\n}\n"],"names":["InitialHistogramState","HistogramStateController","ControllerBase","ComponentController","checkSourceBySpecForFilters","__publicField","store","state","valueColumnIdString","_a","valueColumnId","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","value","getColumnOrAxisLabel","facetBy","selectorState","grouping","_b"],"mappings":";;;;;;AA6BO,MAAMA,IAA0C;AAAA,EACnD,MAAM;AAAA,EACN,YAAY;AAAA,IACR,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACxC,UAAU,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC3C,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IAC1C,OAAO,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAA;AAAA,IACxC,SAAS,EAAC,MAAM,UAAU,gBAAgB,CAAA,EAAE;AAAA,EAAA;AAAA,EAEhD,aAAa,CAAA;AACjB;AAEO,MAAMC,UAAiCC,EAAiC;AAAA,EAG3E,cAAc;AACV;AAAA,MACI;AAAA,QACI,OAAO,IAAIC,EAA+C;AAAA,UACtD,eAAe;AAAA,UACf,cAAc,CAAC,OAAO,QAAQ,UAAU,OAAO;AAAA,UAC/C,UAAU;AAAA,YACN,iBAAiB;AAAA,YACjB,gBAAgB;AAAA,YAChB,aAAa;AAAA,YACb,UAAU;AAAA,UAAA;AAAA,QAAA,CAEjB;AAAA,QACD,UAAU,IAAIA,EAAkD;AAAA,UAC5D,eAAe;AAAA,UACf,cAAc,CAAC,UAAU,OAAO,MAAM;AAAA,UACtC,kBAAkB,CAAC,OAAO;AAAA,UAC1B,WAAW,CAAC,OAAO;AAAA,UACnB,UAAU;AAAA,YACN,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AAAA,eAAA;AAAA,UAChE,MAAM;AAAA,UACN,SAEQnC,IAAA,MAAM4B,EAA6B/B,GAAOsC,EAAc,gBAAgBtB,CAAa,MAArF,OAAA,SAAAb,EACD,kBAAA,MAAuBmC,EAAc;AAAA,QAAA;AAAA,MAAA,CAC9C;AAAA,IAAA;AAEF,QAAAC;AACJ,QAAItC,EAAM,WAAW,SAAS,eAAe,QAAQ;AACjD,YAAM,EAAC,gBAAAuB,MAAkBvB,EAAM,WAAW,SAAS,eAAe,CAAC;AACxDsC,MAAAA,IAAA;AAAA,QACP,MAAM;AAAA,QACN,OAAOf;AAAAA,QACP,OAAO,MAAMY,EAAqBpC,GAAOwB,GAAgBR,CAAa;AAAA,QACtE,cACIwB,IAAA,MAAMT,EAA6B/B,GAAOwB,GAAgBR,CAAa,MAAvE,OAAA,SAAAwB,EACD,kBAAA;AAAA,MAAA;AAAA,IACP;AAEG,WAAA;AAAA,MACH,MAAM;AAAA,MACN,aAAaL;AAAAA,MACb,SAAAE;AAAAA,MACA,UAAAE;AAAAA,IAAA;AAAA,EACJ;AAER;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import M from "../../_virtual/canonicalize.js";
|
|
2
|
+
import V from "../../_virtual/lodash.js";
|
|
3
|
+
import { FORMAT as T } from "../../constants.js";
|
|
4
|
+
import { ControllerBase as X } from "../ControllerBase.js";
|
|
5
|
+
import { ComponentController as c } from "../ComponentController.js";
|
|
6
|
+
import { columnOrAxisIdFromString as S, AxisId as N, isColumnId as C } from "../../spec.js";
|
|
7
|
+
import { checkSourceBySpecForFilters as k, createLinkerMap as Y, getFiltersFromStates as j, getAxesSpecsFromSources as $, getLinkerColumnsForSource as E, getColumnOrAxisValueLabelsId as O, createHighlightColumn as H, getColumnOrAxisLabel as D, getColumnOrAxisSpec as z } from "../../utils.js";
|
|
8
|
+
var J = Object.defineProperty, Q = (h, t, e) => t in h ? J(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, R = (h, t, e) => Q(h, t + "", e);
|
|
9
|
+
const oe = {
|
|
10
|
+
type: "scatterplot-umap",
|
|
11
|
+
components: {
|
|
12
|
+
x: { type: "simple", selectorStates: [] },
|
|
13
|
+
y: { type: "simple", selectorStates: [] },
|
|
14
|
+
filters: { type: "filter", selectorStates: [] },
|
|
15
|
+
highlight: { type: "filter", selectorStates: [] },
|
|
16
|
+
tabBy: { type: "filter", selectorStates: [] },
|
|
17
|
+
facetBy: { type: "simple", selectorStates: [] },
|
|
18
|
+
grouping: { type: "simple", selectorStates: [] },
|
|
19
|
+
label: { type: "simple", selectorStates: [] },
|
|
20
|
+
tooltipContent: { type: "simple", selectorStates: [] },
|
|
21
|
+
size: { type: "simple", selectorStates: [] }
|
|
22
|
+
},
|
|
23
|
+
dividedAxes: {}
|
|
24
|
+
};
|
|
25
|
+
class ne extends X {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(
|
|
28
|
+
{
|
|
29
|
+
x: new c({
|
|
30
|
+
componentName: "x",
|
|
31
|
+
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
32
|
+
parentComponents: ["y"],
|
|
33
|
+
strictlyDependsOnParents: !1,
|
|
34
|
+
settings: {
|
|
35
|
+
isDataComponent: !0,
|
|
36
|
+
required: !0,
|
|
37
|
+
axesAllowed: !0,
|
|
38
|
+
columnsAllowed: !0
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
y: new c({
|
|
42
|
+
componentName: "y",
|
|
43
|
+
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
44
|
+
parentComponents: ["x"],
|
|
45
|
+
strictlyDependsOnParents: !1,
|
|
46
|
+
settings: {
|
|
47
|
+
isDataComponent: !0,
|
|
48
|
+
required: !0,
|
|
49
|
+
axesAllowed: !0,
|
|
50
|
+
columnsAllowed: !0
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
facetBy: new c({
|
|
54
|
+
componentName: "facetBy",
|
|
55
|
+
allowedTypes: ["String", "Int", "Long"],
|
|
56
|
+
strictlyDependsOnParents: !0,
|
|
57
|
+
parentComponents: ["x", "y"],
|
|
58
|
+
dependsOn: ["x", "y"],
|
|
59
|
+
settings: {
|
|
60
|
+
axesAllowed: !0,
|
|
61
|
+
dimensionConsumer: !0,
|
|
62
|
+
multipleSelectors: !0
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
grouping: new c({
|
|
66
|
+
componentName: "grouping",
|
|
67
|
+
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
68
|
+
strictlyDependsOnParents: !0,
|
|
69
|
+
parentComponents: ["x", "y"],
|
|
70
|
+
dependsOn: ["x", "y"],
|
|
71
|
+
settings: {
|
|
72
|
+
axesAllowed: !0,
|
|
73
|
+
multipleSelectors: !0
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
tooltipContent: new c({
|
|
77
|
+
componentName: "tooltipContent",
|
|
78
|
+
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
79
|
+
strictlyDependsOnParents: !0,
|
|
80
|
+
parentComponents: ["x", "y"],
|
|
81
|
+
dependsOn: ["x", "y"],
|
|
82
|
+
settings: {
|
|
83
|
+
columnsAllowed: !0,
|
|
84
|
+
axesAllowed: !0,
|
|
85
|
+
multipleSelectors: !0
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
label: new c({
|
|
89
|
+
componentName: "label",
|
|
90
|
+
allowedTypes: ["String", "Int", "Long"],
|
|
91
|
+
strictlyDependsOnParents: !0,
|
|
92
|
+
parentComponents: ["x", "y"],
|
|
93
|
+
dependsOn: ["x", "y"],
|
|
94
|
+
settings: {
|
|
95
|
+
axesAllowed: !0,
|
|
96
|
+
columnsAllowed: !0,
|
|
97
|
+
multipleSelectors: !1
|
|
98
|
+
}
|
|
99
|
+
}),
|
|
100
|
+
size: new c({
|
|
101
|
+
componentName: "size",
|
|
102
|
+
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
103
|
+
strictlyDependsOnParents: !0,
|
|
104
|
+
parentComponents: ["x", "y"],
|
|
105
|
+
dependsOn: ["x", "y"],
|
|
106
|
+
settings: {
|
|
107
|
+
axesAllowed: !0
|
|
108
|
+
}
|
|
109
|
+
})
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
filters: new c({
|
|
113
|
+
componentName: "filters",
|
|
114
|
+
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
115
|
+
strictlyDependsOnParents: !0,
|
|
116
|
+
parentComponents: ["x", "y"],
|
|
117
|
+
dependsOn: ["x", "y"],
|
|
118
|
+
settings: {
|
|
119
|
+
axesAllowed: !0,
|
|
120
|
+
dimensionConsumer: !0,
|
|
121
|
+
multipleSelectors: !0
|
|
122
|
+
},
|
|
123
|
+
checkSourceBySpec: k
|
|
124
|
+
}),
|
|
125
|
+
tabBy: new c({
|
|
126
|
+
componentName: "tabBy",
|
|
127
|
+
allowedTypes: ["String", "Int"],
|
|
128
|
+
strictlyDependsOnParents: !0,
|
|
129
|
+
parentComponents: ["x", "y"],
|
|
130
|
+
dependsOn: ["x", "y"],
|
|
131
|
+
settings: {
|
|
132
|
+
axesAllowed: !0,
|
|
133
|
+
dimensionConsumer: !0
|
|
134
|
+
}
|
|
135
|
+
}),
|
|
136
|
+
highlight: new c({
|
|
137
|
+
componentName: "highlight",
|
|
138
|
+
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
139
|
+
strictlyDependsOnParents: !0,
|
|
140
|
+
parentComponents: ["x", "y"],
|
|
141
|
+
dependsOn: ["x", "y"],
|
|
142
|
+
settings: {
|
|
143
|
+
axesAllowed: !0,
|
|
144
|
+
columnsAllowed: !0,
|
|
145
|
+
multipleSelectors: !0
|
|
146
|
+
},
|
|
147
|
+
checkSourceBySpec: k
|
|
148
|
+
})
|
|
149
|
+
}
|
|
150
|
+
), R(this, "dataInputs", ["x", "y"]);
|
|
151
|
+
}
|
|
152
|
+
async getMustBeConsumedAxes(t, e) {
|
|
153
|
+
if (!e.components.x.selectorStates.length || !e.components.y.selectorStates.length)
|
|
154
|
+
return /* @__PURE__ */ new Set();
|
|
155
|
+
const y = e.components.x.selectorStates[0].selectedSource, g = e.components.y.selectorStates[0].selectedSource, u = await t.pFrameProvider.getColumnSpecById(S(y)), m = await t.pFrameProvider.getColumnSpecById(S(g));
|
|
156
|
+
if (!u || !m)
|
|
157
|
+
return /* @__PURE__ */ new Set();
|
|
158
|
+
const a = u.axesSpec.map((n) => N.fromAxisSpec(n).toCanonicalString()), r = m.axesSpec.map((n) => N.fromAxisSpec(n).toCanonicalString()), p = a.filter((n) => !r.some((w) => w === n)), d = r.filter((n) => !a.some((w) => w === n));
|
|
159
|
+
return /* @__PURE__ */ new Set([...p, ...d]);
|
|
160
|
+
}
|
|
161
|
+
async createDataByColumns(t, e) {
|
|
162
|
+
var y, g;
|
|
163
|
+
const u = (y = e.components.x.selectorStates[0]) == null ? void 0 : y.selectedSource, m = (g = e.components.y.selectorStates[0]) == null ? void 0 : g.selectedSource;
|
|
164
|
+
if (!u || !m)
|
|
165
|
+
throw Error("X or Y column is not valid");
|
|
166
|
+
const a = S(u), r = S(m);
|
|
167
|
+
if (!a || !r)
|
|
168
|
+
throw Error("X or Y column is not valid");
|
|
169
|
+
const p = {
|
|
170
|
+
type: "columns",
|
|
171
|
+
id: M(e.components) ?? "",
|
|
172
|
+
values: {}
|
|
173
|
+
}, d = await Y(t), n = [
|
|
174
|
+
...e.components.filters.selectorStates,
|
|
175
|
+
...e.components.tabBy.selectorStates
|
|
176
|
+
], w = j(n), I = n.map((i) => S(i.selectedSource)).filter(C), b = [a, r].filter(C).map((i) => i.toCanonicalString());
|
|
177
|
+
if (b.length === 0)
|
|
178
|
+
throw Error("One of X and Y should be a column");
|
|
179
|
+
const B = await $(t, b), P = [a, r, ...I], f = [], F = [[], []], A = [], v = [];
|
|
180
|
+
for (const { selectedSource: i, fixedAxes: s } of n)
|
|
181
|
+
v.push(...await E(
|
|
182
|
+
t,
|
|
183
|
+
d,
|
|
184
|
+
B,
|
|
185
|
+
i,
|
|
186
|
+
s
|
|
187
|
+
)), F.push(
|
|
188
|
+
(s ?? []).map(({ axisIdx: x, axisValue: L }) => ({ idx: x, value: L }))
|
|
189
|
+
);
|
|
190
|
+
const o = [
|
|
191
|
+
e.components.grouping,
|
|
192
|
+
e.components.facetBy,
|
|
193
|
+
e.components.tooltipContent,
|
|
194
|
+
e.components.label,
|
|
195
|
+
e.components.highlight,
|
|
196
|
+
e.components.size
|
|
197
|
+
];
|
|
198
|
+
for (const i of o)
|
|
199
|
+
for (const { selectedSource: s, fixedAxes: x } of i.selectorStates) {
|
|
200
|
+
f.push(S(s)), A.push(
|
|
201
|
+
(x ?? []).map(({ axisIdx: q, axisValue: U }) => ({ idx: q, value: U }))
|
|
202
|
+
), v.push(...await E(
|
|
203
|
+
t,
|
|
204
|
+
d,
|
|
205
|
+
B,
|
|
206
|
+
s,
|
|
207
|
+
x
|
|
208
|
+
));
|
|
209
|
+
const L = await O(t, s, b);
|
|
210
|
+
L && f.push(L);
|
|
211
|
+
}
|
|
212
|
+
const l = await t.pFrameProvider.getTableOuterJoin(
|
|
213
|
+
[a, r, ...v, ...I],
|
|
214
|
+
f,
|
|
215
|
+
w,
|
|
216
|
+
!1,
|
|
217
|
+
F,
|
|
218
|
+
A
|
|
219
|
+
);
|
|
220
|
+
return [...P, ...f].forEach((i) => {
|
|
221
|
+
const s = i.toCanonicalString();
|
|
222
|
+
p.values[s] = C(i) ? l.columnsData[s] : l.axesData[s];
|
|
223
|
+
}), e.components.highlight.selectorStates.length && (p.values.highlight = H(e.components.highlight.selectorStates, l)), {
|
|
224
|
+
byColumns: p,
|
|
225
|
+
axesData: l.axesData
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
async createChartSettings(t, e) {
|
|
229
|
+
var y, g, u, m;
|
|
230
|
+
const a = (y = e.components.x.selectorStates[0]) == null ? void 0 : y.selectedSource, r = (g = e.components.y.selectorStates[0]) == null ? void 0 : g.selectedSource, p = a ? S(a) : null, d = r ? S(r) : null;
|
|
231
|
+
if (!a || !r || !p || !d || !C(p) && !C(d))
|
|
232
|
+
throw Error("Empty or invalid required data");
|
|
233
|
+
const n = [p, d].filter(C).map((o) => o.toCanonicalString()), w = {
|
|
234
|
+
type: "column",
|
|
235
|
+
value: a,
|
|
236
|
+
label: await D(t, a, n)
|
|
237
|
+
}, I = {
|
|
238
|
+
type: "column",
|
|
239
|
+
value: r,
|
|
240
|
+
label: await D(t, r, n)
|
|
241
|
+
}, b = {
|
|
242
|
+
type: "column",
|
|
243
|
+
value: "key"
|
|
244
|
+
}, B = await Promise.all(
|
|
245
|
+
e.components.facetBy.selectorStates.map(async (o) => {
|
|
246
|
+
var l;
|
|
247
|
+
return {
|
|
248
|
+
type: "column",
|
|
249
|
+
value: ((l = await O(t, o.selectedSource, n)) == null ? void 0 : l.toCanonicalString()) ?? o.selectedSource
|
|
250
|
+
};
|
|
251
|
+
})
|
|
252
|
+
), P = V.uniq([
|
|
253
|
+
...e.components.grouping.selectorStates.map((o) => o.selectedSource),
|
|
254
|
+
...e.components.size.selectorStates.map((o) => o.selectedSource)
|
|
255
|
+
]), f = await Promise.all(
|
|
256
|
+
P.map(async (o) => {
|
|
257
|
+
var l;
|
|
258
|
+
return {
|
|
259
|
+
columnName: {
|
|
260
|
+
type: "column",
|
|
261
|
+
label: await D(t, o, n) || o,
|
|
262
|
+
value: o,
|
|
263
|
+
valueLabels: ((l = await O(t, o, n)) == null ? void 0 : l.toCanonicalString()) ?? o
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
})
|
|
267
|
+
), F = await Promise.all(
|
|
268
|
+
e.components.tooltipContent.selectorStates.map(async (o) => {
|
|
269
|
+
var l, i;
|
|
270
|
+
const s = o.selectedSource, x = await z(t, s, n);
|
|
271
|
+
return {
|
|
272
|
+
type: "column",
|
|
273
|
+
label: await D(t, s, n) || s,
|
|
274
|
+
value: s,
|
|
275
|
+
valueLabels: ((l = await O(t, s, n)) == null ? void 0 : l.toCanonicalString()) ?? s,
|
|
276
|
+
format: (i = x == null ? void 0 : x.annotations) == null ? void 0 : i[T]
|
|
277
|
+
};
|
|
278
|
+
})
|
|
279
|
+
);
|
|
280
|
+
let A;
|
|
281
|
+
if (e.components.label.selectorStates.length) {
|
|
282
|
+
const o = e.components.label.selectorStates[0].selectedSource, l = await z(t, o, n);
|
|
283
|
+
A = {
|
|
284
|
+
type: "column",
|
|
285
|
+
value: o,
|
|
286
|
+
label: await D(t, o, n),
|
|
287
|
+
valueLabels: ((u = await O(t, o, n)) == null ? void 0 : u.toCanonicalString()) ?? o,
|
|
288
|
+
format: (m = l == null ? void 0 : l.annotations) == null ? void 0 : m[T]
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
let v;
|
|
292
|
+
return e.components.highlight.selectorStates.length && (v = {
|
|
293
|
+
type: "column",
|
|
294
|
+
value: "highlight"
|
|
295
|
+
}), {
|
|
296
|
+
type: "scatterplot-umap",
|
|
297
|
+
x: w,
|
|
298
|
+
y: I,
|
|
299
|
+
keyColumn: b,
|
|
300
|
+
facetBy: B,
|
|
301
|
+
grouping: f,
|
|
302
|
+
label: A,
|
|
303
|
+
highlight: v,
|
|
304
|
+
tooltips: {
|
|
305
|
+
show: !0,
|
|
306
|
+
content: F
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
export {
|
|
312
|
+
oe as InitialScatterplotUmapState,
|
|
313
|
+
ne as ScatterplotUmapStateController
|
|
314
|
+
};
|
|
315
|
+
//# sourceMappingURL=scatterplot-umap.js.map
|