@milaboratories/graph-maker 1.1.140 → 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/index.vue.js +24 -23
- package/dist/GraphMaker/index.vue.js.map +1 -1
- package/dist/GraphMaker/store.js +9 -9
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.d.ts.map +1 -1
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js +54 -52
- package/dist/GraphMaker/utils/createChartSettingsForRender/composeScatterplotSettings.js.map +1 -1
- package/dist/GraphMaker/utils/loadDefaultSources.js +4 -3
- package/dist/GraphMaker/utils/loadDefaultSources.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +3 -5
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- 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 -3426
- 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 +2 -2
- 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":"utils.js","sources":["../../../../../node_modules/@milaboratories/pf-plots/src/utils.ts"],"sourcesContent":["import {getNormalizedAxesList, LinkerMap, SingleValuePredicateV2} from '@milaboratories/pl-model-common';\nimport {SelectorState} from './common';\nimport {TableOuterJoinResult} from './pframe/ColumnsProvider';\nimport type {DataStore, PValue} from './store';\nimport type {ColumnOrAxisIdString} from './spec';\nimport {isAxisId} from './spec';\nimport {AxisId, ColumnId, columnOrAxisIdFromString, isColumnId} from './spec';\nimport type {AxisData, ColumnData, InputState, SelectorStateFilter} from './common';\nimport {\n AXIS_NATURE_KEY,\n COLUMN_DOMAIN_KEY,\n COLUMN_LABEL_KEY,\n COLUMN_NAME_KEY, DISCRETE_FILTER_KEY, IS_LINKER_COLUMN,\n IS_VIRTUAL_COLUMN,\n SUBSET_FILTER_KEY,\n} from './constants';\nimport {\n AxisSpec,\n type PColumnSpec,\n type PObjectId,\n type PTableRecordSingleValueFilterV2,\n} from '@milaboratories/pl-model-common';\nimport canonicalize from 'canonicalize';\nimport { DemoDataStore } from './demoStore';\n\nexport async function addSourceInfoToMap( // by column id / axis id, without qualifications\n store: DataStore,\n selectedIdStr: ColumnOrAxisIdString,\n label: string | undefined,\n dataMap: Map<string, ColumnData | AxisData>,\n dataAxesList: AxisSpec[],\n dataAxes: Set<ColumnOrAxisIdString>,\n fixedAxesAllowed = true,\n linkerMap: LinkerMap\n) {\n const sourceId = columnOrAxisIdFromString(selectedIdStr);\n if (isColumnId(sourceId)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(sourceId);\n if (!columnSpec) {\n return;\n }\n const extraAxesIds = getNotAllowedAxes(\n columnSpec,\n dataAxesList,\n dataAxes,\n linkerMap\n ).map((axisSpec) => AxisId.fromAxisSpec(axisSpec).toCanonicalString());\n\n const extraAxesSet = new Set(extraAxesIds);\n const axesIds = columnSpec.axesSpec.map(axisSpec => AxisId.fromAxisSpec(axisSpec).toCanonicalString());\n const extraAxesIndexes: Record<string, number> = {};\n if (fixedAxesAllowed) {\n axesIds.forEach((id, idx) => {\n if (extraAxesSet.has(id)) {\n extraAxesIndexes[id] = idx;\n }\n });\n }\n const columnInfo: ColumnData = {\n kind: 'column',\n name: columnSpec.name,\n label: label ?? (await getColumnOrAxisLabel(store, selectedIdStr, [])),\n type: columnSpec.valueType,\n spec: columnSpec,\n annotations: columnSpec.annotations,\n isSubsetFilter: columnSpec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter: columnSpec.valueType === 'String' || columnSpec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n axesToBeFixed: extraAxesIds,\n axesToBeFixedIndexes: extraAxesIndexes,\n };\n dataMap.set(sourceId.toCanonicalString(), columnInfo);\n for (const axisSpec of columnSpec.axesSpec) {\n const axisId = AxisId.fromAxisSpec(axisSpec);\n const axisIdStr = axisId.toCanonicalString();\n if (dataMap.has(axisIdStr)) {\n continue;\n }\n const mustBeConsumed = axisMustBeConsumed(axisSpec);\n const axisInfo: AxisData = {\n kind: 'axis',\n name: axisSpec.name,\n label: await getColumnOrAxisLabel(store, axisIdStr, [selectedIdStr]),\n type: axisSpec.type,\n mustBeConsumed,\n dividable: false,\n spec: axisSpec,\n annotations: axisSpec.annotations,\n isSubsetFilter: axisSpec.annotations?.[SUBSET_FILTER_KEY] === 'true',\n isDiscreteFilter: axisSpec.type === 'String' || axisSpec.annotations?.[DISCRETE_FILTER_KEY] === 'true',\n parentSources: [selectedIdStr],\n };\n dataMap.set(axisIdStr, axisInfo);\n }\n }\n}\n\nexport function getDefaultInfo(sourceIdStr: ColumnOrAxisIdString): ColumnData | AxisData {\n const item = columnOrAxisIdFromString(sourceIdStr);\n const {name, type} = item;\n if (isColumnId(item)) {\n return {\n kind: 'column',\n name: '',\n label: ' ',\n type: item.type,\n spec: {axesSpec: [], kind: 'PColumn', valueType: item.type, name},\n annotations: undefined,\n isSubsetFilter: false,\n isDiscreteFilter: item.type === 'String',\n axesToBeFixed: [],\n axesToBeFixedIndexes: {}\n };\n }\n return {\n kind: 'axis',\n name: '',\n label: ' ',\n type: type,\n spec: {type, name},\n mustBeConsumed: false,\n dividable: false,\n annotations: undefined,\n isSubsetFilter: false,\n isDiscreteFilter: type === 'String',\n parentSources: [],\n };\n}\n\nexport function getStateCopy<State extends InputState>(state: State): State {\n return {\n type: state.type,\n components: {...state.components},\n dividedAxes: {...state.dividedAxes},\n } as State;\n}\n\nexport function getFilterFromState(state: SelectorStateFilter): PTableRecordSingleValueFilterV2[] {\n const {selectedSource, type, selectedFilterRange, selectedFilterValue} = state;\n const id = columnOrAxisIdFromString(selectedSource);\n if (!id) {\n throw Error('Empty source selected');\n }\n if (type === 'range') {\n const rangeFilters = [];\n if (selectedFilterRange?.max !== undefined) {\n rangeFilters.push({\n type: 'bySingleColumnV2' as const,\n column: isAxisId(id) ? {type: 'axis' as const, id: id.toPFrameId()} : {type: 'column' as const, id: id.name as PObjectId},\n predicate: {\n operator: 'LessOrEqual',\n reference: selectedFilterRange.max\n } as SingleValuePredicateV2,\n })\n }\n if (selectedFilterRange?.min !== undefined) {\n rangeFilters.push({\n type: 'bySingleColumnV2' as const,\n column: isAxisId(id) ? {type: 'axis' as const, id: id.toPFrameId()} : {type: 'column' as const, id: id.name as PObjectId},\n predicate: {\n operator: 'GreaterOrEqual',\n reference: selectedFilterRange?.min as number,\n } as SingleValuePredicateV2,\n })\n }\n return rangeFilters;\n } else if (type === 'subset') {\n return [\n {\n type: 'bySingleColumnV2' as const,\n column: isAxisId(id) ? {type: 'axis' as const, id: id.toPFrameId()} : {type: 'column' as const, id: id.name as PObjectId},\n predicate: {\n operator: 'Not',\n operand: { operator: 'IsNA' }\n } as SingleValuePredicateV2,\n },\n ]\n }\n if (typeof selectedFilterValue === 'undefined') {\n return [];\n }\n return [\n {\n type: 'bySingleColumnV2' as const,\n column: isAxisId(id) ? {type: 'axis' as const, id: id.toPFrameId()} : {\n type: 'column' as const,\n id: id.name as PObjectId,\n },\n predicate: {\n operator: 'Equal',\n reference:\n id.type === 'String'\n ? String(selectedFilterValue)\n : (Number(selectedFilterValue) as string | number),\n } as SingleValuePredicateV2,\n },\n ];\n}\n\nexport function getFiltersFromStates(states: SelectorStateFilter[]): PTableRecordSingleValueFilterV2[] {\n const result: PTableRecordSingleValueFilterV2[] = [];\n for (const state of states) {\n result.push(...getFilterFromState(state));\n }\n return result;\n}\n\nexport function getGlobalId(spec: PColumnSpec): string;\nexport function getGlobalId(spec: AxisSpec): string;\nexport function getGlobalId(spec: AxisSpec | PColumnSpec): string {\n if ('kind' in spec && spec.kind === 'PColumn') {\n const name = spec.name ?? spec.annotations?.[COLUMN_NAME_KEY];\n const domain = spec.domain ?? spec.annotations?.[COLUMN_DOMAIN_KEY];\n return canonicalize({name, domain})!;\n }\n const name = spec.name;\n const domain = spec.domain;\n return canonicalize({name, domain})!;\n}\n\nasync function getAxisSpecFromParents(store: DataStore, axisId: AxisId, parentSources: ColumnOrAxisIdString[]) {\n for (const parentSource of parentSources) {\n const parentId = columnOrAxisIdFromString(parentSource);\n if (isColumnId(parentId)) {\n const columnSpec = await store.pFrameProvider.getColumnSpecById(parentId);\n const spec = (columnSpec?.axesSpec ?? []).find(\n s => AxisId.fromAxisSpec(s).toCanonicalString() === axisId.toCanonicalString(),\n );\n if (spec) {\n return spec;\n }\n }\n }\n return null;\n}\n\nconst LABEL_COLUMN_NAME = 'pl7.app/label';\n\nexport async function getColumnOrAxisValueLabelsId(\n store: DataStore,\n selectedSource: ColumnOrAxisIdString,\n parentSources: ColumnOrAxisIdString[],\n): Promise<ColumnId | undefined> {\n const id = columnOrAxisIdFromString(selectedSource);\n if (isColumnId(id)) {\n return undefined;\n }\n async function getAxisGlobalId(axisId: AxisId) {\n const spec = await getAxisSpecFromParents(store, axisId, parentSources);\n return spec ? getGlobalId(spec) : null;\n }\n const labelColumns = await store.pFrameProvider.getColumnsFull([], false, undefined, [LABEL_COLUMN_NAME]);\n const sourceGlobalId = await getAxisGlobalId(id);\n const labelColumn = labelColumns.find(({spec}) => {\n return spec && spec.axesSpec.length === 1 && getGlobalId(spec.axesSpec[0]) === sourceGlobalId;\n });\n return labelColumn ? new ColumnId({name: labelColumn.columnId, type: labelColumn.spec.valueType}) : undefined;\n}\n\nexport async function getColumnOrAxisSpec(\n store: DataStore,\n selectedSource: ColumnOrAxisIdString,\n parentSources: ColumnOrAxisIdString[],\n) {\n const selectedId = columnOrAxisIdFromString(selectedSource);\n const labelsColumn = await getColumnOrAxisValueLabelsId(store, selectedSource, parentSources);\n\n let spec: AxisSpec | PColumnSpec | null;\n if (isColumnId(selectedId)) {\n spec = await store.pFrameProvider.getColumnSpecById(labelsColumn ?? selectedId);\n } else {\n spec = labelsColumn\n ? await store.pFrameProvider.getColumnSpecById(labelsColumn)\n : await getAxisSpecFromParents(store, selectedId, parentSources);\n }\n return spec;\n}\n\nexport async function getColumnOrAxisLabel(\n store: DataStore,\n selectedSource: ColumnOrAxisIdString,\n parentSources: ColumnOrAxisIdString[],\n) {\n const spec = await getColumnOrAxisSpec(store, selectedSource, parentSources);\n if (!spec) {\n return '';\n }\n const label = spec.annotations?.[COLUMN_LABEL_KEY] ?? spec.name;\n return store.labelsModifier(spec.name, label);\n}\n\nexport function axisMustBeConsumed(spec: AxisSpec) {\n const axisNature = spec.annotations?.[AXIS_NATURE_KEY]?.toLowerCase();\n return Boolean(axisNature) && axisNature !== 'homogenous' && axisNature !== 'homogeneous';\n}\n\nexport function checkSourceBySpecForFilters(spec: PColumnSpec | AxisSpec) {\n //const type = 'kind' in spec && spec.kind === 'PColumn' ? spec.valueType : spec.type;\n if (spec.annotations?.[SUBSET_FILTER_KEY] === 'true') {\n return true;\n }\n if (spec.annotations?.[DISCRETE_FILTER_KEY] === 'true') {\n return true;\n }\n //return type === 'Double' || type === 'Float' || type === 'Int' || type === 'Long'\n return true;\n}\n\nexport function dataColumnPredicateDefault(spec: PColumnSpec) {\n return !spec.name.includes('metadata') && !(spec.annotations?.[IS_VIRTUAL_COLUMN] === 'true') && !(spec.annotations?.[SUBSET_FILTER_KEY] === 'true');\n}\n\nexport async function getAxesSpecsFromSources(store:DataStore, idStrs: ColumnOrAxisIdString[]):Promise<AxisSpec[]>{\n const set = new Set<ColumnOrAxisIdString>();\n const result:AxisSpec[] = [];\n for(const idStr of idStrs) {\n const id = columnOrAxisIdFromString(idStr);\n if (isColumnId(id)) {\n const spec = await store.pFrameProvider.getColumnSpecById(id);\n if (!spec) {\n continue;\n }\n spec.axesSpec.forEach(axisSpec => {\n const id = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n if (!set.has(id)) {\n set.add(id);\n result.push(axisSpec);\n }\n })\n }\n }\n return result;\n}\n\nexport async function createLinkerMap(store: DemoDataStore) {\n const allLinkerColumns = await store.pFrameProvider.getColumnsFull(\n [], false, undefined, undefined,\n {[IS_LINKER_COLUMN]: 'true'},\n );\n return LinkerMap.fromColumns(allLinkerColumns);\n}\n\nexport async function getLinkerColumnsForSource(\n store: DataStore,\n linkerMap: LinkerMap,\n dataInputAxes: AxisSpec[],\n secondarySource: ColumnOrAxisIdString,\n fixedAxesOfSecondaryColumn: SelectorState['fixedAxes']\n):Promise<ColumnId[]> {\n const columnOrAxisId = columnOrAxisIdFromString(secondarySource);\n if (!isColumnId(columnOrAxisId)) {\n return [];\n }\n const secondaryColumnSpec = await store.pFrameProvider.getColumnSpecById(columnOrAxisId);\n if (!secondaryColumnSpec) {\n return [];\n }\n const allColumnAxesWithoutFixed = secondaryColumnSpec.axesSpec.filter(\n (axisSpec) => {\n const axisId = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n return !fixedAxesOfSecondaryColumn?.some(el => el.axisSource === axisId);\n });\n\n const dataInputAxesSet = new Set(dataInputAxes.map(axisSpec => AxisId.fromAxisSpec(axisSpec).toCanonicalString()));\n const rightPartAxes = allColumnAxesWithoutFixed.filter((axisSpec) => { // right part from column minus 'fixedAxes'\n const axisId = AxisId.fromAxisSpec(axisSpec).toCanonicalString();\n return !dataInputAxesSet.has(axisId);\n });\n\n const from = getNormalizedAxesList(dataInputAxes);\n const to = getNormalizedAxesList(rightPartAxes);\n\n return linkerMap.getLinkerColumnsForAxes({from,to}).map(v => new ColumnId({name: v.columnId, type: v.spec.valueType}));\n}\n\nexport function getNotAllowedAxes(\n columnSpec: PColumnSpec,\n dataInputAxesList: AxisSpec[], // axes from data-input\n someset: Set<unknown>, \n linkerMap: LinkerMap, // composite linkers, without chains\n): AxisSpec[] {\n const dataInputAxesSet = new Set(dataInputAxesList.map((v) => AxisId.fromAxisSpec(v).toCanonicalString()))\n const allColumnAxes = getNormalizedAxesList(columnSpec.axesSpec);\n // remove from the column axes - axes from data inputs\n const rightPartAxes = allColumnAxes.filter(\n (axisSpec:AxisSpec) => !dataInputAxesSet.has(AxisId.fromAxisSpec(axisSpec).toCanonicalString())\n );\n\n const sourceAxes = getNormalizedAxesList(dataInputAxesList);\n const targetAxes = LinkerMap.getAxesRoots(rightPartAxes);\n\n return linkerMap.getNonLinkableAxes(sourceAxes, targetAxes);\n}\n\nexport function createHighlightColumn(highlightSelectedStates:SelectorStateFilter[], data: TableOuterJoinResult) {\n const dataLength = data.columnsData[Object.keys(data.columnsData)[0]].length;\n const highlightColumn = new Int32Array(dataLength).fill(0);\n for (let rowIdx = 0; rowIdx < dataLength; rowIdx++) {\n let res = false;\n for (let i = 0; i < highlightSelectedStates.length; i++) {\n const {selectedSource, selectedFilterValue, selectedFilterRange, type} = highlightSelectedStates[i];\n const sourceId = columnOrAxisIdFromString(selectedSource);\n const value = (isColumnId(sourceId) ? data.columnsData[selectedSource] : data.axesData[selectedSource])[rowIdx];\n if (selectedFilterValue !== undefined) {\n res = res || value === selectedFilterValue;\n }\n if (selectedFilterRange !== undefined && (selectedFilterRange.min !== undefined || selectedFilterRange.max !== undefined) && typeof value === 'number') {\n let rangeResult = true;\n if (selectedFilterRange.min !== undefined) {\n rangeResult = rangeResult && value >= selectedFilterRange.min;\n }\n if (selectedFilterRange.max !== undefined) {\n rangeResult = rangeResult && value <= selectedFilterRange.max;\n }\n res = res || rangeResult;\n }\n if (type === 'subset') {\n res = res || (value !== null && value !== undefined);\n }\n }\n if (res) {\n highlightColumn[rowIdx] = 1;\n }\n }\n return highlightColumn as unknown as PValue[];\n}\n"],"names":["addSourceInfoToMap","store","selectedIdStr","label","dataMap","dataAxesList","dataAxes","fixedAxesAllowed","linkerMap","sourceId","columnOrAxisIdFromString","isColumnId","columnSpec","extraAxesIds","getNotAllowedAxes","axisSpec","AxisId","extraAxesSet","axesIds","extraAxesIndexes","id","idx","columnInfo","getColumnOrAxisLabel","_a","SUBSET_FILTER_KEY","_b","DISCRETE_FILTER_KEY","axisIdStr","mustBeConsumed","axisMustBeConsumed","axisInfo","_c","_d","getDefaultInfo","sourceIdStr","item","name","type","getStateCopy","state","getFilterFromState","selectedSource","selectedFilterRange","selectedFilterValue","rangeFilters","isAxisId","getFiltersFromStates","states","result","getGlobalId","spec","COLUMN_NAME_KEY","domain","COLUMN_DOMAIN_KEY","canonicalize","getAxisSpecFromParents","axisId","parentSources","parentSource","parentId","s","LABEL_COLUMN_NAME","getColumnOrAxisValueLabelsId","getAxisGlobalId","labelColumns","sourceGlobalId","labelColumn","ColumnId","getColumnOrAxisSpec","selectedId","labelsColumn","COLUMN_LABEL_KEY","axisNature","AXIS_NATURE_KEY","checkSourceBySpecForFilters","dataColumnPredicateDefault","IS_VIRTUAL_COLUMN","getAxesSpecsFromSources","idStrs","set","idStr","createLinkerMap","allLinkerColumns","IS_LINKER_COLUMN","LinkerMap","getLinkerColumnsForSource","dataInputAxes","secondarySource","fixedAxesOfSecondaryColumn","columnOrAxisId","secondaryColumnSpec","allColumnAxesWithoutFixed","el","dataInputAxesSet","rightPartAxes","from","getNormalizedAxesList","to","v","dataInputAxesList","someset","sourceAxes","targetAxes","createHighlightColumn","highlightSelectedStates","data","dataLength","highlightColumn","rowIdx","res","i","value","rangeResult"],"mappings":";;;;AAyBsB,eAAAA,EAClBC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,IAAmB,IACnBC,GACF;;AACQ,QAAAC,IAAWC,EAAyBR,CAAa;AACnD,MAAAS,EAAWF,CAAQ,GAAG;AACtB,UAAMG,IAAa,MAAMX,EAAM,eAAe,kBAAkBQ,CAAQ;AACxE,QAAI,CAACG;AACD;AAEJ,UAAMC,IAAeC;AAAAA,MACjBF;AAAAA,MACAP;AAAAA,MACAC;AAAAA,MACAE;AAAAA,IAAA,EACF,IAAI,CAACO,MAAaC,EAAO,aAAaD,CAAQ,EAAE,mBAAmB,GAE/DE,IAAe,IAAI,IAAIJ,CAAY,GACnCK,IAAUN,EAAW,SAAS,IAAI,CAAAG,MAAYC,EAAO,aAAaD,CAAQ,EAAE,mBAAmB,GAC/FI,IAA2C,CAAA;AAC7CZ,SACQW,EAAA,QAAQ,CAACE,GAAIC,MAAQ;AACrBJ,MAAAA,EAAa,IAAIG,CAAE,MACnBD,EAAiBC,CAAE,IAAIC;AAAAA,IAC3B,CACH;AAEL,UAAMC,IAAyB;AAAA,MAC3B,MAAM;AAAA,MACN,MAAMV,EAAW;AAAA,M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,CAAC,EAAE,QAChEE,IAAkB,IAAI,WAAWD,CAAU,EAAE,KAAK,CAAC;AACzD,WAASE,IAAS,GAAGA,IAASF,GAAYE,KAAU;AAChD,QAAIC,IAAM;AACV,aAASC,IAAI,GAAGA,IAAIN,EAAwB,QAAQM,KAAK;AACrD,YAAM,EAAC,gBAAArE,GAAgB,qBAAAE,GAAqB,qBAAAD,GAAqB,MAAAL,EAAAA,IAAQmE,EAAwBM,CAAC,GAC5FtG,IAAWC,EAAyBgC,CAAc,GAClDsE,KAASrG,EAAWF,CAAQ,IAAIiG,EAAK,YAAYhE,CAAc,IAAIgE,EAAK,SAAShE,CAAc,GAAGmE,CAAM;AAI1G,UAHAjE,MAAwB,WACxBkE,IAAMA,KAAOE,MAAUpE,IAEvBD,MAAwB,WAAcA,EAAoB,QAAQ,UAAaA,EAAoB,QAAQ,WAAc,OAAOqE,KAAU,UAAU;AACpJ,YAAIC,IAAc;AACdtE,QAAAA,EAAoB,QAAQ,WACdsE,IAAAA,KAAeD,KAASrE,EAAoB,MAE1DA,EAAoB,QAAQ,WACdsE,IAAAA,KAAeD,KAASrE,EAAoB,MAE9DmE,IAAMA,KAAOG;AAAAA,MAAA;AAEb3E,MAAAA,MAAS,aACHwE,IAAAA,KAAQE,KAAU;AAAA,IAC5B;AAEAF,IAAAA,MACAF,EAAgBC,CAAM,IAAI;AAAA,EAC9B;AAEG,SAAAD;AACX;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/graph-maker",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.141",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/lib.js",
|
|
6
6
|
"types": "dist/lib.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@ag-grid-community/core": "^32.3.3",
|
|
39
39
|
"@milaboratories/helpers": "^1.6.15",
|
|
40
40
|
"@milaboratories/miplots4": "^1.0.133",
|
|
41
|
-
"@milaboratories/pf-plots": "^1.1.
|
|
41
|
+
"@milaboratories/pf-plots": "^1.1.28",
|
|
42
42
|
"@platforma-sdk/model": "^1.39.8",
|
|
43
43
|
"@platforma-sdk/ui-vue": "^1.39.16",
|
|
44
44
|
"@types/d3-hierarchy": "^3.1.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@milaboratories/pl-error-like/src/error_like_shape.ts"],"sourcesContent":["import stringify from 'json-stringify-safe';\nimport { z } from 'zod';\n\n// We want to define StandardErrorLike and PlErrorLike, it's a way to define recursive types in zod.\n// https://zod.dev/?id=recursive-types\n// We need zod to parse error strings into these objects for keeping new UI and old blocks compatible.\n\nexport const BasePlErrorLike = z.object({\n type: z.literal('PlError'),\n name: z.string(),\n message: z.string(),\n /** The message with all details needed for SDK developers. */\n fullMessage: z.string().optional(),\n stack: z.string().optional(),\n});\n\n/** Known Pl backend and ML errors. */\nexport type PlErrorLike = z.infer<typeof BasePlErrorLike> & {\n cause?: ErrorLike;\n errors?: ErrorLike[];\n};\n\nexport const PlErrorLike: z.ZodType<PlErrorLike> = BasePlErrorLike.extend({\n cause: z.lazy(() => ErrorLike).optional(),\n errors: z.lazy(() => ErrorLike.array()).optional(),\n});\n\nconst BaseStandardErrorLike = z.object({\n type: z.literal('StandardError'),\n name: z.string(),\n message: z.string(),\n stack: z.string().optional(),\n});\n\n/** Others unknown errors that could be thrown by the client. */\nexport type StandardErrorLike = z.infer<typeof BaseStandardErrorLike> & {\n cause?: ErrorLike;\n errors?: ErrorLike[];\n};\n\nexport const StandardErrorLike: z.ZodType<StandardErrorLike> = BaseStandardErrorLike.extend({\n cause: z.lazy(() => ErrorLike).optional(),\n errors: z.lazy(() => ErrorLike.array()).optional(),\n});\n\nexport const ErrorLike = z.union([StandardErrorLike, PlErrorLike]);\nexport type ErrorLike = z.infer<typeof ErrorLike>;\n\n/** Converts everything into ErrorLike. */\nexport function ensureErrorLike(error: unknown): ErrorLike {\n const result = ErrorShape.safeParse(error);\n\n if (result.success) {\n const err = result.data;\n\n if (err.name === 'PlQuickJSError'\n || err.name === 'PlErrorReport'\n || err.name === 'PlInternalError'\n || err.name === 'PlTengoError'\n || err.name === 'PlRunnerError'\n || err.name === 'PlMonetizationError') {\n return {\n type: 'PlError',\n name: err.name,\n message: err.message,\n fullMessage: err.fullMessage ?? undefined,\n stack: err.stack ?? undefined,\n cause: err.cause ? ensureErrorLike(err.cause) : undefined,\n errors: err.errors ? err.errors.map(ensureErrorLike) : undefined,\n };\n }\n\n return {\n type: 'StandardError',\n name: err.name,\n message: err.message,\n stack: err.stack ?? undefined,\n cause: err.cause ? ensureErrorLike(err.cause) : undefined,\n errors: err.errors ? err.errors.map(ensureErrorLike) : undefined,\n };\n }\n\n return {\n type: 'StandardError',\n name: 'Error',\n // Stringify without circular dependencies.\n // Maps (and sets?) will be converted to empty json objects,\n // if this is a problem, we should change the library,\n // but the new library must work in all QuickJS, UI and Node.js like this one.\n message: stringify(error),\n };\n}\n\n/** Tries to parse strings into ErrorLike. It's needed for keeping old blocks compatible with new UI. */\nexport function parseErrorLikeSafe(err: string): {\n success: true;\n data: ErrorLike;\n} | {\n success: false;\n error: Error;\n} {\n try {\n return ErrorLike.safeParse(JSON.parse(err));\n } catch (e) {\n return { success: false, error: new Error(`parseErrorLikeSafe: could not parse JSON: ${err}, ${String(e)}`) };\n }\n}\n\n// We want to define ErrorShape schema just to parse it above, it's a way to define recursive types in zod.\n// https://zod.dev/?id=recursive-types\n\nconst baseErrorShape = z.object({\n name: z.string(),\n message: z.string(),\n fullMessage: z.string().optional(),\n stack: z.string().optional(),\n});\n\ntype ErrorShape = z.infer<typeof baseErrorShape> & {\n cause?: ErrorShape;\n errors?: ErrorShape[];\n};\n\nconst ErrorShape: z.ZodType<ErrorShape> = baseErrorShape.extend({\n cause: z.lazy(() => ErrorShape).optional(),\n errors: z.lazy(() => ErrorShape.array()).optional(),\n});\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AE,SAAA;AAC3C,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,584 +0,0 @@
|
|
|
1
|
-
import u from "../../../zod/lib/index.js";
|
|
2
|
-
import l from "../../../canonicalize/lib/canonicalize.js";
|
|
3
|
-
var A = Object.defineProperty, k = (e, t, r) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, m = (e, t, r) => k(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
u.object({
|
|
5
|
-
/** Included left border. */
|
|
6
|
-
from: u.number(),
|
|
7
|
-
/** Excluded right border. */
|
|
8
|
-
to: u.number()
|
|
9
|
-
});
|
|
10
|
-
function P(e) {
|
|
11
|
-
throw new Error("Unexpected object: " + e);
|
|
12
|
-
}
|
|
13
|
-
function F(e) {
|
|
14
|
-
if (!e || typeof e != "object")
|
|
15
|
-
return !1;
|
|
16
|
-
const t = e;
|
|
17
|
-
if (!("type" in t))
|
|
18
|
-
return !1;
|
|
19
|
-
switch (t.type) {
|
|
20
|
-
case "Json":
|
|
21
|
-
return typeof t.keyLength == "number" && t.data !== void 0 && typeof t.data == "object";
|
|
22
|
-
case "JsonPartitioned":
|
|
23
|
-
return typeof t.partitionKeyLength == "number" && t.parts !== void 0 && typeof t.parts == "object";
|
|
24
|
-
case "BinaryPartitioned":
|
|
25
|
-
return typeof t.partitionKeyLength == "number" && t.parts !== void 0 && typeof t.parts == "object";
|
|
26
|
-
default:
|
|
27
|
-
return !1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function z(e, t) {
|
|
31
|
-
if (e !== void 0)
|
|
32
|
-
switch (e.type) {
|
|
33
|
-
case "Json":
|
|
34
|
-
return e;
|
|
35
|
-
case "JsonPartitioned": {
|
|
36
|
-
const r = {};
|
|
37
|
-
for (const [n, o] of Object.entries(e.parts))
|
|
38
|
-
r[n] = t(o);
|
|
39
|
-
return {
|
|
40
|
-
...e,
|
|
41
|
-
parts: r
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
case "BinaryPartitioned": {
|
|
45
|
-
const r = {};
|
|
46
|
-
for (const [n, o] of Object.entries(e.parts))
|
|
47
|
-
r[n] = {
|
|
48
|
-
index: t(o.index),
|
|
49
|
-
values: t(o.values)
|
|
50
|
-
};
|
|
51
|
-
return {
|
|
52
|
-
...e,
|
|
53
|
-
parts: r
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function S(e) {
|
|
59
|
-
if (!e || typeof e != "object")
|
|
60
|
-
return !1;
|
|
61
|
-
const t = e;
|
|
62
|
-
if (!("type" in t))
|
|
63
|
-
return !1;
|
|
64
|
-
switch (t.type) {
|
|
65
|
-
case "Json":
|
|
66
|
-
return typeof t.keyLength == "number" && Array.isArray(t.data);
|
|
67
|
-
case "JsonPartitioned":
|
|
68
|
-
return typeof t.partitionKeyLength == "number" && Array.isArray(t.parts);
|
|
69
|
-
case "BinaryPartitioned":
|
|
70
|
-
return typeof t.partitionKeyLength == "number" && Array.isArray(t.parts);
|
|
71
|
-
default:
|
|
72
|
-
return !1;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function q(e) {
|
|
76
|
-
return S(e) ? e.type === "JsonPartitioned" || e.type === "BinaryPartitioned" : !1;
|
|
77
|
-
}
|
|
78
|
-
function U(e) {
|
|
79
|
-
switch (e.type) {
|
|
80
|
-
case "Json": {
|
|
81
|
-
const t = Object.entries(e.data).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
|
|
82
|
-
return {
|
|
83
|
-
type: "Json",
|
|
84
|
-
keyLength: e.keyLength,
|
|
85
|
-
data: t
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
case "JsonPartitioned": {
|
|
89
|
-
const t = Object.entries(e.parts).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
|
|
90
|
-
return {
|
|
91
|
-
type: "JsonPartitioned",
|
|
92
|
-
partitionKeyLength: e.partitionKeyLength,
|
|
93
|
-
parts: t
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
case "BinaryPartitioned": {
|
|
97
|
-
const t = Object.entries(e.parts).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
|
|
98
|
-
return {
|
|
99
|
-
type: "BinaryPartitioned",
|
|
100
|
-
partitionKeyLength: e.partitionKeyLength,
|
|
101
|
-
parts: t
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function G(e) {
|
|
107
|
-
switch (e.type) {
|
|
108
|
-
case "Json": {
|
|
109
|
-
const t = {};
|
|
110
|
-
for (const r of e.data)
|
|
111
|
-
t[JSON.stringify(r.key)] = r.value;
|
|
112
|
-
return {
|
|
113
|
-
type: "Json",
|
|
114
|
-
keyLength: e.keyLength,
|
|
115
|
-
data: t
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
case "JsonPartitioned": {
|
|
119
|
-
const t = {};
|
|
120
|
-
for (const r of e.parts)
|
|
121
|
-
t[JSON.stringify(r.key)] = r.value;
|
|
122
|
-
return {
|
|
123
|
-
type: "JsonPartitioned",
|
|
124
|
-
partitionKeyLength: e.partitionKeyLength,
|
|
125
|
-
parts: t
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
case "BinaryPartitioned": {
|
|
129
|
-
const t = {};
|
|
130
|
-
for (const r of e.parts)
|
|
131
|
-
t[JSON.stringify(r.key)] = r.value;
|
|
132
|
-
return {
|
|
133
|
-
type: "BinaryPartitioned",
|
|
134
|
-
partitionKeyLength: e.partitionKeyLength,
|
|
135
|
-
parts: t
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
const E = -2147483648, b = -9007199254740991n, j = null, N = null;
|
|
141
|
-
function O(e, t) {
|
|
142
|
-
switch (t) {
|
|
143
|
-
case "Int":
|
|
144
|
-
return e === E;
|
|
145
|
-
case "Long":
|
|
146
|
-
return e === Number(b) || e === b;
|
|
147
|
-
case "Float":
|
|
148
|
-
return Number.isNaN(e);
|
|
149
|
-
case "Double":
|
|
150
|
-
return Number.isNaN(e);
|
|
151
|
-
case "String":
|
|
152
|
-
return e === j;
|
|
153
|
-
case "Bytes":
|
|
154
|
-
return e === N;
|
|
155
|
-
default:
|
|
156
|
-
throw Error(`unsupported data type: ${t}`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function I(e, t) {
|
|
160
|
-
const r = Math.floor(t / 8), n = 1 << 7 - t % 8;
|
|
161
|
-
return (e[r] & n) > 0;
|
|
162
|
-
}
|
|
163
|
-
const J = { type: "absent" }, L = null;
|
|
164
|
-
function Q(e, t, r = {}) {
|
|
165
|
-
if (I(e.absent, t))
|
|
166
|
-
return r.absent === void 0 ? J : r.absent;
|
|
167
|
-
const n = e.data[t], o = e.type;
|
|
168
|
-
if (O(n, o)) return r.na === void 0 ? L : r.na;
|
|
169
|
-
switch (o) {
|
|
170
|
-
case "Int":
|
|
171
|
-
return n;
|
|
172
|
-
case "Long":
|
|
173
|
-
return Number(n);
|
|
174
|
-
case "Float":
|
|
175
|
-
return n;
|
|
176
|
-
case "Double":
|
|
177
|
-
return n;
|
|
178
|
-
case "String":
|
|
179
|
-
return n;
|
|
180
|
-
case "Bytes":
|
|
181
|
-
throw Error("Bytes not yet supported");
|
|
182
|
-
default:
|
|
183
|
-
throw Error(`unsupported data type: ${o}`);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
function d(e) {
|
|
187
|
-
const { type: t, name: r, domain: n } = e, o = { type: t, name: r };
|
|
188
|
-
return n && Object.entries(n).length > 0 && Object.assign(o, { domain: n }), o;
|
|
189
|
-
}
|
|
190
|
-
function $(e) {
|
|
191
|
-
return e.map(d);
|
|
192
|
-
}
|
|
193
|
-
function X(e) {
|
|
194
|
-
return l(d(e));
|
|
195
|
-
}
|
|
196
|
-
function C(e, t) {
|
|
197
|
-
if (e === void 0) return t === void 0;
|
|
198
|
-
if (t === void 0) return !0;
|
|
199
|
-
for (const r in t)
|
|
200
|
-
if (e[r] !== t[r]) return !1;
|
|
201
|
-
return !0;
|
|
202
|
-
}
|
|
203
|
-
function T(e, t) {
|
|
204
|
-
return e.name === t.name && C(e.domain, t.domain);
|
|
205
|
-
}
|
|
206
|
-
function Y(e, t) {
|
|
207
|
-
return { ...e, src: h(e.src, t) };
|
|
208
|
-
}
|
|
209
|
-
function h(e, t) {
|
|
210
|
-
switch (e.type) {
|
|
211
|
-
case "column":
|
|
212
|
-
return {
|
|
213
|
-
type: "column",
|
|
214
|
-
column: t(e.column)
|
|
215
|
-
};
|
|
216
|
-
case "slicedColumn":
|
|
217
|
-
return {
|
|
218
|
-
type: "slicedColumn",
|
|
219
|
-
column: t(e.column),
|
|
220
|
-
newId: e.newId,
|
|
221
|
-
axisFilters: e.axisFilters
|
|
222
|
-
};
|
|
223
|
-
case "inlineColumn":
|
|
224
|
-
return e;
|
|
225
|
-
case "inner":
|
|
226
|
-
case "full":
|
|
227
|
-
return {
|
|
228
|
-
type: e.type,
|
|
229
|
-
entries: e.entries.map((r) => h(r, t))
|
|
230
|
-
};
|
|
231
|
-
case "outer":
|
|
232
|
-
return {
|
|
233
|
-
type: "outer",
|
|
234
|
-
primary: h(e.primary, t),
|
|
235
|
-
secondary: e.secondary.map((r) => h(r, t))
|
|
236
|
-
};
|
|
237
|
-
default:
|
|
238
|
-
P(e);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
function B(e) {
|
|
242
|
-
return l(e);
|
|
243
|
-
}
|
|
244
|
-
function g(e) {
|
|
245
|
-
return l(d(e));
|
|
246
|
-
}
|
|
247
|
-
function x(e, t) {
|
|
248
|
-
return JSON.stringify([e, t]);
|
|
249
|
-
}
|
|
250
|
-
class Z {
|
|
251
|
-
/**
|
|
252
|
-
* Creates a new anchor context from a set of anchor column specifications
|
|
253
|
-
* @param anchors Record of anchor column specifications indexed by anchor ID
|
|
254
|
-
*/
|
|
255
|
-
constructor(t) {
|
|
256
|
-
m(this, "domains", /* @__PURE__ */ new Map()), m(this, "axes", /* @__PURE__ */ new Map()), m(this, "domainPacks", []), m(this, "domainPackToAnchor", /* @__PURE__ */ new Map()), this.anchors = t;
|
|
257
|
-
const r = Object.entries(t);
|
|
258
|
-
r.sort((n, o) => n[0].localeCompare(o[0]));
|
|
259
|
-
for (const [n, o] of r) {
|
|
260
|
-
for (let i = 0; i < o.axesSpec.length; i++) {
|
|
261
|
-
const a = o.axesSpec[i], s = g(a);
|
|
262
|
-
this.axes.set(s, { anchor: n, idx: i });
|
|
263
|
-
}
|
|
264
|
-
if (o.domain !== void 0) {
|
|
265
|
-
const i = Object.entries(o.domain);
|
|
266
|
-
i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), n), this.domainPacks.push(i.map(([a]) => a));
|
|
267
|
-
for (const [a, s] of i) {
|
|
268
|
-
const c = x(a, s);
|
|
269
|
-
this.domains.set(c, n);
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Implementation of derive method
|
|
276
|
-
*/
|
|
277
|
-
derive(t, r) {
|
|
278
|
-
const n = {
|
|
279
|
-
name: t.name,
|
|
280
|
-
axes: []
|
|
281
|
-
};
|
|
282
|
-
let o;
|
|
283
|
-
if (t.domain !== void 0)
|
|
284
|
-
e:
|
|
285
|
-
for (const a of this.domainPacks) {
|
|
286
|
-
const s = [];
|
|
287
|
-
for (const f of a) {
|
|
288
|
-
const p = t.domain[f];
|
|
289
|
-
if (p !== void 0)
|
|
290
|
-
s.push([f, p]);
|
|
291
|
-
else
|
|
292
|
-
break e;
|
|
293
|
-
}
|
|
294
|
-
const c = this.domainPackToAnchor.get(JSON.stringify(s));
|
|
295
|
-
if (c !== void 0) {
|
|
296
|
-
n.domainAnchor = c, o = new Set(a);
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
for (const [a, s] of Object.entries(t.domain ?? {})) {
|
|
301
|
-
if (o !== void 0 && o.has(a))
|
|
302
|
-
continue;
|
|
303
|
-
const c = x(a, s), f = this.domains.get(c);
|
|
304
|
-
n.domain ?? (n.domain = {}), n.domain[a] = f ? { anchor: f } : s;
|
|
305
|
-
}
|
|
306
|
-
if (n.axes = t.axesSpec.map((a) => {
|
|
307
|
-
const s = g(a), c = this.axes.get(s);
|
|
308
|
-
return c === void 0 ? d(a) : c;
|
|
309
|
-
}), !r || r.length === 0)
|
|
310
|
-
return n;
|
|
311
|
-
const i = [];
|
|
312
|
-
for (const a of r) {
|
|
313
|
-
const [s, c] = a;
|
|
314
|
-
if (typeof s == "number") {
|
|
315
|
-
if (s < 0 || s >= t.axesSpec.length)
|
|
316
|
-
throw new Error(`Axis index ${s} is out of bounds (0-${t.axesSpec.length - 1})`);
|
|
317
|
-
i.push([s, c]);
|
|
318
|
-
} else {
|
|
319
|
-
const f = t.axesSpec.findIndex((p) => p.name === s);
|
|
320
|
-
if (f === -1)
|
|
321
|
-
throw new Error(`Axis with name "${s}" not found in the column specification`);
|
|
322
|
-
i.push([f, c]);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
return i.sort((a, s) => a[0] - s[0]), {
|
|
326
|
-
source: n,
|
|
327
|
-
axisFilters: i
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column
|
|
332
|
-
* @param spec Column specification to anchor
|
|
333
|
-
* @param axisFilters Optional axis filters to apply to the column
|
|
334
|
-
* @returns A canonicalized string representation of the anchored column identifier
|
|
335
|
-
*/
|
|
336
|
-
deriveS(t, r) {
|
|
337
|
-
return B(this.derive(t, r));
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
function H(e, t, r) {
|
|
341
|
-
const n = { ...t }, o = (r == null ? void 0 : r.ignoreMissingDomains) ?? !1;
|
|
342
|
-
if (n.domainAnchor !== void 0) {
|
|
343
|
-
const i = e[n.domainAnchor];
|
|
344
|
-
if (!i)
|
|
345
|
-
throw new Error(`Anchor "${n.domainAnchor}" not found`);
|
|
346
|
-
const a = i.domain || {};
|
|
347
|
-
n.domain = { ...a, ...n.domain }, delete n.domainAnchor;
|
|
348
|
-
}
|
|
349
|
-
if (n.domain) {
|
|
350
|
-
const i = {};
|
|
351
|
-
for (const [a, s] of Object.entries(n.domain))
|
|
352
|
-
if (typeof s == "string")
|
|
353
|
-
i[a] = s;
|
|
354
|
-
else {
|
|
355
|
-
const c = e[s.anchor];
|
|
356
|
-
if (!c)
|
|
357
|
-
throw new Error(`Anchor "${s.anchor}" not found for domain key "${a}"`);
|
|
358
|
-
if (!c.domain || c.domain[a] === void 0) {
|
|
359
|
-
if (!o)
|
|
360
|
-
throw new Error(`Domain key "${a}" not found in anchor "${s.anchor}"`);
|
|
361
|
-
continue;
|
|
362
|
-
}
|
|
363
|
-
i[a] = c.domain[a];
|
|
364
|
-
}
|
|
365
|
-
n.domain = i;
|
|
366
|
-
}
|
|
367
|
-
return n.axes && (n.axes = n.axes.map((i) => D(e, i))), n;
|
|
368
|
-
}
|
|
369
|
-
function D(e, t) {
|
|
370
|
-
if (!K(t))
|
|
371
|
-
return t;
|
|
372
|
-
const r = t.anchor, n = e[r];
|
|
373
|
-
if (!n)
|
|
374
|
-
throw new Error(`Anchor "${r}" not found for axis reference`);
|
|
375
|
-
if ("idx" in t) {
|
|
376
|
-
if (t.idx < 0 || t.idx >= n.axesSpec.length)
|
|
377
|
-
throw new Error(`Axis index ${t.idx} out of bounds for anchor "${r}"`);
|
|
378
|
-
return n.axesSpec[t.idx];
|
|
379
|
-
} else if ("name" in t) {
|
|
380
|
-
const o = n.axesSpec.filter((i) => i.name === t.name);
|
|
381
|
-
if (o.length > 1)
|
|
382
|
-
throw new Error(`Multiple axes with name "${t.name}" found in anchor "${r}"`);
|
|
383
|
-
if (o.length === 0)
|
|
384
|
-
throw new Error(`Axis with name "${t.name}" not found in anchor "${r}"`);
|
|
385
|
-
return o[0];
|
|
386
|
-
} else if ("id" in t) {
|
|
387
|
-
const o = n.axesSpec.filter((i) => T(t.id, d(i)));
|
|
388
|
-
if (o.length > 1)
|
|
389
|
-
throw new Error(`Multiple matching axes found for matcher in anchor "${r}"`);
|
|
390
|
-
if (o.length === 0)
|
|
391
|
-
throw new Error(`No matching axis found for matcher in anchor "${r}"`);
|
|
392
|
-
return o[0];
|
|
393
|
-
}
|
|
394
|
-
throw new Error("Unsupported axis reference type");
|
|
395
|
-
}
|
|
396
|
-
function K(e) {
|
|
397
|
-
return typeof e == "object" && "anchor" in e;
|
|
398
|
-
}
|
|
399
|
-
function y(e) {
|
|
400
|
-
return e.kind === "PColumn";
|
|
401
|
-
}
|
|
402
|
-
function M(e) {
|
|
403
|
-
return y(e.spec);
|
|
404
|
-
}
|
|
405
|
-
function W(e) {
|
|
406
|
-
if (!M(e)) throw new Error(`not a PColumn (kind = ${e.spec.kind})`);
|
|
407
|
-
return e;
|
|
408
|
-
}
|
|
409
|
-
function ee(e, t) {
|
|
410
|
-
return e === void 0 ? void 0 : {
|
|
411
|
-
...e,
|
|
412
|
-
data: t(e.data)
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
function te(e) {
|
|
416
|
-
const t = /* @__PURE__ */ new Map(), r = (n) => {
|
|
417
|
-
switch (n.type) {
|
|
418
|
-
case "column":
|
|
419
|
-
t.set(n.column.id, n.column);
|
|
420
|
-
return;
|
|
421
|
-
case "slicedColumn":
|
|
422
|
-
t.set(n.column.id, n.column);
|
|
423
|
-
return;
|
|
424
|
-
case "inlineColumn":
|
|
425
|
-
return;
|
|
426
|
-
case "full":
|
|
427
|
-
case "inner":
|
|
428
|
-
for (const o of n.entries) r(o);
|
|
429
|
-
return;
|
|
430
|
-
case "outer":
|
|
431
|
-
r(n.primary);
|
|
432
|
-
for (const o of n.secondary) r(o);
|
|
433
|
-
return;
|
|
434
|
-
default:
|
|
435
|
-
P(n);
|
|
436
|
-
}
|
|
437
|
-
};
|
|
438
|
-
return r(e), [...t.values()];
|
|
439
|
-
}
|
|
440
|
-
function v(e, t) {
|
|
441
|
-
if (e.name !== void 0 && e.name !== t.name)
|
|
442
|
-
return !1;
|
|
443
|
-
if (e.type !== void 0) {
|
|
444
|
-
if (Array.isArray(e.type)) {
|
|
445
|
-
if (!e.type.includes(t.type))
|
|
446
|
-
return !1;
|
|
447
|
-
} else if (e.type !== t.type)
|
|
448
|
-
return !1;
|
|
449
|
-
}
|
|
450
|
-
if (e.domain !== void 0) {
|
|
451
|
-
const r = t.domain || {};
|
|
452
|
-
for (const [n, o] of Object.entries(e.domain))
|
|
453
|
-
if (r[n] !== o)
|
|
454
|
-
return !1;
|
|
455
|
-
}
|
|
456
|
-
return !0;
|
|
457
|
-
}
|
|
458
|
-
function w(e, t) {
|
|
459
|
-
if (t.name !== void 0 && e.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(e.name))
|
|
460
|
-
return !1;
|
|
461
|
-
if (t.type !== void 0) {
|
|
462
|
-
if (Array.isArray(t.type)) {
|
|
463
|
-
if (!t.type.includes(e.valueType))
|
|
464
|
-
return !1;
|
|
465
|
-
} else if (t.type !== e.valueType)
|
|
466
|
-
return !1;
|
|
467
|
-
}
|
|
468
|
-
if (t.domain !== void 0) {
|
|
469
|
-
const r = e.domain || {};
|
|
470
|
-
for (const [n, o] of Object.entries(t.domain))
|
|
471
|
-
if (r[n] !== o)
|
|
472
|
-
return !1;
|
|
473
|
-
}
|
|
474
|
-
if (t.axes !== void 0) {
|
|
475
|
-
const r = e.axesSpec.map(d);
|
|
476
|
-
if (t.partialAxesMatch) {
|
|
477
|
-
for (const n of t.axes)
|
|
478
|
-
if (!r.some((o) => v(n, o)))
|
|
479
|
-
return !1;
|
|
480
|
-
} else {
|
|
481
|
-
if (r.length !== t.axes.length)
|
|
482
|
-
return !1;
|
|
483
|
-
for (let n = 0; n < t.axes.length; n++)
|
|
484
|
-
if (!v(t.axes[n], r[n]))
|
|
485
|
-
return !1;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
if (t.annotations !== void 0) {
|
|
489
|
-
const r = e.annotations || {};
|
|
490
|
-
for (const [n, o] of Object.entries(t.annotations))
|
|
491
|
-
if (r[n] !== o)
|
|
492
|
-
return !1;
|
|
493
|
-
}
|
|
494
|
-
if (t.annotationPatterns !== void 0) {
|
|
495
|
-
const r = e.annotations || {};
|
|
496
|
-
for (const [n, o] of Object.entries(t.annotationPatterns)) {
|
|
497
|
-
const i = r[n];
|
|
498
|
-
if (i === void 0 || !new RegExp(o).test(i))
|
|
499
|
-
return !1;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
return !0;
|
|
503
|
-
}
|
|
504
|
-
function ne(e) {
|
|
505
|
-
return Array.isArray(e) ? (t) => e.some((r) => y(t) && w(t, r)) : (t) => y(t) && w(t, e);
|
|
506
|
-
}
|
|
507
|
-
function re(e) {
|
|
508
|
-
const t = {
|
|
509
|
-
kind: e.kind,
|
|
510
|
-
name: e.name
|
|
511
|
-
};
|
|
512
|
-
return e.domain !== void 0 && (t.domain = e.domain), y(e) && (t.axesSpec = $(e.axesSpec)), l(t);
|
|
513
|
-
}
|
|
514
|
-
u.object({
|
|
515
|
-
__isRef: u.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
516
|
-
blockId: u.string().describe("Upstream block id"),
|
|
517
|
-
name: u.string().describe("Name of the output provided to the upstream block's output context"),
|
|
518
|
-
requireEnrichments: u.literal(!0).optional().describe("True if current block that stores this reference in its args, may need enrichments for the references value originating from the blocks in between current and referenced block")
|
|
519
|
-
}).describe(
|
|
520
|
-
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
521
|
-
).readonly();
|
|
522
|
-
function oe(e) {
|
|
523
|
-
return typeof e == "object" && e !== null && "__isRef" in e && e.__isRef === !0 && "blockId" in e && "name" in e;
|
|
524
|
-
}
|
|
525
|
-
function ie(e, t = !0) {
|
|
526
|
-
if (t)
|
|
527
|
-
return {
|
|
528
|
-
...e,
|
|
529
|
-
requireEnrichments: !0
|
|
530
|
-
};
|
|
531
|
-
{
|
|
532
|
-
const { requireEnrichments: r, ...n } = e;
|
|
533
|
-
return n;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
function ae(e, t) {
|
|
537
|
-
return e.ok ? { ok: !0, value: t(e.value) } : e;
|
|
538
|
-
}
|
|
539
|
-
const V = 24;
|
|
540
|
-
u.string().length(V).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
541
|
-
function se(e) {
|
|
542
|
-
return l(e);
|
|
543
|
-
}
|
|
544
|
-
export {
|
|
545
|
-
Z as AnchoredIdDeriver,
|
|
546
|
-
J as PTableAbsent,
|
|
547
|
-
L as PTableNA,
|
|
548
|
-
N as PValueBytesNA,
|
|
549
|
-
E as PValueIntNA,
|
|
550
|
-
b as PValueLongNA,
|
|
551
|
-
j as PValueStringNA,
|
|
552
|
-
V as PlIdLength,
|
|
553
|
-
X as canonicalizeAxisId,
|
|
554
|
-
se as canonicalizeJson,
|
|
555
|
-
U as dataInfoToEntries,
|
|
556
|
-
re as deriveNativeId,
|
|
557
|
-
W as ensurePColumn,
|
|
558
|
-
G as entriesToDataInfo,
|
|
559
|
-
te as extractAllColumns,
|
|
560
|
-
$ as getAxesId,
|
|
561
|
-
d as getAxisId,
|
|
562
|
-
F as isDataInfo,
|
|
563
|
-
S as isDataInfoEntries,
|
|
564
|
-
M as isPColumn,
|
|
565
|
-
y as isPColumnSpec,
|
|
566
|
-
q as isPartitionedDataInfoEntries,
|
|
567
|
-
oe as isPlRef,
|
|
568
|
-
I as isValueAbsent,
|
|
569
|
-
O as isValueNA,
|
|
570
|
-
z as mapDataInfo,
|
|
571
|
-
h as mapJoinEntry,
|
|
572
|
-
ee as mapPObjectData,
|
|
573
|
-
Y as mapPTableDef,
|
|
574
|
-
ae as mapValueInVOE,
|
|
575
|
-
v as matchAxis,
|
|
576
|
-
T as matchAxisId,
|
|
577
|
-
w as matchPColumn,
|
|
578
|
-
Q as pTableValue,
|
|
579
|
-
H as resolveAnchors,
|
|
580
|
-
ne as selectorsToPredicate,
|
|
581
|
-
B as stringifyColumnId,
|
|
582
|
-
ie as withEnrichments
|
|
583
|
-
};
|
|
584
|
-
//# sourceMappingURL=index.js.map
|