@milaboratories/miplots4 1.0.177 → 1.0.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/DataFrame.d.ts +1 -0
  2. package/dist/DataFrame.d.ts.map +1 -1
  3. package/dist/DataFrame.js.map +1 -1
  4. package/dist/bubble/BubbleSettingsImpl.d.ts +2 -0
  5. package/dist/bubble/BubbleSettingsImpl.d.ts.map +1 -1
  6. package/dist/bubble/BubbleSettingsImpl.js +3 -1
  7. package/dist/bubble/BubbleSettingsImpl.js.map +1 -1
  8. package/dist/bubble/getGroupedCellsData.d.ts +1 -1
  9. package/dist/bubble/getGroupedCellsData.d.ts.map +1 -1
  10. package/dist/bubble/getGroupedCellsData.js +30 -10
  11. package/dist/bubble/getGroupedCellsData.js.map +1 -1
  12. package/dist/bubble/index.d.ts.map +1 -1
  13. package/dist/bubble/index.js +3 -3
  14. package/dist/bubble/index.js.map +1 -1
  15. package/dist/heatmap/ChartRenderer.d.ts.map +1 -1
  16. package/dist/heatmap/ChartRenderer.js +26 -20
  17. package/dist/heatmap/ChartRenderer.js.map +1 -1
  18. package/dist/heatmap/HeatmapSettingsImpl.d.ts +2 -0
  19. package/dist/heatmap/HeatmapSettingsImpl.d.ts.map +1 -1
  20. package/dist/heatmap/HeatmapSettingsImpl.js +3 -1
  21. package/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
  22. package/dist/heatmap/fillCellsData.d.ts +22 -2
  23. package/dist/heatmap/fillCellsData.d.ts.map +1 -1
  24. package/dist/heatmap/fillCellsData.js +60 -47
  25. package/dist/heatmap/fillCellsData.js.map +1 -1
  26. package/dist/heatmap/getCells.d.ts +22 -1
  27. package/dist/heatmap/getCells.d.ts.map +1 -1
  28. package/dist/heatmap/getCells.js +23 -3
  29. package/dist/heatmap/getCells.js.map +1 -1
  30. package/dist/heatmap/getDendrograms.d.ts +5 -1
  31. package/dist/heatmap/getDendrograms.d.ts.map +1 -1
  32. package/dist/heatmap/getDendrograms.js +33 -11
  33. package/dist/heatmap/getDendrograms.js.map +1 -1
  34. package/dist/heatmap/index.d.ts.map +1 -1
  35. package/dist/heatmap/index.js +30 -6
  36. package/dist/heatmap/index.js.map +1 -1
  37. package/dist/types/bubble.d.ts +6 -0
  38. package/dist/types/bubble.d.ts.map +1 -1
  39. package/dist/types/bubble.js +3 -1
  40. package/dist/types/bubble.js.map +1 -1
  41. package/dist/types/heatmap.d.ts +6 -0
  42. package/dist/types/heatmap.d.ts.map +1 -1
  43. package/dist/types/heatmap.js +2 -0
  44. package/dist/types/heatmap.js.map +1 -1
  45. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ChartRenderer.js","names":[],"sources":["../../src/heatmap/ChartRenderer.tsx"],"sourcesContent":["import { extent } from 'd3-array';\nimport type { HierarchyNode, HierarchyPointNode } from 'd3-hierarchy';\nimport { cluster } from 'd3-hierarchy';\nimport type { ScaleLinear, ScaleOrdinal } from 'd3-scale';\nimport { scaleLinear, scaleOrdinal } from 'd3-scale';\nimport lodash from 'lodash';\nimport type { ReactElement } from 'react';\nimport type { Root } from 'react-dom/client';\nimport { createRoot } from 'react-dom/client';\nimport { Error } from '../common/Error';\nimport type { LegendData, LegendItem } from '../common/types';\nimport { DataFrameProvider } from '../common/useDataFrame';\nimport { DEFAULT_HEIGHT, DEFAULT_WIDTH, MAX_LEGEND_GRADIENT_HEIGHT, MIN_LEGEND_GRADIENT_HEIGHT, TITLE_LINE_HEIGHT, TITLE_MARGIN } from '../constants';\nimport type { DataFrame } from '../DataFrame';\nimport type { AesItem, ColumnName, DataValue } from '../types';\nimport { arrangeLegendParts } from '../utils/arrangeLegendParts';\nimport { getChartEdgeSides } from '../utils/getChartEdgeSides';\nimport { getContinuousLegendTicks } from '../utils/getContinuousLegendTicks';\nimport { TextMeasurer } from '../utils/TextMeasurer/TextMeasurer';\nimport { ChartsGroup } from './components/ChartsGroup';\nimport type {\n AnnotationColorScales,\n CaptionsSizes,\n ChartDendrograms,\n ChartDimensionsData,\n ChartSizes,\n ChartsScales,\n Cluster,\n DendrogramAesScales,\n LabelAngles,\n Margins,\n} from './components/types';\nimport { CHART_SIDE_ELEMENTS, DEFAULT_AES, LEGEND_OFFSET, MIN_MARGIN, TITLE_LINE } from './constants';\nimport type { GroupedCellsHeatmap } from './getCells';\nimport type { DendrogramsData } from './getDendrograms';\nimport type { HeatmapSettingsImpl } from './HeatmapSettingsImpl';\nimport {\n calculateAnnotationTitleSizes,\n calculateChartSideElementSizes,\n calculateSideElementsBBoxes,\n createContinuousColorScale,\n createDiscreteColorScale,\n createDiscreteRoundColorScale,\n} from './utils';\nimport { calculateCaptionTails } from './utils/calculateCaptionTails';\n\nconst COS_PI_4 = Math.cos(Math.PI / 4);\nconst INCLINE_OFFSET = 5; // height of little triangle of text for captions inclined 45deg\nfunction updateLinksHeight(root: HierarchyPointNode<Cluster>, scale: (v: number) => number, coord: 'x' | 'y') {\n function setHeight(d: HierarchyPointNode<Cluster>) {\n d[coord] = scale(d.data.height);\n if (d.children) d.children.forEach(setHeight);\n }\n setHeight(root);\n}\n\n// add shift to move nodes positions with group gaps\nfunction addShiftToLinkCoord(\n root: HierarchyPointNode<Cluster>,\n shift: number,\n coordFrom: 'x' | 'y',\n coordTo = coordFrom\n) {\n function setX(d: HierarchyPointNode<Cluster>) {\n d[coordTo] = d[coordFrom] + shift;\n if (d.children) d.children.forEach(setX);\n }\n setX(root);\n}\n\nconst getSteps = (count: number, valueExtent: number[]) => {\n const min = Math.min(...valueExtent);\n const max = Math.max(...valueExtent);\n if (min === max) {\n const steps = count % 2 === 0 ? [] : [min];\n for (let i = 1; i < count / 2 + 1; i++) {\n steps.push(min + i);\n steps.unshift(min - i);\n }\n return steps;\n }\n if (count < 2) {\n return [min, max];\n }\n const step = (max - min) / (count - 1);\n const steps = [];\n for (let i = 0; i < count - 1; i++) {\n steps.push(min + step * i);\n }\n steps.push(max);\n return steps;\n};\n\nfunction getContinuousColorRange(normalization: HeatmapSettingsImpl['normalization'], colorsCount: number, valueExtent: number[]) {\n let extent = valueExtent;\n if (normalization) {\n if (normalization.colorRange) {\n extent = normalization.colorRange;\n }\n if (normalization.method === 'standardScaling') {\n extent = [-2, 2];\n }\n if (normalization.method === 'meanNormalization') {\n extent = [-0.75, 0.75];\n }\n }\n return getSteps(colorsCount, extent);\n}\n\nfunction getMaxTextLength(keys: string[], labels: Record<string, string>, textMeasurer: TextMeasurer) {\n let maxLabelSize = 0;\n for (const key of keys) {\n if (labels[key] === undefined) continue;\n const l = textMeasurer.getTextWidth(labels[key]);\n if (l > maxLabelSize) maxLabelSize = l;\n }\n return maxLabelSize;\n}\n\nfunction getCaptionHeight(size: number, angle: number) {\n if (angle === 90) {\n return size;\n }\n if (angle === 45) {\n return size * COS_PI_4 + (size > 0 ? 2 * INCLINE_OFFSET : 0);\n }\n return TITLE_LINE;\n}\n\nclass ChartRenderer {\n reactRoot: Root | null = null;\n parentNode: HTMLElement | null = null;\n rootNode: HTMLElement | null = null;\n component: ReactElement = (<></>);\n chartsDimensions: Record<string, ChartDimensionsData> = {};\n chartSizes: ChartSizes = {\n chartWidth: DEFAULT_WIDTH, // width of single chart\n chartHeight: DEFAULT_HEIGHT, // height of single chart\n chartsWidth: DEFAULT_WIDTH, // width of all charts in charts row\n chartsHeight: DEFAULT_HEIGHT, // width of all charts in charts column, without axes\n totalWidth: DEFAULT_WIDTH, // width of all charts in charts row, plus left axis, plus legend\n totalHeight: DEFAULT_HEIGHT, // width of all charts in charts height, plus bottom axis, plus top title\n };\n margins: Margins = {\n top: MIN_MARGIN,\n bottom: MIN_MARGIN,\n left: MIN_MARGIN,\n right: MIN_MARGIN,\n };\n captionsSizes: CaptionsSizes = {\n xAxisCaptions: 100,\n yAxisCaptions: 100,\n xGroupCaptions: TITLE_LINE,\n yGroupCaptions: TITLE_LINE,\n xCaptionTail: 0,\n yCaptionTail: 0,\n };\n labelAngles: LabelAngles = {\n xAxisLabels: 0,\n yAxisLabels: 0,\n xGroupLabels: 0,\n yGroupLabels: 0,\n };\n columnsCount = 1;\n rowsCount = 1;\n scales: ChartsScales = {\n // scales grouped by facet\n x: { null: scaleOrdinal<string, number>().domain(['null']).range([1]) },\n y: { null: scaleOrdinal<string, number>().domain(['null']).range([1]) },\n };\n step: {\n x: Record<string, number>;\n y: Record<string, number>;\n } = { x: {}, y: {} };\n colorScale: ScaleLinear<string, string> | ScaleOrdinal<string, string, string> = scaleLinear<string, string>()\n .domain([0, 1])\n .range(['white', 'black']);\n annotationColorScales: AnnotationColorScales = {};\n dendrogramAesScales: DendrogramAesScales = {};\n legend: LegendData = {\n width: 0,\n height: 0,\n items: [],\n };\n dendrograms: Record<string, ChartDendrograms> = {};\n\n clear() {\n if (this.parentNode && this.rootNode) {\n this.parentNode?.removeChild(this.rootNode);\n this.parentNode = null;\n this.rootNode = null;\n }\n // timeout to avoid trying to unmount during rendering\n setTimeout(() => {\n this.reactRoot?.unmount();\n this.reactRoot = null;\n });\n }\n\n init(node: HTMLElement) {\n if (this.parentNode === null) {\n this.parentNode = node;\n this.rootNode = document.createElement('div');\n this.parentNode.appendChild(this.rootNode);\n this.reactRoot = createRoot(this.rootNode);\n }\n }\n\n updateMargins(title: HeatmapSettingsImpl['chartSettings']['title'], size: HeatmapSettingsImpl['chartSettings']['size']) {\n this.margins = {\n top: title.show ? TITLE_LINE_HEIGHT + TITLE_MARGIN * 2 : size.outerOffset,\n bottom: size.outerOffset,\n left: size.outerOffset,\n right: this.legend.width + size.outerOffset,\n };\n this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right;\n this.chartSizes.totalHeight =\n this.margins.top + Math.max(this.chartSizes.chartsHeight + this.margins.bottom, this.legend.height);\n }\n\n updateLegendSize(\n valueType: HeatmapSettingsImpl['chartSettings']['valueType'],\n legend: HeatmapSettingsImpl['chartSettings']['legend'],\n annotations: HeatmapSettingsImpl['annotations'],\n columnValue: ColumnName,\n valueExtent: [number, number]\n ) {\n if (!legend.show) {\n this.legend = { width: 0, height: 0, items: [] };\n return;\n }\n const continuousHeight = Math.min(\n Math.max(this.chartSizes.chartHeight, MIN_LEGEND_GRADIENT_HEIGHT),\n MAX_LEGEND_GRADIENT_HEIGHT\n );\n const legendHeight = Math.max(this.chartSizes.chartHeight, continuousHeight);\n const legendItems: LegendItem[] = [];\n const emptySizes = { width: 0, height: 0, left: 0, top: 0 };\n\n const getDefaultLabels = (values: (string | number)[]) => values.reduce((res: Record<string, string>, v: string | number) => { res[v] = String(v); return res; }, {});\n if (valueType === 'continuous') {\n const scale = this.colorScale as ScaleLinear<string, string>;\n const values = getContinuousLegendTicks(scale, valueExtent);\n const tickPositionScale = scaleLinear([values[0], values[values.length - 1]], [continuousHeight, 0]); //TODO: update during adding log scale for heatmap\n const title = columnValue.label ?? columnValue.value;\n legendItems.push({\n ...emptySizes,\n type: 'continuous',\n id: 'heatmapValue',\n scale,\n values,\n title,\n tickPositionScale\n });\n } else if (valueType === 'discrete') {\n const scale = this.colorScale as ScaleOrdinal<string, string>;\n const title = columnValue.label ?? columnValue.value;\n const values = scale.domain();\n const labels = getDefaultLabels(values);\n\n legendItems.push({ ...emptySizes, type: 'discreteColor', id: 'heatmapValue', title, scale, values, labels });\n }\n annotations.forEach(item => {\n const title = item.valueColumn.label ?? item.valueColumn.value;\n if (item.type === 'continuous') {\n const scale = this.annotationColorScales[item.id].scale as ScaleLinear<string, string>;\n const values = getContinuousLegendTicks(scale, valueExtent);\n const tickPositionScale = scaleLinear([values[0], values[values.length - 1]], [continuousHeight, 0]); //TODO: update during adding log scale for heatmap\n\n legendItems.push({ ...emptySizes, type: 'continuous', id: item.id, tickPositionScale, title, scale, values });\n }\n if (item.type === 'discrete') {\n const scale = this.annotationColorScales[item.id].scale as ScaleOrdinal<string, string>;\n const values = scale.domain();\n const labels = getDefaultLabels(values);\n\n legendItems.push({ ...emptySizes, type: 'discreteColor', id: item.id, title, scale, values, labels });\n }\n });\n\n if (!legendItems.length) {\n this.legend = { width: 0, height: 0, items: [] };\n return;\n }\n\n const items = arrangeLegendParts(legendItems, this.chartSizes.chartHeight,continuousHeight);\n const maxRightEdge = items.reduce((max, item) => Math.max(max, item.left + item.width), 0);\n\n const legendWidth = maxRightEdge + LEGEND_OFFSET;\n\n this.legend = {\n width: legendWidth,\n height: legendHeight,\n items\n };\n }\n\n updateCaptionsSize(\n groupedCells: GroupedCellsHeatmap,\n xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'],\n yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'],\n facetSettings: HeatmapSettingsImpl['facetSettings']\n ) {\n const textMeasurer = new TextMeasurer('bold 16px Manrope');\n const { xGroupKeys, yGroupKeys, xGroupLabels, yGroupLabels, xKeysByGroups, yKeysByGroups, xLabels, yLabels } = groupedCells.meta;\n this.labelAngles = {\n xAxisLabels: xAxis.axisLabelsAngle,\n yAxisLabels: yAxis.axisLabelsAngle,\n xGroupLabels: xAxis.groupLabelsAngle,\n yGroupLabels: yAxis.groupLabelsAngle,\n };\n\n const maxXLabelSize = xGroupKeys.reduce((res, key) => Math.max(res, getMaxTextLength(xKeysByGroups[key], xLabels, textMeasurer)), 0);\n const maxYLabelSize = yGroupKeys.reduce((res, key) => Math.max(res, getMaxTextLength(yKeysByGroups[key], yLabels, textMeasurer)), 0);\n const maxXGroupLabelSize = getMaxTextLength(xGroupKeys, xGroupLabels, textMeasurer);\n const maxYGroupLabelSize = getMaxTextLength(yGroupKeys, yGroupLabels, textMeasurer);\n const { xCaptionTail, yCaptionTail } = calculateCaptionTails(\n this.labelAngles,\n facetSettings,\n this.scales,\n this.step,\n groupedCells,\n textMeasurer\n );\n this.captionsSizes = {\n xCaptionTail,\n yCaptionTail,\n xGroupCaptions: getCaptionHeight(maxXGroupLabelSize, this.labelAngles.xGroupLabels),\n yGroupCaptions: getCaptionHeight(maxYGroupLabelSize, this.labelAngles.yGroupLabels),\n xAxisCaptions: getCaptionHeight(maxXLabelSize, this.labelAngles.xAxisLabels),\n yAxisCaptions: getCaptionHeight(maxYLabelSize, this.labelAngles.yAxisLabels),\n };\n }\n\n updateChartDimensions(\n size: HeatmapSettingsImpl['chartSettings']['size'],\n facetKeys: string[],\n xGroupKeys: string[],\n yGroupKeys: string[],\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'],\n yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'],\n annotations: HeatmapSettingsImpl['annotations'],\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY']\n ) {\n const facetCount = facetKeys.length;\n const maxNRows = Math.min(facetSettings.nRows ?? facetCount, facetCount);\n const maxNCols = Math.min(facetSettings.nCols ?? facetCount, facetCount);\n // Use columns/rows count from settings if some of them defined, else make 1 column\n this.columnsCount = facetSettings.nRows ? Math.ceil(facetCount / maxNRows) : maxNCols;\n this.rowsCount = Math.ceil(facetCount / this.columnsCount);\n const { sharedX, sharedY } = facetSettings;\n\n this.chartsDimensions = {};\n\n let currentLeft = 0;\n let currentTop = 0;\n facetKeys.forEach((key, index) => {\n const currentColumn = (index % this.columnsCount) + 1;\n const chartSides = getChartEdgeSides(index, facetKeys.length, this.columnsCount, this.rowsCount);\n const stepX = this.step.x[key];\n const stepY = this.step.y[key];\n const sideElementSizes = calculateChartSideElementSizes(\n xAxis,\n yAxis,\n this.captionsSizes,\n annotations,\n dendrogramX,\n dendrogramY,\n chartSides,\n sharedX,\n sharedY,\n facetKeys,\n xGroupKeys,\n yGroupKeys,\n stepX,\n stepY\n );\n const annotationsTitleSizes = calculateAnnotationTitleSizes(annotations, chartSides, sharedX, sharedY);\n function getPadding(side: 'left' | 'right' | 'top' | 'bottom') {\n return Math.max(\n CHART_SIDE_ELEMENTS[side].reduce((res, el) => res + sideElementSizes[side][el], 0),\n annotationsTitleSizes[side],\n size.innerOffset\n );\n }\n const padding = {\n left: getPadding('left'),\n right: getPadding('right'),\n top: getPadding('top'),\n bottom: getPadding('bottom'),\n };\n if (padding.left < this.captionsSizes.xCaptionTail) {\n padding.left = this.captionsSizes.xCaptionTail;\n }\n if (padding.bottom < this.captionsSizes.yCaptionTail) {\n padding.bottom = this.captionsSizes.yCaptionTail;\n }\n const sideElementBBoxes = calculateSideElementsBBoxes(sideElementSizes, this.chartSizes.chartWidth, this.chartSizes.chartHeight);\n const outerWidth = this.chartSizes.chartWidth + padding.left + padding.right;\n const outerHeight = this.chartSizes.chartHeight + padding.top + padding.bottom;\n this.chartsDimensions[key] = {\n left: currentLeft,\n top: currentTop,\n inner: { width: this.chartSizes.chartWidth, height: this.chartSizes.chartHeight },\n outer: { width: outerWidth, height: outerHeight },\n padding,\n sideElementBBoxes,\n chartEdgeSides: chartSides,\n };\n currentLeft += outerWidth;\n if (currentColumn === this.columnsCount) {\n currentLeft = 0;\n currentTop += outerHeight;\n }\n });\n\n // sum of widths of first row\n const chartsWidth = facetKeys\n .slice(0, this.columnsCount)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.width, 0);\n // sum of heights of first column\n const chartsHeight = facetKeys\n .filter((_key, index) => index % this.columnsCount === 0)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.height, 0);\n this.chartSizes.chartsWidth = chartsWidth;\n this.chartSizes.chartsHeight = chartsHeight;\n }\n\n updateChartsSizes(\n size: HeatmapSettingsImpl['chartSettings']['size'],\n groupedCells: GroupedCellsHeatmap,\n groupGap: number,\n ) {\n const { width, height, cellWidth, cellHeight } = size;\n const firstFacet = groupedCells.meta.facetKeys[0];\n if (cellWidth && firstFacet) {\n const keysCount = groupedCells.facets[firstFacet].xKeys.length;\n const groupsCount = groupedCells.meta.xGroupKeys.length;\n this.chartSizes.chartWidth = keysCount * cellWidth + groupGap * (groupsCount - 1);\n } else {\n this.chartSizes.chartWidth = width;\n }\n\n if (cellHeight && firstFacet) {\n const keysCount = groupedCells.facets[firstFacet].yKeys.length;\n const groupsCount = groupedCells.meta.yGroupKeys.length;\n this.chartSizes.chartHeight = keysCount * cellHeight + groupGap * (groupsCount - 1);\n } else {\n this.chartSizes.chartHeight = height;\n }\n }\n\n // update scales for cell positions, x and y for each facet\n updateScales(\n facetKeys: string[],\n groupedCells: GroupedCellsHeatmap,\n groupGap: number,\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n size: HeatmapSettingsImpl['chartSettings']['size'],\n xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'],\n yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'],\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY'],\n customOrder: {x: boolean, y: boolean, xGroup: boolean, yGroup: boolean},\n ) {\n const { width, height, cellWidth, cellHeight } = size;\n const { meta, facets } = groupedCells;\n const { sharedX, sharedY } = facetSettings;\n const sortX = (arr: string[], labels: Record<string, string> = {}) => {\n return arr.sort((a, b) => xAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', { numeric: true })\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', { numeric: true })\n );\n };\n const sortY = (arr: string[], labels: Record<string, string> = {}) => {\n return arr.sort((a, b) => yAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', { numeric: true })\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', { numeric: true })\n );\n };\n facetKeys.forEach(facetKey => {\n const facetGroup = facets[facetKey];\n const xGroupKeys = customOrder.xGroup ? meta.xGroupKeys : sortX(meta.xGroupKeys);\n const yGroupKeys = customOrder.yGroup ? meta.yGroupKeys : sortY(meta.yGroupKeys);\n const { xKeysByGroups } = sharedX ? meta : facetGroup;\n const { yKeysByGroups } = sharedY ? meta : facetGroup;\n // for shared facets max cells counts in group should be used\n const xCounts = xGroupKeys.map(xGroupKey => xKeysByGroups[xGroupKey].length);\n const yCounts = yGroupKeys.map(yGroupKey => yKeysByGroups[yGroupKey].length);\n const xCellsCount = xCounts.reduce((sum, count) => sum + count, 0);\n const yCellsCount = yCounts.reduce((sum, count) => sum + count, 0);\n const xStep = cellWidth ? cellWidth : (width - (xCounts.filter(count => count > 0).length - 1) * groupGap) / xCellsCount;\n const yStep = cellHeight ? cellHeight : (height - (yCounts.filter(count => count > 0).length - 1) * groupGap) / yCellsCount;\n\n const xPositions: number[] = [];\n let xKeys: string[] = [];\n let currentX = 0;\n xGroupKeys.forEach(xKey => {\n const axisKeys = dendrogramX || customOrder.x ? xKeysByGroups[xKey] : sortX(xKeysByGroups[xKey], meta.xLabels);\n xKeys = xKeys.concat(axisKeys);\n axisKeys.forEach(() => {\n xPositions.push(currentX);\n currentX += xStep;\n });\n // do not add offset for empty group\n if (axisKeys.length > 0) {\n currentX += groupGap;\n }\n });\n\n const yPositions: number[] = [];\n let yKeys: string[] = [];\n let currentY = 0;\n yGroupKeys.forEach(yKey => {\n const axisKeys = dendrogramY || customOrder.y ? yKeysByGroups[yKey] : sortY(yKeysByGroups[yKey], meta.yLabels);\n yKeys = yKeys.concat(axisKeys);\n axisKeys.forEach(() => {\n yPositions.push(currentY);\n currentY += yStep;\n });\n // do not add offset for empty group\n if (axisKeys.length > 0) {\n currentY += groupGap;\n }\n });\n\n this.scales.x[facetKey] = scaleOrdinal<string, number>().domain(xKeys).range(xPositions);\n this.scales.y[facetKey] = scaleOrdinal<string, number>().domain(yKeys).range(yPositions);\n this.step.x[facetKey] = xStep;\n this.step.y[facetKey] = yStep;\n });\n }\n\n updateAesScale(\n valueType: 'discrete' | 'continuous',\n valueExtent: [number, number],\n aes: HeatmapSettingsImpl['aes'],\n annotations: HeatmapSettingsImpl['annotations'],\n groupedCellsData: GroupedCellsHeatmap,\n cellUniqValues: DataValue[],\n normalization: HeatmapSettingsImpl['normalization']\n ) {\n if (valueType === 'continuous') {\n if (aes.valueColors) {\n this.colorScale = scaleLinear<string, string>()\n .domain(aes.valuesByColors ?? getContinuousColorRange(normalization, aes.valueColors.length, valueExtent))\n .range(aes.valueColors);\n } else if (aes.colorsList) {\n this.colorScale = scaleLinear<string, string>()\n .domain(getContinuousColorRange(normalization, aes.colorsList.length, valueExtent))\n .range(aes.colorsList);\n }\n } else {\n if (aes.colorsMap) {\n const valueKeys = Object.entries(aes.colorsMap);\n this.colorScale = scaleOrdinal<string, string>()\n .domain(valueKeys.map(v => v[0]))\n .range(valueKeys.map(v => v[1]))\n .unknown('#ccc');\n } else if (aes.colorsList) {\n this.colorScale = createDiscreteColorScale(aes.colorsList, cellUniqValues.map(String));\n }\n }\n\n const { xDataByKeys, yDataByKeys } = groupedCellsData.meta;\n annotations.forEach(item => {\n const { colors, type, axis, valueColumn } = item;\n const data = (axis === 'x' ? xDataByKeys : yDataByKeys)[valueColumn.valueLabels ?? valueColumn.value];\n if (type === 'discrete') {\n const discreteValues = lodash.uniq(Object.values(data).map(String)).sort();\n this.annotationColorScales[item.id] = {\n type: 'discrete',\n scale: createDiscreteRoundColorScale(colors, discreteValues),\n };\n } else {\n const values = Object.values(data).map(Number);\n if (!values.length) {\n return;\n }\n const [min = values[0], max = values[0]] = extent(values);\n this.annotationColorScales[item.id] = {\n type: 'continuous',\n scale: createContinuousColorScale(colors, min, max, 0, 0.5, 1),\n };\n }\n });\n }\n\n updateDendrogram(\n facetKeys: string[],\n xGroupKeys: string[],\n yGroupKeys: string[],\n groups: GroupedCellsHeatmap['facets'],\n dendrogramsData: DendrogramsData,\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY']\n ) {\n facetKeys.forEach(facetKey => {\n this.dendrograms[facetKey] = { x: { treesByGroupKey: {}, data: dendrogramX }, y: { treesByGroupKey: {}, data: dendrogramY } };\n const { xKeysByGroups, yKeysByGroups } = groups[facetKey];\n if (dendrogramX) {\n const { hierarchyByGroupX } = dendrogramsData[facetKey];\n const maxHeightX = xGroupKeys.reduce((res, xKey) => Math.max(res, hierarchyByGroupX[xKey]?.data.height), 0);\n this.dendrograms[facetKey].x.treesByGroupKey = xGroupKeys.reduce((res, groupKey) => {\n const hierarchy = hierarchyByGroupX[groupKey];\n const xKeys = xKeysByGroups[groupKey];\n cluster()\n .separation(() => 1)\n .size([xKeys.length * this.step.x[facetKey], dendrogramX.size])(\n hierarchy as HierarchyNode<unknown>\n );\n const root = hierarchy as HierarchyPointNode<Cluster>;\n const heightScale = scaleLinear()\n .domain(dendrogramX.position === 'top' ? [0, maxHeightX] : [maxHeightX, 0])\n .range([dendrogramX.size, 0]);\n updateLinksHeight(root, heightScale, 'y');\n addShiftToLinkCoord(root, this.scales.x[facetKey](xKeys[0]), 'x');\n res[groupKey] = root;\n return res;\n }, {} as Record<string, HierarchyPointNode<Cluster>>);\n this.dendrograms[facetKey].x.data = dendrogramX;\n }\n if (dendrogramY) {\n const { hierarchyByGroupY } = dendrogramsData[facetKey];\n const maxHeightY = yGroupKeys.reduce((res, yKey) => Math.max(res, hierarchyByGroupY[yKey]?.data.height), 0);\n this.dendrograms[facetKey].y.treesByGroupKey = yGroupKeys.reduce((res, groupKey) => {\n const hierarchy = hierarchyByGroupY[groupKey];\n const yKeys = yKeysByGroups[groupKey];\n cluster()\n .separation(() => 1)\n .size([yKeys.length * this.step.y[facetKey], dendrogramY.size])(\n hierarchy as HierarchyNode<unknown>\n );\n const root = hierarchy as HierarchyPointNode<Cluster>;\n const heightScale = scaleLinear()\n .domain(dendrogramY.position === 'left' ? [0, maxHeightY] : [maxHeightY, 0])\n .range([dendrogramY.size, 0]);\n addShiftToLinkCoord(root, this.scales.y[facetKey](yKeys[0]), 'x', 'y');\n updateLinksHeight(root, heightScale, 'x');\n res[groupKey] = root;\n return res;\n }, {} as Record<string, HierarchyPointNode<Cluster>>);\n this.dendrograms[facetKey].y.data = dendrogramY;\n }\n });\n }\n\n updateDendrogramAesScales(inheritedAes: HeatmapSettingsImpl['inheritedDendrogramAes']) {\n if (!inheritedAes) {\n return;\n }\n const usedColumns = Object.keys(inheritedAes);\n this.dendrogramAesScales = usedColumns.reduce((res: DendrogramAesScales, columnName) => {\n const aesMap = inheritedAes[columnName];\n const columnValues: string[] = Object.keys(aesMap);\n res[columnName] = scaleOrdinal<string, AesItem, AesItem>()\n .domain(columnValues)\n .range(\n columnValues.map(value => ({\n ...DEFAULT_AES,\n ...aesMap[value],\n }))\n )\n .unknown(DEFAULT_AES);\n return res;\n }, {});\n }\n\n render(\n dataFrame: DataFrame,\n settingsId: string,\n chartSettings: HeatmapSettingsImpl['chartSettings'],\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n aes: HeatmapSettingsImpl['aes'],\n groupedCellsData: GroupedCellsHeatmap,\n annotations: HeatmapSettingsImpl['annotations'],\n valueColumn: ColumnName,\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY'],\n dendrogramsData: DendrogramsData,\n inheritedDendrogramAes: HeatmapSettingsImpl['inheritedDendrogramAes'],\n cellUniqValues: DataValue[],\n normalization: HeatmapSettingsImpl['normalization'],\n onTooltipHintSwitch: (v: boolean) => void,\n customOrder: {x: boolean, y: boolean, xGroup: boolean, yGroup: boolean},\n cellsRenderingMode: 'canvas' | 'svg'\n ) {\n const { meta, facets } = groupedCellsData;\n const { facetKeys, xGroupKeys, yGroupKeys, valueExtent } = meta;\n const { xAxis, yAxis, title, size, valueType } = chartSettings;\n this.updateChartsSizes(size, groupedCellsData, aes.groupGap);\n this.updateAesScale(valueType, valueExtent.dataSource, aes, annotations, groupedCellsData, cellUniqValues, normalization);\n this.updateScales(facetKeys, groupedCellsData, aes.groupGap, facetSettings, size, chartSettings.xAxis, chartSettings.yAxis, dendrogramX, dendrogramY, customOrder);\n // caption sizes are needed for chart paddings in chart dimensions\n this.updateCaptionsSize(groupedCellsData, xAxis, yAxis, facetSettings);\n this.updateChartDimensions(\n size,\n facetKeys,\n xGroupKeys,\n yGroupKeys,\n facetSettings,\n xAxis,\n yAxis,\n annotations,\n dendrogramX,\n dendrogramY\n );\n this.updateLegendSize(valueType, chartSettings.legend, annotations, valueColumn, valueExtent.dataSource);\n this.updateMargins(title, size);\n this.updateDendrogram(facetKeys, xGroupKeys, yGroupKeys, facets, dendrogramsData, dendrogramX, dendrogramY);\n this.updateDendrogramAesScales(inheritedDendrogramAes);\n const component = (\n <DataFrameProvider dataFrame={dataFrame}>\n <ChartsGroup\n aes={aes}\n annotations={annotations}\n annotationColorScales={this.annotationColorScales}\n captionsSizes={this.captionsSizes}\n cellsMeta={meta}\n columnsCount={this.columnsCount}\n chartsDimensions={this.chartsDimensions}\n chartSettings={chartSettings}\n chartSizes={this.chartSizes}\n colorScale={this.colorScale as (v: unknown) => string}\n dendrogramAesScales={this.dendrogramAesScales}\n dendrograms={this.dendrograms}\n facetKeys={facetKeys}\n facetSettings={facetSettings}\n groupedCells={facets}\n labelAngles={this.labelAngles}\n legend={this.legend}\n margins={this.margins}\n scales={this.scales}\n settingsId={settingsId}\n step={this.step}\n xGroupKeys={xGroupKeys}\n yGroupKeys={yGroupKeys}\n onTooltipHintSwitch={onTooltipHintSwitch}\n cellsRenderingMode={cellsRenderingMode}\n />\n </DataFrameProvider>\n );\n this.component = component;\n this.reactRoot?.render(component);\n }\n\n renderError(message: string) {\n this.reactRoot?.render(<Error message={message} />);\n }\n}\n\nexport default ChartRenderer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8CA,IAAM,IAAW,KAAK,IAAI,KAAK,KAAK,EAAE,EAChC,IAAiB;AACvB,SAAS,EAAkB,GAAmC,GAA8B,GAAkB;CAC1G,SAAS,EAAU,GAAgC;AAE/C,EADA,EAAE,KAAS,EAAM,EAAE,KAAK,OAAO,EAC3B,EAAE,YAAU,EAAE,SAAS,QAAQ,EAAU;;AAEjD,GAAU,EAAK;;AAInB,SAAS,EACL,GACA,GACA,GACA,IAAU,GACZ;CACE,SAAS,EAAK,GAAgC;AAE1C,EADA,EAAE,KAAW,EAAE,KAAa,GACxB,EAAE,YAAU,EAAE,SAAS,QAAQ,EAAK;;AAE5C,GAAK,EAAK;;AAGd,IAAM,KAAY,GA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BACD,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACH,EACD,KAAK,iBAAiB,GAAW,EAAc,QAAQ,GAAa,GAAa,EAAY,WAAW,EACxG,KAAK,cAAc,GAAO,EAAK,EAC/B,KAAK,iBAAiB,GAAW,GAAY,GAAY,GAAQ,GAAiB,GAAa,EAAY,EAC3G,KAAK,0BAA0B,EAAuB;EACtD,IAAM,IACF,kBAAC,GAAD;GAA8B;aAC1B,kBAAC,GAAD;IACS;IACQ;IACb,uBAAuB,KAAK;IAC5B,eAAe,KAAK;IACpB,WAAW;IACX,cAAc,KAAK;IACnB,kBAAkB,KAAK;IACR;IACf,YAAY,KAAK;IACjB,YAAY,KAAK;IACjB,qBAAqB,KAAK;IAC1B,aAAa,KAAK;IACP;IACI;IACf,cAAc;IACd,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,SAAS,KAAK;IACd,QAAQ,KAAK;IACD;IACZ,MAAM,KAAK;IACC;IACA;IACS;IACD;IACtB,CAAA;GACc,CAAA;AAGxB,EADA,KAAK,YAAY,GACjB,KAAK,WAAW,OAAO,EAAU;;CAGrC,YAAY,GAAiB;AACzB,OAAK,WAAW,OAAO,kBAAC,GAAD,EAAgB,YAAW,CAAA,CAAC"}
