@milaboratories/miplots4 1.0.151 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bubble/BubbleSettingsImpl.d.ts +9 -1
- package/dist/bubble/BubbleSettingsImpl.d.ts.map +1 -1
- package/dist/bubble/BubbleSettingsImpl.js +25 -16
- package/dist/bubble/BubbleSettingsImpl.js.map +1 -1
- package/dist/bubble/ChartRenderer.d.ts +15 -5
- package/dist/bubble/ChartRenderer.d.ts.map +1 -1
- package/dist/bubble/ChartRenderer.js +146 -146
- package/dist/bubble/ChartRenderer.js.map +1 -1
- package/dist/bubble/components/Chart.d.ts +5 -5
- package/dist/bubble/components/Chart.d.ts.map +1 -1
- package/dist/bubble/components/Chart.js +46 -46
- package/dist/bubble/components/Chart.js.map +1 -1
- package/dist/bubble/components/ChartsGroup.d.ts +4 -4
- package/dist/bubble/components/ChartsGroup.d.ts.map +1 -1
- package/dist/bubble/components/ChartsGroup.js.map +1 -1
- package/dist/bubble/getCellTooltip.d.ts +2 -2
- package/dist/bubble/getCellTooltip.d.ts.map +1 -1
- package/dist/bubble/getCellTooltip.js +17 -17
- package/dist/bubble/getCellTooltip.js.map +1 -1
- package/dist/bubble/getGroupedCellsData.d.ts +7 -29
- package/dist/bubble/getGroupedCellsData.d.ts.map +1 -1
- package/dist/bubble/getGroupedCellsData.js +49 -83
- package/dist/bubble/getGroupedCellsData.js.map +1 -1
- package/dist/bubble/index.d.ts +2 -2
- package/dist/bubble/index.d.ts.map +1 -1
- package/dist/bubble/index.js +54 -37
- package/dist/bubble/index.js.map +1 -1
- package/dist/bubble/utils/calculateCaptionTails.d.ts +2 -2
- package/dist/bubble/utils/calculateCaptionTails.d.ts.map +1 -1
- package/dist/bubble/utils/calculateCaptionTails.js.map +1 -1
- package/dist/heatmap/ChartRenderer.d.ts +7 -7
- package/dist/heatmap/ChartRenderer.d.ts.map +1 -1
- package/dist/heatmap/ChartRenderer.js +2 -2
- package/dist/heatmap/ChartRenderer.js.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.d.ts +4 -4
- package/dist/heatmap/components/Annotations/Annotation.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/heatmap/components/Annotations/AnnotationCellsCanvas.d.ts +2 -2
- package/dist/heatmap/components/Annotations/AnnotationCellsCanvas.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/AnnotationCellsCanvas.js.map +1 -1
- package/dist/heatmap/components/Annotations/AnnotationCellsSvg.d.ts +2 -2
- package/dist/heatmap/components/Annotations/AnnotationCellsSvg.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/AnnotationCellsSvg.js.map +1 -1
- package/dist/heatmap/components/Annotations/index.d.ts +5 -5
- package/dist/heatmap/components/Annotations/index.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/index.js.map +1 -1
- package/dist/heatmap/components/CanvasCells.d.ts +3 -3
- package/dist/heatmap/components/CanvasCells.d.ts.map +1 -1
- package/dist/heatmap/components/CanvasCells.js +18 -18
- package/dist/heatmap/components/CanvasCells.js.map +1 -1
- package/dist/heatmap/components/Chart.d.ts +6 -6
- package/dist/heatmap/components/Chart.d.ts.map +1 -1
- package/dist/heatmap/components/Chart.js +63 -63
- package/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/heatmap/components/ChartsGroup.d.ts +3 -3
- package/dist/heatmap/components/ChartsGroup.d.ts.map +1 -1
- package/dist/heatmap/components/ChartsGroup.js.map +1 -1
- package/dist/heatmap/components/SvgCells.d.ts +3 -3
- package/dist/heatmap/components/SvgCells.d.ts.map +1 -1
- package/dist/heatmap/components/SvgCells.js +18 -18
- package/dist/heatmap/components/SvgCells.js.map +1 -1
- package/dist/heatmap/components/tooltipUtils.d.ts +5 -5
- package/dist/heatmap/components/tooltipUtils.d.ts.map +1 -1
- package/dist/heatmap/components/tooltipUtils.js +7 -7
- package/dist/heatmap/components/tooltipUtils.js.map +1 -1
- package/dist/heatmap/fillCellsData.d.ts +45 -0
- package/dist/heatmap/fillCellsData.d.ts.map +1 -0
- package/dist/heatmap/fillCellsData.js +244 -0
- package/dist/heatmap/fillCellsData.js.map +1 -0
- package/dist/heatmap/getCells.d.ts +5 -37
- package/dist/heatmap/getCells.d.ts.map +1 -1
- package/dist/heatmap/getCells.js +28 -214
- package/dist/heatmap/getCells.js.map +1 -1
- package/dist/heatmap/getDendrograms.d.ts +2 -2
- package/dist/heatmap/getDendrograms.d.ts.map +1 -1
- package/dist/heatmap/getDendrograms.js +19 -19
- package/dist/heatmap/getDendrograms.js.map +1 -1
- package/dist/heatmap/index.d.ts +2 -2
- package/dist/heatmap/index.d.ts.map +1 -1
- package/dist/heatmap/index.js +7 -7
- package/dist/heatmap/index.js.map +1 -1
- package/dist/heatmap/utils/calculateCaptionTails.d.ts +2 -2
- package/dist/heatmap/utils/calculateCaptionTails.d.ts.map +1 -1
- package/dist/heatmap/utils/calculateCaptionTails.js.map +1 -1
- package/dist/types/bubble.d.ts +92 -0
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/bubble.js +16 -5
- package/dist/types/bubble.js.map +1 -1
- package/dist/types/discrete.d.ts +24 -24
- package/dist/types/heatmap.d.ts +18 -18
- package/dist/utils/getFacetOrGroupKey.d.ts +2 -0
- package/dist/utils/getFacetOrGroupKey.d.ts.map +1 -0
- package/dist/utils/getFacetOrGroupKey.js +7 -0
- package/dist/utils/getFacetOrGroupKey.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGroupedCellsData.js","sources":["../../src/bubble/getGroupedCellsData.ts"],"sourcesContent":["import { deviation, extent, mean } from 'd3-array';\nimport { uniq } from 'lodash';\nimport type { DataFrame } from '../DataFrame';\nimport type { ColumnName, DataValue, NormalizationMethod } from '../types';\nimport type { BubbleSettingsImpl } from './BubbleSettingsImpl';\n\nconst MAX_RENDERED_CELLS_COUNT = 1000000;\nfunction normalizeByStd(values: number[]) {\n const stdValue = deviation(values);\n const meanValue = mean(values);\n\n if (stdValue === undefined || meanValue === undefined || stdValue === 0) {\n return (v: number) => v;\n }\n return (v: number) => (v - meanValue) / stdValue;\n}\n\nfunction normalizeByMinMax(values: number[]) {\n const meanValue = mean(values);\n const [min, max] = extent(values);\n if (meanValue === undefined || min === undefined || max === undefined) {\n return (v: number) => v;\n }\n return (v: number) => (v - meanValue) / (max - min);\n}\n\nfunction getNormalizationFn(method: NormalizationMethod, values: number[]) {\n if (method === 'standardScaling') {\n return normalizeByStd(values);\n }\n if (method === 'meanNormalization') {\n return normalizeByMinMax(values);\n }\n return (v: number) => v;\n}\n\nexport type Cell = {\n id: string;\n idx: number;\n sizeValue: DataValue;\n colorValue: DataValue;\n normalizedSizeValue: DataValue;\n normalizedColorValue: DataValue;\n x: DataValue;\n y: DataValue;\n};\n\nexport type GroupedCellsData = {\n meta: {\n facetKeys: string[];\n facetKeyValues: Record<string, string[]>;\n xKeys: string[]; // all the keys from facets\n yKeys: string[]; // all the keys from facets\n xLabels: Record<string, string>;\n yLabels: Record<string, string>;\n valueExtentSize: [number, number]; // for size scales\n valueExtentColor: [number, number]; // for color scales\n };\n //facet groups\n facets: Record<\n string,\n {\n // axis keys\n xKeys: string[];\n yKeys: string[];\n // cells grouped by X, then by Y\n cells: Record<string, Record<string, Cell>>;\n }\n >;\n};\n\nexport function getGroupedCellsData(\n data: DataFrame,\n xColumn: ColumnName,\n yColumn: ColumnName,\n valueColumnSize: ColumnName,\n valueColumnColor: ColumnName,\n facetBy: ColumnName[],\n facetKeysCombinations: string[][],\n normalization: BubbleSettingsImpl['normalization'],\n NAValueAs: BubbleSettingsImpl['NAValueAs']\n): GroupedCellsData {\n const facetKeys = facetKeysCombinations.map(v => v.join('_'));\n const result: GroupedCellsData = {\n meta: {\n facetKeys,\n xKeys: [],\n yKeys: [],\n xLabels: {},\n yLabels: {},\n facetKeyValues: facetKeys.reduce((res: Record<string, string[]>, key, index) => {\n res[key] = facetKeysCombinations[index];\n return res;\n }, {}),\n valueExtentSize: [Infinity, -Infinity],\n valueExtentColor: [Infinity, -Infinity],\n },\n facets: {},\n };\n const usedXKeys = new Set();\n const usedYKeys = new Set();\n\n const xLabelsSource = xColumn.valueLabels ?? xColumn.value;\n const yLabelsSource = yColumn.valueLabels ?? yColumn.value;\n\n for (let i = 0; i < data.rowsCount; i++) {\n const facetKey = facetBy.length ? facetBy.map(column => data.getColumnValue(column.value, i)).join('_') : 'null';\n const x = data.getColumnValue(xColumn.value, i) as string;\n const y = data.getColumnValue(yColumn.value, i) as string;\n const sizeValue = (data.getColumnValue(valueColumnSize.value, i) ?? NAValueAs) as (null | number);\n const colorValue = (data.getColumnValue(valueColumnColor.value, i) ?? NAValueAs) as (null | number);\n \n if (x === null || y === null || sizeValue === null || colorValue === null) {\n continue;\n }\n\n if (!result.facets[facetKey]) {\n result.facets[facetKey] = {\n xKeys: [],\n yKeys: [],\n cells: {},\n };\n }\n result.facets[facetKey].xKeys.push(x);\n result.facets[facetKey].yKeys.push(y);\n\n if (!usedXKeys.has(x)) {\n usedXKeys.add(x);\n result.meta.xKeys.push(x);\n }\n if (!usedYKeys.has(y)) {\n usedYKeys.add(y);\n result.meta.yKeys.push(y);\n }\n if (!result.facets[facetKey].cells[x]) {\n result.facets[facetKey].cells[x] = {};\n }\n result.meta.valueExtentSize[0] = Math.min(sizeValue, result.meta.valueExtentSize[0]);\n result.meta.valueExtentSize[1] = Math.max(sizeValue, result.meta.valueExtentSize[1]);\n result.meta.valueExtentColor[0] = Math.min(colorValue, result.meta.valueExtentColor[0]);\n result.meta.valueExtentColor[1] = Math.max(colorValue, result.meta.valueExtentColor[1]);\n\n const xLabelsValueStr = String(data.getColumnValue(xLabelsSource, i));\n const yLabelsValueStr = String(data.getColumnValue(yLabelsSource, i));\n\n if (result.facets[facetKey].cells[x][y]) {\n throw Error(`More than 1 value for x=${x}, y=${y}`);\n }\n if (result.meta.xLabels[x] && xLabelsValueStr !== result.meta.xLabels[x]) {\n throw Error(`More than 1 x-label value for x=${x}`);\n }\n if (result.meta.yLabels[y] && yLabelsValueStr !== result.meta.yLabels[y]) {\n throw Error(`More than 1 y-label value for y=${y}`);\n }\n result.meta.xLabels[x] = xLabelsValueStr;\n result.meta.yLabels[y] = yLabelsValueStr;\n result.facets[facetKey].cells[x][y] = {\n id: `${x}_${y}`,\n idx: i,\n x,\n y,\n sizeValue,\n normalizedSizeValue: sizeValue,\n colorValue,\n normalizedColorValue: colorValue,\n };\n }\n result.meta.facetKeys = result.meta.facetKeys.filter((key) => result.facets[key]); // filter only used;\n\n // make uniq x, y, x-group and y-group keys\n result.meta.facetKeys.forEach(facetKey => {\n const facet = result.facets[facetKey];\n facet.xKeys = uniq(facet.xKeys);\n facet.yKeys = uniq(facet.yKeys);\n\n if (facet.xKeys.length * facet.yKeys.length > MAX_RENDERED_CELLS_COUNT) {\n throw Error(`Too many cells for graph rendering (${facet.xKeys.length * facet.yKeys.length})`);\n }\n });\n\n if (normalization) {\n //const valueExtentSize = [Infinity, -Infinity] as [number, number];\n const valueExtentColor = [Infinity, -Infinity] as [number, number];\n result.meta.facetKeys.forEach(facetKey => {\n if (!result.facets[facetKey]) {\n return;\n }\n const {xKeys, yKeys, cells} = result.facets[facetKey];\n const cellKeys = normalization.direction === 'row' ? xKeys : yKeys;\n const groupKeys = normalization.direction === 'row' ? yKeys : xKeys;\n const cellGetter =\n normalization.direction === 'row'\n ? (cellKey: string, groupKey: string) => cells[cellKey]?.[groupKey]\n : (cellKey: string, groupKey: string) => cells[groupKey]?.[cellKey];\n groupKeys.forEach(groupKey => {\n //const sizeValues:number[] = [];\n const colorValues: number[] = [];\n cellKeys.forEach(cellKey => {\n //const sizeV = cellGetter(cellKey, groupKey)?.sizeValue;\n const colorV = cellGetter(cellKey, groupKey)?.colorValue;\n // if (sizeV !== undefined) {\n // sizeValues.push(sizeV as number);\n // }\n if (colorV !== undefined) {\n colorValues.push(colorV as number);\n }\n });\n // const normalizeSize = getNormalizationFn(normalization.method, sizeValues);\n const normalizeColor = getNormalizationFn(normalization.method, colorValues);\n cellKeys.forEach(cellKey => {\n const cell = cellGetter(cellKey, groupKey);\n if (cell !== undefined) {\n // cell.normalizedSizeValue = normalizeSize(cell.sizeValue as number);\n cell.normalizedColorValue = normalizeColor(cell.colorValue as number);\n // valueExtentSize[0] = Math.min(cell.normalizedSizeValue, valueExtentSize[0]);\n // valueExtentSize[1] = Math.max(cell.normalizedSizeValue, valueExtentSize[1]);\n valueExtentColor[0] = Math.min(cell.normalizedColorValue, valueExtentColor[0]);\n valueExtentColor[1] = Math.max(cell.normalizedColorValue, valueExtentColor[1]);\n }\n });\n });\n });\n // result.meta.valueExtentSize = valueExtentSize;\n result.meta.valueExtentColor = valueExtentColor;\n }\n\n // avoid render errors on empty data\n if (result.meta.valueExtentSize[0] === Infinity) {\n result.meta.valueExtentSize[0] = 0;\n }\n if (result.meta.valueExtentSize[1] === -Infinity) {\n result.meta.valueExtentSize[1] = 0;\n }\n if (result.meta.valueExtentColor[0] === Infinity) {\n result.meta.valueExtentColor[0] = 0;\n }\n if (result.meta.valueExtentColor[1] === -Infinity) {\n result.meta.valueExtentColor[1] = 0;\n }\n\n return result;\n}\n"],"names":["MAX_RENDERED_CELLS_COUNT","normalizeByStd","values","stdValue","deviation","meanValue","mean","v","normalizeByMinMax","min","max","extent","getNormalizationFn","method","getGroupedCellsData","data","xColumn","yColumn","valueColumnSize","valueColumnColor","facetBy","facetKeysCombinations","normalization","NAValueAs","facetKeys","result","res","key","index","usedXKeys","usedYKeys","xLabelsSource","yLabelsSource","i","facetKey","column","x","y","sizeValue","colorValue","xLabelsValueStr","yLabelsValueStr","facet","uniq","valueExtentColor","xKeys","yKeys","cells","cellKeys","groupKeys","cellGetter","cellKey","groupKey","_a","colorValues","colorV","normalizeColor","cell"],"mappings":";;;;AAMA,MAAMA,IAA2B;AACjC,SAASC,EAAeC,GAAkB;AACtC,QAAMC,IAAWC,EAAUF,CAAM,GAC3BG,IAAYC,EAAKJ,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C,GAEDnB,EAAO,KAAK,mBAAmBmB;AAAA,EACnC;AAGA,SAAInB,EAAO,KAAK,gBAAgB,CAAC,MAAM,UACnCA,EAAO,KAAK,gBAAgB,CAAC,IAAI,IAEjCA,EAAO,KAAK,gBAAgB,CAAC,MAAM,WACnCA,EAAO,KAAK,gBAAgB,CAAC,IAAI,IAEjCA,EAAO,KAAK,iBAAiB,CAAC,MAAM,UACpCA,EAAO,KAAK,iBAAiB,CAAC,IAAI,IAElCA,EAAO,KAAK,iBAAiB,CAAC,MAAM,WACpCA,EAAO,KAAK,iBAAiB,CAAC,IAAI,IAG/BA;AACX;"}
|
|
1
|
+
{"version":3,"file":"getGroupedCellsData.js","sources":["../../src/bubble/getGroupedCellsData.ts"],"sourcesContent":["import type { DataFrame } from '../DataFrame';\nimport type { ColumnName } from '../types';\nimport type { BubbleSettingsImpl } from './BubbleSettingsImpl';\nimport { type Cell, fillCellsData, type GroupedCellsData } from '../heatmap/fillCellsData';\n\nconst MAX_RENDERED_CELLS_COUNT = 1000000;\n\ntype BubbleDataFields = 'sizeValue'|'colorValue';\nexport type CellBubble = Cell<BubbleDataFields>;\nexport type GroupedCellsBubble = GroupedCellsData<BubbleDataFields>;\n\nfunction createEmptyGroupedCells(): GroupedCellsBubble {\n return {\n meta: {\n valueSources: ['sizeValue', 'colorValue'],\n facetKeys: [],\n xGroupKeys: [],\n yGroupKeys: [],\n\n xKeys: [], // all the keys from facets\n yKeys: [], // all the keys from facets\n xKeysByGroups: {},\n yKeysByGroups: {},\n\n xLabels: {},\n yLabels: {},\n xGroupLabels: {},\n yGroupLabels: {},\n\n facetKeyValues: {},\n xGroupKeyValues: {},\n yGroupKeyValues: {},\n\n xDataByKeys: {},\n yDataByKeys: {},\n\n valueExtent: {\n sizeValue: [Infinity, -Infinity],\n colorValue: [Infinity, -Infinity]\n }\n },\n facets: {},\n };\n}\n\nexport function getGroupedCellsData(\n data: DataFrame,\n xColumn: ColumnName,\n yColumn: ColumnName,\n valueColumnSize: ColumnName,\n valueColumnColor: ColumnName,\n facetBy: ColumnName[],\n xGroupBy: ColumnName[],\n yGroupBy: ColumnName[],\n normalization: BubbleSettingsImpl['normalization'],\n NAValueAs: BubbleSettingsImpl['NAValueAs'],\n keysOrder: BubbleSettingsImpl['keysOrder'],\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis'],\n aggregation: BubbleSettingsImpl['aggregation'],\n): GroupedCellsBubble {\n const result: GroupedCellsBubble = createEmptyGroupedCells();\n\n fillCellsData(\n result,\n data,\n xColumn, yColumn, {sizeValue: valueColumnSize, colorValue: valueColumnColor},\n facetBy, xGroupBy, yGroupBy,\n [],\n null, null,\n {sizeValue: null, colorValue: normalization},\n NAValueAs,\n keysOrder,\n xAxis,\n yAxis,\n aggregation\n );\n\n if (result.meta.xKeys.length * result.meta.yKeys.length > MAX_RENDERED_CELLS_COUNT) {\n throw Error(`Too many cells for graph rendering (${result.meta.xKeys.length * result.meta.yKeys.length})`);\n }\n return result;\n}\n"],"names":["MAX_RENDERED_CELLS_COUNT","createEmptyGroupedCells","getGroupedCellsData","data","xColumn","yColumn","valueColumnSize","valueColumnColor","facetBy","xGroupBy","yGroupBy","normalization","NAValueAs","keysOrder","xAxis","yAxis","aggregation","result","fillCellsData"],"mappings":";AAKA,MAAMA,IAA2B;AAMjC,SAASC,IAA8C;AACnD,SAAO;AAAA,IACH,MAAM;AAAA,MACF,cAAc,CAAC,aAAa,YAAY;AAAA,MACxC,WAAW,CAAA;AAAA,MACX,YAAY,CAAA;AAAA,MACZ,YAAY,CAAA;AAAA,MAEZ,OAAO,CAAA;AAAA;AAAA,MACP,OAAO,CAAA;AAAA;AAAA,MACP,eAAe,CAAA;AAAA,MACf,eAAe,CAAA;AAAA,MAEf,SAAS,CAAA;AAAA,MACT,SAAS,CAAA;AAAA,MACT,cAAc,CAAA;AAAA,MACd,cAAc,CAAA;AAAA,MAEd,gBAAgB,CAAA;AAAA,MAChB,iBAAiB,CAAA;AAAA,MACjB,iBAAiB,CAAA;AAAA,MAEjB,aAAa,CAAA;AAAA,MACb,aAAa,CAAA;AAAA,MAEb,aAAa;AAAA,QACT,WAAW,CAAC,OAAU,MAAS;AAAA,QAC/B,YAAY,CAAC,OAAU,MAAS;AAAA,MAAA;AAAA,IACpC;AAAA,IAEJ,QAAQ,CAAA;AAAA,EAAC;AAEjB;AAEO,SAASC,EACZC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACkB;AAClB,QAAMC,IAA6BhB,EAAA;AAiBnC,MAfAiB;AAAA,IACID;AAAA,IACAd;AAAA,IACAC;AAAA,IAASC;AAAA,IAAS,EAAC,WAAWC,GAAiB,YAAYC,EAAA;AAAA,IAC3DC;AAAA,IAASC;AAAA,IAAUC;AAAA,IACnB,CAAA;AAAA,IACA;AAAA,IAAM;AAAA,IACN,EAAC,WAAW,MAAM,YAAYC,EAAA;AAAA,IAC9BC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA,GAGAC,EAAO,KAAK,MAAM,SAASA,EAAO,KAAK,MAAM,SAASjB;AACtD,UAAM,MAAM,uCAAuCiB,EAAO,KAAK,MAAM,SAASA,EAAO,KAAK,MAAM,MAAM,GAAG;AAE7G,SAAOA;AACX;"}
|
package/dist/bubble/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import { DataFrame } from '../DataFrame';
|
|
|
3
3
|
import { BubbleEventHandlers, BubbleSettings } from '../types';
|
|
4
4
|
import { BubbleSettingsImpl } from './BubbleSettingsImpl';
|
|
5
5
|
import { default as ChartRenderer } from './ChartRenderer';
|
|
6
|
-
import {
|
|
6
|
+
import { GroupedCellsBubble } from './getGroupedCellsData';
|
|
7
7
|
export declare class ChartBubble extends AbstractChart {
|
|
8
8
|
settings: BubbleSettingsImpl;
|
|
9
9
|
chartRenderer: ChartRenderer;
|
|
10
10
|
onTooltipHintSwitch: (v: boolean) => void;
|
|
11
11
|
calculatedData: {
|
|
12
|
-
groupedCellsData:
|
|
12
|
+
groupedCellsData: GroupedCellsBubble;
|
|
13
13
|
} | null;
|
|
14
14
|
constructor(data: DataFrame, settings: BubbleSettings, eventHandlers?: BubbleEventHandlers);
|
|
15
15
|
mount(node: HTMLElement): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bubble/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bubble/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwC,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEtG,qBAAa,WAAY,SAAQ,aAAa;IAC1C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAE7B,mBAAmB,EAAE,CAAC,CAAC,EAAC,OAAO,KAAK,IAAI,CAAmB;IAC3D,cAAc,EAAE;QACZ,gBAAgB,EAAE,kBAAkB,CAAC;KACxC,GAAG,IAAI,CAAQ;gBAEJ,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,mBAAmB;IAU1F,KAAK,CAAC,IAAI,EAAE,WAAW;IAevB,OAAO;IAIP,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc;IAyB/D,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAIhD,MAAM,IAAI,MAAM;IAKhB,mCAAmC,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB;IAclG,+BAA+B,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS;IAUpE,WAAW;IA8BX,gBAAgB;IAOhB,YAAY;IA2BZ,OAAO,CAAC,WAAW,CAIjB;CACL"}
|
package/dist/bubble/index.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { renderToString as
|
|
5
|
-
import { AbstractChart as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
class K extends y {
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var x = (h, i, t) => i in h ? v(h, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[i] = t;
|
|
3
|
+
var C = (h, i, t) => x(h, typeof i != "symbol" ? i + "" : i, t);
|
|
4
|
+
import { renderToString as B } from "../node_modules/react-dom/server.browser.js";
|
|
5
|
+
import { AbstractChart as A } from "../AbstractChart.js";
|
|
6
|
+
import { BubbleSettingsImpl as _ } from "./BubbleSettingsImpl.js";
|
|
7
|
+
import b from "./ChartRenderer.js";
|
|
8
|
+
import { getCellTooltip as z } from "./getCellTooltip.js";
|
|
9
|
+
import { getGroupedCellsData as G } from "./getGroupedCellsData.js";
|
|
10
|
+
class N extends A {
|
|
12
11
|
constructor(t, a, e) {
|
|
13
12
|
super(t, a);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
C(this, "settings");
|
|
14
|
+
C(this, "chartRenderer");
|
|
15
|
+
C(this, "onTooltipHintSwitch", () => {
|
|
17
16
|
});
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
C(this, "calculatedData", null);
|
|
18
|
+
C(this, "_getTooltip", (t) => {
|
|
20
19
|
var a, e, r;
|
|
21
|
-
return this.calculatedData ?
|
|
20
|
+
return this.calculatedData ? z(this.data, t, this.calculatedData.groupedCellsData.meta, (r = (e = (a = this.settings) == null ? void 0 : a.chartSettings) == null ? void 0 : e.tooltips) == null ? void 0 : r.content) : ["No data available"];
|
|
22
21
|
});
|
|
23
|
-
this.settings = new
|
|
22
|
+
this.settings = new _(a), this.chartRenderer = new b(), e && (this.onTooltipHintSwitch = e[0]);
|
|
24
23
|
}
|
|
25
24
|
mount(t) {
|
|
26
25
|
try {
|
|
@@ -35,7 +34,7 @@ class K extends y {
|
|
|
35
34
|
updateSettingsAndData(t, a) {
|
|
36
35
|
try {
|
|
37
36
|
const e = this.settings, r = this.data;
|
|
38
|
-
this.settings = new
|
|
37
|
+
this.settings = new _(a), this.data = t, this._needUpdateCalculatedDataBySettings(e, this.settings) || this._needUpdateCalculatedDataByData(r, this.data) ? this._updateData() : this._updateAesInData(), this._updateChart(), this.hasError = !1;
|
|
39
38
|
} catch (e) {
|
|
40
39
|
this.hasError = !0, e instanceof Error && (this.chartRenderer.renderError(e.message), console.error(e));
|
|
41
40
|
}
|
|
@@ -44,14 +43,14 @@ class K extends y {
|
|
|
44
43
|
console.warn("no chart state for bubble chart");
|
|
45
44
|
}
|
|
46
45
|
export() {
|
|
47
|
-
return this._updateChart(),
|
|
46
|
+
return this._updateChart(), B(this.chartRenderer.component);
|
|
48
47
|
}
|
|
49
48
|
_needUpdateCalculatedDataBySettings(t, a) {
|
|
50
|
-
var e, r, o, l;
|
|
51
|
-
return t.facetBy.some((
|
|
52
|
-
var
|
|
53
|
-
return
|
|
54
|
-
}) || ((e = t.normalization) == null ? void 0 : e.method) !== ((r = a.normalization) == null ? void 0 : r.method) || ((o = t.normalization) == null ? void 0 : o.direction) !== ((l = a.normalization) == null ? void 0 : l.direction) || t.xColumn.value !== a.xColumn.value || t.yColumn.value !== a.yColumn.value || t.valueColumnColor.value !== a.valueColumnColor.value || t.valueColumnSize.value !== a.valueColumnSize.value || t.NAValueAs !== a.NAValueAs;
|
|
49
|
+
var e, r, o, l, c, n, d, m, u, g;
|
|
50
|
+
return t.facetBy.some((y, p) => {
|
|
51
|
+
var s;
|
|
52
|
+
return y.value !== ((s = a.facetBy[p]) == null ? void 0 : s.value);
|
|
53
|
+
}) || ((e = t.normalization) == null ? void 0 : e.method) !== ((r = a.normalization) == null ? void 0 : r.method) || ((o = t.normalization) == null ? void 0 : o.direction) !== ((l = a.normalization) == null ? void 0 : l.direction) || t.xColumn.value !== a.xColumn.value || t.yColumn.value !== a.yColumn.value || t.valueColumnColor.value !== a.valueColumnColor.value || t.valueColumnSize.value !== a.valueColumnSize.value || t.NAValueAs !== a.NAValueAs || ((c = t.aggregation) == null ? void 0 : c.method) !== ((n = a.aggregation) == null ? void 0 : n.method) || ((d = t.aggregation) == null ? void 0 : d.x) !== ((m = a.aggregation) == null ? void 0 : m.x) || ((u = t.aggregation) == null ? void 0 : u.y) !== ((g = a.aggregation) == null ? void 0 : g.y);
|
|
55
54
|
}
|
|
56
55
|
_needUpdateCalculatedDataByData(t, a) {
|
|
57
56
|
const e = Object.keys(t.data), r = Object.keys(a.data);
|
|
@@ -61,18 +60,23 @@ class K extends y {
|
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
_updateData() {
|
|
64
|
-
const { facetBy: t,
|
|
65
|
-
this.data.setGrouping([...
|
|
66
|
-
const p =
|
|
63
|
+
const { facetBy: t, xGroupBy: a, yGroupBy: e, xColumn: r, yColumn: o, valueColumnSize: l, valueColumnColor: c, normalization: n, NAValueAs: d, aggregation: m, chartSettings: u, keysOrder: g } = this.settings, y = t.map((s) => s.value) ?? null;
|
|
64
|
+
this.data.setGrouping([...y]);
|
|
65
|
+
const p = G(
|
|
67
66
|
this.data,
|
|
68
|
-
a,
|
|
69
|
-
e,
|
|
70
67
|
r,
|
|
71
68
|
o,
|
|
72
|
-
t,
|
|
73
|
-
c,
|
|
74
69
|
l,
|
|
75
|
-
|
|
70
|
+
c,
|
|
71
|
+
t,
|
|
72
|
+
a,
|
|
73
|
+
e,
|
|
74
|
+
n,
|
|
75
|
+
d,
|
|
76
|
+
g,
|
|
77
|
+
u.xAxis,
|
|
78
|
+
u.yAxis,
|
|
79
|
+
m
|
|
76
80
|
);
|
|
77
81
|
this.calculatedData = {
|
|
78
82
|
groupedCellsData: p
|
|
@@ -82,9 +86,21 @@ class K extends y {
|
|
|
82
86
|
this.calculatedData;
|
|
83
87
|
}
|
|
84
88
|
_updateChart() {
|
|
89
|
+
var p, s;
|
|
85
90
|
if (!this.calculatedData)
|
|
86
91
|
return;
|
|
87
|
-
const { id: t, chartSettings: a, facetSettings: e, valueColumnColor: r, valueColumnSize: o, normalization: l, aes: u } = this.settings
|
|
92
|
+
const { id: t, chartSettings: a, facetSettings: e, valueColumnColor: r, valueColumnSize: o, normalization: l, aes: c, keysOrder: n, xColumn: d, yColumn: m, xGroupBy: u, yGroupBy: g } = this.settings, y = {
|
|
93
|
+
x: ((p = n[d.value]) == null ? void 0 : p.length) > 0,
|
|
94
|
+
y: ((s = n[m.value]) == null ? void 0 : s.length) > 0,
|
|
95
|
+
xGroup: u.some((D) => {
|
|
96
|
+
var f;
|
|
97
|
+
return ((f = n[D.value]) == null ? void 0 : f.length) > 0;
|
|
98
|
+
}),
|
|
99
|
+
yGroup: g.some((D) => {
|
|
100
|
+
var f;
|
|
101
|
+
return ((f = n[D.value]) == null ? void 0 : f.length) > 0;
|
|
102
|
+
})
|
|
103
|
+
};
|
|
88
104
|
this.chartRenderer.render(
|
|
89
105
|
this.data,
|
|
90
106
|
t,
|
|
@@ -94,13 +110,14 @@ class K extends y {
|
|
|
94
110
|
r,
|
|
95
111
|
o,
|
|
96
112
|
l,
|
|
97
|
-
|
|
113
|
+
c,
|
|
98
114
|
this._getTooltip,
|
|
99
|
-
this.onTooltipHintSwitch
|
|
115
|
+
this.onTooltipHintSwitch,
|
|
116
|
+
y
|
|
100
117
|
);
|
|
101
118
|
}
|
|
102
119
|
}
|
|
103
120
|
export {
|
|
104
|
-
|
|
121
|
+
N as ChartBubble
|
|
105
122
|
};
|
|
106
123
|
//# sourceMappingURL=index.js.map
|
package/dist/bubble/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/bubble/index.ts"],"sourcesContent":["import { renderToString } from 'react-dom/server';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport type { BubbleEventHandlers, BubbleSettings } from '../types';\nimport { getKeysCombinations } from '../utils/getKeysCombination';\nimport { BubbleSettingsImpl } from './BubbleSettingsImpl';\nimport ChartRenderer from './ChartRenderer';\nimport { getCellTooltip } from './getCellTooltip';\nimport type { Cell, GroupedCellsData } from './getGroupedCellsData';\nimport { getGroupedCellsData } from './getGroupedCellsData';\n\nexport class ChartBubble extends AbstractChart {\n settings: BubbleSettingsImpl;\n chartRenderer: ChartRenderer;\n\n onTooltipHintSwitch: (v:boolean) => void = () => undefined;\n calculatedData: {\n groupedCellsData: GroupedCellsData;\n } | null = null;\n\n constructor(data: DataFrame, settings: BubbleSettings, eventHandlers?: BubbleEventHandlers) {\n super(data, settings);\n\n this.settings = new BubbleSettingsImpl(settings);\n this.chartRenderer = new ChartRenderer();\n if (eventHandlers) {\n this.onTooltipHintSwitch = eventHandlers[0];\n }\n }\n\n mount(node: HTMLElement) {\n try {\n this.chartRenderer.init(node);\n this._updateData();\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n unmount() {\n this.chartRenderer.clear();\n }\n\n updateSettingsAndData(data: DataFrame, settings: BubbleSettings) {\n try {\n const previousSettings = this.settings;\n const previousData = this.data;\n this.settings = new BubbleSettingsImpl(settings);\n this.data = data;\n if (\n this._needUpdateCalculatedDataBySettings(previousSettings, this.settings) ||\n this._needUpdateCalculatedDataByData(previousData, this.data)\n ) {\n this._updateData();\n } else {\n this._updateAesInData();\n }\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n updateChartState(_field: string, _value: unknown) {\n console.warn('no chart state for bubble chart');\n }\n\n export(): string {\n this._updateChart();\n return renderToString(this.chartRenderer.component);\n }\n\n _needUpdateCalculatedDataBySettings(prevSettings: BubbleSettingsImpl, settings: BubbleSettingsImpl) {\n return prevSettings.facetBy.some((el, idx) => el.value !== settings.facetBy[idx]?.value) ||\n prevSettings.normalization?.method !== settings.normalization?.method ||\n prevSettings.normalization?.direction !== settings.normalization?.direction ||\n prevSettings.xColumn.value !== settings.xColumn.value ||\n prevSettings.yColumn.value !== settings.yColumn.value ||\n prevSettings.valueColumnColor.value !== settings.valueColumnColor.value ||\n prevSettings.valueColumnSize.value !== settings.valueColumnSize.value ||\n prevSettings.NAValueAs !== settings.NAValueAs;\n }\n\n _needUpdateCalculatedDataByData(prevData: DataFrame, data: DataFrame) {\n const prevKeys = Object.keys(prevData.data);\n const keys = Object.keys(data.data);\n return (\n prevData.id !== data.id ||\n prevKeys.length !== keys.length ||\n prevKeys.some(key => prevData.data[key].length !== data.data[key]?.length)\n );\n }\n\n _updateData() {\n const {facetBy, xColumn, yColumn, valueColumnSize, valueColumnColor, normalization, NAValueAs} = this.settings;\n\n const facetKeysLists = facetBy.map(column => this.data.getColumnCategories(column.value));\n const facetKeysCombinations = facetKeysLists.length ? getKeysCombinations([...facetKeysLists]) : [['null']];\n const facetGroupingValues = facetBy.map(column => column.value) ?? null;\n\n this.data.setGrouping([...facetGroupingValues]);\n\n const groupedCellsData = getGroupedCellsData(\n this.data,\n xColumn,\n yColumn,\n valueColumnSize,\n valueColumnColor,\n facetBy,\n facetKeysCombinations,\n normalization,\n NAValueAs\n );\n this.calculatedData = {\n groupedCellsData,\n };\n }\n\n _updateAesInData() {\n const calculated = this.calculatedData;\n if (!calculated) {\n return;\n }\n }\n\n _updateChart() {\n if (!this.calculatedData) {\n return;\n }\n const {id, chartSettings, facetSettings, valueColumnColor, valueColumnSize, normalization, aes} = this.settings;\n this.chartRenderer.render(\n this.data,\n id,\n chartSettings,\n facetSettings,\n this.calculatedData.groupedCellsData,\n valueColumnColor,\n valueColumnSize,\n normalization,\n aes,\n this._getTooltip,\n this.onTooltipHintSwitch\n );\n }\n\n private _getTooltip = (cell: Cell): string[] => {\n return this.calculatedData\n ? getCellTooltip(this.data, cell, this.calculatedData.groupedCellsData.meta, this.settings?.chartSettings?.tooltips?.content)\n : ['No data available'];\n };\n}\n"],"names":["ChartBubble","AbstractChart","data","settings","eventHandlers","__publicField","cell","getCellTooltip","_c","_b","_a","BubbleSettingsImpl","ChartRenderer","node","err","previousSettings","previousData","_field","_value","renderToString","prevSettings","el","idx","_d","prevData","prevKeys","keys","key","facetBy","xColumn","yColumn","valueColumnSize","valueColumnColor","normalization","NAValueAs","facetKeysLists","column","facetKeysCombinations","getKeysCombinations","facetGroupingValues","groupedCellsData","getGroupedCellsData","id","chartSettings","facetSettings","aes"],"mappings":";;;;;;;;;;AAWO,MAAMA,UAAoBC,EAAc;AAAA,EAS3C,YAAYC,GAAiBC,GAA0BC,GAAqC;AACxF,UAAMF,GAAMC,CAAQ;AATxB,IAAAE,EAAA;AACA,IAAAA,EAAA;AAEA,IAAAA,EAAA,6BAA2C,MAAA;AAAA;AAC3C,IAAAA,EAAA,wBAEW;AA0IH,IAAAA,EAAA,qBAAc,CAACC,MAAyB;;AAC5C,aAAO,KAAK,iBACNC,EAAe,KAAK,MAAMD,GAAM,KAAK,eAAe,iBAAiB,OAAME,KAAAC,KAAAC,IAAA,KAAK,aAAL,gBAAAA,EAAe,kBAAf,gBAAAD,EAA8B,aAA9B,gBAAAD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,MACrB,KAAK;AAAA,MACLZ;AAAA,MACAC;AAAA,MACAC;AAAA,MACAC;AAAA,MACAJ;AAAA,MACAS;AAAA,MACAJ;AAAA,MACAC;AAAA,IAAA;AAEJ,SAAK,iBAAiB;AAAA,MAClB,kBAAAM;AAAA,IAAA;AAAA,EAER;AAAA,EAEA,mBAAmB;AAEf,IADmB,KAAK;AAAA,EAI5B;AAAA,EAEA,eAAe;AACX,QAAI,CAAC,KAAK;AACN;AAEJ,UAAM,EAAC,IAAAE,GAAI,eAAAC,GAAe,eAAAC,GAAe,kBAAAZ,GAAkB,iBAAAD,GAAiB,eAAAE,GAAe,KAAAY,MAAO,KAAK;AACvG,SAAK,cAAc;AAAA,MACf,KAAK;AAAA,MACLH;AAAA,MACAC;AAAA,MACAC;AAAA,MACA,KAAK,eAAe;AAAA,MACpBZ;AAAA,MACAD;AAAA,MACAE;AAAA,MACAY;AAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,IAAA;AAAA,EAEb;AAOJ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/bubble/index.ts"],"sourcesContent":["import { renderToString } from 'react-dom/server';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport type { BubbleEventHandlers, BubbleSettings } from '../types';\nimport { BubbleSettingsImpl } from './BubbleSettingsImpl';\nimport ChartRenderer from './ChartRenderer';\nimport { getCellTooltip } from './getCellTooltip';\nimport { type CellBubble, getGroupedCellsData, type GroupedCellsBubble } from './getGroupedCellsData';\n\nexport class ChartBubble extends AbstractChart {\n settings: BubbleSettingsImpl;\n chartRenderer: ChartRenderer;\n\n onTooltipHintSwitch: (v:boolean) => void = () => undefined;\n calculatedData: {\n groupedCellsData: GroupedCellsBubble;\n } | null = null;\n\n constructor(data: DataFrame, settings: BubbleSettings, eventHandlers?: BubbleEventHandlers) {\n super(data, settings);\n\n this.settings = new BubbleSettingsImpl(settings);\n this.chartRenderer = new ChartRenderer();\n if (eventHandlers) {\n this.onTooltipHintSwitch = eventHandlers[0];\n }\n }\n\n mount(node: HTMLElement) {\n try {\n this.chartRenderer.init(node);\n this._updateData();\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n unmount() {\n this.chartRenderer.clear();\n }\n\n updateSettingsAndData(data: DataFrame, settings: BubbleSettings) {\n try {\n const previousSettings = this.settings;\n const previousData = this.data;\n this.settings = new BubbleSettingsImpl(settings);\n this.data = data;\n if (\n this._needUpdateCalculatedDataBySettings(previousSettings, this.settings) ||\n this._needUpdateCalculatedDataByData(previousData, this.data)\n ) {\n this._updateData();\n } else {\n this._updateAesInData();\n }\n this._updateChart();\n this.hasError = false;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.chartRenderer.renderError(err.message as string);\n console.error(err);\n }\n }\n }\n\n updateChartState(_field: string, _value: unknown) {\n console.warn('no chart state for bubble chart');\n }\n\n export(): string {\n this._updateChart();\n return renderToString(this.chartRenderer.component);\n }\n\n _needUpdateCalculatedDataBySettings(prevSettings: BubbleSettingsImpl, settings: BubbleSettingsImpl) {\n return prevSettings.facetBy.some((el, idx) => el.value !== settings.facetBy[idx]?.value) ||\n prevSettings.normalization?.method !== settings.normalization?.method ||\n prevSettings.normalization?.direction !== settings.normalization?.direction ||\n prevSettings.xColumn.value !== settings.xColumn.value ||\n prevSettings.yColumn.value !== settings.yColumn.value ||\n prevSettings.valueColumnColor.value !== settings.valueColumnColor.value ||\n prevSettings.valueColumnSize.value !== settings.valueColumnSize.value ||\n prevSettings.NAValueAs !== settings.NAValueAs ||\n prevSettings.aggregation?.method !== settings.aggregation?.method ||\n prevSettings.aggregation?.x !== settings.aggregation?.x ||\n prevSettings.aggregation?.y !== settings.aggregation?.y;\n }\n\n _needUpdateCalculatedDataByData(prevData: DataFrame, data: DataFrame) {\n const prevKeys = Object.keys(prevData.data);\n const keys = Object.keys(data.data);\n return (\n prevData.id !== data.id ||\n prevKeys.length !== keys.length ||\n prevKeys.some(key => prevData.data[key].length !== data.data[key]?.length)\n );\n }\n\n _updateData() {\n const {facetBy, xGroupBy, yGroupBy, xColumn, yColumn, valueColumnSize, valueColumnColor, normalization, NAValueAs, aggregation, chartSettings, keysOrder} = this.settings;\n\n //const facetKeysLists = facetBy.map(column => this.data.getColumnCategories(column.value));\n //const facetKeysCombinations = facetKeysLists.length ? getKeysCombinations([...facetKeysLists]) : [['null']];\n const facetGroupingValues = facetBy.map(column => column.value) ?? null;\n\n this.data.setGrouping([...facetGroupingValues]);\n\n const groupedCellsData = getGroupedCellsData(\n this.data,\n xColumn,\n yColumn,\n valueColumnSize,\n valueColumnColor,\n facetBy,\n xGroupBy,\n yGroupBy,\n normalization,\n NAValueAs,\n keysOrder,\n chartSettings.xAxis,\n chartSettings.yAxis,\n aggregation\n );\n this.calculatedData = {\n groupedCellsData,\n };\n }\n\n _updateAesInData() {\n const calculated = this.calculatedData;\n if (!calculated) {\n return;\n }\n }\n\n _updateChart() {\n if (!this.calculatedData) {\n return;\n }\n const {id, chartSettings, facetSettings, valueColumnColor, valueColumnSize, normalization, aes, keysOrder, xColumn, yColumn, xGroupBy, yGroupBy} = this.settings;\n const customOrder = {\n x: keysOrder[xColumn.value]?.length > 0,\n y: keysOrder[yColumn.value]?.length > 0,\n xGroup: xGroupBy.some((v) => keysOrder[v.value]?.length > 0),\n yGroup: yGroupBy.some((v) => keysOrder[v.value]?.length > 0),\n };\n this.chartRenderer.render(\n this.data,\n id,\n chartSettings,\n facetSettings,\n this.calculatedData.groupedCellsData,\n valueColumnColor,\n valueColumnSize,\n normalization,\n aes,\n this._getTooltip,\n this.onTooltipHintSwitch,\n customOrder\n );\n }\n\n private _getTooltip = (cell: CellBubble): string[] => {\n return this.calculatedData\n ? getCellTooltip(this.data, cell, this.calculatedData.groupedCellsData.meta, this.settings?.chartSettings?.tooltips?.content)\n : ['No data available'];\n };\n}\n"],"names":["ChartBubble","AbstractChart","data","settings","eventHandlers","__publicField","cell","getCellTooltip","_c","_b","_a","BubbleSettingsImpl","ChartRenderer","node","err","previousSettings","previousData","_field","_value","renderToString","prevSettings","el","idx","_d","_e","_f","_g","_h","_i","_j","prevData","prevKeys","keys","key","facetBy","xGroupBy","yGroupBy","xColumn","yColumn","valueColumnSize","valueColumnColor","normalization","NAValueAs","aggregation","chartSettings","keysOrder","facetGroupingValues","column","groupedCellsData","getGroupedCellsData","id","facetSettings","aes","customOrder","v"],"mappings":";;;;;;;;;AASO,MAAMA,UAAoBC,EAAc;AAAA,EAS3C,YAAYC,GAAiBC,GAA0BC,GAAqC;AACxF,UAAMF,GAAMC,CAAQ;AATxB,IAAAE,EAAA;AACA,IAAAA,EAAA;AAEA,IAAAA,EAAA,6BAA2C,MAAA;AAAA;AAC3C,IAAAA,EAAA,wBAEW;AAyJH,IAAAA,EAAA,qBAAc,CAACC,MAA+B;;AAClD,aAAO,KAAK,iBACNC,EAAe,KAAK,MAAMD,GAAM,KAAK,eAAe,iBAAiB,OAAME,KAAAC,KAAAC,IAAA,KAAK,aAAL,gBAAAA,EAAe,kBAAf,gBAAAD,EAA8B,aAA9B,gBAAAD,EAAwC,OAAO,IAC1H,CAAC,mBAAmB;AAAA,IAC9B;AAxJI,SAAK,WAAW,IAAIG,EAAmBR,CAAQ,GAC/C,KAAK,gBAAgB,IAAIS,EAAA,GACrBR,MACA,KAAK,sBAAsBA,EAAc,CAAC;AAAA,EAElD;AAAA,EAEA,MAAMS,GAAmB;AACrB,QAAI;AACA,WAAK,cAAc,KAAKA,CAAI,GAC5B,KAAK,YAAA,GACL,KAAK,aAAA,GACL,KAAK,WAAW;AAAA,IACpB,SAASC,GAAK;AACV,WAAK,WAAW,IACZA,aAAe,UACf,KAAK,cAAc,YAAYA,EAAI,OAAiB,GACpD,QAAQ,MAAMA,CAAG;AAAA,IAEzB;AAAA,EACJ;AAAA,EAEA,UAAU;AACN,SAAK,cAAc,MAAA;AAAA,EACvB;AAAA,EAE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;;AACX,QAAI,CAAC,KAAK;AACN;AAEJ,UAAM,EAAC,IAAAE,GAAI,eAAAN,GAAe,eAAAO,GAAe,kBAAAX,GAAkB,iBAAAD,GAAiB,eAAAE,GAAe,KAAAW,GAAK,WAAAP,GAAW,SAAAR,GAAS,SAAAC,GAAS,UAAAH,GAAU,UAAAC,EAAA,IAAY,KAAK,UAClJiB,IAAc;AAAA,MAChB,KAAG3C,IAAAmC,EAAUR,EAAQ,KAAK,MAAvB,gBAAA3B,EAA0B,UAAS;AAAA,MACtC,KAAGD,IAAAoC,EAAUP,EAAQ,KAAK,MAAvB,gBAAA7B,EAA0B,UAAS;AAAA,MACtC,QAAQ0B,EAAS,KAAK,CAACmB,MAAA;;AAAM,iBAAA5C,IAAAmC,EAAUS,EAAE,KAAK,MAAjB,gBAAA5C,EAAoB,UAAS;AAAA,OAAC;AAAA,MAC3D,QAAQ0B,EAAS,KAAK,CAACkB,MAAA;;AAAM,iBAAA5C,IAAAmC,EAAUS,EAAE,KAAK,MAAjB,gBAAA5C,EAAoB,UAAS;AAAA,OAAC;AAAA,IAAA;AAE/D,SAAK,cAAc;AAAA,MACf,KAAK;AAAA,MACLwC;AAAA,MACAN;AAAA,MACAO;AAAA,MACA,KAAK,eAAe;AAAA,MACpBX;AAAA,MACAD;AAAA,MACAE;AAAA,MACAW;AAAA,MACA,KAAK;AAAA,MACL,KAAK;AAAA,MACLC;AAAA,IAAA;AAAA,EAER;AAOJ;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';
|
|
2
2
|
import { LabelAngles } from '../components/types';
|
|
3
|
-
import {
|
|
3
|
+
import { GroupedCellsBubble } from '../getGroupedCellsData';
|
|
4
4
|
export declare function calculateCaptionTails(labelAngles: LabelAngles, steps: {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
|
-
}, groupedCells:
|
|
7
|
+
}, groupedCells: GroupedCellsBubble, textMeasurer: TextMeasurer): {
|
|
8
8
|
xCaptionTail: number;
|
|
9
9
|
yCaptionTail: number;
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateCaptionTails.d.ts","sourceRoot":"","sources":["../../../src/bubble/utils/calculateCaptionTails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"calculateCaptionTails.d.ts","sourceRoot":"","sources":["../../../src/bubble/utils/calculateCaptionTails.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,wBAAgB,qBAAqB,CACjC,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;CAAC,EAC9B,YAAY,EAAE,kBAAkB,EAChC,YAAY,EAAE,YAAY,GAC3B;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAsC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculateCaptionTails.js","sources":["../../../src/bubble/utils/calculateCaptionTails.ts"],"sourcesContent":["import type { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';\nimport type { LabelAngles } from '../components/types';\nimport { MIN_STEP_FOR_VISIBLE_LABELS } from '../constants';\nimport type {
|
|
1
|
+
{"version":3,"file":"calculateCaptionTails.js","sources":["../../../src/bubble/utils/calculateCaptionTails.ts"],"sourcesContent":["import type { TextMeasurer } from '../../utils/TextMeasurer/TextMeasurer';\nimport type { LabelAngles } from '../components/types';\nimport { MIN_STEP_FOR_VISIBLE_LABELS } from '../constants';\nimport type { GroupedCellsBubble } from '../getGroupedCellsData';\n\nexport function calculateCaptionTails(\n labelAngles: LabelAngles,\n steps: {x: number; y: number;},\n groupedCells: GroupedCellsBubble,\n textMeasurer: TextMeasurer\n): {xCaptionTail: number; yCaptionTail: number} {\n const {xLabels, yLabels} = groupedCells.meta;\n const xLabelAngle = (labelAngles.xAxisLabels / 180) * Math.PI;\n const yLabelAngle = (labelAngles.yAxisLabels / 180) * Math.PI;\n let xCaptionTail = 0;\n let yCaptionTail = 0;\n // tails from 45deg inclined captions of groups titles/cells labels, that take place on adjacent padding\n const xLabelsInclined = labelAngles.xAxisLabels === 45;\n if (xLabelsInclined) {\n const xKeys = groupedCells.meta.xKeys;\n const step = steps.x;\n const labelsVisible = step > MIN_STEP_FOR_VISIBLE_LABELS;\n const firstLabel = xLabels[xKeys[0]];\n xCaptionTail = Math.max(\n xCaptionTail,\n (xLabelsInclined && labelsVisible\n ? textMeasurer.getTextWidth(firstLabel) * Math.cos(xLabelAngle)\n : 0) -\n step / 2\n );\n }\n const yLabelsInclined = labelAngles.yAxisLabels === 45;\n if (yLabelsInclined) {\n const yKeys = groupedCells.meta.yKeys;\n if (yKeys.length) {\n const step = steps.y;\n const labelsVisible = step > MIN_STEP_FOR_VISIBLE_LABELS;\n const lastLabel = yLabels[yKeys[yKeys.length - 1]];\n yCaptionTail = Math.max(\n yCaptionTail,\n (yLabelsInclined && labelsVisible\n ? textMeasurer.getTextWidth(lastLabel) * Math.cos(yLabelAngle)\n : 0) -\n step / 2\n );\n }\n }\n return {xCaptionTail, yCaptionTail};\n}\n"],"names":["calculateCaptionTails","labelAngles","steps","groupedCells","textMeasurer","xLabels","yLabels","xLabelAngle","yLabelAngle","xCaptionTail","yCaptionTail","xLabelsInclined","xKeys","step","labelsVisible","MIN_STEP_FOR_VISIBLE_LABELS","firstLabel","yLabelsInclined","yKeys","lastLabel"],"mappings":";AAKO,SAASA,EACZC,GACAC,GACAC,GACAC,GAC4C;AAC5C,QAAM,EAAC,SAAAC,GAAS,SAAAC,EAAA,IAAWH,EAAa,MAClCI,IAAeN,EAAY,cAAc,MAAO,KAAK,IACrDO,IAAeP,EAAY,cAAc,MAAO,KAAK;AAC3D,MAAIQ,IAAe,GACfC,IAAe;AAEnB,QAAMC,IAAkBV,EAAY,gBAAgB;AACpD,MAAIU,GAAiB;AACjB,UAAMC,IAAQT,EAAa,KAAK,OAC1BU,IAAOX,EAAM,GACbY,IAAgBD,IAAOE,GACvBC,IAAaX,EAAQO,EAAM,CAAC,CAAC;AACnC,IAAAH,IAAe,KAAK;AAAA,MAChBA;AAAA,OACCE,KAAmBG,IACdV,EAAa,aAAaY,CAAU,IAAI,KAAK,IAAIT,CAAW,IAC5D,KACFM,IAAO;AAAA,IAAA;AAAA,EAEnB;AACA,QAAMI,IAAkBhB,EAAY,gBAAgB;AACpD,MAAIgB,GAAiB;AACjB,UAAMC,IAAQf,EAAa,KAAK;AAChC,QAAIe,EAAM,QAAQ;AACd,YAAML,IAAOX,EAAM,GACbY,IAAgBD,IAAOE,GACvBI,IAAYb,EAAQY,EAAMA,EAAM,SAAS,CAAC,CAAC;AACjD,MAAAR,IAAe,KAAK;AAAA,QAChBA;AAAA,SACCO,KAAmBH,IACdV,EAAa,aAAae,CAAS,IAAI,KAAK,IAAIX,CAAW,IAC3D,KACNK,IAAO;AAAA,MAAA;AAAA,IAEf;AAAA,EACJ;AACA,SAAO,EAAC,cAAAJ,GAAc,cAAAC,EAAA;AAC1B;"}
|
|
@@ -5,7 +5,7 @@ import { LegendData } from '../common/types';
|
|
|
5
5
|
import { DataFrame } from '../DataFrame';
|
|
6
6
|
import { ColumnName, DataValue } from '../types';
|
|
7
7
|
import { AnnotationColorScales, CaptionsSizes, ChartDendrograms, ChartDimensionsData, ChartSizes, ChartsScales, DendrogramAesScales, LabelAngles, Margins } from './components/types';
|
|
8
|
-
import {
|
|
8
|
+
import { GroupedCellsHeatmap } from './getCells';
|
|
9
9
|
import { DendrogramsData } from './getDendrograms';
|
|
10
10
|
import { HeatmapSettingsImpl } from './HeatmapSettingsImpl';
|
|
11
11
|
declare class ChartRenderer {
|
|
@@ -34,19 +34,19 @@ declare class ChartRenderer {
|
|
|
34
34
|
init(node: HTMLElement): void;
|
|
35
35
|
updateMargins(title: HeatmapSettingsImpl['chartSettings']['title'], size: HeatmapSettingsImpl['chartSettings']['size']): void;
|
|
36
36
|
updateLegendSize(valueType: HeatmapSettingsImpl['chartSettings']['valueType'], legend: HeatmapSettingsImpl['chartSettings']['legend'], annotations: HeatmapSettingsImpl['annotations'], columnValue: ColumnName, valueExtent: [number, number]): void;
|
|
37
|
-
updateCaptionsSize(groupedCells:
|
|
37
|
+
updateCaptionsSize(groupedCells: GroupedCellsHeatmap, xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'], facetSettings: HeatmapSettingsImpl['facetSettings']): void;
|
|
38
38
|
updateChartDimensions(size: HeatmapSettingsImpl['chartSettings']['size'], facetKeys: string[], xGroupKeys: string[], yGroupKeys: string[], facetSettings: HeatmapSettingsImpl['facetSettings'], xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'], annotations: HeatmapSettingsImpl['annotations'], dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY']): void;
|
|
39
|
-
updateChartsSizes(size: HeatmapSettingsImpl['chartSettings']['size'], facetSettings: HeatmapSettingsImpl['facetSettings'], groupedCells:
|
|
40
|
-
updateScales(facetKeys: string[], groupedCells:
|
|
39
|
+
updateChartsSizes(size: HeatmapSettingsImpl['chartSettings']['size'], facetSettings: HeatmapSettingsImpl['facetSettings'], groupedCells: GroupedCellsHeatmap, groupGap: number): void;
|
|
40
|
+
updateScales(facetKeys: string[], groupedCells: GroupedCellsHeatmap, groupGap: number, facetSettings: HeatmapSettingsImpl['facetSettings'], size: HeatmapSettingsImpl['chartSettings']['size'], xAxis: HeatmapSettingsImpl['chartSettings']['xAxis'], yAxis: HeatmapSettingsImpl['chartSettings']['yAxis'], dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY'], customOrder: {
|
|
41
41
|
x: boolean;
|
|
42
42
|
y: boolean;
|
|
43
43
|
xGroup: boolean;
|
|
44
44
|
yGroup: boolean;
|
|
45
45
|
}): void;
|
|
46
|
-
updateAesScale(valueType: 'discrete' | 'continuous', valueExtent: [number, number], aes: HeatmapSettingsImpl['aes'], annotations: HeatmapSettingsImpl['annotations'], groupedCellsData:
|
|
47
|
-
updateDendrogram(facetKeys: string[], xGroupKeys: string[], yGroupKeys: string[], groups:
|
|
46
|
+
updateAesScale(valueType: 'discrete' | 'continuous', valueExtent: [number, number], aes: HeatmapSettingsImpl['aes'], annotations: HeatmapSettingsImpl['annotations'], groupedCellsData: GroupedCellsHeatmap, cellUniqValues: DataValue[], normalization: HeatmapSettingsImpl['normalization']): void;
|
|
47
|
+
updateDendrogram(facetKeys: string[], xGroupKeys: string[], yGroupKeys: string[], groups: GroupedCellsHeatmap['facets'], dendrogramsData: DendrogramsData, dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY']): void;
|
|
48
48
|
updateDendrogramAesScales(inheritedAes: HeatmapSettingsImpl['inheritedDendrogramAes']): void;
|
|
49
|
-
render(dataFrame: DataFrame, settingsId: string, chartSettings: HeatmapSettingsImpl['chartSettings'], facetSettings: HeatmapSettingsImpl['facetSettings'], aes: HeatmapSettingsImpl['aes'], groupedCellsData:
|
|
49
|
+
render(dataFrame: DataFrame, settingsId: string, chartSettings: HeatmapSettingsImpl['chartSettings'], facetSettings: HeatmapSettingsImpl['facetSettings'], aes: HeatmapSettingsImpl['aes'], groupedCellsData: GroupedCellsHeatmap, annotations: HeatmapSettingsImpl['annotations'], valueColumn: ColumnName, dendrogramX: HeatmapSettingsImpl['dendrogramX'], dendrogramY: HeatmapSettingsImpl['dendrogramY'], dendrogramsData: DendrogramsData, inheritedDendrogramAes: HeatmapSettingsImpl['inheritedDendrogramAes'], cellUniqValues: DataValue[], normalization: HeatmapSettingsImpl['normalization'], onTooltipHintSwitch: (v: boolean) => void, customOrder: {
|
|
50
50
|
x: boolean;
|
|
51
51
|
y: boolean;
|
|
52
52
|
xGroup: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartRenderer.d.ts","sourceRoot":"","sources":["../../src/heatmap/ChartRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,iBAAiB,CAAC;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAW,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAM/D,OAAO,KAAK,EACR,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,YAAY,EAEZ,mBAAmB,EACnB,WAAW,EACX,OAAO,EACV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ChartRenderer.d.ts","sourceRoot":"","sources":["../../src/heatmap/ChartRenderer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,K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AAE,eAAe,EAChC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC;IAmDnD,yBAAyB,CAAC,YAAY,EAAE,mBAAmB,CAAC,wBAAwB,CAAC;IAqBrF,MAAM,CACF,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,EACnD,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,EACnD,GAAG,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAC/B,gBAAgB,EAAE,mBAAmB,EACrC,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,UAAU,EACvB,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,eAAe,EAAE,eAAe,EAChC,sBAAsB,EAAE,mBAAmB,CAAC,wBAAwB,CAAC,EACrE,cAAc,EAAE,SAAS,EAAE,EAC3B,aAAa,EAAE,mBAAmB,CAAC,eAAe,CAAC,EACnD,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,EACzC,WAAW,EAAE;QAAC,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAC,EACvE,kBAAkB,EAAE,QAAQ,GAAG,KAAK;IA6DxC,WAAW,CAAC,OAAO,EAAE,MAAM;CAG9B;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -379,7 +379,7 @@ class Jt {
|
|
|
379
379
|
render(e, s, t, r, i, a, h, u, x, p, d, A, l, c, o, n, f) {
|
|
380
380
|
var B;
|
|
381
381
|
const { meta: S, facets: T } = a, { facetKeys: y, xGroupKeys: g, yGroupKeys: b, valueExtent: C } = S, { xAxis: z, yAxis: w, title: v, size: N, valueType: M } = t;
|
|
382
|
-
this.updateChartsSizes(N, r, a, i.groupGap), this.updateAesScale(M, C, i, h, a, l, c), this.updateScales(y, a, i.groupGap, r, N, t.xAxis, t.yAxis, x, p, n), this.updateCaptionsSize(a, z, w, r), this.updateChartDimensions(
|
|
382
|
+
this.updateChartsSizes(N, r, a, i.groupGap), this.updateAesScale(M, C.dataSource, i, h, a, l, c), this.updateScales(y, a, i.groupGap, r, N, t.xAxis, t.yAxis, x, p, n), this.updateCaptionsSize(a, z, w, r), this.updateChartDimensions(
|
|
383
383
|
N,
|
|
384
384
|
y,
|
|
385
385
|
g,
|
|
@@ -390,7 +390,7 @@ class Jt {
|
|
|
390
390
|
h,
|
|
391
391
|
x,
|
|
392
392
|
p
|
|
393
|
-
), this.updateLegendSize(M, t.legend, h, u, C), this.updateMargins(v, N), this.updateDendrogram(y, g, b, T, d, x, p), this.updateDendrogramAesScales(A);
|
|
393
|
+
), this.updateLegendSize(M, t.legend, h, u, C.dataSource), this.updateMargins(v, N), this.updateDendrogram(y, g, b, T, d, x, p), this.updateDendrogramAesScales(A);
|
|
394
394
|
const E = /* @__PURE__ */ j.jsx(ht, { dataFrame: e, children: /* @__PURE__ */ j.jsx(
|
|
395
395
|
mt,
|
|
396
396
|
{
|