@milaboratories/miplots4 1.0.150 → 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/discrete/DiscreteSettingsImpl.d.ts +2 -0
- package/dist/discrete/DiscreteSettingsImpl.d.ts.map +1 -1
- package/dist/discrete/DiscreteSettingsImpl.js +21 -19
- package/dist/discrete/DiscreteSettingsImpl.js.map +1 -1
- package/dist/discrete/layers/stackedBar.d.ts.map +1 -1
- package/dist/discrete/layers/stackedBar.js +55 -30
- package/dist/discrete/layers/stackedBar.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/node_modules/d3-array/src/min.js +11 -5
- package/dist/node_modules/d3-array/src/min.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 +30 -8
- package/dist/types/discrete.d.ts.map +1 -1
- package/dist/types/discrete.js +16 -14
- package/dist/types/discrete.js.map +1 -1
- 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":"ChartsGroup.js","sources":["../../../src/heatmap/components/ChartsGroup.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { ChartsTitle } from '../../common/ChartsTitle';\nimport { ErrorBoundary } from '../../common/ErrorBoundary';\nimport fonts from '../../common/fonts';\nimport { Legend } from '../../common/Legend';\nimport { useTooltip } from '../../common/Tooltip';\nimport type { LegendData } from '../../common/types';\nimport { LEGEND_OFFSET } from '../constants';\nimport type {
|
|
1
|
+
{"version":3,"file":"ChartsGroup.js","sources":["../../../src/heatmap/components/ChartsGroup.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport { ChartsTitle } from '../../common/ChartsTitle';\nimport { ErrorBoundary } from '../../common/ErrorBoundary';\nimport fonts from '../../common/fonts';\nimport { Legend } from '../../common/Legend';\nimport { useTooltip } from '../../common/Tooltip';\nimport type { LegendData } from '../../common/types';\nimport { LEGEND_OFFSET } from '../constants';\nimport type { CellHeatmap, GroupedCellsHeatmap } from '../getCells';\nimport type { HeatmapSettingsImpl } from '../HeatmapSettingsImpl';\nimport { Chart } from './Chart';\nimport type {\n AnnotationColorScales, AnnotationTooltipData, CaptionsSizes,\n ChartDendrograms, ChartDimensionsData, ChartSizes, ChartsScales, DendrogramAesScales, LabelAngles, Margins\n} from './types';\n\nexport function ChartsGroup({\n margins,\n captionsSizes,\n settingsId,\n chartSettings,\n chartSizes,\n chartsDimensions,\n facetKeys,\n facetSettings,\n xGroupKeys,\n yGroupKeys,\n scales,\n colorScale,\n groupedCells,\n cellsMeta,\n step,\n annotations,\n annotationColorScales,\n legend,\n aes,\n dendrograms,\n dendrogramAesScales,\n columnsCount,\n labelAngles,\n onTooltipHintSwitch,\n cellsRenderingMode\n}: {\n margins: Margins;\n captionsSizes: CaptionsSizes;\n chartSettings: HeatmapSettingsImpl['chartSettings'];\n facetSettings: HeatmapSettingsImpl['facetSettings'];\n chartSizes: ChartSizes;\n chartsDimensions: Record<string, ChartDimensionsData>;\n scales: ChartsScales;\n facetKeys: string[];\n xGroupKeys: string[];\n yGroupKeys: string[];\n settingsId: string;\n colorScale: (value:unknown) => string;\n annotationColorScales: AnnotationColorScales;\n groupedCells: GroupedCellsHeatmap['facets'];\n cellsMeta: GroupedCellsHeatmap['meta'];\n annotations: HeatmapSettingsImpl['annotations'];\n step: {\n x: Record<string, number>;\n y: Record<string, number>;\n };\n legend: LegendData;\n aes: HeatmapSettingsImpl['aes'];\n dendrograms: Record<string, ChartDendrograms>;\n dendrogramAesScales: DendrogramAesScales;\n columnsCount: number;\n labelAngles: LabelAngles;\n onTooltipHintSwitch: (v:boolean) => void;\n cellsRenderingMode: 'svg' | 'canvas'\n}) {\n const [tooltipsContainer, setTooltipsContainer] = useState<SVGGElement>();\n const tooltipsData = useTooltip<CellHeatmap|AnnotationTooltipData>(onTooltipHintSwitch);\n const tooltipsRef = useRef<SVGGElement>(null);\n useEffect(() => {\n if (tooltipsRef.current) {\n setTooltipsContainer(tooltipsRef.current);\n }\n }, []);\n\n const leftTopChartPadding = chartsDimensions[facetKeys[0]].padding;\n const rightTopChartPadding = chartsDimensions[facetKeys[columnsCount - 1]].padding;\n\n const legendLeft = margins.left + chartSizes.chartsWidth + LEGEND_OFFSET;\n const legendTop = margins.top + leftTopChartPadding.top;\n\n return (\n <ErrorBoundary dataId={settingsId}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={`0 0 ${chartSizes.totalWidth} ${chartSizes.totalHeight}`}\n width={chartSizes.totalWidth}\n height={chartSizes.totalHeight}\n fontFamily=\"Manrope\"\n >\n <defs>{fonts}</defs>\n <g transform={`translate(${margins.left},${margins.top})`}>\n <ChartsTitle\n title={[chartSettings.title.name]}\n show={chartSettings.title.show}\n position={chartSettings.title.position}\n leftPadding={leftTopChartPadding.left}\n rightPadding={rightTopChartPadding.right}\n chartsWidth={chartSizes.chartsWidth}\n />\n {facetKeys.map(facetKey => {\n const {cells, xKeysByGroups, yKeysByGroups} = groupedCells[facetKey];\n return (\n <Chart\n dendrograms={dendrograms[facetKey]}\n captionsSizes={captionsSizes}\n key={facetKey}\n facetKey={facetKey}\n dimensions={chartsDimensions[facetKey]}\n xGroupKeys={xGroupKeys}\n yGroupKeys={yGroupKeys}\n xKeysByGroups={facetSettings.sharedX ? cellsMeta.xKeysByGroups : xKeysByGroups}\n yKeysByGroups={facetSettings.sharedY ? cellsMeta.yKeysByGroups : yKeysByGroups}\n sharedX={facetSettings.sharedX}\n sharedY={facetSettings.sharedY}\n scales={{x: scales.x[facetKey], y: scales.y[facetKey]}}\n cells={cells}\n cellsMeta={cellsMeta}\n stepX={step.x[facetKey]}\n stepY={step.y[facetKey]}\n colorScale={colorScale}\n chartSettings={chartSettings}\n aes={aes}\n annotations={annotations}\n annotationColorScales={annotationColorScales}\n dendrogramAesScales={dendrogramAesScales}\n labelAngles={labelAngles}\n margins={margins}\n chartSizes={chartSizes}\n tooltipsContainer={tooltipsContainer}\n tooltipsData={tooltipsData}\n cellsRenderingMode={cellsRenderingMode}\n />\n );\n })}\n </g>\n <g transform={`translate(${legendLeft},${legendTop})`}>\n <Legend legendData={legend} />\n </g>\n <g ref={tooltipsRef} style={{outline: 'none'}} />\n </svg>\n </ErrorBoundary>\n );\n}\n"],"names":["ChartsGroup","margins","captionsSizes","settingsId","chartSettings","chartSizes","chartsDimensions","facetKeys","facetSettings","xGroupKeys","yGroupKeys","scales","colorScale","groupedCells","cellsMeta","step","annotations","annotationColorScales","legend","aes","dendrograms","dendrogramAesScales","columnsCount","labelAngles","onTooltipHintSwitch","cellsRenderingMode","tooltipsContainer","setTooltipsContainer","useState","tooltipsData","useTooltip","tooltipsRef","useRef","useEffect","leftTopChartPadding","rightTopChartPadding","legendLeft","LEGEND_OFFSET","legendTop","jsx","ErrorBoundary","jsxs","fonts","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AAH;AAAA,gBACA,uBAAAC;AAAA,gBACA,qBAAAI;AAAA,gBACA,aAAAE;AAAA,gBACA,SAAAtB;AAAA,gBACA,YAAAI;AAAA,gBACA,mBAAAqB;AAAA,gBACA,cAAAG;AAAA,gBACA,oBAAAJ;AAAA,cAAA;AAAA,cAzBKmB;AAAA,YAAA;AAAA,UA4BjB,CAAC;AAAA,QAAA,GACL;AAAA,QACAL,gBAAAA,EAAAA,IAAC,KAAA,EAAE,WAAW,aAAaH,CAAU,IAAIE,CAAS,KAC9C,UAAAC,gBAAAA,EAAAA,IAACU,GAAA,EAAO,YAAY/B,EAAA,CAAQ,GAChC;AAAA,QACAqB,gBAAAA,MAAC,OAAE,KAAKR,GAAa,OAAO,EAAC,SAAS,SAAM,CAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEvD;AAER;"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellHeatmap, GroupedCellsHeatmap } from '../getCells';
|
|
2
2
|
import { AnnotationTooltipData, ChartScales } from './types';
|
|
3
3
|
import { TooltipsData } from '../../common/Tooltip';
|
|
4
4
|
import { HeatmapSettingsImpl } from '../HeatmapSettingsImpl';
|
|
5
5
|
interface SvgCellsProps<T> {
|
|
6
6
|
facetKey: string;
|
|
7
7
|
scales: ChartScales;
|
|
8
|
-
cells:
|
|
8
|
+
cells: GroupedCellsHeatmap['facets'][keyof GroupedCellsHeatmap['facets']]['cells'];
|
|
9
9
|
xKeys: string[];
|
|
10
10
|
yKeys: string[];
|
|
11
11
|
stepX: number;
|
|
12
12
|
stepY: number;
|
|
13
13
|
aes: HeatmapSettingsImpl['aes'];
|
|
14
14
|
colorScale: (value: T) => string;
|
|
15
|
-
tooltipsData: TooltipsData<
|
|
15
|
+
tooltipsData: TooltipsData<CellHeatmap | AnnotationTooltipData>;
|
|
16
16
|
}
|
|
17
17
|
export declare function SvgCells<ValueType>({ facetKey, scales, cells, xKeys, yKeys, stepX, stepY, aes, colorScale, tooltipsData, }: SvgCellsProps<ValueType>): (import("react/jsx-runtime").JSX.Element | null)[][];
|
|
18
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgCells.d.ts","sourceRoot":"","sources":["../../../src/heatmap/components/SvgCells.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SvgCells.d.ts","sourceRoot":"","sources":["../../../src/heatmap/components/SvgCells.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,UAAU,aAAa,CAAC,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IACnF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAChC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC,WAAW,GAAG,qBAAqB,CAAC,CAAC;CACnE;AAED,wBAAgB,QAAQ,CAAC,SAAS,EAAE,EAChC,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,UAAU,EACV,YAAY,GACf,EAAE,aAAa,CAAC,SAAS,CAAC,wDAmB1B"}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
function
|
|
3
|
-
facetKey:
|
|
1
|
+
import { j as C } from "../../node_modules/react/jsx-runtime.js";
|
|
2
|
+
function S({
|
|
3
|
+
facetKey: i,
|
|
4
4
|
scales: r,
|
|
5
5
|
cells: e,
|
|
6
|
-
xKeys:
|
|
7
|
-
yKeys:
|
|
8
|
-
stepX:
|
|
9
|
-
stepY:
|
|
6
|
+
xKeys: m,
|
|
7
|
+
yKeys: d,
|
|
8
|
+
stepX: p,
|
|
9
|
+
stepY: v,
|
|
10
10
|
aes: n,
|
|
11
|
-
colorScale:
|
|
11
|
+
colorScale: x,
|
|
12
12
|
tooltipsData: t
|
|
13
13
|
}) {
|
|
14
|
-
return
|
|
15
|
-
(u) =>
|
|
16
|
-
var
|
|
17
|
-
const o = (
|
|
18
|
-
return o ? /* @__PURE__ */
|
|
14
|
+
return m.map(
|
|
15
|
+
(u) => d.map((l) => {
|
|
16
|
+
var a;
|
|
17
|
+
const o = (a = e == null ? void 0 : e[u]) == null ? void 0 : a[l];
|
|
18
|
+
return o ? /* @__PURE__ */ C.jsx(
|
|
19
19
|
"rect",
|
|
20
20
|
{
|
|
21
21
|
x: r.x(u),
|
|
22
22
|
y: r.y(l),
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
23
|
+
width: p,
|
|
24
|
+
height: v,
|
|
25
25
|
stroke: n.cellStrokeColor,
|
|
26
|
-
fill: o.value === null ? n.emptyCellColor :
|
|
27
|
-
onMouseOver: () => t.onMouseEnter(o,
|
|
26
|
+
fill: o.value.dataSource === null ? n.emptyCellColor : x(o.normalizedValue.dataSource),
|
|
27
|
+
onMouseOver: () => t.onMouseEnter(o, i),
|
|
28
28
|
onMouseLeave: () => t.onMouseLeave()
|
|
29
29
|
},
|
|
30
30
|
o.id
|
|
@@ -33,6 +33,6 @@ function f({
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
S as SvgCells
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=SvgCells.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgCells.js","sources":["../../../src/heatmap/components/SvgCells.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"SvgCells.js","sources":["../../../src/heatmap/components/SvgCells.tsx"],"sourcesContent":["import type { CellHeatmap, GroupedCellsHeatmap } from '../getCells';\nimport type { AnnotationTooltipData, ChartScales } from './types';\nimport type { TooltipsData } from '../../common/Tooltip';\nimport type { HeatmapSettingsImpl } from '../HeatmapSettingsImpl';\n\ninterface SvgCellsProps<T> {\n facetKey: string,\n scales: ChartScales,\n cells: GroupedCellsHeatmap['facets'][keyof GroupedCellsHeatmap['facets']]['cells'],\n xKeys: string[],\n yKeys: string[],\n stepX: number,\n stepY: number,\n aes: HeatmapSettingsImpl['aes'];\n colorScale: (value: T) => string,\n tooltipsData: TooltipsData<CellHeatmap | AnnotationTooltipData>;\n}\n\nexport function SvgCells<ValueType>({\n facetKey,\n scales,\n cells,\n xKeys,\n yKeys,\n stepX,\n stepY,\n aes,\n colorScale,\n tooltipsData,\n}: SvgCellsProps<ValueType>) {\n return xKeys.map(xKey =>\n yKeys.map(yKey => {\n const cell = cells?.[xKey]?.[yKey];\n return cell ? (\n <rect\n key={cell.id}\n x={scales.x(xKey)}\n y={scales.y(yKey)}\n width={stepX}\n height={stepY}\n stroke={aes.cellStrokeColor}\n fill={cell.value.dataSource === null ? aes.emptyCellColor : colorScale(cell.normalizedValue.dataSource as ValueType)}\n onMouseOver={() => tooltipsData.onMouseEnter(cell, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n />\n ) : null;\n })\n );\n}"],"names":["SvgCells","facetKey","scales","cells","xKeys","yKeys","stepX","stepY","aes","colorScale","tooltipsData","xKey","yKey","cell","_a","jsx"],"mappings":";AAkBO,SAASA,EAAoB;AAAA,EAChC,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,KAAAC;AAAA,EACA,YAAAC;AAAA,EACA,cAAAC;AACJ,GAA6B;AACzB,SAAON,EAAM;AAAA,IAAI,CAAAO,MACbN,EAAM,IAAI,CAAAO,MAAQ;;AACd,YAAMC,KAAOC,IAAAX,KAAA,gBAAAA,EAAQQ,OAAR,gBAAAG,EAAgBF;AAC7B,aAAOC,IACHE,gBAAAA,EAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UAEG,GAAGb,EAAO,EAAES,CAAI;AAAA,UAChB,GAAGT,EAAO,EAAEU,CAAI;AAAA,UAChB,OAAON;AAAA,UACP,QAAQC;AAAA,UACR,QAAQC,EAAI;AAAA,UACZ,MAAMK,EAAK,MAAM,eAAe,OAAOL,EAAI,iBAAiBC,EAAWI,EAAK,gBAAgB,UAAuB;AAAA,UACnH,aAAa,MAAMH,EAAa,aAAaG,GAAMZ,CAAQ;AAAA,UAC3D,cAAc,MAAMS,EAAa,aAAA;AAAA,QAAa;AAAA,QARzCG,EAAK;AAAA,MAAA,IAUd;AAAA,IACR,CAAC;AAAA,EAAA;AAET;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DataFrame } from '../../DataFrame';
|
|
2
2
|
import { ColumnName, DataValue } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { CellHeatmap, GroupedCellsHeatmap } from '../getCells';
|
|
4
4
|
import { AnnotationTooltipData } from './types';
|
|
5
5
|
export declare function formatCellValue(v: DataValue, format?: string): number | string;
|
|
6
|
-
export declare function getTooltipContent(dataFrame: DataFrame, cell:
|
|
7
|
-
export declare function getAnnotationTooltipContent(data: AnnotationTooltipData, cellsMeta:
|
|
8
|
-
export declare function isAnnotationTooltip(d:
|
|
9
|
-
export declare function isCellTooltip(d:
|
|
6
|
+
export declare function getTooltipContent(dataFrame: DataFrame, cell: CellHeatmap, cellsMeta: GroupedCellsHeatmap['meta'], columnsList?: ColumnName[]): string[];
|
|
7
|
+
export declare function getAnnotationTooltipContent(data: AnnotationTooltipData, cellsMeta: GroupedCellsHeatmap['meta']): string[];
|
|
8
|
+
export declare function isAnnotationTooltip(d: CellHeatmap | AnnotationTooltipData | null): d is AnnotationTooltipData;
|
|
9
|
+
export declare function isCellTooltip(d: CellHeatmap | AnnotationTooltipData | null): d is CellHeatmap;
|
|
10
10
|
//# sourceMappingURL=tooltipUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltipUtils.d.ts","sourceRoot":"","sources":["../../../src/heatmap/components/tooltipUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tooltipUtils.d.ts","sourceRoot":"","sources":["../../../src/heatmap/components/tooltipUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAa9E;AACD,wBAAgB,iBAAiB,CAC7B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,WAAW,EACjB,SAAS,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACtC,WAAW,GAAE,UAAU,EAAO,YAejC;AACD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,mBAAmB,CAAC,MAAM,CAAC,YAU9G;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,WAAW,GAAG,qBAAqB,GAAG,IAAI,GAAG,CAAC,IAAI,qBAAqB,CAE7G;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,WAAW,GAAG,qBAAqB,GAAG,IAAI,GAAG,CAAC,IAAI,WAAW,CAE7F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { format as s } from "../../node_modules/d3-format/src/defaultLocale.js";
|
|
2
|
-
function
|
|
2
|
+
function u(n, o) {
|
|
3
3
|
if (n === null)
|
|
4
4
|
return "null";
|
|
5
5
|
if (typeof n == "number") {
|
|
@@ -11,14 +11,14 @@ function l(n, o) {
|
|
|
11
11
|
return n;
|
|
12
12
|
}
|
|
13
13
|
function c(n, o, e, t = []) {
|
|
14
|
-
const i = `${
|
|
14
|
+
const i = `${u(o.value.dataSource)}${o.value !== o.normalizedValue ? ` (${u(o.normalizedValue.dataSource)})` : ""}`;
|
|
15
15
|
if (t.length) {
|
|
16
16
|
const r = [
|
|
17
17
|
`Value: ${i}`
|
|
18
18
|
];
|
|
19
|
-
for (const
|
|
20
|
-
const f = n.getColumnValue(
|
|
21
|
-
r.push(`${
|
|
19
|
+
for (const l of t) {
|
|
20
|
+
const f = n.getColumnValue(l.value, o.idx);
|
|
21
|
+
r.push(`${l.label}: ${u(f, l.format)}`);
|
|
22
22
|
}
|
|
23
23
|
return r;
|
|
24
24
|
}
|
|
@@ -26,7 +26,7 @@ function c(n, o, e, t = []) {
|
|
|
26
26
|
}
|
|
27
27
|
function m(n, o) {
|
|
28
28
|
const e = [];
|
|
29
|
-
return n.xKey && e.push(`X: ${o.xLabels[n.xKey]}`), n.yKey && e.push(`Y: ${o.yLabels[n.yKey]}`), e.push(`${n.title}: ${
|
|
29
|
+
return n.xKey && e.push(`X: ${o.xLabels[n.xKey]}`), n.yKey && e.push(`Y: ${o.yLabels[n.yKey]}`), e.push(`${n.title}: ${u(n.value, n.column.format)}`), e;
|
|
30
30
|
}
|
|
31
31
|
function p(n) {
|
|
32
32
|
return n !== null && "isAnnotation" in n;
|
|
@@ -35,7 +35,7 @@ function $(n) {
|
|
|
35
35
|
return n !== null && "isCell" in n;
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
u as formatCellValue,
|
|
39
39
|
m as getAnnotationTooltipContent,
|
|
40
40
|
c as getTooltipContent,
|
|
41
41
|
p as isAnnotationTooltip,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltipUtils.js","sources":["../../../src/heatmap/components/tooltipUtils.ts"],"sourcesContent":["import { format as d3format } from 'd3-format';\nimport type { DataFrame } from '../../DataFrame';\nimport type { ColumnName, DataValue } from '../../types';\nimport type {
|
|
1
|
+
{"version":3,"file":"tooltipUtils.js","sources":["../../../src/heatmap/components/tooltipUtils.ts"],"sourcesContent":["import { format as d3format } from 'd3-format';\nimport type { DataFrame } from '../../DataFrame';\nimport type { ColumnName, DataValue } from '../../types';\nimport type { CellHeatmap, GroupedCellsHeatmap } from '../getCells';\nimport type { AnnotationTooltipData } from './types';\n\nexport function formatCellValue(v: DataValue, format?: string): number | string {\n if (v === null) {\n return 'null';\n }\n if (typeof v === 'number') {\n if (format) {\n return d3format(format)(v);\n }\n const whole = v > 0 ? Math.floor(v) : Math.ceil(v);\n const decimal = v - whole;\n return whole + Number(decimal.toPrecision(2));\n }\n return v;\n}\nexport function getTooltipContent(\n dataFrame: DataFrame,\n cell: CellHeatmap,\n cellsMeta: GroupedCellsHeatmap['meta'],\n columnsList: ColumnName[] = []\n) {\n const value = `${formatCellValue(cell.value.dataSource)}${cell.value !== cell.normalizedValue ? ` (${formatCellValue(cell.normalizedValue.dataSource)})` : ''}`;\n if (columnsList.length) {\n const lines = [\n `Value: ${value}`,\n ];\n for (const column of columnsList) {\n const value = dataFrame.getColumnValue(column.value, cell.idx);\n lines.push(`${column.label}: ${formatCellValue(value, column.format)}`);\n }\n return lines;\n }\n\n return [value];\n}\nexport function getAnnotationTooltipContent(data: AnnotationTooltipData, cellsMeta: GroupedCellsHeatmap['meta']) {\n const lines: string[] = [];\n if (data.xKey) {\n lines.push(`X: ${cellsMeta.xLabels[data.xKey as string]}`);\n }\n if (data.yKey) {\n lines.push(`Y: ${cellsMeta.yLabels[data.yKey as string]}`);\n }\n lines.push(`${data.title}: ${formatCellValue(data.value, data.column.format)}`);\n return lines;\n}\n\nexport function isAnnotationTooltip(d: CellHeatmap | AnnotationTooltipData | null): d is AnnotationTooltipData {\n return d !== null && 'isAnnotation' in d;\n}\n\nexport function isCellTooltip(d: CellHeatmap | AnnotationTooltipData | null): d is CellHeatmap {\n return d !== null && 'isCell' in d;\n}\n"],"names":["formatCellValue","v","format","d3format","whole","decimal","getTooltipContent","dataFrame","cell","cellsMeta","columnsList","value","lines","column","getAnnotationTooltipContent","data","isAnnotationTooltip","d","isCellTooltip"],"mappings":";AAMO,SAASA,EAAgBC,GAAcC,GAAkC;AAC5E,MAAID,MAAM;AACN,WAAO;AAEX,MAAI,OAAOA,KAAM,UAAU;AACvB,QAAIC;AACA,aAAOC,EAASD,CAAM,EAAED,CAAC;AAE7B,UAAMG,IAAQH,IAAI,IAAI,KAAK,MAAMA,CAAC,IAAI,KAAK,KAAKA,CAAC,GAC3CI,IAAUJ,IAAIG;AACpB,WAAOA,IAAQ,OAAOC,EAAQ,YAAY,CAAC,CAAC;AAAA,EAChD;AACA,SAAOJ;AACX;AACO,SAASK,EACZC,GACAC,GACAC,GACAC,IAA4B,CAAA,GAC9B;AACE,QAAMC,IAAQ,GAAGX,EAAgBQ,EAAK,MAAM,UAAU,CAAC,GAAGA,EAAK,UAAUA,EAAK,kBAAkB,KAAKR,EAAgBQ,EAAK,gBAAgB,UAAU,CAAC,MAAM,EAAE;AAC7J,MAAIE,EAAY,QAAQ;AACpB,UAAME,IAAQ;AAAA,MACV,UAAUD,CAAK;AAAA,IAAA;AAEnB,eAAWE,KAAUH,GAAa;AAC9B,YAAMC,IAAQJ,EAAU,eAAeM,EAAO,OAAOL,EAAK,GAAG;AAC7D,MAAAI,EAAM,KAAK,GAAGC,EAAO,KAAK,KAAKb,EAAgBW,GAAOE,EAAO,MAAM,CAAC,EAAE;AAAA,IAC1E;AACA,WAAOD;AAAA,EACX;AAEA,SAAO,CAACD,CAAK;AACjB;AACO,SAASG,EAA4BC,GAA6BN,GAAwC;AAC7G,QAAMG,IAAkB,CAAA;AACxB,SAAIG,EAAK,QACLH,EAAM,KAAK,MAAMH,EAAU,QAAQM,EAAK,IAAc,CAAC,EAAE,GAEzDA,EAAK,QACLH,EAAM,KAAK,MAAMH,EAAU,QAAQM,EAAK,IAAc,CAAC,EAAE,GAE7DH,EAAM,KAAK,GAAGG,EAAK,KAAK,KAAKf,EAAgBe,EAAK,OAAOA,EAAK,OAAO,MAAM,CAAC,EAAE,GACvEH;AACX;AAEO,SAASI,EAAoBC,GAA2E;AAC3G,SAAOA,MAAM,QAAQ,kBAAkBA;AAC3C;AAEO,SAASC,EAAcD,GAAiE;AAC3F,SAAOA,MAAM,QAAQ,YAAYA;AACrC;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DataFrame } from '../DataFrame';
|
|
2
|
+
import { ColumnName, DataValue } from '../types';
|
|
3
|
+
import { HeatmapSettingsImpl } from './HeatmapSettingsImpl';
|
|
4
|
+
import { BubbleSettingsImpl } from '../bubble/BubbleSettingsImpl';
|
|
5
|
+
export type Cell<T extends string> = {
|
|
6
|
+
isCell: true;
|
|
7
|
+
idx: number;
|
|
8
|
+
id: string;
|
|
9
|
+
value: Record<T, DataValue>;
|
|
10
|
+
normalizedValue: Record<T, DataValue>;
|
|
11
|
+
x: DataValue;
|
|
12
|
+
y: DataValue;
|
|
13
|
+
};
|
|
14
|
+
export type GroupedCellsData<T extends string> = {
|
|
15
|
+
meta: {
|
|
16
|
+
valueSources: T[];
|
|
17
|
+
facetKeys: string[];
|
|
18
|
+
xGroupKeys: string[];
|
|
19
|
+
yGroupKeys: string[];
|
|
20
|
+
xKeys: string[];
|
|
21
|
+
yKeys: string[];
|
|
22
|
+
xKeysByGroups: Record<string, string[]>;
|
|
23
|
+
yKeysByGroups: Record<string, string[]>;
|
|
24
|
+
facetKeyValues: Record<string, string[]>;
|
|
25
|
+
xGroupKeyValues: Record<string, string[]>;
|
|
26
|
+
yGroupKeyValues: Record<string, string[]>;
|
|
27
|
+
xLabels: Record<string, string>;
|
|
28
|
+
yLabels: Record<string, string>;
|
|
29
|
+
xGroupLabels: Record<string, string>;
|
|
30
|
+
yGroupLabels: Record<string, string>;
|
|
31
|
+
valueExtent: Record<T, [number, number]>;
|
|
32
|
+
xDataByKeys: Record<string, Record<string, DataValue>>;
|
|
33
|
+
yDataByKeys: Record<string, Record<string, DataValue>>;
|
|
34
|
+
};
|
|
35
|
+
facets: Record<string, {
|
|
36
|
+
xKeys: string[];
|
|
37
|
+
yKeys: string[];
|
|
38
|
+
xKeysByGroups: Record<string, string[]>;
|
|
39
|
+
yKeysByGroups: Record<string, string[]>;
|
|
40
|
+
cells: Record<string, Record<string, Cell<T>>>;
|
|
41
|
+
}>;
|
|
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[], 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>;
|
|
45
|
+
//# sourceMappingURL=fillCellsData.d.ts.map
|
|
@@ -0,0 +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;AAEvE,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,CAAC;QACxC,aAAa,EAAE,MAAM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,CAAC,EAC3B,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,UAAU,EACnB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACxC,OAAO,EAAE,UAAU,EAAE,EACrB,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,EAAE,UAAU,EAAE,EACtB,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,EAC/C,qBAAqB,EAAE,MAAM,CAAC,CAAC,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,EAAE,2CAA2C;AACnH,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,EAC3C,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,EAC3C,KAAK,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EACnG,KAAK,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,EACnG,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,uBA+MlD"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import G from "../node_modules/lodash/lodash.js";
|
|
2
|
+
import { exhaustive as ae } from "../utils/index.js";
|
|
3
|
+
import { getFacetOrGroupKey as N } from "../utils/getFacetOrGroupKey.js";
|
|
4
|
+
import U from "../node_modules/d3-array/src/mean.js";
|
|
5
|
+
import { quantileSorted as te } from "../node_modules/d3-array/src/quantile.js";
|
|
6
|
+
import oe from "../node_modules/d3-array/src/deviation.js";
|
|
7
|
+
import ne from "../node_modules/d3-array/src/extent.js";
|
|
8
|
+
function se(e) {
|
|
9
|
+
const t = oe(e), o = U(e);
|
|
10
|
+
return t === void 0 || o === void 0 || t === 0 ? (n) => n : (n) => (n - o) / t;
|
|
11
|
+
}
|
|
12
|
+
function ce(e) {
|
|
13
|
+
const t = U(e), [o, n] = ne(e);
|
|
14
|
+
return t === void 0 || o === void 0 || n === void 0 || n === o ? (u) => u : (u) => (u - t) / (n - o);
|
|
15
|
+
}
|
|
16
|
+
function ue(e, t) {
|
|
17
|
+
return e === "standardScaling" ? se(t) : e === "meanNormalization" ? ce(t) : (o) => o;
|
|
18
|
+
}
|
|
19
|
+
function _(e, t) {
|
|
20
|
+
switch (e) {
|
|
21
|
+
case "max": {
|
|
22
|
+
let o = t[0];
|
|
23
|
+
for (const n of t)
|
|
24
|
+
o = Math.max(o, n);
|
|
25
|
+
return o;
|
|
26
|
+
}
|
|
27
|
+
case "min": {
|
|
28
|
+
let o = t[0];
|
|
29
|
+
for (const n of t)
|
|
30
|
+
o = Math.min(o, n);
|
|
31
|
+
return o;
|
|
32
|
+
}
|
|
33
|
+
case "median": {
|
|
34
|
+
const o = t.sort((n, u) => n - u);
|
|
35
|
+
return te(o, 0.5);
|
|
36
|
+
}
|
|
37
|
+
case "mean":
|
|
38
|
+
return U(t) ?? t[0];
|
|
39
|
+
default:
|
|
40
|
+
ae(e, `Unknown aggregation function ${e}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function T(e) {
|
|
44
|
+
const t = [...new Set(e)].sort();
|
|
45
|
+
return t.length > 3 ? [...t.slice(0, 3), "..."].join(", ") : t.join(", ");
|
|
46
|
+
}
|
|
47
|
+
function R(e) {
|
|
48
|
+
if (!e.length)
|
|
49
|
+
return [];
|
|
50
|
+
let t = [[]];
|
|
51
|
+
return e.forEach((o) => {
|
|
52
|
+
const n = [];
|
|
53
|
+
o.forEach((u) => {
|
|
54
|
+
n.push(...t.map((d) => [...d, u]));
|
|
55
|
+
}), t = n;
|
|
56
|
+
}), t;
|
|
57
|
+
}
|
|
58
|
+
const W = (e, t, o = {}) => e.sort(
|
|
59
|
+
(n, u) => t === "asc" ? (o[n] ?? n).localeCompare(o[u] ?? u, "en", { numeric: !0 }) : (o[u] ?? u).localeCompare(o[n] ?? n, "en", { numeric: !0 })
|
|
60
|
+
);
|
|
61
|
+
function ie(e, t, o, n, u) {
|
|
62
|
+
if (t.x || t.y) {
|
|
63
|
+
const d = e.meta.valueSources.reduce((m, p) => (m[p] = [1 / 0, -1 / 0], m), {});
|
|
64
|
+
e.meta.facetKeys.forEach((m) => {
|
|
65
|
+
var E, D;
|
|
66
|
+
const { xKeys: p, yKeys: C, cells: $, xKeysByGroups: I, yKeysByGroups: j } = e.facets[m], V = t.x ? I : p.reduce((i, l) => (i[l] = [l], i), {}), y = t.y ? j : C.reduce((i, l) => (i[l] = [l], i), {}), b = Object.keys(V), M = Object.keys(y);
|
|
67
|
+
for (const i of b)
|
|
68
|
+
for (const l of M) {
|
|
69
|
+
const S = e.meta.valueSources.reduce((f, K) => (f[K] = [], f), {});
|
|
70
|
+
V[i].forEach((f) => {
|
|
71
|
+
y[l].forEach((K) => {
|
|
72
|
+
var r, L, B, z;
|
|
73
|
+
for (const A of e.meta.valueSources) {
|
|
74
|
+
const Y = (B = (L = (r = $[f]) == null ? void 0 : r[K]) == null ? void 0 : L.value) == null ? void 0 : B[A];
|
|
75
|
+
Y !== void 0 && S[A].push(Y);
|
|
76
|
+
}
|
|
77
|
+
(z = $[f]) == null || delete z[K];
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
for (const f of e.meta.valueSources) {
|
|
81
|
+
const K = S[f];
|
|
82
|
+
if (K.length > 0) {
|
|
83
|
+
const r = _(t.method, K);
|
|
84
|
+
e.facets[m].cells[i] || (e.facets[m].cells[i] = {}), e.facets[m].cells[i][l] || (e.facets[m].cells[i][l] = {
|
|
85
|
+
isCell: !0,
|
|
86
|
+
idx: 0,
|
|
87
|
+
id: `${i}_${l}`,
|
|
88
|
+
x: i,
|
|
89
|
+
y: l,
|
|
90
|
+
value: e.meta.valueSources.reduce((B, z) => (B[z] = null, B), {}),
|
|
91
|
+
normalizedValue: e.meta.valueSources.reduce((B, z) => (B[z] = null, B), {})
|
|
92
|
+
});
|
|
93
|
+
const L = e.facets[m].cells[i][l];
|
|
94
|
+
L.value[f] = r, L.normalizedValue[f] = r, d[f][0] = Math.min((E = L.normalizedValue) == null ? void 0 : E[f], d[f][0]), d[f][1] = Math.max((D = L.normalizedValue) == null ? void 0 : D[f], d[f][1]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
t.x && b.forEach((i) => {
|
|
99
|
+
o.forEach((l) => {
|
|
100
|
+
const S = u.find((r) => r.valueColumn.value === l || r.valueColumn.valueLabels === l);
|
|
101
|
+
if (!S)
|
|
102
|
+
return;
|
|
103
|
+
const f = [];
|
|
104
|
+
V[i].forEach((r) => {
|
|
105
|
+
f.push(e.meta.xDataByKeys[l][r]), delete e.meta.xDataByKeys[l][r];
|
|
106
|
+
});
|
|
107
|
+
const K = S.type === "continuous" ? _(t.method, f) : T(f);
|
|
108
|
+
e.meta.xDataByKeys[l][i] = K;
|
|
109
|
+
});
|
|
110
|
+
}), t.y && (n.forEach((i) => {
|
|
111
|
+
e.meta.yDataByKeys[i] = {};
|
|
112
|
+
}), M.forEach((i) => {
|
|
113
|
+
n.forEach((l) => {
|
|
114
|
+
const S = u.find((r) => r.valueColumn.value === l || r.valueColumn.valueLabels === l);
|
|
115
|
+
if (!S)
|
|
116
|
+
return;
|
|
117
|
+
const f = [];
|
|
118
|
+
y[i].forEach((r) => {
|
|
119
|
+
f.push(e.meta.yDataByKeys[l][r]), delete e.meta.yDataByKeys[l][r];
|
|
120
|
+
});
|
|
121
|
+
const K = S.type === "continuous" ? _(t.method, f) : T(f);
|
|
122
|
+
e.meta.yDataByKeys[l][i] = K;
|
|
123
|
+
});
|
|
124
|
+
})), t.x && (e.facets[m].xKeys = Object.keys(I), e.facets[m].xKeysByGroups = { null: e.facets[m].xKeys }, e.meta.xLabels = e.meta.xGroupLabels, e.meta.xGroupKeys = ["null"], e.meta.xGroupKeyValues = { null: ["null"] }), t.y && (e.facets[m].yKeys = Object.keys(j), e.facets[m].yKeysByGroups = { null: e.facets[m].yKeys }, e.meta.yLabels = e.meta.yGroupLabels, e.meta.yGroupKeys = ["null"], e.meta.yGroupKeyValues = { null: ["null"] });
|
|
125
|
+
}), e.meta.valueExtent = d;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
function le(e, t) {
|
|
129
|
+
var o, n;
|
|
130
|
+
for (const u of e.meta.valueSources)
|
|
131
|
+
e.meta.valueExtent[u][0] = Math.min((o = t.normalizedValue) == null ? void 0 : o[u], e.meta.valueExtent[u][0]), e.meta.valueExtent[u][1] = Math.max((n = t.normalizedValue) == null ? void 0 : n[u], e.meta.valueExtent[u][1]);
|
|
132
|
+
}
|
|
133
|
+
function fe(e, t) {
|
|
134
|
+
if (Object.values(t).length) {
|
|
135
|
+
const o = e.meta.valueSources.reduce((n, u) => (t[u] && (n[u] = [1 / 0, -1 / 0]), n), {});
|
|
136
|
+
e.meta.facetKeys.forEach((n) => {
|
|
137
|
+
const { xKeys: u, yKeys: d, cells: m } = e.facets[n];
|
|
138
|
+
for (const p of e.meta.valueSources) {
|
|
139
|
+
const C = t[p];
|
|
140
|
+
if (!C)
|
|
141
|
+
continue;
|
|
142
|
+
const $ = C.direction === "row" ? u : d, I = C.direction === "row" ? d : u, j = C.direction === "row" ? (V, y) => {
|
|
143
|
+
var b;
|
|
144
|
+
return (b = m[V]) == null ? void 0 : b[y];
|
|
145
|
+
} : (V, y) => {
|
|
146
|
+
var b;
|
|
147
|
+
return (b = m[y]) == null ? void 0 : b[V];
|
|
148
|
+
};
|
|
149
|
+
I.forEach((V) => {
|
|
150
|
+
const y = [];
|
|
151
|
+
$.forEach((M) => {
|
|
152
|
+
var D, i;
|
|
153
|
+
const E = (i = (D = j(M, V)) == null ? void 0 : D.value) == null ? void 0 : i[p];
|
|
154
|
+
E !== void 0 && y.push(E);
|
|
155
|
+
});
|
|
156
|
+
const b = ue(C.method, y);
|
|
157
|
+
$.forEach((M) => {
|
|
158
|
+
var D, i, l;
|
|
159
|
+
const E = j(M, V);
|
|
160
|
+
E !== void 0 && (E.normalizedValue[p] = b((D = E.value) == null ? void 0 : D[p]), o[p][0] = Math.min((i = E.normalizedValue) == null ? void 0 : i[p], o[p][0]), o[p][1] = Math.max((l = E.normalizedValue) == null ? void 0 : l[p], o[p][1]));
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}), e.meta.valueExtent = { ...e.meta.valueExtent, valueExtent: o };
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function de(e, t, o, n, u, d, m, p, C, $, I, j, V, y, b, M, E) {
|
|
168
|
+
const D = d.length ? d.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], i = m.length ? m.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], l = p.length ? p.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], S = R(D), f = R(i), K = R(l), r = S.map(N), L = f.map(N), B = K.map(N);
|
|
169
|
+
e.meta.facetKeys = r, e.meta.xGroupKeys = L, e.meta.yGroupKeys = B, e.meta.facetKeyValues = r.reduce((a, s, x) => (a[s] = S[x], a), {}), e.meta.xGroupKeyValues = L.reduce((a, s, x) => (a[s] = f[x], a), {}), e.meta.yGroupKeyValues = B.reduce((a, s, x) => (a[s] = K[x], a), {});
|
|
170
|
+
const z = o.valueLabels ?? o.value, A = n.valueLabels ?? n.value, Y = C.filter((a) => a.axis === "x").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), Z = C.filter((a) => a.axis === "y").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), O = Object.values($ ?? {}).map((a) => a.value), k = Object.values(I ?? {}).map((a) => a.value), H = G.uniq([...Y, ...O, z]), J = G.uniq([...Z, ...k, A]);
|
|
171
|
+
for (let a = 0; a < t.rowsCount; a++) {
|
|
172
|
+
const s = N(d.map((c) => t.getColumnValue(c.value, a))), x = N(m.map((c) => t.getColumnValue(c.value, a))), g = N(p.map((c) => t.getColumnValue(c.value, a))), q = m.map((c) => t.getColumnValue(c.valueLabels ?? c.value, a)).join(", "), ee = p.map((c) => t.getColumnValue(c.valueLabels ?? c.value, a)).join(", ");
|
|
173
|
+
e.meta.xGroupLabels[x] = q, e.meta.yGroupLabels[g] = ee;
|
|
174
|
+
const v = String(t.getColumnValue(o.value, a)), h = String(t.getColumnValue(n.value, a)), F = e.meta.valueSources.reduce((c, w) => (c[w] = t.getColumnValue(u[w].value, a) ?? V, c), {});
|
|
175
|
+
if (v === "null" || h === "null" || Object.values(F).every((c) => c === null))
|
|
176
|
+
continue;
|
|
177
|
+
e.facets[s] || (e.facets[s] = {
|
|
178
|
+
xKeys: [],
|
|
179
|
+
yKeys: [],
|
|
180
|
+
xKeysByGroups: {},
|
|
181
|
+
yKeysByGroups: {},
|
|
182
|
+
cells: {}
|
|
183
|
+
}), e.facets[s].xKeysByGroups[x] || (e.facets[s].xKeysByGroups[x] = []), e.facets[s].yKeysByGroups[g] || (e.facets[s].yKeysByGroups[g] = []), e.facets[s].xKeys.push(v), e.facets[s].yKeys.push(h), e.facets[s].xKeysByGroups[x].push(v), e.facets[s].yKeysByGroups[g].push(h), e.facets[s].cells[v] || (e.facets[s].cells[v] = {});
|
|
184
|
+
for (const c of e.meta.valueSources)
|
|
185
|
+
if (e.facets[s].cells[v][h] && e.facets[s].cells[v][h].value[c] !== F[c])
|
|
186
|
+
throw Error(`More than 1 value for x=${v}, y=${h}`);
|
|
187
|
+
const P = t.getColumnValue(z, a);
|
|
188
|
+
if (e.meta.xLabels[v] && String(P) !== e.meta.xLabels[v])
|
|
189
|
+
throw Error(`More than 1 x-label value for x=${v}`);
|
|
190
|
+
const Q = t.getColumnValue(A, a);
|
|
191
|
+
if (e.meta.yLabels[h] && String(Q) !== e.meta.yLabels[h])
|
|
192
|
+
throw Error(`More than 1 y-label value for y=${h}`);
|
|
193
|
+
e.meta.xLabels[v] = String(P), e.meta.yLabels[h] = String(Q), H.forEach((c) => {
|
|
194
|
+
const w = typeof e.meta.xDataByKeys[c] < "u", X = w && typeof e.meta.xDataByKeys[c][v] < "u";
|
|
195
|
+
if (w || (e.meta.xDataByKeys[c] = {}), X && e.meta.xDataByKeys[c][v] !== t.getColumnValue(c, a))
|
|
196
|
+
throw Error(`More than 1 value for x = ${v} and column = ${c}`);
|
|
197
|
+
X || (e.meta.xDataByKeys[c][v] = t.getColumnValue(c, a));
|
|
198
|
+
}), J.forEach((c) => {
|
|
199
|
+
const w = typeof e.meta.yDataByKeys[c] < "u", X = w && typeof e.meta.yDataByKeys[c][h] < "u";
|
|
200
|
+
if (w || (e.meta.yDataByKeys[c] = {}), X && e.meta.yDataByKeys[c][h] !== t.getColumnValue(c, a))
|
|
201
|
+
throw Error(`More than 1 value for y = ${h} and column = ${c}`);
|
|
202
|
+
X || (e.meta.yDataByKeys[c][h] = t.getColumnValue(c, a));
|
|
203
|
+
}), e.facets[s].cells[v][h] = {
|
|
204
|
+
isCell: !0,
|
|
205
|
+
idx: a,
|
|
206
|
+
id: `${v}_${h}`,
|
|
207
|
+
x: v,
|
|
208
|
+
y: h,
|
|
209
|
+
value: F,
|
|
210
|
+
normalizedValue: F
|
|
211
|
+
}, le(e, e.facets[s].cells[v][h]);
|
|
212
|
+
}
|
|
213
|
+
e.meta.facetKeys = e.meta.facetKeys.filter((a) => e.facets[a]), e.meta.facetKeys.forEach((a) => {
|
|
214
|
+
const s = e.facets[a], x = G.uniq(s.xKeys), g = G.uniq(s.yKeys);
|
|
215
|
+
s.xKeys = y[o.value] ? G.intersection(y[o.value], x) : x, s.yKeys = y[n.value] ? G.intersection(y[n.value], g) : g, L.forEach((q) => {
|
|
216
|
+
e.facets[a].xKeysByGroups[q] = G.intersection(
|
|
217
|
+
s.xKeys,
|
|
218
|
+
e.facets[a].xKeysByGroups[q]
|
|
219
|
+
);
|
|
220
|
+
}), B.forEach((q) => {
|
|
221
|
+
e.facets[a].yKeysByGroups[q] = G.intersection(
|
|
222
|
+
s.yKeys,
|
|
223
|
+
e.facets[a].yKeysByGroups[q]
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
}), ie(e, E, H, J, C), fe(e, j), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((a, s) => {
|
|
227
|
+
const x = W(G.uniq(
|
|
228
|
+
G.flatten(e.meta.facetKeys.map((g) => e.facets[g].xKeysByGroups[s]))
|
|
229
|
+
), b.sorting, e.meta.xLabels);
|
|
230
|
+
return a[s] = y[o.value] ? G.intersection(y[o.value], x) : x, a;
|
|
231
|
+
}, {}), e.meta.xKeys = e.meta.xGroupKeys.reduce((a, s) => (a = a.concat(e.meta.xKeysByGroups[s]), a), []), e.meta.yKeysByGroups = e.meta.yGroupKeys.reduce((a, s) => {
|
|
232
|
+
const x = W(G.uniq(
|
|
233
|
+
G.flatten(e.meta.facetKeys.map((g) => e.facets[g].yKeysByGroups[s]))
|
|
234
|
+
), M.sorting, e.meta.yLabels);
|
|
235
|
+
return a[s] = y[n.value] ? G.intersection(y[n.value], x) : x, a;
|
|
236
|
+
}, {}), e.meta.yKeys = e.meta.yGroupKeys.reduce((a, s) => (a = a.concat(e.meta.yKeysByGroups[s]), a), []);
|
|
237
|
+
for (const a of e.meta.valueSources)
|
|
238
|
+
e.meta.valueExtent[a][0] === 1 / 0 && (e.meta.valueExtent[a][0] = 0), e.meta.valueExtent[a][1] === -1 / 0 && (e.meta.valueExtent[a][1] = 0);
|
|
239
|
+
return e;
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
de as fillCellsData
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=fillCellsData.js.map
|