1
+ {"version":3,"file":"ChartRenderer.js","names":[],"sources":["../../src/heatmap/ChartRenderer.tsx"],"sourcesContent":["import { extent } from 'd3-array';\nimport type { HierarchyNode, HierarchyPointNode } from 'd3-hierarchy';\nimport { cluster } from 'd3-hierarchy';\nimport type { ScaleLinear, ScaleOrdinal } from 'd3-scale';\nimport { scaleLinear, scaleOrdinal } from 'd3-scale';\nimport lodash from 'lodash';\nimport type { ReactElement } from 'react';\nimport type { Root } from 'react-dom/client';\nimport { createRoot } from 'react-dom/client';\nimport { Error } from '../common/Error';\nimport type { LegendData, LegendItem } from '../common/types';\nimport { DataFrameProvider } from '../common/useDataFrame';\nimport { DEFAULT_HEIGHT, DEFAULT_WIDTH, MAX_LEGEND_GRADIENT_HEIGHT, MIN_LEGEND_GRADIENT_HEIGHT, TITLE_LINE_HEIGHT, TITLE_MARGIN } from '../constants';\nimport type { DataFrame } from '../DataFrame';\nimport type { AesItem, ColumnName, DataValue } from '../types';\nimport { arrangeLegendParts } from '../utils/arrangeLegendParts';\nimport { getChartEdgeSides } from '../utils/getChartEdgeSides';\nimport { getContinuousLegendTicks } from '../utils/getContinuousLegendTicks';\nimport { TextMeasurer } from '../utils/TextMeasurer/TextMeasurer';\nimport { ChartsGroup } from './components/ChartsGroup';\nimport type {\n AnnotationColorScales,\n CaptionsSizes,\n ChartDendrograms,\n ChartDimensionsData,\n ChartSizes,\n ChartsScales,\n Cluster,\n DendrogramAesScales,\n LabelAngles,\n Margins,\n} from './components/types';\nimport { CHART_SIDE_ELEMENTS, DEFAULT_AES, LEGEND_OFFSET, MIN_MARGIN, TITLE_LINE } from './constants';\nimport type { GroupedCellsHeatmap } from './getCells';\nimport type { DendrogramsData } from './getDendrograms';\nimport type { HeatmapSettingsImpl } from './HeatmapSettingsImpl';\nimport {\n calculateAnnotationTitleSizes,\n calculateChartSideElementSizes,\n calculateSideElementsBBoxes,\n createContinuousColorScale,\n createDiscreteColorScale,\n createDiscreteRoundColorScale,\n} from './utils';\nimport { calculateCaptionTails } from './utils/calculateCaptionTails';\n\nconst COS_PI_4 = Math.cos(Math.PI / 4);\nconst INCLINE_OFFSET = 5; // height of little triangle of text for captions inclined 45deg\nfunction updateLinksHeight(root: HierarchyPointNode<Cluster>, scale: (v: number) => number, coord: 'x' | 'y') {\n function setHeight(d: HierarchyPointNode<Cluster>) {\n d[coord] = scale(d.data.height);\n if (d.children) d.children.forEach(setHeight);\n }\n setHeight(root);\n}\n\n// add shift to move nodes positions with group gaps\nfunction addShiftToLinkCoord(\n root: HierarchyPointNode<Cluster>,\n shift: number,\n coordFrom: 'x' | 'y',\n coordTo = coordFrom\n) {\n function setX(d: HierarchyPointNode<Cluster>) {\n d[coordTo] = d[coordFrom] + shift;\n if (d.children) d.children.forEach(setX);\n }\n setX(root);\n}\n\nconst getSteps = (count: number, valueExtent: number[]) => {\n const min = Math.min(...valueExtent);\n const max = Math.max(...valueExtent);\n if (min === max) {\n const steps = count % 2 === 0 ? [] : [min];\n for (let i = 1; i < count / 2 + 1; i++) {\n steps.push(min + i);\n steps.unshift(min - i);\n }\n return steps;\n }\n if (count < 2) {\n return [min, max];\n }\n const step = (max - min) / (count - 1);\n const steps = [];\n for (let i = 0; i < count - 1; i++) {\n steps.push(min + step * i);\n }\n steps.push(max);\n return steps;\n};\n\nfunction getContinuousColorRange(normalization: HeatmapSettingsImpl['normalization'], colorsCount: number, valueExtent: number[]) {\n let extent = valueExtent;\n if (normalization) {\n if (normalization.colorRange) {\n extent = normalization.colorRange;\n }\n if (normalization.method === 'standardScaling') {\n extent = [-2, 2];\n }\n if (normalization.method === 'meanNormalization') {\n extent = [-0.75, 0.75];\n }\n }\n return getSteps(colorsCount, extent);\n}\n\nfunction getMaxTextLength(keys: string[], labels: Record<string, string>, textMeasurer: TextMeasurer) {\n let maxLabelSize = 0;\n for (const key of keys) {\n if (labels[key] === undefined) continue;\n const l = textMeasurer.getTextWidth(labels[key]);\n if (l > maxLabelSize) maxLabelSize = l;\n }\n return maxLabelSize;\n}\n\nfunction getCaptionHeight(size: number, angle: number) {\n if (angle === 90) {\n return size;\n }\n if (angle === 45) {\n return size * COS_PI_4 + (size > 0 ? 2 * INCLINE_OFFSET : 0);\n }\n return TITLE_LINE;\n}\n\nclass ChartRenderer {\n reactRoot: Root | null = null;\n parentNode: HTMLElement | null = null;\n rootNode: HTMLElement | null = null;\n component: ReactElement = (<></>);\n chartsDimensions: Record<string, ChartDimensionsData> = {};\n chartSizes: ChartSizes = {\n chartWidth: DEFAULT_WIDTH, // width of single chart\n chartHeight: DEFAULT_HEIGHT, // height of single chart\n chartsWidth: DEFAULT_WIDTH, // width of all charts in charts row\n chartsHeight: DEFAULT_HEIGHT, // width of all charts in charts column, without axes\n totalWidth: DEFAULT_WIDTH, // width of all charts in charts row, plus left axis, plus legend\n totalHeight: DEFAULT_HEIGHT, // width of all charts in charts height, plus bottom axis, plus top title\n };\n margins: Margins = {\n top: MIN_MARGIN,\n bottom: MIN_MARGIN,\n left: MIN_MARGIN,\n right: MIN_MARGIN,\n };\n captionsSizes: CaptionsSizes = {\n xAxisCaptions: 100,\n yAxisCaptions: 100,\n xGroupCaptions: TITLE_LINE,\n yGroupCaptions: TITLE_LINE,\n xCaptionTail: 0,\n yCaptionTail: 0,\n };\n labelAngles: LabelAngles = {\n xAxisLabels: 0,\n yAxisLabels: 0,\n xGroupLabels: 0,\n yGroupLabels: 0,\n };\n columnsCount = 1;\n rowsCount = 1;\n scales: ChartsScales = {\n // scales grouped by facet\n x: { null: scaleOrdinal<string, number>().domain(['null']).range([1]) },\n y: { null: scaleOrdinal<string, number>().domain(['null']).range([1]) },\n };\n step: {\n x: Record<string, number>;\n y: Record<string, number>;\n } = { x: {}, y: {} };\n colorScale: ScaleLinear<string, string> | ScaleOrdinal<string, string, string> = scaleLinear<string, string>()\n .domain([0, 1])\n .range(['white', 'black']);\n annotationColorScales: AnnotationColorScales = {};\n dendrogramAesScales: DendrogramAesScales = {};\n legend: LegendData = {\n width: 0,\n height: 0,\n items: [],\n };\n dendrograms: Record<string, ChartDendrograms> = {};\n\n clear() {\n if (this.parentNode && this.rootNode) {\n this.parentNode?.removeChild(this.rootNode);\n this.parentNode = null;\n this.rootNode = null;\n }\n // timeout to avoid trying to unmount during rendering\n setTimeout(() => {\n this.reactRoot?.unmount();\n this.reactRoot = null;\n });\n }\n\n init(node: HTMLElement) {\n if (this.parentNode === null) {\n this.parentNode = node;\n this.rootNode = document.createElement('div');\n this.parentNode.appendChild(this.rootNode);\n this.reactRoot = createRoot(this.rootNode);\n }\n }\n\n updateMargins(title: HeatmapSettingsImpl['chartSettings']['title'], size: HeatmapSettingsImpl['chartSettings']['size']) {\n this.margins = {\n top: title.show ? TITLE_LINE_HEIGHT + TITLE_MARGIN * 2 : size.outerOffset,\n bottom: size.outerOffset,\n left: size.outerOffset,\n right: this.legend.width + size.outerOffset,\n };\n this.chartSizes.totalWidth = this.margins.left + this.chartSizes.chartsWidth + this.margins.right;\n this.chartSizes.totalHeight =\n this.margins.top + Math.max(this.chartSizes.chartsHeight + this.margins.bottom, this.legend.height);\n }\n\n updateLegendSize(\n valueType: HeatmapSettingsImpl['chartSettings']['valueType'],\n legend: HeatmapSettingsImpl['chartSettings']['legend'],\n annotations: HeatmapSettingsImpl['annotations'],\n columnValue: ColumnName,\n valueExtent: [number, number]\n ) {\n if (!legend.show) {\n this.legend = { width: 0, height: 0, items: [] };\n return;\n }\n const continuousHeight = Math.min(\n Math.max(this.chartSizes.chartHeight, MIN_LEGEND_GRADIENT_HEIGHT),\n MAX_LEGEND_GRADIENT_HEIGHT\n );\n const legendHeight = Math.max(this.chartSizes.chartHeight, continuousHeight);\n const legendItems: LegendItem[] = [];\n const emptySizes = { width: 0, height: 0, left: 0, top: 0 };\n\n const getDefaultLabels = (values: (string | number)[]) => values.reduce((res: Record<string, string>, v: string | number) => { res[v] = String(v); return res; }, {});\n if (valueType === 'continuous') {\n const scale = this.colorScale as ScaleLinear<string, string>;\n const values = getContinuousLegendTicks(scale, valueExtent);\n const tickPositionScale = scaleLinear([values[0], values[values.length - 1]], [continuousHeight, 0]); //TODO: update during adding log scale for heatmap\n const title = columnValue.label ?? columnValue.value;\n legendItems.push({\n ...emptySizes,\n type: 'continuous',\n id: 'heatmapValue',\n scale,\n values,\n title,\n tickPositionScale\n });\n } else if (valueType === 'discrete') {\n const scale = this.colorScale as ScaleOrdinal<string, string>;\n const title = columnValue.label ?? columnValue.value;\n const values = scale.domain();\n const labels = getDefaultLabels(values);\n\n legendItems.push({ ...emptySizes, type: 'discreteColor', id: 'heatmapValue', title, scale, values, labels });\n }\n annotations.forEach(item => {\n const title = item.valueColumn.label ?? item.valueColumn.value;\n if (item.type === 'continuous') {\n const scale = this.annotationColorScales[item.id].scale as ScaleLinear<string, string>;\n const values = getContinuousLegendTicks(scale, valueExtent);\n const tickPositionScale = scaleLinear([values[0], values[values.length - 1]], [continuousHeight, 0]); //TODO: update during adding log scale for heatmap\n\n legendItems.push({ ...emptySizes, type: 'continuous', id: item.id, tickPositionScale, title, scale, values });\n }\n if (item.type === 'discrete') {\n const scale = this.annotationColorScales[item.id].scale as ScaleOrdinal<string, string>;\n const values = scale.domain();\n const labels = getDefaultLabels(values);\n\n legendItems.push({ ...emptySizes, type: 'discreteColor', id: item.id, title, scale, values, labels });\n }\n });\n\n if (!legendItems.length) {\n this.legend = { width: 0, height: 0, items: [] };\n return;\n }\n\n const items = arrangeLegendParts(legendItems, this.chartSizes.chartHeight,continuousHeight);\n const maxRightEdge = items.reduce((max, item) => Math.max(max, item.left + item.width), 0);\n\n const legendWidth = maxRightEdge + LEGEND_OFFSET;\n\n this.legend = {\n width: legendWidth,\n height: legendHeight,\n items\n };\n }\n\n updateCaptionsSize(\n groupedCells: GroupedCellsHeatmap,\n xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'],\n yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'],\n facetSettings: HeatmapSettingsImpl['facetSettings']\n ) {\n const textMeasurer = new TextMeasurer('bold 16px Manrope');\n const { xGroupKeys, yGroupKeys, xGroupLabels, yGroupLabels, xKeysByGroups, yKeysByGroups, xLabels, yLabels } = groupedCells.meta;\n this.labelAngles = {\n xAxisLabels: xAxis.axisLabelsAngle,\n yAxisLabels: yAxis.axisLabelsAngle,\n xGroupLabels: xAxis.groupLabelsAngle,\n yGroupLabels: yAxis.groupLabelsAngle,\n };\n\n const maxXLabelSize = xGroupKeys.reduce((res, key) => Math.max(res, getMaxTextLength(xKeysByGroups[key], xLabels, textMeasurer)), 0);\n const maxYLabelSize = yGroupKeys.reduce((res, key) => Math.max(res, getMaxTextLength(yKeysByGroups[key], yLabels, textMeasurer)), 0);\n const maxXGroupLabelSize = getMaxTextLength(xGroupKeys, xGroupLabels, textMeasurer);\n const maxYGroupLabelSize = getMaxTextLength(yGroupKeys, yGroupLabels, textMeasurer);\n const { xCaptionTail, yCaptionTail } = calculateCaptionTails(\n this.labelAngles,\n facetSettings,\n this.scales,\n this.step,\n groupedCells,\n textMeasurer\n );\n this.captionsSizes = {\n xCaptionTail,\n yCaptionTail,\n xGroupCaptions: getCaptionHeight(maxXGroupLabelSize, this.labelAngles.xGroupLabels),\n yGroupCaptions: getCaptionHeight(maxYGroupLabelSize, this.labelAngles.yGroupLabels),\n xAxisCaptions: getCaptionHeight(maxXLabelSize, this.labelAngles.xAxisLabels),\n yAxisCaptions: getCaptionHeight(maxYLabelSize, this.labelAngles.yAxisLabels),\n };\n }\n\n updateChartDimensions(\n size: HeatmapSettingsImpl['chartSettings']['size'],\n facetKeys: string[],\n xGroupKeys: string[],\n yGroupKeys: string[],\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'],\n yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'],\n annotations: HeatmapSettingsImpl['annotations'],\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY']\n ) {\n const facetCount = facetKeys.length;\n const maxNRows = Math.min(facetSettings.nRows ?? facetCount, facetCount);\n const maxNCols = Math.min(facetSettings.nCols ?? facetCount, facetCount);\n // Use columns/rows count from settings if some of them defined, else make 1 column\n this.columnsCount = facetSettings.nRows ? Math.ceil(facetCount / maxNRows) : maxNCols;\n this.rowsCount = Math.ceil(facetCount / this.columnsCount);\n const { sharedX, sharedY } = facetSettings;\n\n this.chartsDimensions = {};\n\n let currentLeft = 0;\n let currentTop = 0;\n facetKeys.forEach((key, index) => {\n const currentColumn = (index % this.columnsCount) + 1;\n const chartSides = getChartEdgeSides(index, facetKeys.length, this.columnsCount, this.rowsCount);\n const stepX = this.step.x[key];\n const stepY = this.step.y[key];\n const sideElementSizes = calculateChartSideElementSizes(\n xAxis,\n yAxis,\n this.captionsSizes,\n annotations,\n dendrogramX,\n dendrogramY,\n chartSides,\n sharedX,\n sharedY,\n facetKeys,\n xGroupKeys,\n yGroupKeys,\n stepX,\n stepY\n );\n const annotationsTitleSizes = calculateAnnotationTitleSizes(annotations, chartSides, sharedX, sharedY);\n function getPadding(side: 'left' | 'right' | 'top' | 'bottom') {\n return Math.max(\n CHART_SIDE_ELEMENTS[side].reduce((res, el) => res + sideElementSizes[side][el], 0),\n annotationsTitleSizes[side],\n size.innerOffset\n );\n }\n const padding = {\n left: getPadding('left'),\n right: getPadding('right'),\n top: getPadding('top'),\n bottom: getPadding('bottom'),\n };\n if (padding.left < this.captionsSizes.xCaptionTail) {\n padding.left = this.captionsSizes.xCaptionTail;\n }\n if (padding.bottom < this.captionsSizes.yCaptionTail) {\n padding.bottom = this.captionsSizes.yCaptionTail;\n }\n const sideElementBBoxes = calculateSideElementsBBoxes(sideElementSizes, this.chartSizes.chartWidth, this.chartSizes.chartHeight);\n const outerWidth = this.chartSizes.chartWidth + padding.left + padding.right;\n const outerHeight = this.chartSizes.chartHeight + padding.top + padding.bottom;\n this.chartsDimensions[key] = {\n left: currentLeft,\n top: currentTop,\n inner: { width: this.chartSizes.chartWidth, height: this.chartSizes.chartHeight },\n outer: { width: outerWidth, height: outerHeight },\n padding,\n sideElementBBoxes,\n chartEdgeSides: chartSides,\n };\n currentLeft += outerWidth;\n if (currentColumn === this.columnsCount) {\n currentLeft = 0;\n currentTop += outerHeight;\n }\n });\n\n // sum of widths of first row\n const chartsWidth = facetKeys\n .slice(0, this.columnsCount)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.width, 0);\n // sum of heights of first column\n const chartsHeight = facetKeys\n .filter((_key, index) => index % this.columnsCount === 0)\n .reduce((sum, key) => sum + this.chartsDimensions[key].outer.height, 0);\n this.chartSizes.chartsWidth = chartsWidth;\n this.chartSizes.chartsHeight = chartsHeight;\n }\n\n updateChartsSizes(\n size: HeatmapSettingsImpl['chartSettings']['size'],\n groupedCells: GroupedCellsHeatmap,\n groupGap: number,\n ) {\n const { width, height, cellWidth, cellHeight } = size;\n const firstFacet = groupedCells.meta.facetKeys[0];\n if (cellWidth && firstFacet) {\n const keysCount = groupedCells.facets[firstFacet].xKeys.length;\n const nonEmptyXGroupsCount = groupedCells.meta.xGroupKeys.filter(\n k => (groupedCells.facets[firstFacet]?.xKeysByGroups[k]?.length ?? 0) > 0\n ).length;\n this.chartSizes.chartWidth = keysCount * cellWidth + groupGap * (nonEmptyXGroupsCount - 1);\n } else {\n this.chartSizes.chartWidth = width;\n }\n\n if (cellHeight && firstFacet) {\n const keysCount = groupedCells.facets[firstFacet].yKeys.length;\n const nonEmptyYGroupsCount = groupedCells.meta.yGroupKeys.filter(\n k => (groupedCells.facets[firstFacet]?.yKeysByGroups[k]?.length ?? 0) > 0\n ).length;\n this.chartSizes.chartHeight = keysCount * cellHeight + groupGap * (nonEmptyYGroupsCount - 1);\n } else {\n this.chartSizes.chartHeight = height;\n }\n }\n\n // update scales for cell positions, x and y for each facet\n updateScales(\n facetKeys: string[],\n groupedCells: GroupedCellsHeatmap,\n groupGap: number,\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n size: HeatmapSettingsImpl['chartSettings']['size'],\n xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'],\n yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'],\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY'],\n customOrder: {x: boolean, y: boolean, xGroup: boolean, yGroup: boolean},\n ) {\n const { width, height, cellWidth, cellHeight } = size;\n const { meta, facets } = groupedCells;\n const { sharedX, sharedY } = facetSettings;\n const sortX = (arr: string[], labels: Record<string, string> = {}) => {\n return arr.sort((a, b) => xAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', { numeric: true })\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', { numeric: true })\n );\n };\n const sortY = (arr: string[], labels: Record<string, string> = {}) => {\n return arr.sort((a, b) => yAxis.sorting === 'asc'\n ? (labels[a] ?? a).localeCompare((labels[b] ?? b), 'en', { numeric: true })\n : (labels[b] ?? b).localeCompare((labels[a] ?? a), 'en', { numeric: true })\n );\n };\n facetKeys.forEach(facetKey => {\n const facetGroup = facets[facetKey];\n const xGroupKeys = customOrder.xGroup ? meta.xGroupKeys : sortX(meta.xGroupKeys);\n const yGroupKeys = customOrder.yGroup ? meta.yGroupKeys : sortY(meta.yGroupKeys);\n const { xKeysByGroups } = sharedX ? meta : facetGroup;\n const { yKeysByGroups } = sharedY ? meta : facetGroup;\n // for shared facets max cells counts in group should be used\n const xCounts = xGroupKeys.map(xGroupKey => xKeysByGroups[xGroupKey].length);\n const yCounts = yGroupKeys.map(yGroupKey => yKeysByGroups[yGroupKey].length);\n const xCellsCount = xCounts.reduce((sum, count) => sum + count, 0);\n const yCellsCount = yCounts.reduce((sum, count) => sum + count, 0);\n const xStep = cellWidth ? cellWidth : (width - (xCounts.filter(count => count > 0).length - 1) * groupGap) / xCellsCount;\n const yStep = cellHeight ? cellHeight : (height - (yCounts.filter(count => count > 0).length - 1) * groupGap) / yCellsCount;\n\n const xPositions: number[] = [];\n let xKeys: string[] = [];\n let currentX = 0;\n const resolvedXGroups = xGroupKeys.map(xKey =>\n dendrogramX || customOrder.x ? xKeysByGroups[xKey] : sortX(xKeysByGroups[xKey], meta.xLabels)\n );\n resolvedXGroups.forEach((axisKeys, idx) => {\n xKeys = xKeys.concat(axisKeys);\n axisKeys.forEach(() => {\n xPositions.push(currentX);\n currentX += xStep;\n });\n // add gap only if a non-empty group follows (skip trailing gap after last visible group)\n const hasMoreNonEmpty = resolvedXGroups.slice(idx + 1).some(keys => keys.length > 0);\n if (axisKeys.length > 0 && hasMoreNonEmpty) {\n currentX += groupGap;\n }\n });\n\n const yPositions: number[] = [];\n let yKeys: string[] = [];\n let currentY = 0;\n const resolvedYGroups = yGroupKeys.map(yKey =>\n dendrogramY || customOrder.y ? yKeysByGroups[yKey] : sortY(yKeysByGroups[yKey], meta.yLabels)\n );\n resolvedYGroups.forEach((axisKeys, idx) => {\n yKeys = yKeys.concat(axisKeys);\n axisKeys.forEach(() => {\n yPositions.push(currentY);\n currentY += yStep;\n });\n // add gap only if a non-empty group follows (skip trailing gap after last visible group)\n const hasMoreNonEmpty = resolvedYGroups.slice(idx + 1).some(keys => keys.length > 0);\n if (axisKeys.length > 0 && hasMoreNonEmpty) {\n currentY += groupGap;\n }\n });\n\n this.scales.x[facetKey] = scaleOrdinal<string, number>().domain(xKeys).range(xPositions);\n this.scales.y[facetKey] = scaleOrdinal<string, number>().domain(yKeys).range(yPositions);\n this.step.x[facetKey] = xStep;\n this.step.y[facetKey] = yStep;\n });\n }\n\n updateAesScale(\n valueType: 'discrete' | 'continuous',\n valueExtent: [number, number],\n aes: HeatmapSettingsImpl['aes'],\n annotations: HeatmapSettingsImpl['annotations'],\n groupedCellsData: GroupedCellsHeatmap,\n cellUniqValues: DataValue[],\n normalization: HeatmapSettingsImpl['normalization']\n ) {\n if (valueType === 'continuous') {\n if (aes.valueColors) {\n this.colorScale = scaleLinear<string, string>()\n .domain(aes.valuesByColors ?? getContinuousColorRange(normalization, aes.valueColors.length, valueExtent))\n .range(aes.valueColors);\n } else if (aes.colorsList) {\n this.colorScale = scaleLinear<string, string>()\n .domain(getContinuousColorRange(normalization, aes.colorsList.length, valueExtent))\n .range(aes.colorsList);\n }\n } else {\n if (aes.colorsMap) {\n const valueKeys = Object.entries(aes.colorsMap);\n this.colorScale = scaleOrdinal<string, string>()\n .domain(valueKeys.map(v => v[0]))\n .range(valueKeys.map(v => v[1]))\n .unknown('#ccc');\n } else if (aes.colorsList) {\n this.colorScale = createDiscreteColorScale(aes.colorsList, cellUniqValues.map(String));\n }\n }\n\n const { xDataByKeys, yDataByKeys } = groupedCellsData.meta;\n annotations.forEach(item => {\n const { colors, type, axis, valueColumn } = item;\n const data = (axis === 'x' ? xDataByKeys : yDataByKeys)[valueColumn.valueLabels ?? valueColumn.value];\n if (type === 'discrete') {\n const discreteValues = lodash.uniq(Object.values(data).map(String)).sort();\n this.annotationColorScales[item.id] = {\n type: 'discrete',\n scale: createDiscreteRoundColorScale(colors, discreteValues),\n };\n } else {\n const values = Object.values(data).map(Number);\n if (!values.length) {\n return;\n }\n const [min = values[0], max = values[0]] = extent(values);\n this.annotationColorScales[item.id] = {\n type: 'continuous',\n scale: createContinuousColorScale(colors, min, max, 0, 0.5, 1),\n };\n }\n });\n }\n\n updateDendrogram(\n facetKeys: string[],\n xGroupKeys: string[],\n yGroupKeys: string[],\n groups: GroupedCellsHeatmap['facets'],\n dendrogramsData: DendrogramsData,\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY']\n ) {\n facetKeys.forEach(facetKey => {\n this.dendrograms[facetKey] = { x: { treesByGroupKey: {}, data: dendrogramX }, y: { treesByGroupKey: {}, data: dendrogramY } };\n const { xKeysByGroups, yKeysByGroups } = groups[facetKey];\n if (dendrogramX) {\n const { hierarchyByGroupX } = dendrogramsData[facetKey];\n const maxHeightX = xGroupKeys.reduce((res, xKey) => Math.max(res, hierarchyByGroupX[xKey]?.data.height ?? 0), 0);\n this.dendrograms[facetKey].x.treesByGroupKey = xGroupKeys.reduce((res, groupKey) => {\n const hierarchy = hierarchyByGroupX[groupKey];\n if (!hierarchy) return res;\n const xKeys = xKeysByGroups[groupKey];\n cluster()\n .separation(() => 1)\n .size([hierarchy.leaves().length * this.step.x[facetKey], dendrogramX.size])(\n hierarchy as HierarchyNode<unknown>\n );\n const root = hierarchy as HierarchyPointNode<Cluster>;\n const heightScale = scaleLinear()\n .domain(dendrogramX.position === 'top' ? [0, maxHeightX] : [maxHeightX, 0])\n .range([dendrogramX.size, 0]);\n updateLinksHeight(root, heightScale, 'y');\n addShiftToLinkCoord(root, this.scales.x[facetKey](xKeys[0]), 'x');\n res[groupKey] = root;\n return res;\n }, {} as Record<string, HierarchyPointNode<Cluster>>);\n this.dendrograms[facetKey].x.data = dendrogramX;\n }\n if (dendrogramY) {\n const { hierarchyByGroupY } = dendrogramsData[facetKey];\n const maxHeightY = yGroupKeys.reduce((res, yKey) => Math.max(res, hierarchyByGroupY[yKey]?.data.height ?? 0), 0);\n this.dendrograms[facetKey].y.treesByGroupKey = yGroupKeys.reduce((res, groupKey) => {\n const hierarchy = hierarchyByGroupY[groupKey];\n if (!hierarchy) return res;\n const yKeys = yKeysByGroups[groupKey];\n cluster()\n .separation(() => 1)\n .size([hierarchy.leaves().length * this.step.y[facetKey], dendrogramY.size])(\n hierarchy as HierarchyNode<unknown>\n );\n const root = hierarchy as HierarchyPointNode<Cluster>;\n const heightScale = scaleLinear()\n .domain(dendrogramY.position === 'left' ? [0, maxHeightY] : [maxHeightY, 0])\n .range([dendrogramY.size, 0]);\n addShiftToLinkCoord(root, this.scales.y[facetKey](yKeys[0]), 'x', 'y');\n updateLinksHeight(root, heightScale, 'x');\n res[groupKey] = root;\n return res;\n }, {} as Record<string, HierarchyPointNode<Cluster>>);\n this.dendrograms[facetKey].y.data = dendrogramY;\n }\n });\n }\n\n updateDendrogramAesScales(inheritedAes: HeatmapSettingsImpl['inheritedDendrogramAes']) {\n if (!inheritedAes) {\n return;\n }\n const usedColumns = Object.keys(inheritedAes);\n this.dendrogramAesScales = usedColumns.reduce((res: DendrogramAesScales, columnName) => {\n const aesMap = inheritedAes[columnName];\n const columnValues: string[] = Object.keys(aesMap);\n res[columnName] = scaleOrdinal<string, AesItem, AesItem>()\n .domain(columnValues)\n .range(\n columnValues.map(value => ({\n ...DEFAULT_AES,\n ...aesMap[value],\n }))\n )\n .unknown(DEFAULT_AES);\n return res;\n }, {});\n }\n\n render(\n dataFrame: DataFrame,\n settingsId: string,\n chartSettings: HeatmapSettingsImpl['chartSettings'],\n facetSettings: HeatmapSettingsImpl['facetSettings'],\n aes: HeatmapSettingsImpl['aes'],\n groupedCellsData: GroupedCellsHeatmap,\n annotations: HeatmapSettingsImpl['annotations'],\n valueColumn: ColumnName,\n dendrogramX: HeatmapSettingsImpl['dendrogramX'],\n dendrogramY: HeatmapSettingsImpl['dendrogramY'],\n dendrogramsData: DendrogramsData,\n inheritedDendrogramAes: HeatmapSettingsImpl['inheritedDendrogramAes'],\n cellUniqValues: DataValue[],\n normalization: HeatmapSettingsImpl['normalization'],\n onTooltipHintSwitch: (v: boolean) => void,\n customOrder: {x: boolean, y: boolean, xGroup: boolean, yGroup: boolean},\n cellsRenderingMode: 'canvas' | 'svg'\n ) {\n const { meta, facets } = groupedCellsData;\n const { facetKeys, xGroupKeys, yGroupKeys, valueExtent } = meta;\n const { xAxis, yAxis, title, size, valueType } = chartSettings;\n this.updateChartsSizes(size, groupedCellsData, aes.groupGap);\n this.updateAesScale(valueType, valueExtent.dataSource, aes, annotations, groupedCellsData, cellUniqValues, normalization);\n this.updateScales(facetKeys, groupedCellsData, aes.groupGap, facetSettings, size, chartSettings.xAxis, chartSettings.yAxis, dendrogramX, dendrogramY, customOrder);\n // caption sizes are needed for chart paddings in chart dimensions\n this.updateCaptionsSize(groupedCellsData, xAxis, yAxis, facetSettings);\n this.updateChartDimensions(\n size,\n facetKeys,\n xGroupKeys,\n yGroupKeys,\n facetSettings,\n xAxis,\n yAxis,\n annotations,\n dendrogramX,\n dendrogramY\n );\n this.updateLegendSize(valueType, chartSettings.legend, annotations, valueColumn, valueExtent.dataSource);\n this.updateMargins(title, size);\n this.updateDendrogram(facetKeys, xGroupKeys, yGroupKeys, facets, dendrogramsData, dendrogramX, dendrogramY);\n this.updateDendrogramAesScales(inheritedDendrogramAes);\n const component = (\n <DataFrameProvider dataFrame={dataFrame}>\n <ChartsGroup\n aes={aes}\n annotations={annotations}\n annotationColorScales={this.annotationColorScales}\n captionsSizes={this.captionsSizes}\n cellsMeta={meta}\n columnsCount={this.columnsCount}\n chartsDimensions={this.chartsDimensions}\n chartSettings={chartSettings}\n chartSizes={this.chartSizes}\n colorScale={this.colorScale as (v: unknown) => string}\n dendrogramAesScales={this.dendrogramAesScales}\n dendrograms={this.dendrograms}\n facetKeys={facetKeys}\n facetSettings={facetSettings}\n groupedCells={facets}\n labelAngles={this.labelAngles}\n legend={this.legend}\n margins={this.margins}\n scales={this.scales}\n settingsId={settingsId}\n step={this.step}\n xGroupKeys={xGroupKeys}\n yGroupKeys={yGroupKeys}\n onTooltipHintSwitch={onTooltipHintSwitch}\n cellsRenderingMode={cellsRenderingMode}\n />\n </DataFrameProvider>\n );\n this.component = component;\n this.reactRoot?.render(component);\n }\n\n renderError(message: string) {\n this.reactRoot?.render(<Error message={message} />);\n }\n}\n\nexport default ChartRenderer;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA8CA,IAAM,IAAW,KAAK,IAAI,KAAK,KAAK,EAAE,EAChC,IAAiB;AACvB,SAAS,EAAkB,GAAmC,GAA8B,GAAkB;CAC1G,SAAS,EAAU,GAAgC;AAE/C,EADA,EAAE,KAAS,EAAM,EAAE,KAAK,OAAO,EAC3B,EAAE,YAAU,EAAE,SAAS,QAAQ,EAAU;;AAEjD,GAAU,EAAK;;AAInB,SAAS,EACL,GACA,GACA,GACA,IAAU,GACZ;CACE,SAAS,EAAK,GAAgC;AAE1C,EADA,EAAE,KAAW,EAAE,KAAa,GACxB,EAAE,YAAU,EAAE,SAAS,QAAQ,EAAK;;AAE5C,GAAK,EAAK;;AAGd,IAAM,KAAY,GAAe,MAA0B;CACvD,IAAM,IAAM,KAAK,IAAI,GAAG,EAAY,EAC9B,IAAM,KAAK,IAAI,GAAG,EAAY;AACpC,KAAI,MAAQ,GAAK;EACb,IAAM,IAAQ,IAAQ,KAAM,IAAI,EAAE,GAAG,CAAC,EAAI;AAC1C,OAAK,IAAI,IAAI,GAAG,IAAI,IAAQ,IAAI,GAAG,IAE/B,CADA,EAAM,KAAK,IAAM,EAAE,EACnB,EAAM,QAAQ,IAAM,EAAE;AAE1B,SAAO;;AAEX,KAAI,IAAQ,EACR,QAAO,CAAC,GAAK,EAAI;CAErB,IAAM,KAAQ,IAAM,MAAQ,IAAQ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GAAa,GAAa,EAAY,EAElK,KAAK,mBAAmB,GAAkB,GAAO,GAAO,EAAc,EACtE,KAAK,sBACD,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EACH,EACD,KAAK,iBAAiB,GAAW,EAAc,QAAQ,GAAa,GAAa,EAAY,WAAW,EACxG,KAAK,cAAc,GAAO,EAAK,EAC/B,KAAK,iBAAiB,GAAW,GAAY,GAAY,GAAQ,GAAiB,GAAa,EAAY,EAC3G,KAAK,0BAA0B,EAAuB;EACtD,IAAM,IACF,kBAAC,GAAD;GAA8B;aAC1B,kBAAC,GAAD;IACS;IACQ;IACb,uBAAuB,KAAK;IAC5B,eAAe,KAAK;IACpB,WAAW;IACX,cAAc,KAAK;IACnB,kBAAkB,KAAK;IACR;IACf,YAAY,KAAK;IACjB,YAAY,KAAK;IACjB,qBAAqB,KAAK;IAC1B,aAAa,KAAK;IACP;IACI;IACf,cAAc;IACd,aAAa,KAAK;IAClB,QAAQ,KAAK;IACb,SAAS,KAAK;IACd,QAAQ,KAAK;IACD;IACZ,MAAM,KAAK;IACC;IACA;IACS;IACD;IACtB,CAAA;GACc,CAAA;AAGxB,EADA,KAAK,YAAY,GACjB,KAAK,WAAW,OAAO,EAAU;;CAGrC,YAAY,GAAiB;AACzB,OAAK,WAAW,OAAO,kBAAC,GAAD,EAAgB,YAAW,CAAA,CAAC"}
@@ -131,6 +131,8 @@ export declare class HeatmapSettingsImpl implements SettingsInterface {
131
131
  readonly dendrogramY: HeatmapDendrogramSettingsY | null;
132
132
  readonly inheritedDendrogramAes: Record<string, AesRecord> | null;
133
133
  readonly NAValueAs: number | null;
134
+ readonly showEmptyRows: boolean;
135
+ readonly showEmptyColumns: boolean;
134
136
  readonly cellsRenderingMode: 'canvas' | 'svg' | null;
135
137
  constructor(settings: HeatmapSettings);
136
138
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HeatmapSettingsImpl.d.ts","sourceRoot":"","sources":["../../src/heatmap/HeatmapSettingsImpl.ts"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,gBAAgB,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC;gBAEzC,QAAQ,EAAE,eAAe;CAuJxC"}
@@ -38,6 +38,8 @@ var r = {
38
38
  dendrogramY;
39
39
  inheritedDendrogramAes;
40
40
  NAValueAs;
41
+ showEmptyRows;
42
+ showEmptyColumns;
41
43
  cellsRenderingMode;
42
44
  constructor(e) {
43
45
  if (t.parse(e), this.id = n.uniqueId("settings"), this.xColumn = e.xColumn, this.xGroupBy = e.xGroupBy ?? [], this.yColumn = e.yColumn, this.yGroupBy = e.yGroupBy ?? [], this.valueColumn = e.valueColumn, this.facetBy = e.facetBy ?? [], this.chartSettings = {
@@ -97,7 +99,7 @@ var r = {
97
99
  sharedY: !0,
98
100
  order: e.facetSettings?.order ?? null,
99
101
  ...e.facetSettings
100
- }, this.chartSettings.size.cellWidth && this.facetBy.length > 0 && (this.facetSettings.sharedX = !0), this.chartSettings.size.cellHeight && this.facetBy.length > 0 && (this.facetSettings.sharedY = !0), this.keysOrder = e.keysOrder ?? {}, this.normalization = this.chartSettings.valueType === "continuous" ? e.normalization ?? null : null, this.NAValueAs = e.NAValueAs ?? null, this.aes = {
102
+ }, this.chartSettings.size.cellWidth && this.facetBy.length > 0 && (this.facetSettings.sharedX = !0), this.chartSettings.size.cellHeight && this.facetBy.length > 0 && (this.facetSettings.sharedY = !0), this.keysOrder = e.keysOrder ?? {}, this.normalization = this.chartSettings.valueType === "continuous" ? e.normalization ?? null : null, this.NAValueAs = e.NAValueAs ?? null, this.showEmptyRows = e.showEmptyRows ?? !1, this.showEmptyColumns = e.showEmptyColumns ?? !1, this.aes = {
101
103
  colorsList: e.aes?.colorsList ?? [
102
104
  "black",
103
105
  "white",
@@ -1 +1 @@
1
- {"version":3,"file":"HeatmapSettingsImpl.js","names":[],"sources":["../../src/heatmap/HeatmapSettingsImpl.ts"],"sourcesContent":["import lodash from 'lodash';\nimport { BLACK, DEFAULT_HEIGHT, DEFAULT_HEIGHT_SMALL, DEFAULT_WIDTH, DEFAULT_WIDTH_SMALL } from '../constants';\nimport type {\n AesRecord,\n AggregationMethod,\n ColumnName, DendrogramDistance, DendrogramLinkage, HeatmapSettings,\n LegendPosition, LineShape, NormalizationDirection, NormalizationMethod, PointShape,\n SettingsInterface,\n TitlePosition\n} from '../types';\nimport { HeatmapSettingsSchema } from '../types';\nimport { MIN_MARGIN, MIN_PADDING } from './constants';\n\nconst DEFAULT_DENDRO_AES = {\n lineColor: BLACK,\n dotShape: '21' as PointShape,\n dotFill: BLACK,\n dotSize: 3,\n lineShape: 'solid' as LineShape,\n lineWidth: 1,\n};\nconst DEFAULT_DENDRO: HeatmapDendrogramSettings = {\n size: 150,\n distance: 'euclidean',\n linkage: 'average',\n fillNA: 0,\n showNodes: true,\n hidden: false,\n edgeInheritance: 'up',\n aes: DEFAULT_DENDRO_AES,\n};\n\nexport interface HeatmapDendrogramSettings {\n size: number;\n distance: DendrogramDistance;\n linkage: DendrogramLinkage;\n fillNA: number;\n showNodes: boolean;\n hidden: boolean;\n edgeInheritance: 'up' | 'down';\n aes: {\n lineColor: string | ColumnName;\n dotFill: string | ColumnName;\n dotShape: PointShape | ColumnName;\n dotSize: number | ColumnName;\n lineShape: LineShape | ColumnName;\n lineWidth: number | ColumnName;\n };\n}\n\ninterface HeatmapDendrogramSettingsX extends HeatmapDendrogramSettings {\n position: 'top' | 'bottom';\n}\ninterface HeatmapDendrogramSettingsY extends HeatmapDendrogramSettings {\n position: 'left' | 'right';\n}\n\ninterface HeatmapAnnotation {\n id: string;\n valueColumn: ColumnName;\n showTitle: boolean;\n type: 'discrete' | 'continuous';\n colors: string[];\n}\n\ninterface HeatmapAnnotationX extends HeatmapAnnotation {\n axis: 'x';\n position: 'top' | 'bottom';\n titlePosition: 'left' | 'right';\n}\ninterface HeatmapAnnotationY extends HeatmapAnnotation {\n axis: 'y';\n position: 'left' | 'right';\n titlePosition: 'top' | 'bottom';\n}\n\nexport class HeatmapSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'heatmap';\n readonly facetSettings: {\n order: string[] | null;\n sharedX: boolean;\n sharedY: boolean;\n nRows?: number;\n nCols?: number;\n };\n readonly xColumn: ColumnName;\n readonly xGroupBy: ColumnName[];\n readonly yColumn: ColumnName;\n readonly yGroupBy: ColumnName[];\n readonly valueColumn: ColumnName;\n readonly facetBy: ColumnName[];\n readonly normalization: { direction: NormalizationDirection, method: NormalizationMethod, colorRange?: number[] } | null;\n readonly chartSettings: {\n readonly title: { name: string; show: boolean; position: TitlePosition };\n readonly size: {\n width: number;\n height: number;\n cellWidth: number | null;\n cellHeight: number | null;\n innerOffset: number;\n outerOffset: number;\n };\n readonly frame: { type: 'full' | 'groups' | 'none' };\n readonly valueType: 'discrete' | 'continuous';\n readonly yAxis: {\n title: string;\n showTicks: boolean;\n showTitle: boolean;\n showAxisLabels: boolean;\n showGroupLabels: boolean;\n position: 'left' | 'right';\n groupingPosition: 'left' | 'right';\n axisLabelsAngle: 0 | 45 | 90;\n groupLabelsAngle: 0 | 45 | 90;\n sorting: 'asc' | 'desc';\n };\n readonly xAxis: {\n title: string;\n showTicks: boolean;\n showTitle: boolean;\n showAxisLabels: boolean;\n showGroupLabels: boolean;\n position: 'bottom' | 'top';\n groupingPosition: 'bottom' | 'top';\n axisLabelsAngle: 0 | 45 | 90;\n groupLabelsAngle: 0 | 45 | 90;\n sorting: 'asc' | 'desc';\n };\n readonly legend: { show: boolean; position: LegendPosition };\n readonly tooltips: { show: boolean; content?: ColumnName[] };\n };\n readonly keysOrder: Record<string, string[]>;\n readonly aes: {\n colorsList: string[];\n colorsMap: Record<string, string> | null;\n valueColors: string[] | null;\n valuesByColors: number[] | null;\n groupGap: number;\n cellStrokeColor: string;\n emptyCellColor: string;\n };\n\n readonly aggregation: {\n x: boolean;\n y: boolean;\n method: AggregationMethod;\n };\n\n readonly annotations: (HeatmapAnnotationX | HeatmapAnnotationY)[];\n\n readonly dendrogramX: HeatmapDendrogramSettingsX | null;\n readonly dendrogramY: HeatmapDendrogramSettingsY | null;\n readonly inheritedDendrogramAes: Record<string, AesRecord> | null;\n readonly NAValueAs: number | null;\n readonly cellsRenderingMode: 'canvas' | 'svg' | null;\n\n constructor(settings: HeatmapSettings) {\n HeatmapSettingsSchema.parse(settings);\n\n this.id = lodash.uniqueId('settings');\n this.xColumn = settings.xColumn;\n this.xGroupBy = settings.xGroupBy ?? [];\n this.yColumn = settings.yColumn;\n this.yGroupBy = settings.yGroupBy ?? [];\n this.valueColumn = settings.valueColumn;\n this.facetBy = settings.facetBy ?? [];\n this.chartSettings = {\n title: {\n position: 'left',\n show: true,\n ...settings.title,\n name: settings.title?.name ?? 'Chart',\n },\n size: {\n width: settings?.size?.width ?? (this.facetBy.length ? DEFAULT_WIDTH_SMALL : DEFAULT_WIDTH),\n height: settings?.size?.height ?? (this.facetBy.length ? DEFAULT_HEIGHT_SMALL : DEFAULT_HEIGHT),\n innerOffset: settings.size?.innerOffset ?? MIN_PADDING,\n outerOffset: settings.size?.outerOffset ?? MIN_MARGIN,\n cellWidth: settings?.size?.cellWidth ?? null,\n cellHeight: settings?.size?.cellHeight ?? null,\n },\n frame: { type: settings.frame?.type ?? 'none' },\n valueType: settings.valueType ?? 'continuous',\n yAxis: {\n title: settings.yColumn.label ?? settings.yColumn.value,\n showTicks: true,\n showTitle: true,\n showAxisLabels: true,\n showGroupLabels: true,\n position: 'left',\n groupingPosition: 'left',\n axisLabelsAngle: 90,\n groupLabelsAngle: 0,\n sorting: 'asc',\n ...settings.yAxis,\n },\n xAxis: {\n title: settings.xColumn.label ?? settings.xColumn.value,\n showTicks: true,\n showTitle: true,\n showAxisLabels: true,\n showGroupLabels: true,\n position: 'bottom',\n groupingPosition: 'bottom',\n axisLabelsAngle: 90,\n groupLabelsAngle: 0,\n sorting: 'asc',\n ...settings.xAxis,\n },\n legend: {\n show: true,\n position: 'right',\n ...settings.legend,\n },\n tooltips: {\n show: true,\n ...settings.tooltips,\n },\n };\n this.facetSettings = {\n sharedX: true,\n sharedY: true,\n order: settings.facetSettings?.order ?? null,\n ...settings.facetSettings,\n };\n if (this.chartSettings.size.cellWidth && this.facetBy.length > 0) {\n this.facetSettings.sharedX = true;\n }\n if (this.chartSettings.size.cellHeight && this.facetBy.length > 0) {\n this.facetSettings.sharedY = true;\n }\n this.keysOrder = settings.keysOrder ?? {};\n this.normalization = this.chartSettings.valueType === 'continuous' ? settings.normalization ?? null : null;\n this.NAValueAs = settings.NAValueAs ?? null;\n this.aes = {\n colorsList: settings.aes?.colorsList ?? ['black', 'white', 'red'],\n colorsMap: settings.aes?.colorsMap ?? null,\n valueColors: settings.aes?.valueColors ?? null,\n valuesByColors: settings.aes?.valuesByColors ?? null,\n cellStrokeColor: settings.aes?.cellStrokeColor ?? 'none',\n groupGap: settings.aes?.groupGap ?? 3,\n emptyCellColor: settings.aes?.emptyCellColor ?? 'white',\n };\n\n this.annotations = (settings.annotations ?? []).map(item => {\n if (item.axis === 'x') {\n return {\n id: lodash.uniqueId('annotation'),\n axis: 'x',\n valueColumn: item.valueColumn,\n position: item.position ?? this.chartSettings.xAxis.position,\n titlePosition: item.titlePosition ?? 'right',\n showTitle: item.showTitle ?? true,\n type: item.type,\n colors: item.colors ?? ['white', 'black'],\n };\n }\n return {\n id: lodash.uniqueId('annotation'),\n axis: 'y',\n valueColumn: item.valueColumn,\n position: item.position ?? this.chartSettings.yAxis.position,\n titlePosition: item.titlePosition ?? 'top',\n showTitle: item.showTitle ?? true,\n type: item.type,\n colors: item.colors ?? ['white', 'black'],\n };\n });\n\n if (settings.valueType === 'discrete' && (settings.dendrogramX || settings.dendrogramY)) {\n throw Error('Dendrogram is not available with discrete cells values');\n }\n\n this.aggregation = {\n x: false,\n y: false,\n method: 'min',\n ...settings.aggregation\n };\n\n this.dendrogramX = settings.dendrogramX\n ? {\n ...DEFAULT_DENDRO,\n position: 'top',\n ...settings.dendrogramX,\n aes: {\n ...DEFAULT_DENDRO_AES,\n ...settings.dendrogramX?.aes,\n },\n }\n : null;\n this.dendrogramY = settings.dendrogramY\n ? {\n ...DEFAULT_DENDRO,\n position: 'left',\n ...settings.dendrogramY,\n aes: {\n ...DEFAULT_DENDRO_AES,\n ...settings.dendrogramY?.aes,\n },\n }\n : null;\n this.inheritedDendrogramAes = settings.inheritedDendrogramAes ?? null;\n this.cellsRenderingMode = settings.cellsRenderingMode ?? null;\n }\n}\n"],"mappings":";;;;AAaA,IAAM,IAAqB;CACvB,WAAW;CACX,UAAU;CACV,SAAS;CACT,SAAS;CACT,WAAW;CACX,WAAW;CACd,EACK,IAA4C;CAC9C,MAAM;CACN,UAAU;CACV,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,iBAAiB;CACjB,KAAK;CACR,EA8CY,IAAb,MAA8D;CAC1D;CACA,OAAgB;CAChB;CAOA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAuCA;CACA;CAUA;CAMA;CAEA;CACA;CACA;CACA;CACA;CAEA,YAAY,GAA2B;AAiHnC,MAhHA,EAAsB,MAAM,EAAS,EAErC,KAAK,KAAK,EAAO,SAAS,WAAW,EACrC,KAAK,UAAU,EAAS,SACxB,KAAK,WAAW,EAAS,YAAY,EAAE,EACvC,KAAK,UAAU,EAAS,SACxB,KAAK,WAAW,EAAS,YAAY,EAAE,EACvC,KAAK,cAAc,EAAS,aAC5B,KAAK,UAAU,EAAS,WAAW,EAAE,EACrC,KAAK,gBAAgB;GACjB,OAAO;IACH,UAAU;IACV,MAAM;IACN,GAAG,EAAS;IACZ,MAAM,EAAS,OAAO,QAAQ;IACjC;GACD,MAAM;IACF,OAAO,GAAU,MAAM,UAAU,KAAK,QAAQ,SAAA,MAAA;IAC9C,QAAQ,GAAU,MAAM,WAAW,KAAK,QAAQ,SAAA,MAAA;IAChD,aAAa,EAAS,MAAM,eAAA;IAC5B,aAAa,EAAS,MAAM,eAAA;IAC5B,WAAW,GAAU,MAAM,aAAa;IACxC,YAAY,GAAU,M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,EAED,KAAK,eAAe,EAAS,eAAe,EAAE,EAAE,KAAI,MAC5C,EAAK,SAAS,MACP;GACH,IAAI,EAAO,SAAS,aAAa;GACjC,MAAM;GACN,aAAa,EAAK;GAClB,UAAU,EAAK,YAAY,KAAK,cAAc,MAAM;GACpD,eAAe,EAAK,iBAAiB;GACrC,WAAW,EAAK,aAAa;GAC7B,MAAM,EAAK;GACX,QAAQ,EAAK,UAAU,CAAC,SAAS,QAAQ;GAC5C,GAEE;GACH,IAAI,EAAO,SAAS,aAAa;GACjC,MAAM;GACN,aAAa,EAAK;GAClB,UAAU,EAAK,YAAY,KAAK,cAAc,MAAM;GACpD,eAAe,EAAK,iBAAiB;GACrC,WAAW,EAAK,aAAa;GAC7B,MAAM,EAAK;GACX,QAAQ,EAAK,UAAU,CAAC,SAAS,QAAQ;GAC5C,CACH,EAEE,EAAS,cAAc,eAAe,EAAS,eAAe,EAAS,aACvE,OAAM,MAAM,yDAAyD;AAiCzE,EA9BA,KAAK,cAAc;GACf,GAAG;GACH,GAAG;GACH,QAAQ;GACR,GAAG,EAAS;GACf,EAED,KAAK,cAAc,EAAS,cACtB;GACE,GAAG;GACH,UAAU;GACV,GAAG,EAAS;GACZ,KAAK;IACD,GAAG;IACH,GAAG,EAAS,aAAa;IAC5B;GACJ,GACC,MACN,KAAK,cAAc,EAAS,cACtB;GACE,GAAG;GACH,UAAU;GACV,GAAG,EAAS;GACZ,KAAK;IACD,GAAG;IACH,GAAG,EAAS,aAAa;IAC5B;GACJ,GACC,MACN,KAAK,yBAAyB,EAAS,0BAA0B,MACjE,KAAK,qBAAqB,EAAS,sBAAsB"}
1
+ {"version":3,"file":"HeatmapSettingsImpl.js","names":[],"sources":["../../src/heatmap/HeatmapSettingsImpl.ts"],"sourcesContent":["import lodash from 'lodash';\nimport { BLACK, DEFAULT_HEIGHT, DEFAULT_HEIGHT_SMALL, DEFAULT_WIDTH, DEFAULT_WIDTH_SMALL } from '../constants';\nimport type {\n AesRecord,\n AggregationMethod,\n ColumnName, DendrogramDistance, DendrogramLinkage, HeatmapSettings,\n LegendPosition, LineShape, NormalizationDirection, NormalizationMethod, PointShape,\n SettingsInterface,\n TitlePosition\n} from '../types';\nimport { HeatmapSettingsSchema } from '../types';\nimport { MIN_MARGIN, MIN_PADDING } from './constants';\n\nconst DEFAULT_DENDRO_AES = {\n lineColor: BLACK,\n dotShape: '21' as PointShape,\n dotFill: BLACK,\n dotSize: 3,\n lineShape: 'solid' as LineShape,\n lineWidth: 1,\n};\nconst DEFAULT_DENDRO: HeatmapDendrogramSettings = {\n size: 150,\n distance: 'euclidean',\n linkage: 'average',\n fillNA: 0,\n showNodes: true,\n hidden: false,\n edgeInheritance: 'up',\n aes: DEFAULT_DENDRO_AES,\n};\n\nexport interface HeatmapDendrogramSettings {\n size: number;\n distance: DendrogramDistance;\n linkage: DendrogramLinkage;\n fillNA: number;\n showNodes: boolean;\n hidden: boolean;\n edgeInheritance: 'up' | 'down';\n aes: {\n lineColor: string | ColumnName;\n dotFill: string | ColumnName;\n dotShape: PointShape | ColumnName;\n dotSize: number | ColumnName;\n lineShape: LineShape | ColumnName;\n lineWidth: number | ColumnName;\n };\n}\n\ninterface HeatmapDendrogramSettingsX extends HeatmapDendrogramSettings {\n position: 'top' | 'bottom';\n}\ninterface HeatmapDendrogramSettingsY extends HeatmapDendrogramSettings {\n position: 'left' | 'right';\n}\n\ninterface HeatmapAnnotation {\n id: string;\n valueColumn: ColumnName;\n showTitle: boolean;\n type: 'discrete' | 'continuous';\n colors: string[];\n}\n\ninterface HeatmapAnnotationX extends HeatmapAnnotation {\n axis: 'x';\n position: 'top' | 'bottom';\n titlePosition: 'left' | 'right';\n}\ninterface HeatmapAnnotationY extends HeatmapAnnotation {\n axis: 'y';\n position: 'left' | 'right';\n titlePosition: 'top' | 'bottom';\n}\n\nexport class HeatmapSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'heatmap';\n readonly facetSettings: {\n order: string[] | null;\n sharedX: boolean;\n sharedY: boolean;\n nRows?: number;\n nCols?: number;\n };\n readonly xColumn: ColumnName;\n readonly xGroupBy: ColumnName[];\n readonly yColumn: ColumnName;\n readonly yGroupBy: ColumnName[];\n readonly valueColumn: ColumnName;\n readonly facetBy: ColumnName[];\n readonly normalization: { direction: NormalizationDirection, method: NormalizationMethod, colorRange?: number[] } | null;\n readonly chartSettings: {\n readonly title: { name: string; show: boolean; position: TitlePosition };\n readonly size: {\n width: number;\n height: number;\n cellWidth: number | null;\n cellHeight: number | null;\n innerOffset: number;\n outerOffset: number;\n };\n readonly frame: { type: 'full' | 'groups' | 'none' };\n readonly valueType: 'discrete' | 'continuous';\n readonly yAxis: {\n title: string;\n showTicks: boolean;\n showTitle: boolean;\n showAxisLabels: boolean;\n showGroupLabels: boolean;\n position: 'left' | 'right';\n groupingPosition: 'left' | 'right';\n axisLabelsAngle: 0 | 45 | 90;\n groupLabelsAngle: 0 | 45 | 90;\n sorting: 'asc' | 'desc';\n };\n readonly xAxis: {\n title: string;\n showTicks: boolean;\n showTitle: boolean;\n showAxisLabels: boolean;\n showGroupLabels: boolean;\n position: 'bottom' | 'top';\n groupingPosition: 'bottom' | 'top';\n axisLabelsAngle: 0 | 45 | 90;\n groupLabelsAngle: 0 | 45 | 90;\n sorting: 'asc' | 'desc';\n };\n readonly legend: { show: boolean; position: LegendPosition };\n readonly tooltips: { show: boolean; content?: ColumnName[] };\n };\n readonly keysOrder: Record<string, string[]>;\n readonly aes: {\n colorsList: string[];\n colorsMap: Record<string, string> | null;\n valueColors: string[] | null;\n valuesByColors: number[] | null;\n groupGap: number;\n cellStrokeColor: string;\n emptyCellColor: string;\n };\n\n readonly aggregation: {\n x: boolean;\n y: boolean;\n method: AggregationMethod;\n };\n\n readonly annotations: (HeatmapAnnotationX | HeatmapAnnotationY)[];\n\n readonly dendrogramX: HeatmapDendrogramSettingsX | null;\n readonly dendrogramY: HeatmapDendrogramSettingsY | null;\n readonly inheritedDendrogramAes: Record<string, AesRecord> | null;\n readonly NAValueAs: number | null;\n readonly showEmptyRows: boolean;\n readonly showEmptyColumns: boolean;\n readonly cellsRenderingMode: 'canvas' | 'svg' | null;\n\n constructor(settings: HeatmapSettings) {\n HeatmapSettingsSchema.parse(settings);\n\n this.id = lodash.uniqueId('settings');\n this.xColumn = settings.xColumn;\n this.xGroupBy = settings.xGroupBy ?? [];\n this.yColumn = settings.yColumn;\n this.yGroupBy = settings.yGroupBy ?? [];\n this.valueColumn = settings.valueColumn;\n this.facetBy = settings.facetBy ?? [];\n this.chartSettings = {\n title: {\n position: 'left',\n show: true,\n ...settings.title,\n name: settings.title?.name ?? 'Chart',\n },\n size: {\n width: settings?.size?.width ?? (this.facetBy.length ? DEFAULT_WIDTH_SMALL : DEFAULT_WIDTH),\n height: settings?.size?.height ?? (this.facetBy.length ? DEFAULT_HEIGHT_SMALL : DEFAULT_HEIGHT),\n innerOffset: settings.size?.innerOffset ?? MIN_PADDING,\n outerOffset: settings.size?.outerOffset ?? MIN_MARGIN,\n cellWidth: settings?.size?.cellWidth ?? null,\n cellHeight: settings?.size?.cellHeight ?? null,\n },\n frame: { type: settings.frame?.type ?? 'none' },\n valueType: settings.valueType ?? 'continuous',\n yAxis: {\n title: settings.yColumn.label ?? settings.yColumn.value,\n showTicks: true,\n showTitle: true,\n showAxisLabels: true,\n showGroupLabels: true,\n position: 'left',\n groupingPosition: 'left',\n axisLabelsAngle: 90,\n groupLabelsAngle: 0,\n sorting: 'asc',\n ...settings.yAxis,\n },\n xAxis: {\n title: settings.xColumn.label ?? settings.xColumn.value,\n showTicks: true,\n showTitle: true,\n showAxisLabels: true,\n showGroupLabels: true,\n position: 'bottom',\n groupingPosition: 'bottom',\n axisLabelsAngle: 90,\n groupLabelsAngle: 0,\n sorting: 'asc',\n ...settings.xAxis,\n },\n legend: {\n show: true,\n position: 'right',\n ...settings.legend,\n },\n tooltips: {\n show: true,\n ...settings.tooltips,\n },\n };\n this.facetSettings = {\n sharedX: true,\n sharedY: true,\n order: settings.facetSettings?.order ?? null,\n ...settings.facetSettings,\n };\n if (this.chartSettings.size.cellWidth && this.facetBy.length > 0) {\n this.facetSettings.sharedX = true;\n }\n if (this.chartSettings.size.cellHeight && this.facetBy.length > 0) {\n this.facetSettings.sharedY = true;\n }\n this.keysOrder = settings.keysOrder ?? {};\n this.normalization = this.chartSettings.valueType === 'continuous' ? settings.normalization ?? null : null;\n this.NAValueAs = settings.NAValueAs ?? null;\n this.showEmptyRows = settings.showEmptyRows ?? false;\n this.showEmptyColumns = settings.showEmptyColumns ?? false;\n this.aes = {\n colorsList: settings.aes?.colorsList ?? ['black', 'white', 'red'],\n colorsMap: settings.aes?.colorsMap ?? null,\n valueColors: settings.aes?.valueColors ?? null,\n valuesByColors: settings.aes?.valuesByColors ?? null,\n cellStrokeColor: settings.aes?.cellStrokeColor ?? 'none',\n groupGap: settings.aes?.groupGap ?? 3,\n emptyCellColor: settings.aes?.emptyCellColor ?? 'white',\n };\n\n this.annotations = (settings.annotations ?? []).map(item => {\n if (item.axis === 'x') {\n return {\n id: lodash.uniqueId('annotation'),\n axis: 'x',\n valueColumn: item.valueColumn,\n position: item.position ?? this.chartSettings.xAxis.position,\n titlePosition: item.titlePosition ?? 'right',\n showTitle: item.showTitle ?? true,\n type: item.type,\n colors: item.colors ?? ['white', 'black'],\n };\n }\n return {\n id: lodash.uniqueId('annotation'),\n axis: 'y',\n valueColumn: item.valueColumn,\n position: item.position ?? this.chartSettings.yAxis.position,\n titlePosition: item.titlePosition ?? 'top',\n showTitle: item.showTitle ?? true,\n type: item.type,\n colors: item.colors ?? ['white', 'black'],\n };\n });\n\n if (settings.valueType === 'discrete' && (settings.dendrogramX || settings.dendrogramY)) {\n throw Error('Dendrogram is not available with discrete cells values');\n }\n\n this.aggregation = {\n x: false,\n y: false,\n method: 'min',\n ...settings.aggregation\n };\n\n this.dendrogramX = settings.dendrogramX\n ? {\n ...DEFAULT_DENDRO,\n position: 'top',\n ...settings.dendrogramX,\n aes: {\n ...DEFAULT_DENDRO_AES,\n ...settings.dendrogramX?.aes,\n },\n }\n : null;\n this.dendrogramY = settings.dendrogramY\n ? {\n ...DEFAULT_DENDRO,\n position: 'left',\n ...settings.dendrogramY,\n aes: {\n ...DEFAULT_DENDRO_AES,\n ...settings.dendrogramY?.aes,\n },\n }\n : null;\n this.inheritedDendrogramAes = settings.inheritedDendrogramAes ?? null;\n this.cellsRenderingMode = settings.cellsRenderingMode ?? null;\n }\n}\n"],"mappings":";;;;AAaA,IAAM,IAAqB;CACvB,WAAW;CACX,UAAU;CACV,SAAS;CACT,SAAS;CACT,WAAW;CACX,WAAW;CACd,EACK,IAA4C;CAC9C,MAAM;CACN,UAAU;CACV,SAAS;CACT,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,iBAAiB;CACjB,KAAK;CACR,EA8CY,IAAb,MAA8D;CAC1D;CACA,OAAgB;CAChB;CAOA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAuCA;CACA;CAUA;CAMA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,GAA2B;AAmHnC,MAlHA,EAAsB,MAAM,EAAS,EAErC,KAAK,KAAK,EAAO,SAAS,WAAW,EACrC,KAAK,UAAU,EAAS,SACxB,KAAK,WAAW,EAAS,YAAY,EAAE,EACvC,KAAK,UAAU,EAAS,SACxB,KAAK,WAAW,EAAS,YAAY,EAAE,EACvC,KAAK,cAAc,EAAS,aAC5B,KAAK,UAAU,EAAS,WAAW,EAAE,EACrC,KAAK,gBAAgB;GACjB,OAAO;IACH,UAAU;IACV,MAAM;IACN,GAAG,EAAS;IACZ,MAAM,EAAS,OAAO,QAAQ;IACjC;GACD,MAAM;IACF,OAAO,GAAU,MAAM,UAAU,KAAK,QAAQ,SAAA,MAAA;IAC9C,QAAQ,GAAU,MAAM,WAAW,KAAK,QAAQ,SAAA,MAAA;IAChD,aAAa,EAAS,MAAM,eAAA;IAC5B,aAAa,EAAS,MAAM,eAAA;IAC5B,WAAW,GAAU,MAAM,aAAa;IACxC,YAA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K,mBAAmB;GAClD,UAAU,EAAS,KAAK,YAAY;GACpC,gBAAgB,EAAS,KAAK,kBAAkB;GACnD,EAED,KAAK,eAAe,EAAS,eAAe,EAAE,EAAE,KAAI,MAC5C,EAAK,SAAS,MACP;GACH,IAAI,EAAO,SAAS,aAAa;GACjC,MAAM;GACN,aAAa,EAAK;GAClB,UAAU,EAAK,YAAY,KAAK,cAAc,MAAM;GACpD,eAAe,EAAK,iBAAiB;GACrC,WAAW,EAAK,aAAa;GAC7B,MAAM,EAAK;GACX,QAAQ,EAAK,UAAU,CAAC,SAAS,QAAQ;GAC5C,GAEE;GACH,IAAI,EAAO,SAAS,aAAa;GACjC,MAAM;GACN,aAAa,EAAK;GAClB,UAAU,EAAK,YAAY,KAAK,cAAc,MAAM;GACpD,eAAe,EAAK,iBAAiB;GACrC,WAAW,EAAK,aAAa;GAC7B,MAAM,EAAK;GACX,QAAQ,EAAK,UAAU,CAAC,SAAS,QAAQ;GAC5C,CACH,EAEE,EAAS,cAAc,eAAe,EAAS,eAAe,EAAS,aACvE,OAAM,MAAM,yDAAyD;AAiCzE,EA9BA,KAAK,cAAc;GACf,GAAG;GACH,GAAG;GACH,QAAQ;GACR,GAAG,EAAS;GACf,EAED,KAAK,cAAc,EAAS,cACtB;GACE,GAAG;GACH,UAAU;GACV,GAAG,EAAS;GACZ,KAAK;IACD,GAAG;IACH,GAAG,EAAS,aAAa;IAC5B;GACJ,GACC,MACN,KAAK,cAAc,EAAS,cACtB;GACE,GAAG;GACH,UAAU;GACV,GAAG,EAAS;GACZ,KAAK;IACD,GAAG;IACH,GAAG,EAAS,aAAa;IAC5B;GACJ,GACC,MACN,KAAK,yBAAyB,EAAS,0BAA0B,MACjE,KAAK,qBAAqB,EAAS,sBAAsB"}
@@ -40,6 +40,26 @@ export type GroupedCellsData<T extends string> = {
40
40
  cells: Record<string, Record<string, Cell<T>>>;
41
41
  }>;
42
42
  };
43
- export declare function fillCellsData<T extends string>(result: GroupedCellsData<T>, data: DataFrame, xColumn: ColumnName, yColumn: ColumnName, valueColumns: Record<string, ColumnName>, facetBy: ColumnName[], xGroupBy: ColumnName[], yGroupBy: ColumnName[], facetSettings: HeatmapSettingsImpl['facetSettings'], annotations: HeatmapSettingsImpl['annotations'], dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY'], normalizationBySource: Record<T, HeatmapSettingsImpl['normalization']>, // separated for color and size for example
44
- NAValueAs: HeatmapSettingsImpl['NAValueAs'], keysOrder: HeatmapSettingsImpl['keysOrder'], xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'] | BubbleSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'] | BubbleSettingsImpl['chartSettings']['yAxis'], aggregation: HeatmapSettingsImpl['aggregation']): GroupedCellsData<T>;
43
+ export declare function fillCellsData<T extends string>(result: GroupedCellsData<T>, { data, xColumn, yColumn, valueColumns, facetBy, xGroupBy, yGroupBy, facetSettings, annotations, dendrogramX, dendrogramY, normalizationBySource, // separated for color and size for example
44
+ NAValueAs, keysOrder, xAxis, yAxis, aggregation, showEmptyRows, showEmptyColumns, }: {
45
+ data: DataFrame;
46
+ xColumn: ColumnName;
47
+ yColumn: ColumnName;
48
+ valueColumns: Record<string, ColumnName>;
49
+ facetBy: ColumnName[];
50
+ xGroupBy: ColumnName[];
51
+ yGroupBy: ColumnName[];
52
+ facetSettings: HeatmapSettingsImpl['facetSettings'];
53
+ annotations: HeatmapSettingsImpl['annotations'];
54
+ dendrogramX: HeatmapSettingsImpl['dendrogramX'];
55
+ dendrogramY: HeatmapSettingsImpl['dendrogramY'];
56
+ normalizationBySource: Record<T, HeatmapSettingsImpl['normalization']>;
57
+ NAValueAs: HeatmapSettingsImpl['NAValueAs'];
58
+ keysOrder: HeatmapSettingsImpl['keysOrder'];
59
+ xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'] | BubbleSettingsImpl['chartSettings']['xAxis'];
60
+ yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'] | BubbleSettingsImpl['chartSettings']['yAxis'];
61
+ aggregation: HeatmapSettingsImpl['aggregation'];
62
+ showEmptyRows?: boolean;
63
+ showEmptyColumns?: boolean;
64
+ }): GroupedCellsData<T>;
45
65
  //# sourceMappingURL=fillCellsData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fillCellsData.d.ts","sourceRoot":"","sources":["../../src/heatmap/fillCellsData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAqB,UAAU,EAAE,SAAS,EAAuB,MAAM,UAAU,CAAC;AAC9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,MAAM,IAAI;IACjC,MAAM,EAAE,IAAI,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACtC,CAAC,EAAE,SAAS,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;IAC7C,IAAI,EAAE;QACF,YAAY,EAAE,CAAC,EAAE,CAAC;QAElB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,UAAU,EAAE,MAAM,EAAE,CAAC;QAErB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA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;IACvB,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACpD,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAChD,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAChD,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAChD,qBAAqB,EAAE,MAAM,CAAC,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;IACvE,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5C,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5C,KAAK,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IACpG,KAAK,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IACpG,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,uBA4OJ"}
@@ -141,67 +141,80 @@ function y(e, t) {
141
141
  };
142
142
  }
143
143
  }
144
- function b(e, a, o, s, c, l, u, d, f, p, m, b, x, S, C, w, T, E) {
145
- let D = l.length ? l.map((e) => C[e.value] ?? a.getColumnCategories(e.value)) : [["null"]], O = u.length ? u.map((e) => C[e.value] ?? a.getColumnCategories(e.value)) : [["null"]], k = d.length ? d.map((e) => C[e.value] ?? a.getColumnCategories(e.value)) : [["null"]], A = h(D), j = h(O), M = h(k);
146
- f?.order?.length && (A = A.filter((e) => f.order?.includes(t(e))));
147
- let N = A.map(r), P = new Set(N), F = j.map(r), I = M.map(r);
148
- e.meta.facetKeys = N, e.meta.xGroupKeys = F, e.meta.yGroupKeys = I;
149
- let L = n(a, l, N, A);
150
- e.meta.facetKeyValues = N.reduce((e, t) => (e[t] = L[t], e), {}), e.meta.xGroupKeyValues = F.reduce((e, t, n) => (e[t] = j[n], e), {}), e.meta.yGroupKeyValues = I.reduce((e, t, n) => (e[t] = M[n], e), {});
151
- let R = o.valueLabels ?? o.value, z = s.valueLabels ?? s.value, B = p.filter((e) => e.axis === "x").map((e) => e.valueColumn.valueLabels ?? e.valueColumn.value), V = p.filter((e) => e.axis === "y").map((e) => e.valueColumn.valueLabels ?? e.valueColumn.value), H = Object.values(m ?? {}).map((e) => e.value), U = Object.values(b ?? {}).map((e) => e.value), W = i.uniq([
152
- ...B,
144
+ function b(e, { data: a, xColumn: o, yColumn: s, valueColumns: c, facetBy: l, xGroupBy: u, yGroupBy: d, facetSettings: f, annotations: p, dendrogramX: m, dendrogramY: b, normalizationBySource: x, NAValueAs: S, keysOrder: C, xAxis: w, yAxis: T, aggregation: E, showEmptyRows: D = !1, showEmptyColumns: O = !1 }) {
145
+ let k = l.length ? l.map((e) => C[e.value] ?? a.getColumnCategories(e.value)) : [["null"]], A = u.length ? u.map((e) => C[e.value] ?? a.getColumnCategories(e.value)) : [["null"]], j = d.length ? d.map((e) => C[e.value] ?? a.getColumnCategories(e.value)) : [["null"]], M = h(k), N = h(A), P = h(j);
146
+ f?.order?.length && (M = M.filter((e) => f.order?.includes(t(e))));
147
+ let F = M.map(r), I = new Set(F), L = N.map(r), R = P.map(r);
148
+ e.meta.facetKeys = F, e.meta.xGroupKeys = L, e.meta.yGroupKeys = R;
149
+ let z = n(a, l, F, M);
150
+ e.meta.facetKeyValues = F.reduce((e, t) => (e[t] = z[t], e), {}), e.meta.xGroupKeyValues = L.reduce((e, t, n) => (e[t] = N[n], e), {}), e.meta.yGroupKeyValues = R.reduce((e, t, n) => (e[t] = P[n], e), {});
151
+ let B = o.valueLabels ?? o.value, V = s.valueLabels ?? s.value, H = p.filter((e) => e.axis === "x").map((e) => e.valueColumn.valueLabels ?? e.valueColumn.value), U = p.filter((e) => e.axis === "y").map((e) => e.valueColumn.valueLabels ?? e.valueColumn.value), W = Object.values(m ?? {}).map((e) => e.value), G = Object.values(b ?? {}).map((e) => e.value), K = i.uniq([
153
152
  ...H,
154
- R
155
- ]), G = i.uniq([
156
- ...V,
153
+ ...W,
154
+ B
155
+ ]), q = i.uniq([
157
156
  ...U,
158
- z
157
+ ...G,
158
+ V
159
159
  ]);
160
160
  for (let t = 0; t < a.rowsCount; t++) {
161
161
  let n = r(l.map((e) => a.getColumnValue(e.value, t)));
162
- if (!P.has(n)) continue;
162
+ if (!I.has(n)) continue;
163
163
  let i = r(u.map((e) => a.getColumnValue(e.value, t))), f = r(d.map((e) => a.getColumnValue(e.value, t))), p = u.map((e) => a.getColumnValue(e.valueLabels ?? e.value, t)).join(", "), m = d.map((e) => a.getColumnValue(e.valueLabels ?? e.value, t)).join(", ");
164
164
  e.meta.xGroupLabels[i] = p, e.meta.yGroupLabels[f] = m;
165
165
  let h = String(a.getColumnValue(o.value, t)), g = String(a.getColumnValue(s.value, t)), _ = e.meta.valueSources.reduce((e, n) => (e[n] = a.getColumnValue(c[n].value, t) ?? S, e), {});
166
- if (h === "null" || g === "null" || Object.values(_).every((e) => e === null)) continue;
167
- e.facets[n] || (e.facets[n] = {
168
- xKeys: [],
169
- yKeys: [],
170
- xKeysByGroups: {},
171
- yKeysByGroups: {},
172
- cells: {}
173
- }), e.facets[n].xKeysByGroups[i] || (e.facets[n].xKeysByGroups[i] = []), e.facets[n].yKeysByGroups[f] || (e.facets[n].yKeysByGroups[f] = []), e.facets[n].xKeys.push(h), e.facets[n].yKeys.push(g), e.facets[n].xKeysByGroups[i].push(h), e.facets[n].yKeysByGroups[f].push(g), e.facets[n].cells[h] || (e.facets[n].cells[h] = {});
174
- for (let t of e.meta.valueSources) if (e.facets[n].cells[h][g] && e.facets[n].cells[h][g].value[t] !== _[t]) throw Error(`More than 1 value for x=${h}, y=${g}`);
175
- let y = a.getColumnValue(R, t);
176
- if (e.meta.xLabels[h] && String(y) !== e.meta.xLabels[h]) throw Error(`More than 1 x-label value for x=${h}`);
177
- let b = a.getColumnValue(z, t);
178
- if (e.meta.yLabels[g] && String(b) !== e.meta.yLabels[g]) throw Error(`More than 1 y-label value for y=${g}`);
179
- e.meta.xLabels[h] = String(y), e.meta.yLabels[g] = String(b), W.forEach((n) => {
180
- let r = e.meta.xDataByKeys[n] !== void 0, i = r && e.meta.xDataByKeys[n][h] !== void 0;
181
- if (r || (e.meta.xDataByKeys[n] = {}), i && e.meta.xDataByKeys[n][h] !== a.getColumnValue(n, t)) throw Error(`More than 1 value for x = ${h} and column = ${n}`);
182
- i || (e.meta.xDataByKeys[n][h] = a.getColumnValue(n, t));
183
- }), G.forEach((n) => {
184
- let r = e.meta.yDataByKeys[n] !== void 0, i = r && e.meta.yDataByKeys[n][g] !== void 0;
185
- if (r || (e.meta.yDataByKeys[n] = {}), i && e.meta.yDataByKeys[n][g] !== a.getColumnValue(n, t)) throw Error(`More than 1 value for y = ${g} and column = ${n}`);
186
- i || (e.meta.yDataByKeys[n][g] = a.getColumnValue(n, t));
187
- }), e.facets[n].cells[h][g] = {
188
- isCell: !0,
189
- idx: t,
190
- id: `${h}_${g}`,
191
- x: h,
192
- y: g,
193
- value: _,
194
- normalizedValue: _
195
- }, v(e, e.facets[n].cells[h][g]);
166
+ if (h === "null" || g === "null") continue;
167
+ let y = Object.values(_).every((e) => e === null);
168
+ if (!(y && !D && !O)) {
169
+ if (e.facets[n] || (e.facets[n] = {
170
+ xKeys: [],
171
+ yKeys: [],
172
+ xKeysByGroups: {},
173
+ yKeysByGroups: {},
174
+ cells: {}
175
+ }), e.facets[n].xKeysByGroups[i] || (e.facets[n].xKeysByGroups[i] = []), e.facets[n].yKeysByGroups[f] || (e.facets[n].yKeysByGroups[f] = []), !y || O) {
176
+ e.facets[n].xKeys.push(h), e.facets[n].xKeysByGroups[i].push(h);
177
+ let r = a.getColumnValue(B, t);
178
+ if (e.meta.xLabels[h] && String(r) !== e.meta.xLabels[h]) throw Error(`More than 1 x-label value for x=${h}`);
179
+ e.meta.xLabels[h] = String(r), K.forEach((n) => {
180
+ let r = e.meta.xDataByKeys[n] !== void 0, i = r && e.meta.xDataByKeys[n][h] !== void 0;
181
+ if (r || (e.meta.xDataByKeys[n] = {}), i && e.meta.xDataByKeys[n][h] !== a.getColumnValue(n, t)) throw Error(`More than 1 value for x = ${h} and column = ${n}`);
182
+ i || (e.meta.xDataByKeys[n][h] = a.getColumnValue(n, t));
183
+ });
184
+ }
185
+ if (!y || D) {
186
+ e.facets[n].yKeys.push(g), e.facets[n].yKeysByGroups[f].push(g);
187
+ let r = a.getColumnValue(V, t);
188
+ if (e.meta.yLabels[g] && String(r) !== e.meta.yLabels[g]) throw Error(`More than 1 y-label value for y=${g}`);
189
+ e.meta.yLabels[g] = String(r), q.forEach((n) => {
190
+ let r = e.meta.yDataByKeys[n] !== void 0, i = r && e.meta.yDataByKeys[n][g] !== void 0;
191
+ if (r || (e.meta.yDataByKeys[n] = {}), i && e.meta.yDataByKeys[n][g] !== a.getColumnValue(n, t)) throw Error(`More than 1 value for y = ${g} and column = ${n}`);
192
+ i || (e.meta.yDataByKeys[n][g] = a.getColumnValue(n, t));
193
+ });
194
+ }
195
+ if (!y) {
196
+ e.facets[n].cells[h] || (e.facets[n].cells[h] = {});
197
+ for (let t of e.meta.valueSources) if (e.facets[n].cells[h][g] && e.facets[n].cells[h][g].value[t] !== _[t]) throw Error(`More than 1 value for x=${h}, y=${g}`);
198
+ e.facets[n].cells[h][g] = {
199
+ isCell: !0,
200
+ idx: t,
201
+ id: `${h}_${g}`,
202
+ x: h,
203
+ y: g,
204
+ value: _,
205
+ normalizedValue: _
206
+ }, v(e, e.facets[n].cells[h][g]);
207
+ }
208
+ }
196
209
  }
197
210
  e.meta.facetKeys = e.meta.facetKeys.filter((t) => e.facets[t]), e.meta.facetKeys.forEach((t) => {
198
211
  let n = e.facets[t], r = i.uniq(n.xKeys), a = i.uniq(n.yKeys);
199
- n.xKeys = C[o.value] ? i.intersection(C[o.value], r) : r, n.yKeys = C[s.value] ? i.intersection(C[s.value], a) : a, F.forEach((r) => {
212
+ n.xKeys = C[o.value] ? i.intersection(C[o.value], r) : r, n.yKeys = C[s.value] ? i.intersection(C[s.value], a) : a, L.forEach((r) => {
200
213
  e.facets[t].xKeysByGroups[r] = i.intersection(n.xKeys, e.facets[t].xKeysByGroups[r]);
201
- }), I.forEach((r) => {
214
+ }), R.forEach((r) => {
202
215
  e.facets[t].yKeysByGroups[r] = i.intersection(n.yKeys, e.facets[t].yKeysByGroups[r]);
203
216
  });
204
- }), _(e, E, W, G, p), y(e, x), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((t, n) => {
217
+ }), _(e, E, K, q, p), y(e, x), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((t, n) => {
205
218
  let r = g(i.uniq(i.flatten(e.meta.facetKeys.map((t) => e.facets[t].xKeysByGroups[n]))), w.sorting, e.meta.xLabels);
206
219
  return t[n] = C[o.value] ? i.intersection(C[o.value], r) : r, t;
207
220
  }, {}), e.meta.xKeys = e.meta.xGroupKeys.reduce((t, n) => (t = t.concat(e.meta.xKeysByGroups[n]), t), []), e.meta.yKeysByGroups = e.meta.yGroupKeys.reduce((t, n) => {