@milaboratories/miplots4 1.0.166 → 1.0.168
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/_virtual/index10.js +5 -2
- package/dist/_virtual/index10.js.map +1 -1
- package/dist/_virtual/index5.js +2 -5
- package/dist/_virtual/index5.js.map +1 -1
- package/dist/_virtual/index6.js +4 -4
- package/dist/_virtual/index7.js +1 -1
- package/dist/_virtual/index8.js +4 -4
- package/dist/_virtual/index9.js +3 -3
- package/dist/bubble/components/ChartsGroup.js +21 -21
- package/dist/bubble/components/ChartsGroup.js.map +1 -1
- package/dist/common/Tooltip.js +2 -2
- package/dist/common/Tooltip.js.map +1 -1
- package/dist/discrete/index.d.ts +2 -0
- package/dist/discrete/index.js +127 -123
- package/dist/discrete/index.js.map +1 -1
- package/dist/discrete/layers/stats/pValueCalculation.js +5 -5
- package/dist/discrete/utils/getFacetLabels.d.ts +3 -0
- package/dist/discrete/utils/getFacetLabels.js +16 -0
- package/dist/discrete/utils/getFacetLabels.js.map +1 -0
- package/dist/heatmap/components/ChartsGroup.js +9 -9
- package/dist/heatmap/components/ChartsGroup.js.map +1 -1
- package/dist/heatmap/components/tooltipUtils.js +15 -15
- package/dist/heatmap/components/tooltipUtils.js.map +1 -1
- package/dist/heatmap/fillCellsData.js +88 -85
- package/dist/heatmap/fillCellsData.js.map +1 -1
- package/dist/histogram/getHistogramData.js +42 -41
- package/dist/histogram/getHistogramData.js.map +1 -1
- package/dist/histogram/index.d.ts +1 -0
- package/dist/histogram/index.js +59 -57
- package/dist/histogram/index.js.map +1 -1
- package/dist/node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/index.js +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +8 -0
- package/dist/scatterplot/ScatterplotSettingsImpl.js +22 -20
- package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/scatterplot/index.d.ts +1 -0
- package/dist/scatterplot/index.js +94 -92
- package/dist/scatterplot/index.js.map +1 -1
- package/dist/types/scatterplot.d.ts +176 -0
- package/dist/types/scatterplot.js +63 -51
- package/dist/types/scatterplot.js.map +1 -1
- package/package.json +2 -2
|
@@ -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 { 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
|
|
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","ChartsTitle","facetKey","cells","xKeysByGroups","yKeysByGroups","Chart","Legend"],"mappings":"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"}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { format as
|
|
2
|
-
function
|
|
1
|
+
import { format as f } from "../../node_modules/.pnpm/d3-format@3.1.0/node_modules/d3-format/src/defaultLocale.js";
|
|
2
|
+
function l(n, e) {
|
|
3
3
|
if (n === null)
|
|
4
4
|
return "null";
|
|
5
5
|
if (typeof n == "number") {
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
const
|
|
9
|
-
return
|
|
6
|
+
if (e)
|
|
7
|
+
return f(e)(n);
|
|
8
|
+
const o = n > 0 ? Math.floor(n) : Math.ceil(n), t = n - o;
|
|
9
|
+
return o + Number(t.toPrecision(2));
|
|
10
10
|
}
|
|
11
11
|
return n;
|
|
12
12
|
}
|
|
13
|
-
function c(n,
|
|
14
|
-
const i = `${
|
|
13
|
+
function c(n, e, o, t = []) {
|
|
14
|
+
const i = `${l(e.value.dataSource)}${e.value !== e.normalizedValue ? ` (${l(e.normalizedValue.dataSource)})` : ""}`;
|
|
15
15
|
if (t.length) {
|
|
16
16
|
const r = [
|
|
17
17
|
`Value: ${i}`
|
|
18
18
|
];
|
|
19
|
-
for (const
|
|
20
|
-
const
|
|
21
|
-
r.push(`${
|
|
19
|
+
for (const u of t) {
|
|
20
|
+
const a = n.getColumnValue(u.valueLabels ?? u.value, e.idx);
|
|
21
|
+
r.push(`${u.label}: ${l(a, u.format)}`);
|
|
22
22
|
}
|
|
23
23
|
return r;
|
|
24
24
|
}
|
|
25
25
|
return [i];
|
|
26
26
|
}
|
|
27
|
-
function m(n,
|
|
28
|
-
const
|
|
29
|
-
return n.xKey &&
|
|
27
|
+
function m(n, e) {
|
|
28
|
+
const o = [];
|
|
29
|
+
return n.xKey && o.push(`X: ${e.xLabels[n.xKey]}`), n.yKey && o.push(`Y: ${e.yLabels[n.yKey]}`), o.push(`${n.title}: ${l(n.value, n.column.format)}`), o;
|
|
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
|
+
l 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 { 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;
|
|
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.valueLabels ?? 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,eAAeA,EAAO,OAAOL,EAAK,GAAG;AACnF,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;"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import G from "../_virtual/lodash.js";
|
|
2
|
-
import { exhaustive as
|
|
2
|
+
import { exhaustive as te } from "../utils/index.js";
|
|
3
3
|
import { getFacetOrGroupKey as N } from "../utils/getFacetOrGroupKey.js";
|
|
4
|
-
import
|
|
4
|
+
import { getFacetLabels as oe } from "../discrete/utils/getFacetLabels.js";
|
|
5
|
+
import ne from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/sum.js";
|
|
5
6
|
import U from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/mean.js";
|
|
6
|
-
import { quantileSorted as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
function
|
|
10
|
-
const t =
|
|
7
|
+
import { quantileSorted as se } from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/quantile.js";
|
|
8
|
+
import ce from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/deviation.js";
|
|
9
|
+
import ue from "../node_modules/.pnpm/d3-array@3.2.4/node_modules/d3-array/src/extent.js";
|
|
10
|
+
function ie(e) {
|
|
11
|
+
const t = ce(e), o = U(e);
|
|
11
12
|
return t === void 0 || o === void 0 || t === 0 ? (n) => n : (n) => (n - o) / t;
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const t = U(e), [o, n] =
|
|
14
|
+
function fe(e) {
|
|
15
|
+
const t = U(e), [o, n] = ue(e);
|
|
15
16
|
return t === void 0 || o === void 0 || n === void 0 || n === o ? (u) => u : (u) => (u - t) / (n - o);
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
-
return e === "standardScaling" ?
|
|
18
|
+
function le(e, t) {
|
|
19
|
+
return e === "standardScaling" ? ie(t) : e === "meanNormalization" ? fe(t) : (o) => o;
|
|
19
20
|
}
|
|
20
21
|
function _(e, t) {
|
|
21
22
|
switch (e) {
|
|
@@ -33,14 +34,14 @@ function _(e, t) {
|
|
|
33
34
|
}
|
|
34
35
|
case "median": {
|
|
35
36
|
const o = t.sort((n, u) => n - u);
|
|
36
|
-
return
|
|
37
|
+
return se(o, 0.5);
|
|
37
38
|
}
|
|
38
39
|
case "mean":
|
|
39
40
|
return U(t) ?? t[0];
|
|
40
41
|
case "sum":
|
|
41
|
-
return
|
|
42
|
+
return ne(t);
|
|
42
43
|
default:
|
|
43
|
-
|
|
44
|
+
te(e, `Unknown aggregation function ${e}`);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
function T(e) {
|
|
@@ -61,23 +62,23 @@ function R(e) {
|
|
|
61
62
|
const W = (e, t, o = {}) => e.sort(
|
|
62
63
|
(n, u) => t === "asc" ? (o[n] ?? n).localeCompare(o[u] ?? u, "en", { numeric: !0 }) : (o[u] ?? u).localeCompare(o[n] ?? n, "en", { numeric: !0 })
|
|
63
64
|
);
|
|
64
|
-
function
|
|
65
|
+
function me(e, t, o, n, u) {
|
|
65
66
|
if (t.x || t.y) {
|
|
66
67
|
const d = e.meta.valueSources.reduce((m, p) => (m[p] = [1 / 0, -1 / 0], m), {});
|
|
67
68
|
e.meta.facetKeys.forEach((m) => {
|
|
68
69
|
var E, D;
|
|
69
|
-
const { xKeys: p, yKeys:
|
|
70
|
-
for (const i of
|
|
71
|
-
for (const f of
|
|
70
|
+
const { xKeys: p, yKeys: L, cells: $, xKeysByGroups: I, yKeysByGroups: j } = e.facets[m], b = t.x ? I : p.reduce((i, f) => (i[f] = [f], i), {}), y = t.y ? j : L.reduce((i, f) => (i[f] = [f], i), {}), V = Object.keys(b), z = Object.keys(y);
|
|
71
|
+
for (const i of V)
|
|
72
|
+
for (const f of z) {
|
|
72
73
|
const S = e.meta.valueSources.reduce((l, K) => (l[K] = [], l), {});
|
|
73
|
-
|
|
74
|
+
b[i].forEach((l) => {
|
|
74
75
|
y[f].forEach((K) => {
|
|
75
|
-
var r,
|
|
76
|
+
var r, B, C, M;
|
|
76
77
|
for (const A of e.meta.valueSources) {
|
|
77
|
-
const
|
|
78
|
-
|
|
78
|
+
const X = (C = (B = (r = $[l]) == null ? void 0 : r[K]) == null ? void 0 : B.value) == null ? void 0 : C[A];
|
|
79
|
+
X !== void 0 && S[A].push(X);
|
|
79
80
|
}
|
|
80
|
-
(
|
|
81
|
+
(M = $[l]) == null || delete M[K];
|
|
81
82
|
});
|
|
82
83
|
});
|
|
83
84
|
for (const l of e.meta.valueSources) {
|
|
@@ -90,21 +91,21 @@ function fe(e, t, o, n, u) {
|
|
|
90
91
|
id: `${i}_${f}`,
|
|
91
92
|
x: i,
|
|
92
93
|
y: f,
|
|
93
|
-
value: e.meta.valueSources.reduce((
|
|
94
|
-
normalizedValue: e.meta.valueSources.reduce((
|
|
94
|
+
value: e.meta.valueSources.reduce((C, M) => (C[M] = null, C), {}),
|
|
95
|
+
normalizedValue: e.meta.valueSources.reduce((C, M) => (C[M] = null, C), {})
|
|
95
96
|
});
|
|
96
|
-
const
|
|
97
|
-
|
|
97
|
+
const B = e.facets[m].cells[i][f];
|
|
98
|
+
B.value[l] = r, B.normalizedValue[l] = r, d[l][0] = Math.min((E = B.normalizedValue) == null ? void 0 : E[l], d[l][0]), d[l][1] = Math.max((D = B.normalizedValue) == null ? void 0 : D[l], d[l][1]);
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
|
-
t.x &&
|
|
102
|
+
t.x && V.forEach((i) => {
|
|
102
103
|
o.forEach((f) => {
|
|
103
104
|
const S = u.find((r) => r.valueColumn.value === f || r.valueColumn.valueLabels === f);
|
|
104
105
|
if (!S)
|
|
105
106
|
return;
|
|
106
107
|
const l = [];
|
|
107
|
-
|
|
108
|
+
b[i].forEach((r) => {
|
|
108
109
|
l.push(e.meta.xDataByKeys[f][r]), delete e.meta.xDataByKeys[f][r];
|
|
109
110
|
});
|
|
110
111
|
const K = S.type === "continuous" ? _(t.method, l) : T(l);
|
|
@@ -112,7 +113,7 @@ function fe(e, t, o, n, u) {
|
|
|
112
113
|
});
|
|
113
114
|
}), t.y && (n.forEach((i) => {
|
|
114
115
|
e.meta.yDataByKeys[i] = {};
|
|
115
|
-
}),
|
|
116
|
+
}), z.forEach((i) => {
|
|
116
117
|
n.forEach((f) => {
|
|
117
118
|
const S = u.find((r) => r.valueColumn.value === f || r.valueColumn.valueLabels === f);
|
|
118
119
|
if (!S)
|
|
@@ -128,54 +129,56 @@ function fe(e, t, o, n, u) {
|
|
|
128
129
|
}), e.meta.valueExtent = d;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
+
function ye(e, t) {
|
|
132
133
|
var o, n;
|
|
133
134
|
for (const u of e.meta.valueSources)
|
|
134
135
|
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]);
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function re(e, t) {
|
|
137
138
|
if (Object.values(t).length) {
|
|
138
139
|
const o = e.meta.valueSources.reduce((n, u) => (t[u] && (n[u] = [1 / 0, -1 / 0]), n), {});
|
|
139
140
|
e.meta.facetKeys.forEach((n) => {
|
|
140
141
|
const { xKeys: u, yKeys: d, cells: m } = e.facets[n];
|
|
141
142
|
for (const p of e.meta.valueSources) {
|
|
142
|
-
const
|
|
143
|
-
if (!
|
|
143
|
+
const L = t[p];
|
|
144
|
+
if (!L)
|
|
144
145
|
continue;
|
|
145
|
-
const $ =
|
|
146
|
-
var
|
|
147
|
-
return (
|
|
148
|
-
} : (
|
|
149
|
-
var
|
|
150
|
-
return (
|
|
146
|
+
const $ = L.direction === "row" ? u : d, I = L.direction === "row" ? d : u, j = L.direction === "row" ? (b, y) => {
|
|
147
|
+
var V;
|
|
148
|
+
return (V = m[b]) == null ? void 0 : V[y];
|
|
149
|
+
} : (b, y) => {
|
|
150
|
+
var V;
|
|
151
|
+
return (V = m[y]) == null ? void 0 : V[b];
|
|
151
152
|
};
|
|
152
|
-
I.forEach((
|
|
153
|
+
I.forEach((b) => {
|
|
153
154
|
const y = [];
|
|
154
|
-
$.forEach((
|
|
155
|
+
$.forEach((z) => {
|
|
155
156
|
var D, i;
|
|
156
|
-
const E = (i = (D = j(
|
|
157
|
+
const E = (i = (D = j(z, b)) == null ? void 0 : D.value) == null ? void 0 : i[p];
|
|
157
158
|
E !== void 0 && y.push(E);
|
|
158
159
|
});
|
|
159
|
-
const
|
|
160
|
-
$.forEach((
|
|
160
|
+
const V = le(L.method, y);
|
|
161
|
+
$.forEach((z) => {
|
|
161
162
|
var D, i, f;
|
|
162
|
-
const E = j(
|
|
163
|
-
E !== void 0 && (E.normalizedValue[p] =
|
|
163
|
+
const E = j(z, b);
|
|
164
|
+
E !== void 0 && (E.normalizedValue[p] = V((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((f = E.normalizedValue) == null ? void 0 : f[p], o[p][1]));
|
|
164
165
|
});
|
|
165
166
|
});
|
|
166
167
|
}
|
|
167
168
|
}), e.meta.valueExtent = { ...e.meta.valueExtent, valueExtent: o };
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
|
-
function
|
|
171
|
-
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"]], f = p.length ? p.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], S = R(D), l = R(i), K = R(f), r = S.map(N),
|
|
172
|
-
e.meta.facetKeys = r, e.meta.xGroupKeys =
|
|
173
|
-
const
|
|
171
|
+
function Ve(e, t, o, n, u, d, m, p, L, $, I, j, b, y, V, z, E) {
|
|
172
|
+
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"]], f = p.length ? p.map((a) => y[a.value] ?? t.getColumnCategories(a.value)) : [["null"]], S = R(D), l = R(i), K = R(f), r = S.map(N), B = l.map(N), C = K.map(N);
|
|
173
|
+
e.meta.facetKeys = r, e.meta.xGroupKeys = B, e.meta.yGroupKeys = C;
|
|
174
|
+
const M = oe(t, d, r, S);
|
|
175
|
+
e.meta.facetKeyValues = r.reduce((a, s) => (a[s] = M[s], a), {}), e.meta.xGroupKeyValues = B.reduce((a, s, h) => (a[s] = l[h], a), {}), e.meta.yGroupKeyValues = C.reduce((a, s, h) => (a[s] = K[h], a), {});
|
|
176
|
+
const A = o.valueLabels ?? o.value, X = n.valueLabels ?? n.value, Z = L.filter((a) => a.axis === "x").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), O = L.filter((a) => a.axis === "y").map((a) => a.valueColumn.valueLabels ?? a.valueColumn.value), k = Object.values($ ?? {}).map((a) => a.value), ee = Object.values(I ?? {}).map((a) => a.value), H = G.uniq([...Z, ...k, A]), J = G.uniq([...O, ...ee, X]);
|
|
174
177
|
for (let a = 0; a < t.rowsCount; a++) {
|
|
175
|
-
const s = N(d.map((c) => t.getColumnValue(c.value, a))),
|
|
176
|
-
e.meta.xGroupLabels[
|
|
177
|
-
const v = String(t.getColumnValue(o.value, a)),
|
|
178
|
-
if (v === "null" ||
|
|
178
|
+
const s = N(d.map((c) => t.getColumnValue(c.value, a))), h = 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(", "), ae = p.map((c) => t.getColumnValue(c.valueLabels ?? c.value, a)).join(", ");
|
|
179
|
+
e.meta.xGroupLabels[h] = q, e.meta.yGroupLabels[g] = ae;
|
|
180
|
+
const v = String(t.getColumnValue(o.value, a)), x = String(t.getColumnValue(n.value, a)), F = e.meta.valueSources.reduce((c, w) => (c[w] = t.getColumnValue(u[w].value, a) ?? b, c), {});
|
|
181
|
+
if (v === "null" || x === "null" || Object.values(F).every((c) => c === null))
|
|
179
182
|
continue;
|
|
180
183
|
e.facets[s] || (e.facets[s] = {
|
|
181
184
|
xKeys: [],
|
|
@@ -183,65 +186,65 @@ function Ge(e, t, o, n, u, d, m, p, C, $, I, j, V, y, b, M, E) {
|
|
|
183
186
|
xKeysByGroups: {},
|
|
184
187
|
yKeysByGroups: {},
|
|
185
188
|
cells: {}
|
|
186
|
-
}), e.facets[s].xKeysByGroups[
|
|
189
|
+
}), e.facets[s].xKeysByGroups[h] || (e.facets[s].xKeysByGroups[h] = []), e.facets[s].yKeysByGroups[g] || (e.facets[s].yKeysByGroups[g] = []), e.facets[s].xKeys.push(v), e.facets[s].yKeys.push(x), e.facets[s].xKeysByGroups[h].push(v), e.facets[s].yKeysByGroups[g].push(x), e.facets[s].cells[v] || (e.facets[s].cells[v] = {});
|
|
187
190
|
for (const c of e.meta.valueSources)
|
|
188
|
-
if (e.facets[s].cells[v][
|
|
189
|
-
throw Error(`More than 1 value for x=${v}, y=${
|
|
190
|
-
const P = t.getColumnValue(
|
|
191
|
+
if (e.facets[s].cells[v][x] && e.facets[s].cells[v][x].value[c] !== F[c])
|
|
192
|
+
throw Error(`More than 1 value for x=${v}, y=${x}`);
|
|
193
|
+
const P = t.getColumnValue(A, a);
|
|
191
194
|
if (e.meta.xLabels[v] && String(P) !== e.meta.xLabels[v])
|
|
192
195
|
throw Error(`More than 1 x-label value for x=${v}`);
|
|
193
|
-
const Q = t.getColumnValue(
|
|
194
|
-
if (e.meta.yLabels[
|
|
195
|
-
throw Error(`More than 1 y-label value for y=${
|
|
196
|
-
e.meta.xLabels[v] = String(P), e.meta.yLabels[
|
|
197
|
-
const w = typeof e.meta.xDataByKeys[c] < "u",
|
|
198
|
-
if (w || (e.meta.xDataByKeys[c] = {}),
|
|
196
|
+
const Q = t.getColumnValue(X, a);
|
|
197
|
+
if (e.meta.yLabels[x] && String(Q) !== e.meta.yLabels[x])
|
|
198
|
+
throw Error(`More than 1 y-label value for y=${x}`);
|
|
199
|
+
e.meta.xLabels[v] = String(P), e.meta.yLabels[x] = String(Q), H.forEach((c) => {
|
|
200
|
+
const w = typeof e.meta.xDataByKeys[c] < "u", Y = w && typeof e.meta.xDataByKeys[c][v] < "u";
|
|
201
|
+
if (w || (e.meta.xDataByKeys[c] = {}), Y && e.meta.xDataByKeys[c][v] !== t.getColumnValue(c, a))
|
|
199
202
|
throw Error(`More than 1 value for x = ${v} and column = ${c}`);
|
|
200
|
-
|
|
203
|
+
Y || (e.meta.xDataByKeys[c][v] = t.getColumnValue(c, a));
|
|
201
204
|
}), J.forEach((c) => {
|
|
202
|
-
const w = typeof e.meta.yDataByKeys[c] < "u",
|
|
203
|
-
if (w || (e.meta.yDataByKeys[c] = {}),
|
|
204
|
-
throw Error(`More than 1 value for y = ${
|
|
205
|
-
|
|
206
|
-
}), e.facets[s].cells[v][
|
|
205
|
+
const w = typeof e.meta.yDataByKeys[c] < "u", Y = w && typeof e.meta.yDataByKeys[c][x] < "u";
|
|
206
|
+
if (w || (e.meta.yDataByKeys[c] = {}), Y && e.meta.yDataByKeys[c][x] !== t.getColumnValue(c, a))
|
|
207
|
+
throw Error(`More than 1 value for y = ${x} and column = ${c}`);
|
|
208
|
+
Y || (e.meta.yDataByKeys[c][x] = t.getColumnValue(c, a));
|
|
209
|
+
}), e.facets[s].cells[v][x] = {
|
|
207
210
|
isCell: !0,
|
|
208
211
|
idx: a,
|
|
209
|
-
id: `${v}_${
|
|
212
|
+
id: `${v}_${x}`,
|
|
210
213
|
x: v,
|
|
211
|
-
y:
|
|
214
|
+
y: x,
|
|
212
215
|
value: F,
|
|
213
216
|
normalizedValue: F
|
|
214
|
-
},
|
|
217
|
+
}, ye(e, e.facets[s].cells[v][x]);
|
|
215
218
|
}
|
|
216
219
|
e.meta.facetKeys = e.meta.facetKeys.filter((a) => e.facets[a]), e.meta.facetKeys.forEach((a) => {
|
|
217
|
-
const s = e.facets[a],
|
|
218
|
-
s.xKeys = y[o.value] ? G.intersection(y[o.value],
|
|
220
|
+
const s = e.facets[a], h = G.uniq(s.xKeys), g = G.uniq(s.yKeys);
|
|
221
|
+
s.xKeys = y[o.value] ? G.intersection(y[o.value], h) : h, s.yKeys = y[n.value] ? G.intersection(y[n.value], g) : g, B.forEach((q) => {
|
|
219
222
|
e.facets[a].xKeysByGroups[q] = G.intersection(
|
|
220
223
|
s.xKeys,
|
|
221
224
|
e.facets[a].xKeysByGroups[q]
|
|
222
225
|
);
|
|
223
|
-
}),
|
|
226
|
+
}), C.forEach((q) => {
|
|
224
227
|
e.facets[a].yKeysByGroups[q] = G.intersection(
|
|
225
228
|
s.yKeys,
|
|
226
229
|
e.facets[a].yKeysByGroups[q]
|
|
227
230
|
);
|
|
228
231
|
});
|
|
229
|
-
}),
|
|
230
|
-
const
|
|
232
|
+
}), me(e, E, H, J, L), re(e, j), e.meta.xKeysByGroups = e.meta.xGroupKeys.reduce((a, s) => {
|
|
233
|
+
const h = W(G.uniq(
|
|
231
234
|
G.flatten(e.meta.facetKeys.map((g) => e.facets[g].xKeysByGroups[s]))
|
|
232
|
-
),
|
|
233
|
-
return a[s] = y[o.value] ? G.intersection(y[o.value],
|
|
235
|
+
), V.sorting, e.meta.xLabels);
|
|
236
|
+
return a[s] = y[o.value] ? G.intersection(y[o.value], h) : h, a;
|
|
234
237
|
}, {}), 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) => {
|
|
235
|
-
const
|
|
238
|
+
const h = W(G.uniq(
|
|
236
239
|
G.flatten(e.meta.facetKeys.map((g) => e.facets[g].yKeysByGroups[s]))
|
|
237
|
-
),
|
|
238
|
-
return a[s] = y[n.value] ? G.intersection(y[n.value],
|
|
240
|
+
), z.sorting, e.meta.yLabels);
|
|
241
|
+
return a[s] = y[n.value] ? G.intersection(y[n.value], h) : h, a;
|
|
239
242
|
}, {}), e.meta.yKeys = e.meta.yGroupKeys.reduce((a, s) => (a = a.concat(e.meta.yKeysByGroups[s]), a), []);
|
|
240
243
|
for (const a of e.meta.valueSources)
|
|
241
244
|
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);
|
|
242
245
|
return e;
|
|
243
246
|
}
|
|
244
247
|
export {
|
|
245
|
-
|
|
248
|
+
Ve as fillCellsData
|
|
246
249
|
};
|
|
247
250
|
//# sourceMappingURL=fillCellsData.js.map
|