@milaboratories/graph-maker 1.1.148 → 1.1.150
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/AesSettings/AesDataMappingDiscrete.vue.d.ts +1 -0
- package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.d.ts.map +1 -1
- package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.js +97 -95
- package/dist/GraphMaker/components/AesSettings/AesDataMappingDiscrete.vue.js.map +1 -1
- package/dist/GraphMaker/dataBindAes.js +44 -44
- package/dist/GraphMaker/dataBindAes.js.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js +111 -109
- package/dist/GraphMaker/forms/AxesSettingsForm/DiscreteAxesSettingsForm.vue.js.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.d.ts.map +1 -1
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js +84 -83
- package/dist/GraphMaker/forms/LayersForm/AesSelector.vue.js.map +1 -1
- package/dist/GraphMaker/index.vue.js +33 -33
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js +25 -33
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.d.ts.map +1 -1
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js +23 -23
- package/dist/GraphMaker/utils/loadUniqueValuesToSave.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/StackedAreaElement.js +49 -49
- package/dist/node_modules/@milaboratories/miplots4/dist/discrete/components/layers/StackedAreaElement.js.map +1 -1
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js +18 -18
- package/dist/node_modules/@milaboratories/miplots4/dist/scatterplot/utils/createLegendInfo.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.js","sources":["../../src/GraphMaker/index.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n ChartInterface,\n DataByColumns,\n LassoControlsState,\n MiPlots,\n Settings\n} from '@milaboratories/miplots4';\nimport {\n ChartType,\n DemoDataStore, getInitialStateByType,\n PlotDataAndSettings\n} from '@milaboratories/pf-plots';\nimport type { AxisSpec, PFrameDriver, PlSelectionModel, PTableKey } from '@platforma-sdk/model';\nimport { watchDebounced } from '@vueuse/core';\nimport canonicalize from 'canonicalize';\nimport { computed, onMounted, onUnmounted, ref, shallowRef, toRaw, useSlots, watch } from 'vue';\nimport './assets/ui.scss';\nimport Chart from './components/Chart.vue';\nimport Loading from './components/Loading.vue';\nimport PanelModal from './components/PanelModal.vue';\nimport VTabs from './components/SettingsTabs/index.vue';\nimport TransitionSlidePanel from './components/TransitionSlidePanel.vue';\nimport { useSettingsForm } from './forms';\nimport { createReactiveState, provideStore } from './store';\nimport type { GraphMakerState, GraphStatus } from './types';\nimport { DendroNodeInfo, GraphMakerProps } from './types';\nimport { composeChartSettings, saveToFile } from './utils';\nimport { copyJSON } from './utils/copyJSON';\n\nconst emit = defineEmits(['delete-this-graph', 'tooltip-btn-click']);\n\nconst graphMakerState = defineModel<GraphMakerState>({ required: true });\nconst selectionState = defineModel<PlSelectionModel>('selection');\n\nconst props = defineProps<GraphMakerProps>();\n\ndefineExpose({\n /**\n reset() will update data-mapping, axis-settings, layers-settings with the state that is in v-model at the moment.\n In other cases editing of v-model fields doesn't make any impact to graphs and interface.\n Besides, after reset default-options will be applied again. You can use reset to apply new default-options.\n */\n reset,\n /**\n Apply new defaults without resetting all the state\n */\n resetDefaults\n});\n\nconst dataStore = ref<DemoDataStore | null>(null);\n\nwatch(() => props.pFrame, (pframeValue) => {\n if (!pframeValue) {\n return;\n }\n const driver = ('platforma' in window) ? window.platforma?.pFrameDriver as PFrameDriver : props.driver;\n if (!driver) {\n throw new Error('PFrame driver is missing');\n }\n dataStore.value = new DemoDataStore(\n pframeValue,\n driver,\n props.labelsModifier\n );\n}, { immediate: true });\n\n\n//fixed options can be updated outside, other settings only inside from chart settings interface, so we don't watching other settings\nconst fixedOptions = ref<typeof props.fixedOptions>(props.fixedOptions ?? []);\nwatch(() => props.fixedOptions, (value, oldValue) => {\n if (\n value && oldValue && JSON.stringify(value) !== JSON.stringify(oldValue) ||\n value && !oldValue ||\n oldValue && !value\n ) {\n fixedOptions.value = value;\n }\n}, { deep: true });\nconst defaultOptions = ref<typeof props.defaultOptions>(props.defaultOptions);\n\nconst state = provideStore(\n toRaw(graphMakerState.value),\n dataStore,\n props.chartType,\n defaultOptions,\n fixedOptions,\n props.dataColumnPredicate,\n props.readonlyInputs\n);\n\nfunction reset() {\n const nextReactiveState = createReactiveState(\n toRaw(graphMakerState.value),\n props.chartType\n );\n Object.assign(state.value.reactive, nextReactiveState);\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions;\n}\n\nfunction resetDefaults() {\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions ? [...props.defaultOptions] as typeof props.defaultOptions : [];\n}\n\nconst prevDataKey = computed(() => state.value.reactive.dataStateKey);\nwatch(() => canonicalize(props.dataStateKey), (keyValue) => {\n if ((keyValue !== undefined || prevDataKey.value !== undefined) && prevDataKey.value !== keyValue) {\n graphMakerState.value.optionsState = copyJSON(getInitialStateByType(props.chartType));\n const nextReactiveState = createReactiveState(toRaw(graphMakerState.value), props.chartType);\n Object.assign(state.value.reactive, nextReactiveState);\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions ? [...props.defaultOptions] as typeof props.defaultOptions : []; // to trigger watch on defaults\n }\n state.value.reactive.dataStateKey = keyValue;\n}, {deep: true, immediate: true});\n\nconst currentForm = computed(() => useSettingsForm(state.value.reactive.currentTab));\n\nconst chartRef = shallowRef<ChartInterface | null>(null);\nconst chartCalculatedDataRef = ref<Record<string, unknown> | null>(null);\nconst chartError = ref(false);\n\nconst graphStatus = computed<GraphStatus>(() => {\n const inputGuide = state.value.inputGuide.value;\n const chartData = state.value.chartData.value;\n if (!inputGuide.consistent) {\n return 'inconsistent';\n }\n if (!inputGuide.ready) {\n return 'notReady';\n }\n if (chartData && Object.values(chartData.data.byColumns.values)[0]?.length === 0) {\n return 'empty';\n }\n if (chartError.value) {\n return 'error';\n }\n return 'ready';\n});\nfunction onTreeNodeClick(d: DendroNodeInfo) {\n state.value.reactive.dendroSelectedNodeId = d?.info[0]?.id as number;\n state.value.reactive.dendroInfoByClick = d;\n}\n\nfunction onTooltipHintSwitch(v:boolean) {\n state.value.reactive.showTooltipHint = v;\n}\n\nfunction onLassoPolygonUpdate(dotIndexes:number[], polygons:{points:[number, number][], closed: boolean}[]) {\n graphMakerState.value = {\n ...graphMakerState.value,\n selectedPolygons: polygons\n };\n\n const axesData = state.value.chartData.value?.data?.axesData;\n if (dotIndexes.length === 0 || !axesData) {\n selectionState.value = {axesSpec: [], selectedKeys: []};\n return;\n }\n\n const axisKeys = Object.keys(axesData);\n const inputGuide = state.value.inputGuide.value;\n selectionState.value = {\n axesSpec: axisKeys.map(axisKey => inputGuide.getSourceInfo(axisKey).spec as AxisSpec),\n selectedKeys: dotIndexes.map((idx) => axisKeys.map((axisKey) => axesData[axisKey][idx]) as PTableKey)\n };\n}\n\nfunction onLassoStateChange (v:LassoControlsState) {\n state.value.reactive.lassoControlsState = v;\n}\nconst graphEventHandlers:Record<ChartType, unknown> = {\n dendro: [onTreeNodeClick],\n 'scatterplot-umap': {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange\n },\n discrete: [onTooltipHintSwitch],\n scatterplot: {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange\n },\n histogram: [onTooltipHintSwitch],\n heatmap: [onTooltipHintSwitch],\n bubble: [onTooltipHintSwitch]\n}\nfunction updateChart(value: {data: PlotDataAndSettings['data']['byColumns'], settings: PlotDataAndSettings['settings']} | null) {\n // if dataByColumns exists but columns has no data - show empty chart\n if (value && Object.values(value.data.values)[0]?.length > 0) {\n console.log('value.dataByColumns', toRaw(value.data));\n console.log('value.settings', toRaw(value.settings));\n if (chartRef.value) {\n chartRef.value.updateSettingsAndData(toRaw(value.data), toRaw(value.settings) as Settings);\n } else {\n const htmlNode = document.getElementById('chartSvgContainer');\n if (htmlNode) {\n chartRef.value = MiPlots.newPlot(toRaw(value.data), toRaw(value.settings) as Settings, graphEventHandlers[value.settings.type as ChartType]);\n if (value.settings.type === 'scatterplot-umap') {\n // set default polygons (from props)\n chartRef.value.updateChartState('polygon', graphMakerState.value.selectedPolygons ?? []);\n }\n chartRef.value.mount(htmlNode);\n }\n }\n // calculated by chart renderer data, tree hierarchy for example\n chartCalculatedDataRef.value = chartRef.value?.calculatedData ? { ...chartRef.value.calculatedData } : null;\n chartError.value = chartRef.value?.hasError ?? false;\n } else {\n chartRef.value?.unmount();\n chartRef.value = null;\n }\n}\n\nconst chartDataForRender = shallowRef<{settings:Settings, data:DataByColumns} | null>(null);\nwatch([\n () => state.value.chartData.value\n], ([chartData]) => {\n chartDataForRender.value = composeChartSettings(\n toRaw(chartData),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive)\n );\n});\nwatch([\n () => state.value.reactive.template,\n () => state.value.reactive.layersSettings,\n () => state.value.reactive.axesSettings,\n () => state.value.reactive.statisticsSettings,\n () => state.value.reactive.dataBindAes,\n () => state.value.reactive.chartScale,\n], () => {\n chartDataForRender.value = composeChartSettings(\n toRaw(state.value.chartData.value),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive),\n );\n}, {deep: true});\n\nwatch(() => chartDataForRender.value, (chartData) => {\n updateChart(chartData);\n});\nonMounted(() => {\n updateChart(null);\n});\nonUnmounted(() => {\n chartRef.value?.unmount();\n});\n\nwatchDebounced(() => state.value.reactive.optionsState, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n optionsState: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.statisticsSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n statisticsSettings: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.axesSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n axesSettings: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.layersSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n layersSettings: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.dataBindAes, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n dataBindAes: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\n\nwatchDebounced([\n () => state.value.reactive.chartScale,\n () => state.value.reactive.template,\n () => state.value.reactive.currentTab\n], ([zoomState, template, currentTab]) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n zoomState,\n template,\n currentTab\n }\n}, { debounce: 1000});\n\nwatch(() => state.value.reactive.dataStateKey, (dataStateKey) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n dataStateKey\n }\n}, {immediate: true});\n\nwatch(() => graphMakerState.value.currentTab, (v) => {\n state.value.reactive.currentTab = v === undefined ? 'dataMapping' : v;\n});\n\nwatch(() => graphMakerState.value?.layersSettings?.dendro?.showTable, (v) => {\n state.value.reactive.layersSettings.dendro.showTable = v ?? false;\n});\n\nfunction onExport() {\n saveToFile(\n new Blob([\n chartRef.value?.export() ?? ''\n ]),\n 'chart.svg'\n );\n}\n\nfunction updateGraphTitle(nextTitle: string) {\n graphMakerState.value = {\n ...graphMakerState.value,\n title: nextTitle\n };\n}\n\nfunction selectTreeNode(id: number | null) {\n state.value.reactive.dendroSelectedNodeId = id;\n chartRef.value?.updateChartState('selectedNode', id);\n}\n\nconst slots = useSlots();\n\nconst hasSettingsSlot = computed(() => Boolean(slots.settingsSlot));\nconst hasLogSlot = computed(() => Boolean(slots.logSlot));\n\n</script>\n\n<template>\n <div class=\"graph-maker\">\n <div class=\"graph-maker__main-pane\">\n <chart\n :graph-status=\"graphStatus\"\n :graphTitle=\"graphMakerState.title\"\n :chartData=\"chartCalculatedDataRef\"\n :chart-ref=\"chartRef\"\n :dendroTooltipButton=\"tooltipButton\"\n @graph-title-update=\"updateGraphTitle\"\n @dendro-node-select=\"selectTreeNode\"\n @dendro-tooltip-btn-click=\"(id:string) => $emit('tooltip-btn-click', id)\"\n >\n <slot name=\"titleLineSlot\"></slot>\n </chart>\n <loading v-if=\"state.loading.initialInputGuide\" :top=\"67\" :left=\"12\" :right=\"12\" :bottom=\"12\" />\n <TransitionSlidePanel id=\"graph-settings-modal\" v-if=\"!state.loading.initialInputGuide\">\n <panel-modal v-if=\"state.reactive.currentTab\" @close=\"state.reactive.currentTab = null\">\n <component :is=\"currentForm.value\">\n <slot v-if=\"state.reactive.currentTab === 'settings'\" name=\"settingsSlot\"></slot> \n <slot v-if=\"state.reactive.currentTab === 'log'\" name=\"logSlot\"></slot> \n </component>\n </panel-modal>\n </TransitionSlidePanel>\n </div>\n <v-tabs\n :chart-type=\"state.reactive.chartType\"\n :graph-status=\"graphStatus\"\n :allowDeleting=\"allowChartDeleting\"\n :hasSettingsSlot=\"hasSettingsSlot\"\n :hasLogSlot=\"hasLogSlot\"\n :initialLoading=\"state.loading.initialInputGuide\"\n v-model=\"state.reactive.currentTab\"\n @export=\"onExport\"\n @delete=\"$emit('delete-this-graph')\"\n />\n </div>\n</template>\n"],"names":["graphMakerState","_useModel","selectionState","__props","props","__expose","reset","resetDefaults","dataStore","ref","watch","pframeValue","driver","_a","DemoDataStore","fixedOptions","value","oldValue","defaultOptions","state","provideStore","toRaw","nextReactiveState","createReactiveState","prevDataKey","computed","canonicalize","keyValue","copyJSON","getInitialStateByType","currentForm","useSettingsForm","chartRef","shallowRef","chartCalculatedDataRef","chartError","graphStatus","inputGuide","chartData","onTreeNodeClick","d","onTooltipHintSwitch","v","onLassoPolygonUpdate","dotIndexes","polygons","axesData","_b","axisKeys","axisKey","idx","onLassoStateChange","graphEventHandlers","updateChart","htmlNode","MiPlots","_c","_d","chartDataForRender","composeChartSettings","onMounted","onUnmounted","watchDebounced","zoomState","template","currentTab","dataStateKey","onExport","saveToFile","updateGraphTitle","nextTitle","selectTreeNode","id","slots","useSlots","hasSettingsSlot","hasLogSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,UAAMA,IAAkBC,iBAA+C,GACjEC,IAAiBD,EAA6BE,GAAC,WAAW,GAE1DC,IAAQD;AAEd,IAAAE,EAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMX,OAAAC;AAAA;AAAA;AAAA;AAAA,MAIA,eAAAC;AAAA,IAAA,CACD;AAED,UAAMC,IAAYC,EAA0B,IAAI;AAEhD,IAAAC,EAAM,MAAMN,EAAM,QAAQ,CAACO,MAAgB;;AACzC,UAAI,CAACA;AACH;AAEF,YAAMC,IAAU,eAAe,UAAUC,IAAA,OAAO,cAAP,gBAAAA,EAAkB,eAA+BT,EAAM;AAChG,UAAI,CAACQ;AACH,cAAM,IAAI,MAAM,0BAA0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ourcesContent":["<script lang=\"ts\" setup>\nimport {\n ChartInterface,\n DataByColumns,\n LassoControlsState,\n MiPlots,\n Settings\n} from '@milaboratories/miplots4';\nimport {\n ChartType,\n DemoDataStore, getInitialStateByType,\n PlotDataAndSettings\n} from '@milaboratories/pf-plots';\nimport type { AxisSpec, PFrameDriver, PlSelectionModel, PTableKey } from '@platforma-sdk/model';\nimport { watchDebounced } from '@vueuse/core';\nimport canonicalize from 'canonicalize';\nimport { computed, onMounted, onUnmounted, ref, shallowRef, toRaw, useSlots, watch } from 'vue';\nimport './assets/ui.scss';\nimport Chart from './components/Chart.vue';\nimport Loading from './components/Loading.vue';\nimport PanelModal from './components/PanelModal.vue';\nimport VTabs from './components/SettingsTabs/index.vue';\nimport TransitionSlidePanel from './components/TransitionSlidePanel.vue';\nimport { useSettingsForm } from './forms';\nimport { createReactiveState, provideStore } from './store';\nimport type { GraphMakerState, GraphStatus } from './types';\nimport { DendroNodeInfo, GraphMakerProps } from './types';\nimport { composeChartSettings, saveToFile } from './utils';\nimport { copyJSON } from './utils/copyJSON';\n\nconst emit = defineEmits(['delete-this-graph', 'tooltip-btn-click']);\n\nconst graphMakerState = defineModel<GraphMakerState>({ required: true });\nconst selectionState = defineModel<PlSelectionModel>('selection');\n\nconst props = defineProps<GraphMakerProps>();\n\ndefineExpose({\n /**\n reset() will update data-mapping, axis-settings, layers-settings with the state that is in v-model at the moment.\n In other cases editing of v-model fields doesn't make any impact to graphs and interface.\n Besides, after reset default-options will be applied again. You can use reset to apply new default-options.\n */\n reset,\n /**\n Apply new defaults without resetting all the state\n */\n resetDefaults\n});\n\nconst dataStore = ref<DemoDataStore | null>(null);\n\nwatch(() => props.pFrame, (pframeValue) => {\n if (!pframeValue) {\n return;\n }\n const driver = ('platforma' in window) ? window.platforma?.pFrameDriver as PFrameDriver : props.driver;\n if (!driver) {\n throw new Error('PFrame driver is missing');\n }\n dataStore.value = new DemoDataStore(\n pframeValue,\n driver,\n props.labelsModifier\n );\n}, { immediate: true });\n\n\n//fixed options can be updated outside, other settings only inside from chart settings interface, so we don't watching other settings\nconst fixedOptions = ref<typeof props.fixedOptions>(props.fixedOptions ?? []);\nwatch(() => props.fixedOptions, (value, oldValue) => {\n if (\n value && oldValue && JSON.stringify(value) !== JSON.stringify(oldValue) ||\n value && !oldValue ||\n oldValue && !value\n ) {\n fixedOptions.value = value;\n }\n}, { deep: true });\nconst defaultOptions = ref<typeof props.defaultOptions>(props.defaultOptions);\n\nconst state = provideStore(\n toRaw(graphMakerState.value),\n dataStore,\n props.chartType,\n defaultOptions,\n fixedOptions,\n props.dataColumnPredicate,\n props.readonlyInputs\n);\n\nfunction reset() {\n const nextReactiveState = createReactiveState(\n toRaw(graphMakerState.value),\n props.chartType\n );\n Object.assign(state.value.reactive, nextReactiveState);\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions;\n}\n\nfunction resetDefaults() {\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions ? [...props.defaultOptions] as typeof props.defaultOptions : [];\n}\n\nconst prevDataKey = computed(() => state.value.reactive.dataStateKey);\nwatch(() => canonicalize(props.dataStateKey), (keyValue) => {\n if ((keyValue !== undefined || prevDataKey.value !== undefined) && prevDataKey.value !== keyValue) {\n graphMakerState.value.optionsState = copyJSON(getInitialStateByType(props.chartType));\n const nextReactiveState = createReactiveState(toRaw(graphMakerState.value), props.chartType);\n Object.assign(state.value.reactive, nextReactiveState);\n Object.assign(state.value.loading, {\n initialInputGuide: true,\n initialCharts: true,\n initialDefaults: true,\n inputGuide: false,\n chartData: false,\n });\n defaultOptions.value = props.defaultOptions ? [...props.defaultOptions] as typeof props.defaultOptions : []; // to trigger watch on defaults\n }\n state.value.reactive.dataStateKey = keyValue;\n}, {deep: true, immediate: true});\n\nconst currentForm = computed(() => useSettingsForm(state.value.reactive.currentTab));\n\nconst chartRef = shallowRef<ChartInterface | null>(null);\nconst chartCalculatedDataRef = ref<Record<string, unknown> | null>(null);\nconst chartError = ref(false);\n\nconst graphStatus = computed<GraphStatus>(() => {\n const inputGuide = state.value.inputGuide.value;\n const chartData = state.value.chartData.value;\n if (!inputGuide.consistent) {\n return 'inconsistent';\n }\n if (!inputGuide.ready) {\n return 'notReady';\n }\n if (chartData && Object.values(chartData.data.byColumns.values)[0]?.length === 0) {\n return 'empty';\n }\n if (chartError.value) {\n return 'error';\n }\n return 'ready';\n});\nfunction onTreeNodeClick(d: DendroNodeInfo) {\n state.value.reactive.dendroSelectedNodeId = d?.info[0]?.id as number;\n state.value.reactive.dendroInfoByClick = d;\n}\n\nfunction onTooltipHintSwitch(v:boolean) {\n state.value.reactive.showTooltipHint = v;\n}\n\nfunction onLassoPolygonUpdate(dotIndexes:number[], polygons:{points:[number, number][], closed: boolean}[]) {\n graphMakerState.value = {\n ...graphMakerState.value,\n selectedPolygons: polygons\n };\n\n const axesData = state.value.chartData.value?.data?.axesData;\n if (dotIndexes.length === 0 || !axesData) {\n selectionState.value = {axesSpec: [], selectedKeys: []};\n return;\n }\n\n const axisKeys = Object.keys(axesData);\n const inputGuide = state.value.inputGuide.value;\n selectionState.value = {\n axesSpec: axisKeys.map(axisKey => inputGuide.getSourceInfo(axisKey).spec as AxisSpec),\n selectedKeys: dotIndexes.map((idx) => axisKeys.map((axisKey) => axesData[axisKey][idx]) as PTableKey)\n };\n}\n\nfunction onLassoStateChange (v:LassoControlsState) {\n state.value.reactive.lassoControlsState = v;\n}\nconst graphEventHandlers:Record<ChartType, unknown> = {\n dendro: [onTreeNodeClick],\n 'scatterplot-umap': {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange\n },\n discrete: [onTooltipHintSwitch],\n scatterplot: {\n onPolygonUpdate: onLassoPolygonUpdate,\n onTooltipHintSwitch,\n onLassoControlsStateUpdate: onLassoStateChange\n },\n histogram: [onTooltipHintSwitch],\n heatmap: [onTooltipHintSwitch],\n bubble: [onTooltipHintSwitch]\n}\nfunction updateChart(value: {data: PlotDataAndSettings['data']['byColumns'], settings: PlotDataAndSettings['settings']} | null) {\n // if dataByColumns exists but columns has no data - show empty chart\n if (value && Object.values(value.data.values)[0]?.length > 0) {\n // console.log('value.dataByColumns', toRaw(value.data));\n // console.log('value.settings', toRaw(value.settings));\n if (chartRef.value) {\n chartRef.value.updateSettingsAndData(toRaw(value.data), toRaw(value.settings) as Settings);\n } else {\n const htmlNode = document.getElementById('chartSvgContainer');\n if (htmlNode) {\n chartRef.value = MiPlots.newPlot(toRaw(value.data), toRaw(value.settings) as Settings, graphEventHandlers[value.settings.type as ChartType]);\n if (value.settings.type === 'scatterplot-umap') {\n // set default polygons (from props)\n chartRef.value.updateChartState('polygon', graphMakerState.value.selectedPolygons ?? []);\n }\n chartRef.value.mount(htmlNode);\n }\n }\n // calculated by chart renderer data, tree hierarchy for example\n chartCalculatedDataRef.value = chartRef.value?.calculatedData ? { ...chartRef.value.calculatedData } : null;\n chartError.value = chartRef.value?.hasError ?? false;\n } else {\n chartRef.value?.unmount();\n chartRef.value = null;\n }\n}\n\nconst chartDataForRender = shallowRef<{settings:Settings, data:DataByColumns} | null>(null);\nwatch([\n () => state.value.chartData.value\n], ([chartData]) => {\n chartDataForRender.value = composeChartSettings(\n toRaw(chartData),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive)\n );\n});\nwatch([\n () => state.value.reactive.template,\n () => state.value.reactive.layersSettings,\n () => state.value.reactive.axesSettings,\n () => state.value.reactive.statisticsSettings,\n () => state.value.reactive.dataBindAes,\n () => state.value.reactive.chartScale,\n], () => {\n chartDataForRender.value = composeChartSettings(\n toRaw(state.value.chartData.value),\n toRaw(state.value.inputGuide.value),\n toRaw(state.value.uniqueValuesData.value),\n toRaw(state.value.filterLabelsInfo.value),\n toRaw(state.value.reactive),\n );\n}, {deep: true});\n\nwatch(() => chartDataForRender.value, (chartData) => {\n updateChart(chartData);\n});\nonMounted(() => {\n updateChart(null);\n});\nonUnmounted(() => {\n chartRef.value?.unmount();\n});\n\nwatchDebounced(() => state.value.reactive.optionsState, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n optionsState: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.statisticsSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n statisticsSettings: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.axesSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n axesSettings: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.layersSettings, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n layersSettings: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\nwatchDebounced(() => state.value.reactive.dataBindAes, (v) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n dataBindAes: copyJSON(v)\n }\n}, {deep: true, debounce: 1000});\n\nwatchDebounced([\n () => state.value.reactive.chartScale,\n () => state.value.reactive.template,\n () => state.value.reactive.currentTab\n], ([zoomState, template, currentTab]) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n zoomState,\n template,\n currentTab\n }\n}, { debounce: 1000});\n\nwatch(() => state.value.reactive.dataStateKey, (dataStateKey) => {\n graphMakerState.value = {\n ...graphMakerState.value,\n dataStateKey\n }\n}, {immediate: true});\n\nwatch(() => graphMakerState.value.currentTab, (v) => {\n state.value.reactive.currentTab = v === undefined ? 'dataMapping' : v;\n});\n\nwatch(() => graphMakerState.value?.layersSettings?.dendro?.showTable, (v) => {\n state.value.reactive.layersSettings.dendro.showTable = v ?? false;\n});\n\nfunction onExport() {\n saveToFile(\n new Blob([\n chartRef.value?.export() ?? ''\n ]),\n 'chart.svg'\n );\n}\n\nfunction updateGraphTitle(nextTitle: string) {\n graphMakerState.value = {\n ...graphMakerState.value,\n title: nextTitle\n };\n}\n\nfunction selectTreeNode(id: number | null) {\n state.value.reactive.dendroSelectedNodeId = id;\n chartRef.value?.updateChartState('selectedNode', id);\n}\n\nconst slots = useSlots();\n\nconst hasSettingsSlot = computed(() => Boolean(slots.settingsSlot));\nconst hasLogSlot = computed(() => Boolean(slots.logSlot));\n\n</script>\n\n<template>\n <div class=\"graph-maker\">\n <div class=\"graph-maker__main-pane\">\n <chart\n :graph-status=\"graphStatus\"\n :graphTitle=\"graphMakerState.title\"\n :chartData=\"chartCalculatedDataRef\"\n :chart-ref=\"chartRef\"\n :dendroTooltipButton=\"tooltipButton\"\n @graph-title-update=\"updateGraphTitle\"\n @dendro-node-select=\"selectTreeNode\"\n @dendro-tooltip-btn-click=\"(id:string) => $emit('tooltip-btn-click', id)\"\n >\n <slot name=\"titleLineSlot\"></slot>\n </chart>\n <loading v-if=\"state.loading.initialInputGuide\" :top=\"67\" :left=\"12\" :right=\"12\" :bottom=\"12\" />\n <TransitionSlidePanel id=\"graph-settings-modal\" v-if=\"!state.loading.initialInputGuide\">\n <panel-modal v-if=\"state.reactive.currentTab\" @close=\"state.reactive.currentTab = null\">\n <component :is=\"currentForm.value\">\n <slot v-if=\"state.reactive.currentTab === 'settings'\" name=\"settingsSlot\"></slot> \n <slot v-if=\"state.reactive.currentTab === 'log'\" name=\"logSlot\"></slot> \n </component>\n </panel-modal>\n </TransitionSlidePanel>\n </div>\n <v-tabs\n :chart-type=\"state.reactive.chartType\"\n :graph-status=\"graphStatus\"\n :allowDeleting=\"allowChartDeleting\"\n :hasSettingsSlot=\"hasSettingsSlot\"\n :hasLogSlot=\"hasLogSlot\"\n :initialLoading=\"state.loading.initialInputGuide\"\n v-model=\"state.reactive.currentTab\"\n @export=\"onExport\"\n @delete=\"$emit('delete-this-graph')\"\n />\n </div>\n</template>\n"],"names":["graphMakerState","_useModel","selectionState","__props","props","__expose","reset","resetDefaults","dataStore","ref","watch","pframeValue","driver","_a","DemoDataStore","fixedOptions","value","oldValue","defaultOptions","state","provideStore","toRaw","nextReactiveState","createReactiveState","prevDataKey","computed","canonicalize","keyValue","copyJSON","getInitialStateByType","currentForm","useSettingsForm","chartRef","shallowRef","chartCalculatedDataRef","chartError","graphStatus","inputGuide","chartData","onTreeNodeClick","d","onTooltipHintSwitch","v","onLassoPolygonUpdate","dotIndexes","polygons","axesData","_b","axisKeys","axisKey","idx","onLassoStateChange","graphEventHandlers","updateChart","htmlNode","MiPlots","_c","_d","chartDataForRender","composeChartSettings","onMounted","onUnmounted","watchDebounced","zoomState","template","currentTab","dataStateKey","onExport","saveToFile","updateGraphTitle","nextTitle","selectTreeNode","id","slots","useSlots","hasSettingsSlot","hasLogSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,UAAMA,IAAkBC,iBAA+C,GACjEC,IAAiBD,EAA6BE,GAAC,WAAW,GAE1DC,IAAQD;AAEd,IAAAE,EAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMX,OAAAC;AAAA;AAAA;AAAA;AAAA,MAIA,eAAAC;AAAA,IAAA,CACD;AAED,UAAMC,IAAYC,EAA0B,IAAI;AAEhD,IAAAC,EAAM,MAAMN,EAAM,QAAQ,CAACO,MAAgB;;AACzC,UAAI,CAACA;AACH;AAEF,YAAMC,IAAU,eAAe,UAAUC,IAAA,OAAO,cAAP,gBAAAA,EAAkB,eAA+BT,EAAM;AAChG,UAAI,CAACQ;AACH,cAAM,IAAI,MAAM,0BAA0B;AAE5C,MAAAJ,EAAU,QAAQ,IAAIM;AAAAA,QACpBH;AAAA,QACAC;AAAA,QACAR,EAAM;AAAA,MAAA;AAAA,IAEV,GAAG,EAAE,WAAW,IAAM;AAItB,UAAMW,IAAeN,EAA+BL,EAAM,gBAAgB,CAAA,CAAE;AAC5E,IAAAM,EAAM,MAAMN,EAAM,cAA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,IAAAb,EAAgB,UAAhB,gBAAAa,EAAuB,mBAAvB,gBAAAkC,EAAuC,WAAvC,gBAAAS,EAA+C;AAAA,OAAW,CAACd,MAAM;AAC3E,MAAAvB,EAAM,MAAM,SAAS,eAAe,OAAO,YAAYuB,KAAK;AAAA,IAC9D,CAAC;AAED,aAASyB,IAAW;;AAClB,MAAAC;AAAA,QACE,IAAI,KAAK;AAAA,YACPvD,IAAAmB,EAAS,UAAT,gBAAAnB,EAAgB,aAAY;AAAA,QAAA,CAC7B;AAAA,QACD;AAAA,MAAA;AAAA,IAEJ;AAEA,aAASwD,EAAiBC,GAAmB;AAC3C,MAAAtE,EAAgB,QAAQ;AAAA,QACtB,GAAGA,EAAgB;AAAA,QACnB,OAAOsE;AAAA,MAAA;AAAA,IAEX;AAEA,aAASC,EAAeC,GAAmB;;AACzC,MAAArD,EAAM,MAAM,SAAS,uBAAuBqD,IAC5C3D,IAAAmB,EAAS,UAAT,QAAAnB,EAAgB,iBAAiB,gBAAgB2D;AAAA,IACnD;AAEA,UAAMC,IAAQC,GAAA,GAERC,KAAkBlD,EAAS,MAAM,EAAQgD,EAAM,YAAa,GAC5DG,KAAanD,EAAS,MAAM,EAAQgD,EAAM,OAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeDiscreteSettings.d.ts","sourceRoot":"","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAmB,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AASnF,OAAO,EAEL,aAAa,EACb,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAYrB,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,uBAAuB,EACzC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"composeDiscreteSettings.d.ts","sourceRoot":"","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAmB,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AASnF,OAAO,EAEL,aAAa,EACb,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAYrB,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,uBAAuB,EACzC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;;;;YAwEup4K,CAAC;gBAAuC,CAAC;;;;;cAAwH,CAAC;aAAmC,CAAC;mBAAyC,CAAC;;;;WAA4E,CAAC;qBAAyB,CAAC;qBAA2C,CAAC;qBAAuG,CAAC;;;mBAA0H,CAAC;qBAA2C,CAAC;;;wBAA+H,CAAC;yBAAgD,CAAC;;;wBAA2R,CAAC;;;yBAAgI,CAAC;;;oBAA2H,CAAC;;YAAyD,CAAC;kBAAsB,CAAC;iBAAuC,CAAC;iBAAuC,CAAC;aAAmC,CAAC;;;;WAA0F,CAAC;qBAAyB,CAAC;qBAA2C,CAAC;qBAAuG,CAAC;;;mBAA0H,CAAC;qBAA2C,CAAC;;;oBAA2H,CAAC;yBAA+C,CAAC;2BAAkD,CAAC;8BAAgH,CAAC;;YAAqH,CAAC;qBAAyB,CAAC;gBAAsC,CAAC;;;;WAAwF,CAAC;oBAAwB,CAAC;;;mBAAsR,CAAC;qBAA2C,CAAC;;;mBAA0H,CAAC;qBAA2C,CAAC;;;wBAA+H,CAAC;kBAAyC,CAAC;;;;;WAAiI,CAAC;oBAAwB,CAAC;;;mBAAsR,CAAC;qBAA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-1,70 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DISCRETE_TEMPLATES_MAP as
|
|
3
|
-
import { getChartSettingsInheritedAes as
|
|
4
|
-
import { getUsedAesInMapping as
|
|
5
|
-
import { getDiscreteLayersSettings as
|
|
6
|
-
import { getAxesDataFromForms as
|
|
1
|
+
import "../../constantsAesthetic.js";
|
|
2
|
+
import { DISCRETE_TEMPLATES_MAP as e } from "../../constantsCommon.js";
|
|
3
|
+
import { getChartSettingsInheritedAes as y } from "../../dataBindAes.js";
|
|
4
|
+
import { getUsedAesInMapping as c } from "../getUsedAesInMapping.js";
|
|
5
|
+
import { getDiscreteLayersSettings as g } from "./getLayersDataFromForms.js";
|
|
6
|
+
import { getAxesDataFromForms as f } from "./getAxesDataFromForms.js";
|
|
7
7
|
import "../../../node_modules/@milaboratories/pf-plots/dist/index.js";
|
|
8
8
|
import "vue";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
dotShape: E,
|
|
14
|
-
dotSize: f,
|
|
15
|
-
lineWidth: A
|
|
16
|
-
};
|
|
17
|
-
function U(r, o, i, a) {
|
|
18
|
-
var l;
|
|
19
|
-
const G = S(
|
|
20
|
-
g[o.template],
|
|
9
|
+
function P(r, o, i, l) {
|
|
10
|
+
var s;
|
|
11
|
+
const d = g(
|
|
12
|
+
e[o.template],
|
|
21
13
|
o.layersSettings,
|
|
22
14
|
o.statisticsSettings,
|
|
23
15
|
o.optionsState,
|
|
24
|
-
|
|
25
|
-
),
|
|
16
|
+
l
|
|
17
|
+
), m = c(
|
|
26
18
|
o.chartType,
|
|
27
19
|
o.template,
|
|
28
20
|
o.layersSettings,
|
|
29
21
|
o.statisticsSettings,
|
|
30
22
|
o.optionsState,
|
|
31
|
-
|
|
23
|
+
l
|
|
32
24
|
);
|
|
33
|
-
r.layers =
|
|
25
|
+
r.layers = d;
|
|
34
26
|
const n = o.optionsState.components;
|
|
35
27
|
if (n.primaryGrouping.selectorStates.length && r.primaryGrouping) {
|
|
36
28
|
r.primaryGrouping = { ...r.primaryGrouping }, r.primaryGrouping.order && (r.primaryGrouping.order = [...r.primaryGrouping.order]);
|
|
37
|
-
const p = n.primaryGrouping.selectorStates[0].selectedSource,
|
|
29
|
+
const p = n.primaryGrouping.selectorStates[0].selectedSource, a = m[p];
|
|
38
30
|
Object.assign(
|
|
39
31
|
r.primaryGrouping,
|
|
40
|
-
|
|
32
|
+
y(
|
|
41
33
|
i,
|
|
42
34
|
o.dataBindAes[p],
|
|
43
35
|
p,
|
|
44
|
-
|
|
36
|
+
a
|
|
45
37
|
)
|
|
46
|
-
), o.axesSettings.axisX.allowNullPrimaryGroups
|
|
38
|
+
), r.primaryGrouping.allowNullGroup = o.axesSettings.axisX.allowNullPrimaryGroups, !o.axesSettings.axisX.allowNullPrimaryGroups && r.primaryGrouping.order && (r.primaryGrouping.order = r.primaryGrouping.order.filter((u) => u !== "null"));
|
|
47
39
|
}
|
|
48
40
|
if (n.secondaryGrouping.selectorStates && r.secondaryGrouping) {
|
|
49
41
|
r.secondaryGrouping = { ...r.secondaryGrouping }, r.secondaryGrouping.order && (r.secondaryGrouping.order = [...r.secondaryGrouping.order]);
|
|
50
|
-
const p = n.secondaryGrouping.selectorStates[0].selectedSource,
|
|
42
|
+
const p = n.secondaryGrouping.selectorStates[0].selectedSource, a = m[p];
|
|
51
43
|
Object.assign(
|
|
52
44
|
r.secondaryGrouping,
|
|
53
|
-
|
|
45
|
+
y(
|
|
54
46
|
i,
|
|
55
47
|
o.dataBindAes[p],
|
|
56
48
|
p,
|
|
57
|
-
|
|
49
|
+
a
|
|
58
50
|
)
|
|
59
|
-
), o.axesSettings.axisX.allowNullSecondaryGroups
|
|
51
|
+
), r.secondaryGrouping.allowNullGroup = o.axesSettings.axisX.allowNullSecondaryGroups, !o.axesSettings.axisX.allowNullPrimaryGroups && r.secondaryGrouping.order && (r.secondaryGrouping.order = r.secondaryGrouping.order.filter((u) => u !== "null"));
|
|
60
52
|
}
|
|
61
|
-
const
|
|
53
|
+
const G = r.primaryGrouping ? (s = i[r.primaryGrouping.columnName.value]) == null ? void 0 : s.options : [];
|
|
62
54
|
return Object.assign(
|
|
63
55
|
r,
|
|
64
|
-
|
|
56
|
+
f(o.axesSettings, o.chartType, G)
|
|
65
57
|
), r;
|
|
66
58
|
}
|
|
67
59
|
export {
|
|
68
|
-
|
|
60
|
+
P as composeDiscreteSettings
|
|
69
61
|
};
|
|
70
62
|
//# sourceMappingURL=composeDiscreteSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composeDiscreteSettings.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.ts"],"sourcesContent":["import { DiscreteSettings } from '@milaboratories/miplots4';\nimport { DiscreteUIState, InputGuide, InputState } from '@milaboratories/pf-plots';\nimport { DEFAULT_BLACK, DEFAULT_WHITE } from '../../constantsAesthetic';\nimport { DISCRETE_TEMPLATES_MAP, DiscreteStatisticsState } from '../../constantsCommon';\nimport {\n DEFAULT_DOT_SHAPE,\n DEFAULT_DOT_SIZE,\n DEFAULT_LINE_WIDTH,\n getChartSettingsInheritedAes\n} from '../../dataBindAes';\nimport {\n DiscreteLayersTemplate,\n ReactiveState,\n UniqueValuesBySourceMap\n} from '../../types';\nimport { getUsedAesInMapping } from '../getUsedAesInMapping';\nimport { getAxesDataFromForms, getDiscreteLayersSettings } from '../index';\n\nconst NULL_DISCRETE_AES = {\n fillColor: DEFAULT_WHITE,\n lineColor: DEFAULT_BLACK,\n dotFill: DEFAULT_WHITE,\n dotShape: DEFAULT_DOT_SHAPE,\n dotSize: DEFAULT_DOT_SIZE,\n lineWidth: DEFAULT_LINE_WIDTH,\n}\nexport function composeDiscreteSettings(\n settings: DiscreteSettings,\n reactiveState: ReactiveState,\n uniqueValuesData: UniqueValuesBySourceMap,\n inputGuide: InputGuide<InputState>,\n) {\n const layers = getDiscreteLayersSettings(\n DISCRETE_TEMPLATES_MAP[reactiveState.template as DiscreteLayersTemplate],\n reactiveState.layersSettings,\n reactiveState.statisticsSettings as DiscreteStatisticsState,\n reactiveState.optionsState as DiscreteUIState,\n inputGuide\n ) as DiscreteSettings['layers'];\n const usedAesInMappingsMap = getUsedAesInMapping(\n reactiveState.chartType,\n reactiveState.template,\n reactiveState.layersSettings,\n reactiveState.statisticsSettings,\n reactiveState.optionsState,\n inputGuide\n );\n settings.layers = layers;\n\n const inputStateMap = reactiveState.optionsState.components;\n\n if (inputStateMap.primaryGrouping.selectorStates.length && settings.primaryGrouping) {\n settings.primaryGrouping = {...settings.primaryGrouping}\n if (settings.primaryGrouping.order) {\n settings.primaryGrouping.order = [...settings.primaryGrouping.order]\n }\n const columnName = inputStateMap.primaryGrouping.selectorStates[0].selectedSource;\n const usedAesInMapping = usedAesInMappingsMap[columnName];\n Object.assign(\n settings.primaryGrouping,\n getChartSettingsInheritedAes(\n uniqueValuesData,\n reactiveState.dataBindAes[columnName],\n columnName,\n usedAesInMapping\n )\n );\n
|
|
1
|
+
{"version":3,"file":"composeDiscreteSettings.js","sources":["../../../../src/GraphMaker/utils/createChartSettingsForRender/composeDiscreteSettings.ts"],"sourcesContent":["import { DiscreteSettings } from '@milaboratories/miplots4';\nimport { DiscreteUIState, InputGuide, InputState } from '@milaboratories/pf-plots';\nimport { DEFAULT_BLACK, DEFAULT_WHITE } from '../../constantsAesthetic';\nimport { DISCRETE_TEMPLATES_MAP, DiscreteStatisticsState } from '../../constantsCommon';\nimport {\n DEFAULT_DOT_SHAPE,\n DEFAULT_DOT_SIZE,\n DEFAULT_LINE_WIDTH,\n getChartSettingsInheritedAes\n} from '../../dataBindAes';\nimport {\n DiscreteLayersTemplate,\n ReactiveState,\n UniqueValuesBySourceMap\n} from '../../types';\nimport { getUsedAesInMapping } from '../getUsedAesInMapping';\nimport { getAxesDataFromForms, getDiscreteLayersSettings } from '../index';\n\nconst NULL_DISCRETE_AES = {\n fillColor: DEFAULT_WHITE,\n lineColor: DEFAULT_BLACK,\n dotFill: DEFAULT_WHITE,\n dotShape: DEFAULT_DOT_SHAPE,\n dotSize: DEFAULT_DOT_SIZE,\n lineWidth: DEFAULT_LINE_WIDTH,\n}\nexport function composeDiscreteSettings(\n settings: DiscreteSettings,\n reactiveState: ReactiveState,\n uniqueValuesData: UniqueValuesBySourceMap,\n inputGuide: InputGuide<InputState>,\n) {\n const layers = getDiscreteLayersSettings(\n DISCRETE_TEMPLATES_MAP[reactiveState.template as DiscreteLayersTemplate],\n reactiveState.layersSettings,\n reactiveState.statisticsSettings as DiscreteStatisticsState,\n reactiveState.optionsState as DiscreteUIState,\n inputGuide\n ) as DiscreteSettings['layers'];\n const usedAesInMappingsMap = getUsedAesInMapping(\n reactiveState.chartType,\n reactiveState.template,\n reactiveState.layersSettings,\n reactiveState.statisticsSettings,\n reactiveState.optionsState,\n inputGuide\n );\n settings.layers = layers;\n\n const inputStateMap = reactiveState.optionsState.components;\n\n if (inputStateMap.primaryGrouping.selectorStates.length && settings.primaryGrouping) {\n settings.primaryGrouping = {...settings.primaryGrouping}\n if (settings.primaryGrouping.order) {\n settings.primaryGrouping.order = [...settings.primaryGrouping.order]\n }\n const columnName = inputStateMap.primaryGrouping.selectorStates[0].selectedSource;\n const usedAesInMapping = usedAesInMappingsMap[columnName];\n Object.assign(\n settings.primaryGrouping,\n getChartSettingsInheritedAes(\n uniqueValuesData,\n reactiveState.dataBindAes[columnName],\n columnName,\n usedAesInMapping\n )\n );\n settings.primaryGrouping.allowNullGroup = reactiveState.axesSettings.axisX.allowNullPrimaryGroups;\n if (!reactiveState.axesSettings.axisX.allowNullPrimaryGroups && settings.primaryGrouping.order) {\n settings.primaryGrouping.order = settings.primaryGrouping.order.filter(v => v !== 'null');\n }\n }\n if (inputStateMap.secondaryGrouping.selectorStates && settings.secondaryGrouping) {\n settings.secondaryGrouping = {...settings.secondaryGrouping}\n if (settings.secondaryGrouping.order) {\n settings.secondaryGrouping.order = [...settings.secondaryGrouping.order]\n }\n const columnName = inputStateMap.secondaryGrouping.selectorStates[0].selectedSource;\n const usedAesInMapping = usedAesInMappingsMap[columnName];\n Object.assign(\n settings.secondaryGrouping,\n getChartSettingsInheritedAes(\n uniqueValuesData,\n reactiveState.dataBindAes[columnName],\n columnName,\n usedAesInMapping\n )\n );\n settings.secondaryGrouping.allowNullGroup = reactiveState.axesSettings.axisX.allowNullSecondaryGroups;\n if (!reactiveState.axesSettings.axisX.allowNullPrimaryGroups && settings.secondaryGrouping.order) {\n settings.secondaryGrouping.order = settings.secondaryGrouping.order.filter(v => v !== 'null');\n }\n }\n\n const primaryGroups = settings.primaryGrouping ? uniqueValuesData[settings.primaryGrouping.columnName.value]?.options : [];\n\n Object.assign(\n settings,\n getAxesDataFromForms(reactiveState.axesSettings, reactiveState.chartType, primaryGroups)\n );\n\n return settings;\n}"],"names":["composeDiscreteSettings","settings","reactiveState","uniqueValuesData","inputGuide","layers","getDiscreteLayersSettings","DISCRETE_TEMPLATES_MAP","usedAesInMappingsMap","getUsedAesInMapping","inputStateMap","columnName","usedAesInMapping","getChartSettingsInheritedAes","v","primaryGroups","_a","getAxesDataFromForms"],"mappings":";;;;;;;;AA0BO,SAASA,EACdC,GACAC,GACAC,GACAC,GACA;;AACA,QAAMC,IAASC;AAAA,IACbC,EAAuBL,EAAc,QAAkC;AAAA,IACvEA,EAAc;AAAA,IACdA,EAAc;AAAA,IACdA,EAAc;AAAA,IACdE;AAAA,EAAA,GAEII,IAAuBC;AAAA,IAC3BP,EAAc;AAAA,IACdA,EAAc;AAAA,IACdA,EAAc;AAAA,IACdA,EAAc;AAAA,IACdA,EAAc;AAAA,IACdE;AAAA,EAAA;AAEF,EAAAH,EAAS,SAASI;AAElB,QAAMK,IAAgBR,EAAc,aAAa;AAEjD,MAAIQ,EAAc,gBAAgB,eAAe,UAAUT,EAAS,iBAAiB;AACnF,IAAAA,EAAS,kBAAkB,EAAC,GAAGA,EAAS,gBAAA,GACpCA,EAAS,gBAAgB,UAC3BA,EAAS,gBAAgB,QAAQ,CA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AAcA,EAAc,WAAWa,CAAa;AAAA,EAAA,GAGlFd;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadUniqueValuesToSave.d.ts","sourceRoot":"","sources":["../../../src/GraphMaker/utils/loadUniqueValuesToSave.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAqBnD,wBAAsB,iCAAiC,CACrD,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,EACxB,oBAAoB,EAAE,uBAAuB,GAC5C,OAAO,CAAC,uBAAuB,CAAC,CAoHlC;AACD,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EACtC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,EACxB,oBAAoB,EAAE,uBAAuB,GAC7C,OAAO,CAAC,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"loadUniqueValuesToSave.d.ts","sourceRoot":"","sources":["../../../src/GraphMaker/utils/loadUniqueValuesToSave.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAoB,MAAM,UAAU,CAAC;AACrE,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAqBnD,wBAAsB,iCAAiC,CACrD,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,EACxB,oBAAoB,EAAE,uBAAuB,GAC5C,OAAO,CAAC,uBAAuB,CAAC,CAoHlC;AACD,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EACtC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,EACxB,oBAAoB,EAAE,uBAAuB,GAC7C,OAAO,CAAC,uBAAuB,CAAC,CAwDjC;AAED,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,EACtC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,EAClC,SAAS,EAAE,aAAa,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAuBpC"}
|
|
@@ -5,26 +5,26 @@ const A = 100, T = ["primaryGrouping", "secondaryGrouping"], y = ["grouping"], I
|
|
|
5
5
|
"lineColor",
|
|
6
6
|
"heatmapAnnotation"
|
|
7
7
|
// dendro
|
|
8
|
-
], d = (o) => o.sort((
|
|
9
|
-
async function m(o,
|
|
10
|
-
const
|
|
8
|
+
], d = (o) => o.sort((l, _) => l.label.localeCompare(_.label, "en", { numeric: !0 }));
|
|
9
|
+
async function m(o, l, _, g, f) {
|
|
10
|
+
const a = {};
|
|
11
11
|
function i(s, e) {
|
|
12
12
|
const t = o.data.byColumns.values[s], n = e ? o.data.byColumns.values[e] : null, S = /* @__PURE__ */ new Set(), p = [];
|
|
13
|
-
for (let
|
|
14
|
-
const r = String(t[
|
|
15
|
-
if (S.has(r)
|
|
13
|
+
for (let u = 0; u < t.length; u++) {
|
|
14
|
+
const r = String(t[u]);
|
|
15
|
+
if (S.has(r))
|
|
16
16
|
continue;
|
|
17
17
|
if (S.size === A) {
|
|
18
|
-
|
|
18
|
+
a[s] = null;
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
S.add(r);
|
|
22
|
-
const E = n ? String(n[
|
|
22
|
+
const E = n ? String(n[u]) : r;
|
|
23
23
|
p.push({ value: r, label: E });
|
|
24
24
|
}
|
|
25
|
-
d(p),
|
|
26
|
-
list: p.map((
|
|
27
|
-
labels: p.reduce((
|
|
25
|
+
d(p), a[s] = {
|
|
26
|
+
list: p.map((u) => u.value),
|
|
27
|
+
labels: p.reduce((u, r) => (u[r.value] = r.label, u), {}),
|
|
28
28
|
options: p
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -36,11 +36,11 @@ async function m(o, a, _, g, f) {
|
|
|
36
36
|
}
|
|
37
37
|
}), (o.settings.type === "scatterplot" || o.settings.type === "scatterplot-umap") && (I.forEach((s) => {
|
|
38
38
|
const e = o.settings[s];
|
|
39
|
-
e &&
|
|
39
|
+
e && l.getSourceInfo(e.value).type === "String" && i(e.value, e.valueLabels);
|
|
40
40
|
}), y.forEach((s) => {
|
|
41
41
|
const e = o.settings[s];
|
|
42
42
|
e == null || e.forEach(({ columnName: t }) => {
|
|
43
|
-
const n =
|
|
43
|
+
const n = l.getSourceInfo(t.value).type;
|
|
44
44
|
(n === "String" || n === "Int" || n === "Long") && i(t.value, t.valueLabels);
|
|
45
45
|
});
|
|
46
46
|
})), o.settings.type === "histogram" && R.forEach((s) => {
|
|
@@ -51,27 +51,27 @@ async function m(o, a, _, g, f) {
|
|
|
51
51
|
e && i(e.value, e.valueLabels);
|
|
52
52
|
});
|
|
53
53
|
const c = [];
|
|
54
|
-
[...
|
|
54
|
+
[...l.freeOptionsSet].forEach((s) => {
|
|
55
55
|
var t, n, S;
|
|
56
|
-
const e =
|
|
56
|
+
const e = l.getSourceInfo(s);
|
|
57
57
|
e.kind === "axis" && ((t = e.annotations) != null && t[v]) && ((n = e.annotations) == null ? void 0 : n[v]) !== "homogeneous" && ((S = e.annotations) == null ? void 0 : S[v]) !== "homogenous" && c.push(s);
|
|
58
58
|
});
|
|
59
59
|
for (const s of c)
|
|
60
|
-
if (!
|
|
61
|
-
if (f[s] && !
|
|
62
|
-
|
|
60
|
+
if (!a[s]) {
|
|
61
|
+
if (f[s] && !a[s])
|
|
62
|
+
a[s] = f[s];
|
|
63
63
|
else if (g) {
|
|
64
|
-
const e = await _.getUniqueSourceValuesWithLabels(g,
|
|
65
|
-
e.overflow ?
|
|
64
|
+
const e = await _.getUniqueSourceValuesWithLabels(g, l, s, A);
|
|
65
|
+
e.overflow ? a[s] = null : a[s] = {
|
|
66
66
|
list: e.values.map((t) => t.value),
|
|
67
67
|
options: e.values,
|
|
68
68
|
labels: e.values.reduce((t, n) => (t[n.value] = n.label, t), {})
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return a;
|
|
73
73
|
}
|
|
74
|
-
async function N(o,
|
|
74
|
+
async function N(o, l, _, g) {
|
|
75
75
|
const f = [];
|
|
76
76
|
["filters", "tabBy"].forEach((c) => {
|
|
77
77
|
const s = o[c];
|
|
@@ -81,7 +81,7 @@ async function N(o, a, _, g) {
|
|
|
81
81
|
});
|
|
82
82
|
const i = {};
|
|
83
83
|
for (const [c, s] of f) {
|
|
84
|
-
const e = await _.getUniqueSourceValuesWithLabels(g,
|
|
84
|
+
const e = await _.getUniqueSourceValuesWithLabels(g, l, c, 1, void 0, s);
|
|
85
85
|
e.values.length === 1 && (i[c] = e.values[0]);
|
|
86
86
|
}
|
|
87
87
|
return i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadUniqueValuesToSave.js","sources":["../../../src/GraphMaker/utils/loadUniqueValuesToSave.ts"],"sourcesContent":["import { AXIS_NATURE_KEY } from '../constantsCommon';\nimport { UniqueValuesBySourceMap, UniqueValuesData } from '../types';\nimport {\n Controller,\n DemoDataStore,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n SelectorStateFilter\n} from '@milaboratories/pf-plots';\nimport { ListOption } from '@platforma-sdk/ui-vue';\nimport { DendroSettings, DiscreteSettings, HistogramSettings, ScatterplotSettings } from '@milaboratories/miplots4';\n\nconst INPUTS_REQUESTING_UNIQUE_VALUES = [\n 'primaryGrouping', 'secondaryGrouping', // discrete charts\n 'grouping', 'shape', 'x', 'y', // scatterplot\n 'nodeColor', 'nodeShape', 'lineColor', 'heatmapAnnotation', // dendro\n 'filters', 'highlight', 'tabBy' // all\n] as ((keyof InputState['components'])[]);\nconst SAVED_UNIQUE_VALUES_LIMIT = 100;\n\nconst SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS = ['primaryGrouping', 'secondaryGrouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS = ['grouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_XY = ['x', 'y'];\nconst SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING = ['grouping'];\nconst SAVED_IN_CHART_DATA_DENDRO_GROUPING = [\n 'nodeColor', 'nodeShape', 'lineColor', 'heatmapAnnotation' // dendro\n];\n\nconst sortValues = (values:{value:string, label:string}[]) => values.sort((a, b) => a.label.localeCompare(b.label, 'en', {numeric: true}))\n\nexport async function getUniqueValuesFromReadyChartData(\n chartData: PlotDataAndSettings,\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n previousUniqueValues: UniqueValuesBySourceMap\n): Promise<UniqueValuesBySourceMap> {\n const resultMap:UniqueValuesBySourceMap = {};\n function addUniqueData(sourceId:string, labelId?:string) {\n const data = chartData!.data.byColumns.values[sourceId];\n const dataLabels = labelId ? chartData!.data.byColumns.values[labelId] : null;\n\n const resultSet = new Set();\n const result:{value:string, label:string}[] = [];\n for (let i = 0; i < data.length; i++) {\n const v = String(data[i]);\n if (resultSet.has(v) || data[i] === null) {\n continue;\n }\n if (resultSet.size === SAVED_UNIQUE_VALUES_LIMIT) {\n resultMap[sourceId] = null;\n return;\n }\n resultSet.add(v);\n const label = dataLabels ? String(dataLabels[i]) : v;\n result.push({value: v, label});\n }\n sortValues(result);\n resultMap[sourceId] = {\n list: result.map((el) => el.value),\n labels: result.reduce((res, el) => {\n res[el.value] = el.label;\n return res;\n }, {} as Record<string, string>),\n options: result\n };\n }\n if (chartData.settings.type === 'discrete') {\n SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS.forEach((inputName:string) => {\n const savedData = chartData.settings[inputName] as unknown as DiscreteSettings['primaryGrouping'];\n if (savedData) {\n const {columnName} = savedData;\n addUniqueData(columnName.value, columnName.valueLabels)\n }\n });\n }\n if (chartData.settings.type === 'scatterplot' || chartData.settings.type === 'scatterplot-umap') {\n SAVED_IN_CHART_DATA_SCATTERPLOT_XY.forEach((inputName:string) => {\n const columnName = chartData.settings[inputName] as unknown as ScatterplotSettings['x'];\n if (columnName) {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String') {\n addUniqueData(columnName.value, columnName.valueLabels);\n }\n }\n });\n SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS.forEach((inputName:string) => {\n const savedInGrouping = chartData.settings[inputName] as unknown as ScatterplotSettings['grouping'];\n savedInGrouping?.forEach(({columnName}) => {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String' || valueType === 'Int' || valueType === 'Long') {\n addUniqueData(columnName.value, columnName.valueLabels);\n }\n });\n });\n }\n\n if (chartData.settings.type === 'histogram') {\n SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING.forEach((inputName:string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as HistogramSettings['grouping'];\n if (savedByInputName) {\n addUniqueData(savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n if (chartData.settings.type === 'dendro') {\n SAVED_IN_CHART_DATA_DENDRO_GROUPING.forEach((inputName:string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as DendroSettings['heatmapAnnotation'];\n if (savedByInputName) {\n addUniqueData(savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n // sources for loading\n const selectedSources: string[] = [];\n ([...inputGuide.freeOptionsSet]).forEach(id => {\n const info = inputGuide.getSourceInfo(id);\n if (\n info.kind === 'axis' &&\n info.annotations?.[AXIS_NATURE_KEY] &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogeneous' &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogenous'\n ) {\n selectedSources.push(id);\n }\n });\n\n for (const source of selectedSources) {\n if (resultMap[source]) {\n continue;\n }\n if (previousUniqueValues[source] && !resultMap[source]) {\n resultMap[source] = previousUniqueValues[source];\n } else if (dataStore) {\n const uniqueValuesResponse = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, SAVED_UNIQUE_VALUES_LIMIT);\n if (uniqueValuesResponse.overflow) {\n resultMap[source] = null;\n } else {\n resultMap[source] = {\n list: uniqueValuesResponse.values.map((el) => el.value),\n options: uniqueValuesResponse.values,\n labels: uniqueValuesResponse.values.reduce((res: Record<string, string>, el) => {\n res[el.value] = el.label;\n return res;\n }, {})\n } as UniqueValuesData;\n }\n }\n }\n return resultMap;\n}\nexport async function loadUniqueValuesToSave(\n optionsState: InputState['components'],\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n previousUniqueValues: UniqueValuesBySourceMap // save null for too long lists of unique values\n):Promise<UniqueValuesBySourceMap> {\n const selectedSources: string[] = [];\n INPUTS_REQUESTING_UNIQUE_VALUES.forEach(inputName => {\n const componentState = optionsState[inputName];\n if (componentState) {\n for (const { selectedSource } of componentState.selectorStates) {\n const info = inputGuide.getSourceInfo(selectedSource);\n if (inputName === 'filters' || inputName === 'highlight') {\n if (info.type === 'String' || info.type === 'Int' || info.type === 'Long') {\n selectedSources.push(selectedSource);\n }\n } else if (inputName === 'grouping' || inputName === 'x' || inputName === 'y') {\n if (info.type === 'String') {\n selectedSources.push(selectedSource);\n }\n } else {\n selectedSources.push(selectedSource);\n }\n }\n }\n });\n ([...inputGuide.freeOptionsSet]).forEach(id => {\n const info = inputGuide.getSourceInfo(id);\n if (\n info.kind === 'axis' &&\n info.annotations?.[AXIS_NATURE_KEY] &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogeneous' &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogenous'\n ) {\n selectedSources.push(id);\n }\n });\n ([...inputGuide.axesToBeFixedSet]).forEach(id => {\n selectedSources.push(id);\n });\n const nextUniqueValuesData: UniqueValuesBySourceMap = {};\n for (const source of selectedSources) {\n if (previousUniqueValues[source]) {\n nextUniqueValuesData[source] = previousUniqueValues[source];\n } else if (dataStore) {\n const uniqueValuesResponse = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, SAVED_UNIQUE_VALUES_LIMIT);\n if (uniqueValuesResponse.overflow) {\n nextUniqueValuesData[source] = null;\n } else {\n console.log('responce', uniqueValuesResponse)\n nextUniqueValuesData[source] = {\n list: uniqueValuesResponse.values.map((el) => el.value),\n options: uniqueValuesResponse.values,\n labels: uniqueValuesResponse.values.reduce((res: Record<string, string>, el) => {\n res[el.value] = el.label;\n return res;\n }, {})\n } as UniqueValuesData;\n }\n }\n }\n return nextUniqueValuesData;\n}\n\nexport async function loadFilterLabelsForTitle(\n optionsState: InputState['components'],\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n):Promise<Record<string, ListOption>> {\n const selected: [string, string][] = [];\n const INPUTS_REQUESTING_LABELS = ['filters', 'tabBy'] as ((keyof InputState['components'])[]);\n INPUTS_REQUESTING_LABELS.forEach(inputName => {\n const componentState = optionsState[inputName];\n if (componentState) {\n for (const { selectedSource, selectedFilterValue, type } of componentState.selectorStates as SelectorStateFilter[]) {\n if (inputName === 'filters' && type === 'equals' && selectedFilterValue) {\n selected.push([selectedSource, selectedFilterValue]);\n } else if (selectedFilterValue) {\n selected.push([selectedSource, selectedFilterValue]);\n }\n }\n }\n });\n const result:Record<string, ListOption> = {};\n for (const [source, selectedValue] of selected) {\n const uniqueValuesResponse = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, 1, undefined, selectedValue);\n if (uniqueValuesResponse.values.length === 1) {\n result[source] = uniqueValuesResponse.values[0];\n }\n }\n return result;\n}"],"names":["SAVED_UNIQUE_VALUES_LIMIT","SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_XY","SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING","SAVED_IN_CHART_DATA_DENDRO_GROUPING","sortValues","values","b","getUniqueValuesFromReadyChartData","chartData","inputGuide","controller","dataStore","previousUniqueValues","resultMap","addUniqueData","sourceId","labelId","data","dataLabels","resultSet","result","i","v","label","el","res","inputName","savedData","columnName","savedInGrouping","valueType","savedByInputName","selectedSources","id","info","_a","AXIS_NATURE_KEY","_b","_c","source","uniqueValuesResponse","loadFilterLabelsForTitle","optionsState","selected","componentState","selectedSource","selectedFilterValue","type","selectedValue"],"mappings":";AAmBA,MAAMA,IAA4B,KAE5BC,IAAyC,CAAC,mBAAmB,mBAAmB,GAChFC,IAA4C,CAAC,UAAU,GACvDC,IAAqC,CAAC,KAAK,GAAG,GAC9CC,IAAyC,CAAC,UAAU,GACpDC,IAAsC;AAAA,EAC1C;AAAA,EAAa;AAAA,EAAa;AAAA,EAAa;AAAA;AACzC,GAEMC,IAAa,CAACC,MAA0CA,EAAO,KAAK,CAAC,GAAGC,MAAM,EAAE,MAAM,cAAcA,EAAE,OAAO,MAAM,EAAC,SAAS,GAAA,CAAK,CAAC;AAEzI,eAAsBC,EACpBC,GACAC,GACAC,GACAC,GACAC,GACkC;AAClC,QAAMC,IAAoC,CAAA;AAC1C,WAASC,EAAcC,GAAiBC,GAAiB;AACvD,UAAMC,IAAOT,EAAW,KAAK,UAAU,OAAOO,CAAQ,GAChDG,IAAaF,IAAUR,EAAW,KAAK,UA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IAAuB,MAAM9B,EAAW,gCAAgCC,GAAWF,GAAY8B,GAAQzC,CAAyB;AACtI,QAAI0C,EAAqB,WACvB3B,EAAU0B,CAAM,IAAI,OAEpB1B,EAAU0B,CAAM,IAAI;AAAA,UAClB,MAAMC,EAAqB,OAAO,IAAI,CAAChB,MAAOA,EAAG,KAAK;AAAA,UACtD,SAASgB,EAAqB;AAAA,UAC9B,QAAQA,EAAqB,OAAO,OAAO,CAACf,GAA6BD,OACvEC,EAAID,EAAG,KAAK,IAAIA,EAAG,OACZC,IACN,CAAA,CAAE;AAAA,QAAA;AAAA,MAGX;AAAA;AAEF,SAAOZ;AACT;AAkEA,eAAsB4B,EACpBC,GACAjC,GACAC,GACAC,GACoC;AACpC,QAAMgC,IAA+B,CAAA;AAErC,EADiC,CAAC,WAAW,OAAO,EAC3B,QAAQ,CAAAjB,MAAa;AAC5C,UAAMkB,IAAiBF,EAAahB,CAAS;AAC7C,QAAIkB;AACF,iBAAW,EAAE,gBAAAC,GAAgB,qBAAAC,GAAqB,MAAAC,EAAA,KAAUH,EAAe;AACzE,QAAIlB,MAAc,aAAaqB,MAAS,YAAYD,IAClDH,EAAS,KAAK,CAACE,GAAgBC,CAAmB,CAAC,IAC1CA,KACTH,EAAS,KAAK,CAACE,GAAgBC,CAAmB,CAAC;AAAA,EAI3D,CAAC;AACD,QAAM1B,IAAoC,CAAA;AAC1C,aAAW,CAACmB,GAAQS,CAAa,KAAKL,GAAU;AAC9C,UAAMH,IAAuB,MAAM9B,EAAW,gCAAgCC,GAAWF,GAAY8B,GAAQ,GAAG,QAAWS,CAAa;AACxI,IAAIR,EAAqB,OAAO,WAAW,MACzCpB,EAAOmB,CAAM,IAAIC,EAAqB,OAAO,CAAC;AAAA,EAElD;AACA,SAAOpB;AACT;"}
|
|
1
|
+
{"version":3,"file":"loadUniqueValuesToSave.js","sources":["../../../src/GraphMaker/utils/loadUniqueValuesToSave.ts"],"sourcesContent":["import { AXIS_NATURE_KEY } from '../constantsCommon';\nimport { UniqueValuesBySourceMap, UniqueValuesData } from '../types';\nimport {\n Controller,\n DemoDataStore,\n InputGuide,\n InputState,\n PlotDataAndSettings,\n SelectorStateFilter\n} from '@milaboratories/pf-plots';\nimport { ListOption } from '@platforma-sdk/ui-vue';\nimport { DendroSettings, DiscreteSettings, HistogramSettings, ScatterplotSettings } from '@milaboratories/miplots4';\n\nconst INPUTS_REQUESTING_UNIQUE_VALUES = [\n 'primaryGrouping', 'secondaryGrouping', // discrete charts\n 'grouping', 'shape', 'x', 'y', // scatterplot\n 'nodeColor', 'nodeShape', 'lineColor', 'heatmapAnnotation', // dendro\n 'filters', 'highlight', 'tabBy' // all\n] as ((keyof InputState['components'])[]);\nconst SAVED_UNIQUE_VALUES_LIMIT = 100;\n\nconst SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS = ['primaryGrouping', 'secondaryGrouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS = ['grouping'];\nconst SAVED_IN_CHART_DATA_SCATTERPLOT_XY = ['x', 'y'];\nconst SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING = ['grouping'];\nconst SAVED_IN_CHART_DATA_DENDRO_GROUPING = [\n 'nodeColor', 'nodeShape', 'lineColor', 'heatmapAnnotation' // dendro\n];\n\nconst sortValues = (values:{value:string, label:string}[]) => values.sort((a, b) => a.label.localeCompare(b.label, 'en', {numeric: true}))\n\nexport async function getUniqueValuesFromReadyChartData(\n chartData: PlotDataAndSettings,\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n previousUniqueValues: UniqueValuesBySourceMap\n): Promise<UniqueValuesBySourceMap> {\n const resultMap:UniqueValuesBySourceMap = {};\n function addUniqueData(sourceId:string, labelId?:string) {\n const data = chartData!.data.byColumns.values[sourceId];\n const dataLabels = labelId ? chartData!.data.byColumns.values[labelId] : null;\n\n const resultSet = new Set();\n const result:{value:string, label:string}[] = [];\n for (let i = 0; i < data.length; i++) {\n const v = String(data[i]);\n if (resultSet.has(v)) {\n continue;\n }\n if (resultSet.size === SAVED_UNIQUE_VALUES_LIMIT) {\n resultMap[sourceId] = null;\n return;\n }\n resultSet.add(v);\n const label = dataLabels ? String(dataLabels[i]) : v;\n result.push({value: v, label});\n }\n sortValues(result);\n resultMap[sourceId] = {\n list: result.map((el) => el.value),\n labels: result.reduce((res, el) => {\n res[el.value] = el.label;\n return res;\n }, {} as Record<string, string>),\n options: result\n };\n }\n if (chartData.settings.type === 'discrete') {\n SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS.forEach((inputName:string) => {\n const savedData = chartData.settings[inputName] as unknown as DiscreteSettings['primaryGrouping'];\n if (savedData) {\n const {columnName} = savedData;\n addUniqueData(columnName.value, columnName.valueLabels)\n }\n });\n }\n if (chartData.settings.type === 'scatterplot' || chartData.settings.type === 'scatterplot-umap') {\n SAVED_IN_CHART_DATA_SCATTERPLOT_XY.forEach((inputName:string) => {\n const columnName = chartData.settings[inputName] as unknown as ScatterplotSettings['x'];\n if (columnName) {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String') {\n addUniqueData(columnName.value, columnName.valueLabels);\n }\n }\n });\n SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS.forEach((inputName:string) => {\n const savedInGrouping = chartData.settings[inputName] as unknown as ScatterplotSettings['grouping'];\n savedInGrouping?.forEach(({columnName}) => {\n const valueType = inputGuide.getSourceInfo(columnName.value).type;\n if (valueType === 'String' || valueType === 'Int' || valueType === 'Long') {\n addUniqueData(columnName.value, columnName.valueLabels);\n }\n });\n });\n }\n\n if (chartData.settings.type === 'histogram') {\n SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING.forEach((inputName:string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as HistogramSettings['grouping'];\n if (savedByInputName) {\n addUniqueData(savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n if (chartData.settings.type === 'dendro') {\n SAVED_IN_CHART_DATA_DENDRO_GROUPING.forEach((inputName:string) => {\n const savedByInputName = chartData.settings[inputName] as unknown as DendroSettings['heatmapAnnotation'];\n if (savedByInputName) {\n addUniqueData(savedByInputName.value, savedByInputName.valueLabels);\n }\n });\n }\n\n // sources for loading\n const selectedSources: string[] = [];\n ([...inputGuide.freeOptionsSet]).forEach(id => {\n const info = inputGuide.getSourceInfo(id);\n if (\n info.kind === 'axis' &&\n info.annotations?.[AXIS_NATURE_KEY] &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogeneous' &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogenous'\n ) {\n selectedSources.push(id);\n }\n });\n\n for (const source of selectedSources) {\n if (resultMap[source]) {\n continue;\n }\n if (previousUniqueValues[source] && !resultMap[source]) {\n resultMap[source] = previousUniqueValues[source];\n } else if (dataStore) {\n const uniqueValuesResponse = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, SAVED_UNIQUE_VALUES_LIMIT);\n if (uniqueValuesResponse.overflow) {\n resultMap[source] = null;\n } else {\n resultMap[source] = {\n list: uniqueValuesResponse.values.map((el) => el.value),\n options: uniqueValuesResponse.values,\n labels: uniqueValuesResponse.values.reduce((res: Record<string, string>, el) => {\n res[el.value] = el.label;\n return res;\n }, {})\n } as UniqueValuesData;\n }\n }\n }\n return resultMap;\n}\nexport async function loadUniqueValuesToSave(\n optionsState: InputState['components'],\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n previousUniqueValues: UniqueValuesBySourceMap // save null for too long lists of unique values\n):Promise<UniqueValuesBySourceMap> {\n const selectedSources: string[] = [];\n INPUTS_REQUESTING_UNIQUE_VALUES.forEach(inputName => {\n const componentState = optionsState[inputName];\n if (componentState) {\n for (const { selectedSource } of componentState.selectorStates) {\n const info = inputGuide.getSourceInfo(selectedSource);\n if (inputName === 'filters' || inputName === 'highlight') {\n if (info.type === 'String' || info.type === 'Int' || info.type === 'Long') {\n selectedSources.push(selectedSource);\n }\n } else if (inputName === 'grouping' || inputName === 'x' || inputName === 'y') {\n if (info.type === 'String') {\n selectedSources.push(selectedSource);\n }\n } else {\n selectedSources.push(selectedSource);\n }\n }\n }\n });\n ([...inputGuide.freeOptionsSet]).forEach(id => {\n const info = inputGuide.getSourceInfo(id);\n if (\n info.kind === 'axis' &&\n info.annotations?.[AXIS_NATURE_KEY] &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogeneous' &&\n info.annotations?.[AXIS_NATURE_KEY] !== 'homogenous'\n ) {\n selectedSources.push(id);\n }\n });\n ([...inputGuide.axesToBeFixedSet]).forEach(id => {\n selectedSources.push(id);\n });\n const nextUniqueValuesData: UniqueValuesBySourceMap = {};\n for (const source of selectedSources) {\n if (previousUniqueValues[source]) {\n nextUniqueValuesData[source] = previousUniqueValues[source];\n } else if (dataStore) {\n const uniqueValuesResponse = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, SAVED_UNIQUE_VALUES_LIMIT);\n if (uniqueValuesResponse.overflow) {\n nextUniqueValuesData[source] = null;\n } else {\n nextUniqueValuesData[source] = {\n list: uniqueValuesResponse.values.map((el) => el.value),\n options: uniqueValuesResponse.values,\n labels: uniqueValuesResponse.values.reduce((res: Record<string, string>, el) => {\n res[el.value] = el.label;\n return res;\n }, {})\n } as UniqueValuesData;\n }\n }\n }\n return nextUniqueValuesData;\n}\n\nexport async function loadFilterLabelsForTitle(\n optionsState: InputState['components'],\n inputGuide: InputGuide<InputState>,\n controller: Controller<InputState>,\n dataStore: DemoDataStore,\n):Promise<Record<string, ListOption>> {\n const selected: [string, string][] = [];\n const INPUTS_REQUESTING_LABELS = ['filters', 'tabBy'] as ((keyof InputState['components'])[]);\n INPUTS_REQUESTING_LABELS.forEach(inputName => {\n const componentState = optionsState[inputName];\n if (componentState) {\n for (const { selectedSource, selectedFilterValue, type } of componentState.selectorStates as SelectorStateFilter[]) {\n if (inputName === 'filters' && type === 'equals' && selectedFilterValue) {\n selected.push([selectedSource, selectedFilterValue]);\n } else if (selectedFilterValue) {\n selected.push([selectedSource, selectedFilterValue]);\n }\n }\n }\n });\n const result:Record<string, ListOption> = {};\n for (const [source, selectedValue] of selected) {\n const uniqueValuesResponse = await controller.getUniqueSourceValuesWithLabels(dataStore, inputGuide, source, 1, undefined, selectedValue);\n if (uniqueValuesResponse.values.length === 1) {\n result[source] = uniqueValuesResponse.values[0];\n }\n }\n return result;\n}"],"names":["SAVED_UNIQUE_VALUES_LIMIT","SAVED_IN_CHART_DATA_DISCRETE_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_GROUPINGS","SAVED_IN_CHART_DATA_SCATTERPLOT_XY","SAVED_IN_CHART_DATA_HISTOGRAM_GROUPING","SAVED_IN_CHART_DATA_DENDRO_GROUPING","sortValues","values","a","b","getUniqueValuesFromReadyChartData","chartData","inputGuide","controller","dataStore","previousUniqueValues","resultMap","addUniqueData","sourceId","labelId","data","dataLabels","resultSet","result","i","v","label","el","res","inputName","savedData","columnName","savedInGrouping","valueType","savedByInputName","selectedSources","id","info","_a","AXIS_NATURE_KEY","_b","_c","source","uniqueValuesResponse","loadFilterLabelsForTitle","optionsState","selected","componentState","selectedSource","selectedFilterValue","type","selectedValue"],"mappings":";AAmBA,MAAMA,IAA4B,KAE5BC,IAAyC,CAAC,mBAAmB,mBAAmB,GAChFC,IAA4C,CAAC,UAAU,GACvDC,IAAqC,CAAC,KAAK,GAAG,GAC9CC,IAAyC,CAAC,UAAU,GACpDC,IAAsC;AAAA,EAC1C;AAAA,EAAa;AAAA,EAAa;AAAA,EAAa;AAAA;AACzC,GAEMC,IAAa,CAACC,MAA0CA,EAAO,KAAK,CAACC,GAAGC,MAAMD,EAAE,MAAM,cAAcC,EAAE,OAAO,MAAM,EAAC,SAAS,GAAA,CAAK,CAAC;AAEzI,eAAsBC,EACpBC,GACAC,GACAC,GACAC,GACAC,GACkC;AAClC,QAAMC,IAAoC,CAAA;AAC1C,WAASC,EAAcC,GAAiBC,GAAiB;AACvD,UAAMC,IAAOT,EAAW,KA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
|
2
2
|
import { r as D } from "../../../_virtual/index.js";
|
|
3
3
|
import { StackedBarElement as w } from "./StackedBarElement.js";
|
|
4
4
|
import b from "../../../node_modules/d3-shape/src/area.js";
|
|
5
5
|
import { bumpX as A, bumpY as E } from "../../../node_modules/d3-shape/src/curve/bump.js";
|
|
6
|
-
function
|
|
6
|
+
function G(e) {
|
|
7
7
|
return e && typeof e == "object" && "type" in e && e.type === "secondaryGrouping";
|
|
8
8
|
}
|
|
9
|
-
function S(e, t, r,
|
|
9
|
+
function S(e, t, r, a, y) {
|
|
10
10
|
if (r && typeof r == "object" && "type" in r) {
|
|
11
11
|
if (r.type === "primaryGrouping")
|
|
12
|
-
return e.xPrimaryAes(
|
|
12
|
+
return e.xPrimaryAes(a)[t];
|
|
13
13
|
if (r.type === "secondaryGrouping")
|
|
14
14
|
return e.xSecondaryAes(y)[t];
|
|
15
15
|
}
|
|
16
16
|
return r;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const h = (r - t) / 2, C = v.
|
|
18
|
+
function K(e, t, r, a, y, f, v) {
|
|
19
|
+
const h = (r - t) / 2, C = v.reduce((i, n) => {
|
|
20
20
|
const s = {};
|
|
21
|
-
let
|
|
22
|
-
return y.forEach((
|
|
21
|
+
let o = 0;
|
|
22
|
+
return y.forEach((l) => {
|
|
23
23
|
var c;
|
|
24
|
-
const p = ((c =
|
|
25
|
-
s[
|
|
26
|
-
y1:
|
|
27
|
-
y2:
|
|
28
|
-
},
|
|
29
|
-
}), s;
|
|
30
|
-
});
|
|
31
|
-
return y.map((
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}),
|
|
36
|
-
return { secondaryKey:
|
|
24
|
+
const p = ((c = n.valuesMap[l]) == null ? void 0 : c.height) ?? 0;
|
|
25
|
+
s[l] = {
|
|
26
|
+
y1: o,
|
|
27
|
+
y2: o + p
|
|
28
|
+
}, o += p;
|
|
29
|
+
}), i[n.primaryGrouping] = s, i;
|
|
30
|
+
}, {});
|
|
31
|
+
return y.map((i) => {
|
|
32
|
+
const n = a.flatMap((o) => {
|
|
33
|
+
const l = C[o], c = e.xPrimary(o) ?? 0, p = e.y(l[i].y1), x = e.y(l[i].y2), u = [c + h, p, x], g = [c + r - h, p, x];
|
|
34
|
+
return f ? [u, g] : [g, u];
|
|
35
|
+
}), s = (f ? b().curve(A).x((o) => o[0]).y0((o) => o[1]).y1((o) => o[2])(n) : b().curve(E).y((o) => o[0]).x0((o) => o[1]).x1((o) => o[2])(n)) ?? "";
|
|
36
|
+
return { secondaryKey: i, pathD: s };
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function M(e, t) {
|
|
40
40
|
return e.meta.showBars ? e.aes.barWidth === "auto" ? t * 0.2 : Math.min(t, e.aes.barWidth) : 0;
|
|
41
41
|
}
|
|
42
42
|
function O({
|
|
43
43
|
facetKey: e,
|
|
44
44
|
scales: t,
|
|
45
45
|
orientation: r,
|
|
46
|
-
layerData:
|
|
46
|
+
layerData: a,
|
|
47
47
|
sideDistances: y,
|
|
48
|
-
showTooltips:
|
|
48
|
+
showTooltips: f,
|
|
49
49
|
secondaryGrouping: v,
|
|
50
50
|
activeElementContainer: h,
|
|
51
51
|
tooltipsContainer: C,
|
|
52
|
-
tooltipsData:
|
|
52
|
+
tooltipsData: i
|
|
53
53
|
}) {
|
|
54
|
-
const [
|
|
54
|
+
const [n, s] = D.useState(null), o = r === "vertical", l = t.xPrimary.bandwidth(), c = M(a, l), p = t.xPrimary.domain(), x = t.xSecondary.domain().reverse(), u = G(a.aes.fillColor) || typeof a.aes.fillColor == "string", g = u ? K(
|
|
55
55
|
t,
|
|
56
|
-
p,
|
|
57
56
|
c,
|
|
58
|
-
|
|
57
|
+
l,
|
|
58
|
+
p,
|
|
59
59
|
x,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
o,
|
|
61
|
+
a.geoms[e]
|
|
62
62
|
) : [];
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ d.jsxs("g", { children: [
|
|
64
|
+
/* @__PURE__ */ d.jsx("g", { children: u && g.map(({ secondaryKey: m, pathD: j }) => /* @__PURE__ */ d.jsx(
|
|
65
65
|
"path",
|
|
66
66
|
{
|
|
67
67
|
d: j,
|
|
68
|
-
fill: S(t, "fillColor",
|
|
69
|
-
opacity:
|
|
70
|
-
onMouseEnter: () =>
|
|
71
|
-
onMouseLeave: () =>
|
|
68
|
+
fill: S(t, "fillColor", a.aes.fillColor, p[0], m),
|
|
69
|
+
opacity: a.aes.areaOpacity * (n !== null && m !== n ? 0.5 : 1),
|
|
70
|
+
onMouseEnter: () => s(m),
|
|
71
|
+
onMouseLeave: () => s(null)
|
|
72
72
|
},
|
|
73
|
-
|
|
73
|
+
m
|
|
74
74
|
)) }),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ d.jsx("g", { children: a.meta.showBars && a.geoms[e].map((m) => /* @__PURE__ */ d.jsx(
|
|
76
76
|
w,
|
|
77
77
|
{
|
|
78
78
|
facetKey: e,
|
|
79
|
-
geom:
|
|
80
|
-
elementsAmount:
|
|
79
|
+
geom: m,
|
|
80
|
+
elementsAmount: a.geoms[e].length,
|
|
81
81
|
scales: t,
|
|
82
82
|
orientation: r,
|
|
83
83
|
aes: {
|
|
84
|
-
...
|
|
85
|
-
width:
|
|
86
|
-
opacity:
|
|
84
|
+
...a.aes,
|
|
85
|
+
width: c,
|
|
86
|
+
opacity: a.aes.barsOpacity
|
|
87
87
|
},
|
|
88
|
-
normalize:
|
|
88
|
+
normalize: a.meta.normalize,
|
|
89
89
|
sideDistances: y,
|
|
90
|
-
showTooltips:
|
|
90
|
+
showTooltips: f,
|
|
91
91
|
secondaryGrouping: v,
|
|
92
|
-
tooltipsData:
|
|
92
|
+
tooltipsData: i,
|
|
93
93
|
activeElementContainer: h,
|
|
94
94
|
tooltipsContainer: C,
|
|
95
|
-
activeKey:
|
|
96
|
-
onSectionHover:
|
|
95
|
+
activeKey: n,
|
|
96
|
+
onSectionHover: s
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
m.key
|
|
99
99
|
)) })
|
|
100
100
|
] });
|
|
101
101
|
}
|