@milaboratories/miplots4 1.2.4 → 1.4.0
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 +4 -2
- package/dist/bubble/BubbleSettingsImpl.d.ts.map +1 -1
- package/dist/bubble/BubbleSettingsImpl.js +32 -29
- package/dist/bubble/BubbleSettingsImpl.js.map +1 -1
- package/dist/bubble/getGroupedCellsData.d.ts +1 -1
- package/dist/bubble/getGroupedCellsData.d.ts.map +1 -1
- package/dist/bubble/getGroupedCellsData.js +2 -2
- package/dist/bubble/getGroupedCellsData.js.map +1 -1
- package/dist/bubble/index.d.ts.map +1 -1
- package/dist/bubble/index.js +16 -15
- package/dist/bubble/index.js.map +1 -1
- package/dist/discrete/components/layers/ErrorBarElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/ErrorBarElement.js +1 -0
- package/dist/discrete/components/layers/ErrorBarElement.js.map +1 -1
- package/dist/discrete/components/layers/LineElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/LineElement.js +1 -0
- package/dist/discrete/components/layers/LineElement.js.map +1 -1
- package/dist/heatmap/HeatmapSettingsImpl.d.ts +4 -2
- package/dist/heatmap/HeatmapSettingsImpl.d.ts.map +1 -1
- package/dist/heatmap/HeatmapSettingsImpl.js +20 -17
- package/dist/heatmap/HeatmapSettingsImpl.js.map +1 -1
- package/dist/heatmap/fillCellsData.d.ts +3 -3
- package/dist/heatmap/fillCellsData.d.ts.map +1 -1
- package/dist/heatmap/fillCellsData.js +89 -94
- package/dist/heatmap/fillCellsData.js.map +1 -1
- package/dist/heatmap/getCells.d.ts +3 -3
- package/dist/heatmap/getCells.d.ts.map +1 -1
- package/dist/heatmap/getCells.js +3 -3
- package/dist/heatmap/getCells.js.map +1 -1
- package/dist/heatmap/index.d.ts.map +1 -1
- package/dist/heatmap/index.js +21 -22
- package/dist/heatmap/index.js.map +1 -1
- package/dist/heatmap/labelParts.d.ts +21 -0
- package/dist/heatmap/labelParts.d.ts.map +1 -0
- package/dist/heatmap/labelParts.js +55 -0
- package/dist/heatmap/labelParts.js.map +1 -0
- package/dist/scatterplot/ChartRenderer.d.ts.map +1 -1
- package/dist/scatterplot/ChartRenderer.js +2 -1
- package/dist/scatterplot/ChartRenderer.js.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts +1 -0
- package/dist/scatterplot/ScatterplotSettingsImpl.d.ts.map +1 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.js +2 -1
- package/dist/scatterplot/ScatterplotSettingsImpl.js.map +1 -1
- package/dist/scatterplot/components/ChartTrendsData.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartTrendsData.js +2 -1
- package/dist/scatterplot/components/ChartTrendsData.js.map +1 -1
- package/dist/scatterplot/components/types.d.ts +1 -0
- package/dist/scatterplot/components/types.d.ts.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.d.ts.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.js +2 -0
- package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/scatterplot-umap/types.d.ts +1 -0
- package/dist/scatterplot-umap/types.d.ts.map +1 -1
- package/dist/types/bubble.d.ts +26 -16
- package/dist/types/bubble.d.ts.map +1 -1
- package/dist/types/bubble.js +4 -3
- package/dist/types/bubble.js.map +1 -1
- package/dist/types/heatmap.d.ts +22 -12
- package/dist/types/heatmap.d.ts.map +1 -1
- package/dist/types/heatmap.js +4 -3
- package/dist/types/heatmap.js.map +1 -1
- package/dist/types/scatterplot.d.ts +5 -0
- package/dist/types/scatterplot.d.ts.map +1 -1
- package/dist/types/scatterplot.js +2 -1
- package/dist/types/scatterplot.js.map +1 -1
- package/dist/utils/compareColumnGroups.d.ts +4 -0
- package/dist/utils/compareColumnGroups.d.ts.map +1 -0
- package/dist/utils/compareColumnGroups.js +7 -0
- package/dist/utils/compareColumnGroups.js.map +1 -0
- package/package.json +1 -1
|
@@ -12,10 +12,10 @@ export declare class BubbleSettingsImpl implements SettingsInterface {
|
|
|
12
12
|
};
|
|
13
13
|
readonly valueColumnSize: ColumnName;
|
|
14
14
|
readonly valueColumnColor: ColumnName;
|
|
15
|
-
readonly
|
|
15
|
+
readonly x: ColumnName[];
|
|
16
16
|
readonly xGroupBy: ColumnName[];
|
|
17
17
|
readonly xSortBy: ColumnName[];
|
|
18
|
-
readonly
|
|
18
|
+
readonly y: ColumnName[];
|
|
19
19
|
readonly yGroupBy: ColumnName[];
|
|
20
20
|
readonly ySortBy: ColumnName[];
|
|
21
21
|
readonly facetBy: ColumnName[];
|
|
@@ -54,6 +54,7 @@ export declare class BubbleSettingsImpl implements SettingsInterface {
|
|
|
54
54
|
position: 'left' | 'right';
|
|
55
55
|
axisLabelsAngle: 0 | 45 | 90;
|
|
56
56
|
sorting: 'asc' | 'desc';
|
|
57
|
+
labelParts: ColumnName['value'][] | null;
|
|
57
58
|
};
|
|
58
59
|
readonly xAxis: {
|
|
59
60
|
title: string;
|
|
@@ -63,6 +64,7 @@ export declare class BubbleSettingsImpl implements SettingsInterface {
|
|
|
63
64
|
position: 'bottom' | 'top';
|
|
64
65
|
axisLabelsAngle: 0 | 45 | 90;
|
|
65
66
|
sorting: 'asc' | 'desc';
|
|
67
|
+
labelParts: ColumnName['value'][] | null;
|
|
66
68
|
};
|
|
67
69
|
readonly frame: {
|
|
68
70
|
type: FrameType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleSettingsImpl.d.ts","sourceRoot":"","sources":["../../src/bubble/BubbleSettingsImpl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,SAAS,EACT,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAChB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version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AS,EAAE,OAAO,CAAC;YACnB,SAAS,EAAE,OAAO,CAAC;YACnB,cAAc,EAAE,OAAO,CAAC;YACxB,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC;YAC3B,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;YAC7B,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;YACxB,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;SAC5C,CAAC;QACF,QAAQ,CAAC,KAAK,EAAE;YAAE,IAAI,EAAE,SAAS,CAAA;SAAE,CAAC;QACpC,QAAQ,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,QAAQ,EAAE,cAAc,CAAA;SAAE,CAAC;QAC7D,QAAQ,CAAC,QAAQ,EAAE;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;SAAE,CAAC;KAChE,CAAC;IACF,QAAQ,CAAC,GAAG,EAAE;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,EAAE,CAAC;QACrB,eAAe,EAAE,MAAM,CAAC;QACxB,cAAc,EAAE,MAAM,CAAC;KAC1B,CAAC;gBAEU,QAAQ,EAAE,cAAc;CAgFvC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import "../constants.js";
|
|
2
2
|
import { BubblesSettingsSchema as e } from "../types/bubble.js";
|
|
3
3
|
import "../types/index.js";
|
|
4
|
-
import t from "
|
|
5
|
-
|
|
4
|
+
import { joinAxisTitle as t, resolveLabelParts as n } from "../heatmap/labelParts.js";
|
|
5
|
+
import r from "lodash";
|
|
6
|
+
var i = class {
|
|
6
7
|
id;
|
|
7
8
|
type = "bubble";
|
|
8
9
|
facetSettings;
|
|
9
10
|
valueColumnSize;
|
|
10
11
|
valueColumnColor;
|
|
11
|
-
|
|
12
|
+
x;
|
|
12
13
|
xGroupBy;
|
|
13
14
|
xSortBy;
|
|
14
|
-
|
|
15
|
+
y;
|
|
15
16
|
yGroupBy;
|
|
16
17
|
ySortBy;
|
|
17
18
|
facetBy;
|
|
@@ -24,75 +25,77 @@ var n = class {
|
|
|
24
25
|
keysOrder;
|
|
25
26
|
chartSettings;
|
|
26
27
|
aes;
|
|
27
|
-
constructor(
|
|
28
|
-
e.parse(
|
|
28
|
+
constructor(i) {
|
|
29
|
+
e.parse(i), this.id = r.uniqueId("settings"), this.facetSettings = {
|
|
29
30
|
sharedX: !0,
|
|
30
31
|
sharedY: !0,
|
|
31
32
|
titlePosition: "left",
|
|
32
|
-
order:
|
|
33
|
-
...
|
|
34
|
-
}, this.facetBy =
|
|
35
|
-
let
|
|
33
|
+
order: i.facetSettings?.order ?? null,
|
|
34
|
+
...i.facetSettings
|
|
35
|
+
}, this.facetBy = i.facetBy ?? [], this.valueColumnSize = i.valueSize, this.valueColumnColor = i.valueColor, this.x = i.x, this.xGroupBy = i.xGroupBy ?? [], this.xSortBy = i.xSortBy ?? [], this.y = i.y, this.yGroupBy = i.yGroupBy ?? [], this.ySortBy = i.ySortBy ?? [], this.NAValueAs = i.NAValueAs ?? null, this.transform = i.transform ?? null, this.showEmptyRows = i.showEmptyRows ?? !1, this.showEmptyColumns = i.showEmptyColumns ?? !1, this.keysOrder = i.keysOrder ?? {}, this.normalization = i.normalization ?? null;
|
|
36
|
+
let a = i.size?.cellSize ?? null;
|
|
36
37
|
this.chartSettings = {
|
|
37
38
|
size: {
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
40
|
-
cellSize:
|
|
39
|
+
width: a ? null : i?.size?.width ?? (this.facetBy.length ? 400 : 600),
|
|
40
|
+
height: a ? null : i?.size?.height ?? (this.facetBy.length ? 250 : 350),
|
|
41
|
+
cellSize: a
|
|
41
42
|
},
|
|
42
43
|
title: {
|
|
43
44
|
position: "center",
|
|
44
45
|
show: !0,
|
|
45
|
-
...
|
|
46
|
-
name:
|
|
46
|
+
...i.title,
|
|
47
|
+
name: i.title?.name ?? "Chart"
|
|
47
48
|
},
|
|
48
49
|
yAxis: {
|
|
49
|
-
title: n.
|
|
50
|
+
title: t(n(i.y, i.yAxis?.labelParts)),
|
|
50
51
|
showTicks: !0,
|
|
51
52
|
showTitle: !0,
|
|
52
53
|
showAxisLabels: !0,
|
|
53
54
|
position: "left",
|
|
54
55
|
axisLabelsAngle: 90,
|
|
55
56
|
sorting: "asc",
|
|
56
|
-
|
|
57
|
+
labelParts: null,
|
|
58
|
+
...i.yAxis
|
|
57
59
|
},
|
|
58
60
|
xAxis: {
|
|
59
|
-
title: n.
|
|
61
|
+
title: t(n(i.x, i.xAxis?.labelParts)),
|
|
60
62
|
showTicks: !0,
|
|
61
63
|
showTitle: !0,
|
|
62
64
|
showAxisLabels: !0,
|
|
63
65
|
position: "bottom",
|
|
64
66
|
axisLabelsAngle: 90,
|
|
65
67
|
sorting: "asc",
|
|
66
|
-
|
|
68
|
+
labelParts: null,
|
|
69
|
+
...i.xAxis
|
|
67
70
|
},
|
|
68
|
-
frame: { type:
|
|
71
|
+
frame: { type: i.frame?.type ?? "full" },
|
|
69
72
|
legend: {
|
|
70
73
|
show: !0,
|
|
71
74
|
position: "right",
|
|
72
|
-
...
|
|
75
|
+
...i.legend
|
|
73
76
|
},
|
|
74
77
|
tooltips: {
|
|
75
78
|
show: !0,
|
|
76
|
-
...
|
|
79
|
+
...i.tooltips
|
|
77
80
|
}
|
|
78
81
|
}, this.aggregation = {
|
|
79
82
|
x: !1,
|
|
80
83
|
y: !1,
|
|
81
84
|
method: "min",
|
|
82
|
-
...
|
|
85
|
+
...i.aggregation
|
|
83
86
|
}, this.aes = {
|
|
84
|
-
minRadius:
|
|
85
|
-
maxRadius:
|
|
86
|
-
colorsList:
|
|
87
|
+
minRadius: i.aes?.minRadius ?? 3,
|
|
88
|
+
maxRadius: i.aes?.maxRadius ?? 20,
|
|
89
|
+
colorsList: i.aes?.colorsList ?? [
|
|
87
90
|
"black",
|
|
88
91
|
"white",
|
|
89
92
|
"red"
|
|
90
93
|
],
|
|
91
|
-
cellStrokeColor:
|
|
92
|
-
emptyCellColor:
|
|
94
|
+
cellStrokeColor: i.aes?.cellStrokeColor ?? "#110529",
|
|
95
|
+
emptyCellColor: i.aes?.emptyCellColor ?? "white"
|
|
93
96
|
};
|
|
94
97
|
}
|
|
95
98
|
};
|
|
96
|
-
export {
|
|
99
|
+
export { i as BubbleSettingsImpl };
|
|
97
100
|
|
|
98
101
|
//# sourceMappingURL=BubbleSettingsImpl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BubbleSettingsImpl.js","names":[],"sources":["../../src/bubble/BubbleSettingsImpl.ts"],"sourcesContent":["import { BLACK, DEFAULT_HEIGHT, DEFAULT_HEIGHT_SMALL, DEFAULT_WIDTH, DEFAULT_WIDTH_SMALL } from '../constants';\nimport { BubblesSettingsSchema } from '../types';\nimport type {\n AggregationMethod,\n BubbleSettings,\n ColumnName,\n FrameType,\n LegendPosition,\n NormalizationDirection,\n NormalizationMethod,\n SettingsInterface,\n TitlePosition,\n} from '../types';\nimport lodash from 'lodash';\n\nexport class BubbleSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'bubble';\n readonly facetSettings: {\n order: string[] | null;\n sharedX: boolean;\n sharedY: boolean;\n nRows?: number;\n nCols?: number;\n titlePosition: 'left' | 'center' | 'right';\n };\n readonly valueColumnSize: ColumnName;\n readonly valueColumnColor: ColumnName;\n readonly
|
|
1
|
+
{"version":3,"file":"BubbleSettingsImpl.js","names":[],"sources":["../../src/bubble/BubbleSettingsImpl.ts"],"sourcesContent":["import { BLACK, DEFAULT_HEIGHT, DEFAULT_HEIGHT_SMALL, DEFAULT_WIDTH, DEFAULT_WIDTH_SMALL } from '../constants';\nimport { BubblesSettingsSchema } from '../types';\nimport type {\n AggregationMethod,\n BubbleSettings,\n ColumnName,\n FrameType,\n LegendPosition,\n NormalizationDirection,\n NormalizationMethod,\n SettingsInterface,\n TitlePosition,\n} from '../types';\nimport lodash from 'lodash';\nimport { joinAxisTitle, resolveLabelParts } from '../heatmap/labelParts';\n\nexport class BubbleSettingsImpl implements SettingsInterface {\n readonly id: string;\n readonly type = 'bubble';\n readonly facetSettings: {\n order: string[] | null;\n sharedX: boolean;\n sharedY: boolean;\n nRows?: number;\n nCols?: number;\n titlePosition: 'left' | 'center' | 'right';\n };\n readonly valueColumnSize: ColumnName;\n readonly valueColumnColor: ColumnName;\n readonly x: ColumnName[];\n readonly xGroupBy: ColumnName[];\n readonly xSortBy: ColumnName[];\n readonly y: ColumnName[];\n readonly yGroupBy: ColumnName[];\n readonly ySortBy: ColumnName[];\n readonly facetBy: ColumnName[];\n readonly normalization: {\n direction: NormalizationDirection;\n method: NormalizationMethod;\n colorRange?: number[];\n sizeRange?: number[];\n } | null;\n readonly aggregation: {\n x: boolean;\n y: boolean;\n method: AggregationMethod;\n };\n readonly NAValueAs: number | null;\n readonly transform: 'log' | null;\n readonly showEmptyRows: boolean;\n readonly showEmptyColumns: boolean;\n readonly keysOrder: Record<string, string[]>;\n readonly chartSettings: {\n readonly size: { width: number | null; height: number | null, cellSize: number | null };\n readonly title: { name: string; show: boolean; position: TitlePosition };\n readonly yAxis: {\n title: string;\n showTicks: boolean;\n showTitle: boolean;\n showAxisLabels: boolean;\n position: 'left' | 'right';\n axisLabelsAngle: 0 | 45 | 90;\n sorting: 'asc' | 'desc';\n labelParts: ColumnName['value'][] | null;\n };\n readonly xAxis: {\n title: string;\n showTicks: boolean;\n showTitle: boolean;\n showAxisLabels: boolean;\n position: 'bottom' | 'top';\n axisLabelsAngle: 0 | 45 | 90;\n sorting: 'asc' | 'desc';\n labelParts: ColumnName['value'][] | null;\n };\n readonly frame: { type: FrameType };\n readonly legend: { show: boolean; position: LegendPosition };\n readonly tooltips: { show: boolean; content?: ColumnName[] };\n };\n readonly aes: {\n minRadius: number;\n maxRadius: number;\n colorsList: string[];\n cellStrokeColor: string;\n emptyCellColor: string;\n };\n\n constructor(settings: BubbleSettings) {\n BubblesSettingsSchema.parse(settings);\n this.id = lodash.uniqueId('settings');\n this.facetSettings = { sharedX: true, sharedY: true, titlePosition: 'left', order: settings.facetSettings?.order ?? null, ...settings.facetSettings };\n this.facetBy = settings.facetBy ?? [];\n this.valueColumnSize = settings.valueSize;\n this.valueColumnColor = settings.valueColor;\n this.x = settings.x;\n this.xGroupBy = settings.xGroupBy ?? [];\n this.xSortBy = settings.xSortBy ?? [];\n this.y = settings.y;\n this.yGroupBy = settings.yGroupBy ?? [];\n this.ySortBy = settings.ySortBy ?? [];\n this.NAValueAs = settings.NAValueAs ?? null;\n this.transform = settings.transform ?? null;\n this.showEmptyRows = settings.showEmptyRows ?? false;\n this.showEmptyColumns = settings.showEmptyColumns ?? false;\n this.keysOrder = settings.keysOrder ?? {};\n this.normalization = settings.normalization ?? null;\n\n const cellSize = settings.size?.cellSize ?? null;\n const width = cellSize ? null : settings?.size?.width ?? (this.facetBy.length ? DEFAULT_WIDTH_SMALL : DEFAULT_WIDTH);\n const height = cellSize ? null : settings?.size?.height ?? (this.facetBy.length ? DEFAULT_HEIGHT_SMALL : DEFAULT_HEIGHT);\n this.chartSettings = {\n size: { width, height, cellSize },\n title: {\n position: 'center',\n show: true,\n ...settings.title,\n name: settings.title?.name ?? 'Chart',\n },\n yAxis: {\n title: joinAxisTitle(resolveLabelParts(settings.y, settings.yAxis?.labelParts)),\n showTicks: true,\n showTitle: true,\n showAxisLabels: true,\n position: 'left',\n axisLabelsAngle: 90,\n sorting: 'asc',\n labelParts: null,\n ...settings.yAxis,\n },\n xAxis: {\n title: joinAxisTitle(resolveLabelParts(settings.x, settings.xAxis?.labelParts)),\n showTicks: true,\n showTitle: true,\n showAxisLabels: true,\n position: 'bottom',\n axisLabelsAngle: 90,\n sorting: 'asc',\n labelParts: null,\n ...settings.xAxis,\n },\n frame: { type: settings.frame?.type ?? 'full' },\n legend: {\n show: true,\n position: 'right',\n ...settings.legend,\n },\n tooltips: {\n show: true,\n ...settings.tooltips,\n },\n };\n\n this.aggregation = {\n x: false,\n y: false,\n method: 'min',\n ...settings.aggregation\n };\n\n this.aes = {\n minRadius: settings.aes?.minRadius ?? 3,\n maxRadius: settings.aes?.maxRadius ?? 20,\n colorsList: settings.aes?.colorsList ?? ['black', 'white', 'red'],\n cellStrokeColor: settings.aes?.cellStrokeColor ?? BLACK,\n emptyCellColor: settings.aes?.emptyCellColor ?? 'white',\n };\n }\n}\n"],"mappings":";;;;;AAgBA,IAAa,IAAb,MAA6D;CACzD;CACA,OAAgB;CAChB;CAQA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAMA;CAKA;CACA;CACA;CACA;CACA;CACA;CA2BA;CAQA,YAAY,GAA0B;AAkBlC,EAjBA,EAAsB,MAAM,EAAS,EACrC,KAAK,KAAK,EAAO,SAAS,WAAW,EACrC,KAAK,gBAAgB;GAAE,SAAS;GAAM,SAAS;GAAM,eAAe;GAAQ,OAAO,EAAS,eAAe,SAAS;GAAM,GAAG,EAAS;GAAe,EACrJ,KAAK,UAAU,EAAS,WAAW,EAAE,EACrC,KAAK,kBAAkB,EAAS,WAChC,KAAK,mBAAmB,EAAS,YACjC,KAAK,IAAI,EAAS,GAClB,KAAK,WAAW,EAAS,YAAY,EAAE,EACvC,KAAK,UAAU,EAAS,WAAW,EAAE,EACrC,KAAK,IAAI,EAAS,GAClB,KAAK,WAAW,EAAS,YAAY,EAAE,EACvC,KAAK,UAAU,EAAS,WAAW,EAAE,EACrC,KAAK,YAAY,EAAS,aAAa,MACvC,KAAK,YAAY,EAAS,aAAa,MACvC,KAAK,gBAAgB,EAAS,iBAAiB,IAC/C,KAAK,mBAAmB,EAAS,oBAAoB,IACrD,KAAK,YAAY,EAAS,aAAa,EAAE,EACzC,KAAK,gBAAgB,EAAS,iBAAiB;EAE/C,IAAM,IAAW,EAAS,MAAM,YAAY;AAoD5C,EAjDA,KAAK,gBAAgB;GACjB,MAAM;IAAE,OAHE,IAAW,OAAO,GAAU,MAAM,UAAU,KAAK,QAAQ,SAAA,MAAA;IAGpD,QAFJ,IAAW,OAAO,GAAU,MAAM,WAAW,KAAK,QAAQ,SAAA,MAAA;IAE9C;IAAU;GACjC,OAAO;IACH,UAAU;IACV,MAAM;IACN,GAAG,EAAS;IACZ,MAAM,EAAS,OAAO,QAAQ;IACjC;GACD,OAAO;IACH,OAAO,EAAc,EAAkB,EAAS,GAAG,EAAS,OAAO,WAAW,CAAC;IAC/E,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,UAAU;IACV,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,GAAG,EAAS;IACf;GACD,OAAO;IACH,OAAO,EAAc,EAAkB,EAAS,GAAG,EAAS,OAAO,WAAW,CAAC;IAC/E,WAAW;IACX,WAAW;IACX,gBAAgB;IAChB,UAAU;IACV,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,GAAG,EAAS;IACf;GACD,OAAO,EAAE,MAAM,EAAS,OAAO,QAAQ,QAAQ;GAC/C,QAAQ;IACJ,MAAM;IACN,UAAU;IACV,GAAG,EAAS;IACf;GACD,UAAU;IACN,MAAM;IACN,GAAG,EAAS;IACf;GACJ,EAED,KAAK,cAAc;GACf,GAAG;GACH,GAAG;GACH,QAAQ;GACR,GAAG,EAAS;GACf,EAED,KAAK,MAAM;GACP,WAAW,EAAS,KAAK,aAAa;GACtC,WAAW,EAAS,KAAK,aAAa;GACtC,YAAY,EAAS,KAAK,cAAc;IAAC;IAAS;IAAS;IAAM;GACjE,iBAAiB,EAAS,KAAK,mBAAA;GAC/B,gBAAgB,EAAS,KAAK,kBAAkB;GACnD"}
|
|
@@ -5,6 +5,6 @@ import { Cell, GroupedCellsData } from '../heatmap/fillCellsData';
|
|
|
5
5
|
type BubbleDataFields = 'sizeValue' | 'colorValue';
|
|
6
6
|
export type CellBubble = Cell<BubbleDataFields>;
|
|
7
7
|
export type GroupedCellsBubble = GroupedCellsData<BubbleDataFields>;
|
|
8
|
-
export declare function getGroupedCellsData(data: DataFrame,
|
|
8
|
+
export declare function getGroupedCellsData(data: DataFrame, x: ColumnName[], y: ColumnName[], valueColumnSize: ColumnName, valueColumnColor: ColumnName, facetBy: ColumnName[], xGroupBy: ColumnName[], yGroupBy: ColumnName[], xSortBy: ColumnName[], ySortBy: ColumnName[], facetSettings: BubbleSettingsImpl['facetSettings'], normalization: BubbleSettingsImpl['normalization'], NAValueAs: BubbleSettingsImpl['NAValueAs'], transform: BubbleSettingsImpl['transform'], keysOrder: BubbleSettingsImpl['keysOrder'], xAxis: BubbleSettingsImpl['chartSettings']['xAxis'], yAxis: BubbleSettingsImpl['chartSettings']['yAxis'], aggregation: BubbleSettingsImpl['aggregation'], showEmptyRows?: boolean, showEmptyColumns?: boolean): GroupedCellsBubble;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=getGroupedCellsData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGroupedCellsData.d.ts","sourceRoot":"","sources":["../../src/bubble/getGroupedCellsData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,KAAK,IAAI,EAAiB,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI3F,KAAK,gBAAgB,GAAG,WAAW,GAAC,YAAY,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAChD,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AAoCpE,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,SAAS,EACf,
|
|
1
|
+
{"version":3,"file":"getGroupedCellsData.d.ts","sourceRoot":"","sources":["../../src/bubble/getGroupedCells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pB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGroupedCellsData.js","names":[],"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
|
|
1
|
+
{"version":3,"file":"getGroupedCellsData.js","names":[],"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 x: ColumnName[],\n y: ColumnName[],\n valueColumnSize: ColumnName,\n valueColumnColor: ColumnName,\n facetBy: ColumnName[],\n xGroupBy: ColumnName[],\n yGroupBy: ColumnName[],\n xSortBy: ColumnName[],\n ySortBy: ColumnName[],\n facetSettings: BubbleSettingsImpl['facetSettings'],\n normalization: BubbleSettingsImpl['normalization'],\n NAValueAs: BubbleSettingsImpl['NAValueAs'],\n transform: BubbleSettingsImpl['transform'],\n keysOrder: BubbleSettingsImpl['keysOrder'],\n xAxis: BubbleSettingsImpl['chartSettings']['xAxis'],\n yAxis: BubbleSettingsImpl['chartSettings']['yAxis'],\n aggregation: BubbleSettingsImpl['aggregation'],\n showEmptyRows: boolean = false,\n showEmptyColumns: boolean = false,\n): GroupedCellsBubble {\n const result: GroupedCellsBubble = createEmptyGroupedCells();\n\n fillCellsData(result, {\n data,\n x, y,\n valueColumns: { sizeValue: valueColumnSize, colorValue: valueColumnColor },\n facetBy, xGroupBy, yGroupBy,\n xSortBy, ySortBy,\n facetSettings,\n annotations: [],\n dendrogramX: null,\n dendrogramY: null,\n normalizationBySource: { sizeValue: null, colorValue: normalization },\n NAValueAs,\n transformBySource: { sizeValue: null, colorValue: transform },\n keysOrder,\n xAxis,\n yAxis,\n aggregation,\n showEmptyRows,\n showEmptyColumns,\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"],"mappings":";AAKA,IAAM,IAA2B;AAMjC,SAAS,IAA8C;AACnD,QAAO;EACH,MAAM;GACF,cAAc,CAAC,aAAa,aAAa;GACzC,WAAW,EAAE;GACb,YAAY,EAAE;GACd,YAAY,EAAE;GAEd,OAAO,EAAE;GACT,OAAO,EAAE;GACT,eAAe,EAAE;GACjB,eAAe,EAAE;GAEjB,SAAS,EAAE;GACX,SAAS,EAAE;GACX,cAAc,EAAE;GAChB,cAAc,EAAE;GAEhB,gBAAgB,EAAE;GAClB,iBAAiB,EAAE;GACnB,iBAAiB,EAAE;GAEnB,aAAa,EAAE;GACf,aAAa,EAAE;GAEf,aAAa;IACT,WAAW,CAAC,UAAU,UAAU;IAChC,YAAY,CAAC,UAAU,UAAU;IACpC;GACJ;EACD,QAAQ,EAAE;EACb;;AAGL,SAAgB,EACZ,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,IAAyB,IACzB,IAA4B,IACV;CAClB,IAAM,IAA6B,GAAyB;AAuB5D,KArBA,EAAc,GAAQ;EAClB;EACA;EAAG;EACH,cAAc;GAAE,WAAW;GAAiB,YAAY;GAAkB;EAC1E;EAAS;EAAU;EACnB;EAAS;EACT;EACA,aAAa,EAAE;EACf,aAAa;EACb,aAAa;EACb,uBAAuB;GAAE,WAAW;GAAM,YAAY;GAAe;EACrE;EACA,mBAAmB;GAAE,WAAW;GAAM,YAAY;GAAW;EAC7D;EACA;EACA;EACA;EACA;EACA;EACH,CAAC,EAEE,EAAO,KAAK,MAAM,SAAS,EAAO,KAAK,MAAM,SAAS,EACtD,OAAM,MAAM,uCAAuC,EAAO,KAAK,MAAM,SAAS,EAAO,KAAK,MAAM,OAAO,GAAG;AAE9G,QAAO"}
|
|
@@ -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,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAoC,MAAM,UAAU,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwC,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,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,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAoC,MAAM,UAAU,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAwC,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKtG,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;IAiBvB,OAAO;IAIP,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc;IA2B/D,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IAIhD,MAAM,IAAI,MAAM;IAKhB,mCAAmC,CAAC,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,kBAAkB;IA0BlG,+BAA+B,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS;IAUpE,WAAW;IA+BX,gBAAgB;IAOhB,YAAY;IAoBZ,OAAO,CAAC,WAAW,CAIjB;CACL"}
|
package/dist/bubble/index.js
CHANGED
|
@@ -2,18 +2,20 @@ import { AbstractChart as e } from "../AbstractChart.js";
|
|
|
2
2
|
import { getUnknownErrorInfo as t, isErrorInfo as n } from "../types/common.js";
|
|
3
3
|
import "../types/index.js";
|
|
4
4
|
import { arraysAreDifferent as r } from "../utils/arraysAreDifferent.js";
|
|
5
|
-
import {
|
|
6
|
-
import a from "
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import { labelPartsChanged as i } from "../heatmap/labelParts.js";
|
|
6
|
+
import { compareColumnGroups as a } from "../utils/compareColumnGroups.js";
|
|
7
|
+
import { BubbleSettingsImpl as o } from "./BubbleSettingsImpl.js";
|
|
8
|
+
import s from "./ChartRenderer.js";
|
|
9
|
+
import { getCellTooltip as c } from "./getCellTooltip.js";
|
|
10
|
+
import { getGroupedCellsData as l } from "./getGroupedCellsData.js";
|
|
11
|
+
import { renderToString as u } from "react-dom/server.browser";
|
|
12
|
+
var d = class extends e {
|
|
11
13
|
settings;
|
|
12
14
|
chartRenderer;
|
|
13
15
|
onTooltipHintSwitch = () => void 0;
|
|
14
16
|
calculatedData = null;
|
|
15
17
|
constructor(e, t, n) {
|
|
16
|
-
super(e, t), this.settings = new
|
|
18
|
+
super(e, t), this.settings = new o(t), this.chartRenderer = new s(), n && (this.onTooltipHintSwitch = n[0]);
|
|
17
19
|
}
|
|
18
20
|
mount(e) {
|
|
19
21
|
try {
|
|
@@ -28,7 +30,7 @@ var l = class extends e {
|
|
|
28
30
|
updateSettingsAndData(e, r) {
|
|
29
31
|
try {
|
|
30
32
|
let t = this.settings, n = this.data;
|
|
31
|
-
this.settings = new
|
|
33
|
+
this.settings = new o(r), this.data = e, this._needUpdateCalculatedDataBySettings(t, this.settings) || this._needUpdateCalculatedDataByData(n, this.data) ? this._updateData() : this._updateAesInData(), this._updateChart(), this.hasError = !1, this.errorInfo = null;
|
|
32
34
|
} catch (e) {
|
|
33
35
|
this.hasError = !0, e instanceof Error && (this.errorInfo = n(e.cause) ? e.cause : t(e), this.chartRenderer.renderError(e.message), console.error(e));
|
|
34
36
|
}
|
|
@@ -37,19 +39,18 @@ var l = class extends e {
|
|
|
37
39
|
console.warn("no chart state for bubble chart");
|
|
38
40
|
}
|
|
39
41
|
export() {
|
|
40
|
-
return this._updateChart(),
|
|
42
|
+
return this._updateChart(), u(this.chartRenderer.component);
|
|
41
43
|
}
|
|
42
44
|
_needUpdateCalculatedDataBySettings(e, t) {
|
|
43
|
-
|
|
44
|
-
return e.facetBy.some((e, n) => e.value !== t.facetBy[n]?.value) || r(e.facetSettings?.order ?? [], t.facetSettings?.order ?? []) || e.normalization?.method !== t.normalization?.method || e.normalization?.direction !== t.normalization?.direction || e.xColumn.value !== t.xColumn.value || e.yColumn.value !== t.yColumn.value || e.valueColumnColor.value !== t.valueColumnColor.value || e.valueColumnSize.value !== t.valueColumnSize.value || n(e.xSortBy, t.xSortBy) || n(e.ySortBy, t.ySortBy) || e.chartSettings.xAxis.sorting !== t.chartSettings.xAxis.sorting || e.chartSettings.yAxis.sorting !== t.chartSettings.yAxis.sorting || e.NAValueAs !== t.NAValueAs || e.transform !== t.transform || e.aggregation?.method !== t.aggregation?.method || e.aggregation?.x !== t.aggregation?.x || e.aggregation?.y !== t.aggregation?.y || e.showEmptyRows !== t.showEmptyRows || e.showEmptyColumns !== t.showEmptyColumns;
|
|
45
|
+
return e.facetBy.some((e, n) => e.value !== t.facetBy[n]?.value) || r(e.facetSettings?.order ?? [], t.facetSettings?.order ?? []) || e.normalization?.method !== t.normalization?.method || e.normalization?.direction !== t.normalization?.direction || a(e.x, t.x) || a(e.y, t.y) || a(e.xGroupBy, t.xGroupBy) || a(e.yGroupBy, t.yGroupBy) || e.valueColumnColor.value !== t.valueColumnColor.value || e.valueColumnSize.value !== t.valueColumnSize.value || a(e.xSortBy, t.xSortBy) || a(e.ySortBy, t.ySortBy) || e.chartSettings.xAxis.sorting !== t.chartSettings.xAxis.sorting || e.chartSettings.yAxis.sorting !== t.chartSettings.yAxis.sorting || e.NAValueAs !== t.NAValueAs || e.transform !== t.transform || e.aggregation?.method !== t.aggregation?.method || e.aggregation?.x !== t.aggregation?.x || e.aggregation?.y !== t.aggregation?.y || e.showEmptyRows !== t.showEmptyRows || e.showEmptyColumns !== t.showEmptyColumns || i(e.chartSettings.xAxis.labelParts, t.chartSettings.xAxis.labelParts) || i(e.chartSettings.yAxis.labelParts, t.chartSettings.yAxis.labelParts);
|
|
45
46
|
}
|
|
46
47
|
_needUpdateCalculatedDataByData(e, t) {
|
|
47
48
|
let n = Object.keys(e.data), r = Object.keys(t.data);
|
|
48
49
|
return e.id !== t.id || n.length !== r.length || n.some((n) => e.data[n].length !== t.data[n]?.length);
|
|
49
50
|
}
|
|
50
51
|
_updateData() {
|
|
51
|
-
let { facetBy: e, facetSettings: t, xGroupBy: n, yGroupBy: r, xSortBy: i, ySortBy: a,
|
|
52
|
-
this.calculatedData = { groupedCellsData:
|
|
52
|
+
let { facetBy: e, facetSettings: t, xGroupBy: n, yGroupBy: r, xSortBy: i, ySortBy: a, x: o, y: s, valueColumnSize: c, valueColumnColor: u, normalization: d, NAValueAs: f, transform: p, aggregation: m, chartSettings: h, keysOrder: g, showEmptyRows: _, showEmptyColumns: v } = this.settings;
|
|
53
|
+
this.calculatedData = { groupedCellsData: l(this.data, o, s, c, u, e, n, r, i, a, t, d, f, p, g, h.xAxis, h.yAxis, m, _, v) };
|
|
53
54
|
}
|
|
54
55
|
_updateAesInData() {
|
|
55
56
|
this.calculatedData;
|
|
@@ -59,8 +60,8 @@ var l = class extends e {
|
|
|
59
60
|
let { id: e, chartSettings: t, facetSettings: n, valueColumnColor: r, valueColumnSize: i, normalization: a, aes: o } = this.settings;
|
|
60
61
|
this.chartRenderer.render(this.data, e, t, n, this.calculatedData.groupedCellsData, r, i, a, o, this._getTooltip, this.onTooltipHintSwitch);
|
|
61
62
|
}
|
|
62
|
-
_getTooltip = (e) => this.calculatedData ?
|
|
63
|
+
_getTooltip = (e) => this.calculatedData ? c(this.data, e, this.calculatedData.groupedCellsData.meta, this.settings?.chartSettings?.tooltips?.content) : ["No data available"];
|
|
63
64
|
};
|
|
64
|
-
export {
|
|
65
|
+
export { d as ChartBubble };
|
|
65
66
|
|
|
66
67
|
//# sourceMappingURL=index.js.map
|
package/dist/bubble/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/bubble/index.ts"],"sourcesContent":["import { renderToString } from 'react-dom/server.browser';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport { type BubbleEventHandlers, type BubbleSettings, getUnknownErrorInfo, isErrorInfo } from '../types';\nimport { BubbleSettingsImpl } from './BubbleSettingsImpl';\nimport ChartRenderer from './ChartRenderer';\nimport { getCellTooltip } from './getCellTooltip';\nimport { type CellBubble, getGroupedCellsData, type GroupedCellsBubble } from './getGroupedCellsData';\nimport { arraysAreDifferent } from '../utils/arraysAreDifferent';\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 this.errorInfo = null;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.errorInfo = isErrorInfo(err.cause) ? err.cause : getUnknownErrorInfo(err);\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 this.errorInfo = null;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.errorInfo = isErrorInfo(err.cause) ? err.cause : getUnknownErrorInfo(err);\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 const compareColumnGroups = (a: typeof prevSettings.xSortBy, b: typeof settings.xSortBy) =>\n a.length !== b.length || a.some((col, idx) => col.value !== b[idx].value);\n return prevSettings.facetBy.some((el, idx) => el.value !== settings.facetBy[idx]?.value) ||\n arraysAreDifferent(prevSettings.facetSettings?.order ?? [], settings.facetSettings?.order ?? []) ||\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 compareColumnGroups(prevSettings.xSortBy, settings.xSortBy) ||\n compareColumnGroups(prevSettings.ySortBy, settings.ySortBy) ||\n prevSettings.chartSettings.xAxis.sorting !== settings.chartSettings.xAxis.sorting ||\n prevSettings.chartSettings.yAxis.sorting !== settings.chartSettings.yAxis.sorting ||\n prevSettings.NAValueAs !== settings.NAValueAs ||\n prevSettings.transform !== settings.transform ||\n prevSettings.aggregation?.method !== settings.aggregation?.method ||\n prevSettings.aggregation?.x !== settings.aggregation?.x ||\n prevSettings.aggregation?.y !== settings.aggregation?.y ||\n prevSettings.showEmptyRows !== settings.showEmptyRows ||\n prevSettings.showEmptyColumns !== settings.showEmptyColumns;\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, facetSettings, xGroupBy, yGroupBy, xSortBy, ySortBy, xColumn, yColumn, valueColumnSize, valueColumnColor, normalization, NAValueAs, transform, aggregation, chartSettings, keysOrder, showEmptyRows, showEmptyColumns} = this.settings;\n\n const groupedCellsData = getGroupedCellsData(\n this.data,\n xColumn,\n yColumn,\n valueColumnSize,\n valueColumnColor,\n facetBy,\n xGroupBy,\n yGroupBy,\n xSortBy,\n ySortBy,\n facetSettings,\n normalization,\n NAValueAs,\n transform,\n keysOrder,\n chartSettings.xAxis,\n chartSettings.yAxis,\n aggregation,\n showEmptyRows,\n showEmptyColumns,\n );\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: 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"],"mappings":";;;;;;;;;AAUA,IAAa,IAAb,cAAiC,EAAc;CAC3C;CACA;CAEA,4BAAiD,KAAA;CACjD,iBAEW;CAEX,YAAY,GAAiB,GAA0B,GAAqC;AAKxF,EAJA,MAAM,GAAM,EAAS,EAErB,KAAK,WAAW,IAAI,EAAmB,EAAS,EAChD,KAAK,gBAAgB,IAAI,GAAe,EACpC,MACA,KAAK,sBAAsB,EAAc;;CAIjD,MAAM,GAAmB;AACrB,MAAI;AAKA,GAJA,KAAK,cAAc,KAAK,EAAK,EAC7B,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,IAChB,KAAK,YAAY;WACZ,GAAK;AAEV,GADA,KAAK,WAAW,IACZ,aAAe,UACf,KAAK,YAAY,EAAY,EAAI,MAAM,GAAG,EAAI,QAAQ,EAAoB,EAAI,EAC9E,KAAK,cAAc,YAAY,EAAI,QAAkB,EACrD,QAAQ,MAAM,EAAI;;;CAK9B,UAAU;AACN,OAAK,cAAc,OAAO;;CAG9B,sBAAsB,GAAiB,GAA0B;AAC7D,MAAI;GACA,IAAM,IAAmB,KAAK,UACxB,IAAe,KAAK;AAa1B,GAZA,KAAK,WAAW,IAAI,EAAmB,EAAS,EAChD,KAAK,OAAO,GAER,KAAK,oCAAoC,GAAkB,KAAK,SAAS,IACzE,KAAK,gCAAgC,GAAc,KAAK,KAAK,GAE7D,KAAK,aAAa,GAElB,KAAK,kBAAkB,EAE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,EAAa,kBAAkB,EAAS,iBACxC,EAAa,qBAAqB,EAAS;;CAGnD,gCAAgC,GAAqB,GAAiB;EAClE,IAAM,IAAW,OAAO,KAAK,EAAS,KAAK,EACrC,IAAO,OAAO,KAAK,EAAK,KAAK;AACnC,SACI,EAAS,OAAO,EAAK,MACrB,EAAS,WAAW,EAAK,UACzB,EAAS,MAAK,MAAO,EAAS,KAAK,GAAK,WAAW,EAAK,KAAK,IAAM,OAAO;;CAIlF,cAAc;EACV,IAAM,EAAC,YAAS,kBAAe,aAAU,aAAU,YAAS,YAAS,YAAS,YAAS,oBAAiB,qBAAkB,kBAAe,cAAW,cAAW,gBAAa,kBAAe,cAAW,kBAAe,wBAAoB,KAAK;AAyB9O,OAAK,iBAAiB,EAClB,kBAxBqB,EACrB,KAAK,MACL,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,EAAc,OACd,EAAc,OACd,GACA,GACA,EACH,EAIA;;CAGL,mBAAmB;AACI,OAAK;;CAM5B,eAAe;AACX,MAAI,CAAC,KAAK,eACN;EAEJ,IAAM,EAAC,OAAI,kBAAe,kBAAe,qBAAkB,oBAAiB,kBAAe,WAAO,KAAK;AACvG,OAAK,cAAc,OACf,KAAK,MACL,GACA,GACA,GACA,KAAK,eAAe,kBACpB,GACA,GACA,GACA,GACA,KAAK,aACL,KAAK,oBACR;;CAGL,eAAuB,MACZ,KAAK,iBACN,EAAe,KAAK,MAAM,GAAM,KAAK,eAAe,iBAAiB,MAAM,KAAK,UAAU,eAAe,UAAU,QAAQ,GAC3H,CAAC,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/bubble/index.ts"],"sourcesContent":["import { renderToString } from 'react-dom/server.browser';\nimport { AbstractChart } from '../AbstractChart';\nimport type { DataFrame } from '../DataFrame';\nimport { type BubbleEventHandlers, type BubbleSettings, getUnknownErrorInfo, isErrorInfo } from '../types';\nimport { BubbleSettingsImpl } from './BubbleSettingsImpl';\nimport ChartRenderer from './ChartRenderer';\nimport { getCellTooltip } from './getCellTooltip';\nimport { type CellBubble, getGroupedCellsData, type GroupedCellsBubble } from './getGroupedCellsData';\nimport { arraysAreDifferent } from '../utils/arraysAreDifferent';\nimport { compareColumnGroups } from '../utils/compareColumnGroups';\nimport { labelPartsChanged } from '../heatmap/labelParts';\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 this.errorInfo = null;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.errorInfo = isErrorInfo(err.cause) ? err.cause : getUnknownErrorInfo(err);\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 this.errorInfo = null;\n } catch (err) {\n this.hasError = true;\n if (err instanceof Error) {\n this.errorInfo = isErrorInfo(err.cause) ? err.cause : getUnknownErrorInfo(err);\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 arraysAreDifferent(prevSettings.facetSettings?.order ?? [], settings.facetSettings?.order ?? []) ||\n prevSettings.normalization?.method !== settings.normalization?.method ||\n prevSettings.normalization?.direction !== settings.normalization?.direction ||\n compareColumnGroups(prevSettings.x, settings.x) ||\n compareColumnGroups(prevSettings.y, settings.y) ||\n compareColumnGroups(prevSettings.xGroupBy, settings.xGroupBy) ||\n compareColumnGroups(prevSettings.yGroupBy, settings.yGroupBy) ||\n prevSettings.valueColumnColor.value !== settings.valueColumnColor.value ||\n prevSettings.valueColumnSize.value !== settings.valueColumnSize.value ||\n compareColumnGroups(prevSettings.xSortBy, settings.xSortBy) ||\n compareColumnGroups(prevSettings.ySortBy, settings.ySortBy) ||\n prevSettings.chartSettings.xAxis.sorting !== settings.chartSettings.xAxis.sorting ||\n prevSettings.chartSettings.yAxis.sorting !== settings.chartSettings.yAxis.sorting ||\n prevSettings.NAValueAs !== settings.NAValueAs ||\n prevSettings.transform !== settings.transform ||\n prevSettings.aggregation?.method !== settings.aggregation?.method ||\n prevSettings.aggregation?.x !== settings.aggregation?.x ||\n prevSettings.aggregation?.y !== settings.aggregation?.y ||\n prevSettings.showEmptyRows !== settings.showEmptyRows ||\n prevSettings.showEmptyColumns !== settings.showEmptyColumns ||\n labelPartsChanged(prevSettings.chartSettings.xAxis.labelParts, settings.chartSettings.xAxis.labelParts) ||\n labelPartsChanged(prevSettings.chartSettings.yAxis.labelParts, settings.chartSettings.yAxis.labelParts);\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, facetSettings, xGroupBy, yGroupBy, xSortBy, ySortBy, x, y, valueColumnSize, valueColumnColor, normalization, NAValueAs, transform, aggregation, chartSettings, keysOrder, showEmptyRows, showEmptyColumns} = this.settings;\n\n const groupedCellsData = getGroupedCellsData(\n this.data,\n x,\n y,\n valueColumnSize,\n valueColumnColor,\n facetBy,\n xGroupBy,\n yGroupBy,\n xSortBy,\n ySortBy,\n facetSettings,\n normalization,\n NAValueAs,\n transform,\n keysOrder,\n chartSettings.xAxis,\n chartSettings.yAxis,\n aggregation,\n showEmptyRows,\n showEmptyColumns,\n );\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: 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"],"mappings":";;;;;;;;;;;AAYA,IAAa,IAAb,cAAiC,EAAc;CAC3C;CACA;CAEA,4BAAiD,KAAA;CACjD,iBAEW;CAEX,YAAY,GAAiB,GAA0B,GAAqC;AAKxF,EAJA,MAAM,GAAM,EAAS,EAErB,KAAK,WAAW,IAAI,EAAmB,EAAS,EAChD,KAAK,gBAAgB,IAAI,GAAe,EACpC,MACA,KAAK,sBAAsB,EAAc;;CAIjD,MAAM,GAAmB;AACrB,MAAI;AAKA,GAJA,KAAK,cAAc,KAAK,EA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c,OACd,GACA,GACA,EACH,EAIA;;CAGL,mBAAmB;AACI,OAAK;;CAM5B,eAAe;AACX,MAAI,CAAC,KAAK,eACN;EAEJ,IAAM,EAAC,OAAI,kBAAe,kBAAe,qBAAkB,oBAAiB,kBAAe,WAAO,KAAK;AACvG,OAAK,cAAc,OACf,KAAK,MACL,GACA,GACA,GACA,KAAK,eAAe,kBACpB,GACA,GACA,GACA,GACA,KAAK,aACL,KAAK,oBACR;;CAGL,eAAuB,MACZ,KAAK,iBACN,EAAe,KAAK,MAAM,GAAM,KAAK,eAAe,iBAAiB,MAAM,KAAK,UAAU,eAAe,UAAU,QAAQ,GAC3H,CAAC,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBarElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,aAAa;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1B,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAmBD,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,EACR,GAAG,EACH,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"ErrorBarElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,aAAa;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1B,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAmBD,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,MAAM,EACN,WAAW,EACX,QAAQ,EACR,GAAG,EACH,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,aAAa,2CAwEf"}
|
|
@@ -13,6 +13,7 @@ function o(e, t, n, r) {
|
|
|
13
13
|
function s({ facetKey: s, scales: c, orientation: l, errorBar: u, aes: d, sideDistances: f, showTooltips: p, activeElementContainer: m, tooltipsContainer: h, tooltipsData: g }) {
|
|
14
14
|
let _ = l === "vertical", v = o(c, "lineColor", d.lineColor, u), y = o(c, "fillColor", d.fillColor, u), b = o(c, "dotShape", d.dotShape, u), x = (c.xPrimary(u.primaryGrouping) ?? 0) + c.xPrimary.bandwidth() / 2, S = d.width === "auto" ? c.xPrimary.bandwidth() * .2 : d.width, C = c.y(u.min), w = c.y(u.max), T = c.y(u.value), E = n(b, d.dotSize, y), D = m && g.fixed, O = g.selectedData === u && D, k = d.showDots ? /* @__PURE__ */ i("g", {
|
|
15
15
|
transform: _ ? `translate(${x},${T})` : `translate(${T},${x})`,
|
|
16
|
+
strokeWidth: 1,
|
|
16
17
|
children: [
|
|
17
18
|
E,
|
|
18
19
|
p && h && /* @__PURE__ */ r("circle", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBarElement.js","names":[],"sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, InheritAesDiscrete, Orientation } from '../../../types';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { ErrorBar } from '../../layers';\nimport type { ErrorBarsData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface ErrorBarProps {\n facetKey: string;\n scales: ChartScales;\n errorBar: ErrorBar;\n orientation: Orientation;\n aes: ErrorBarsData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: ErrorBar\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n return scales.xPrimaryAes(geom.primaryGrouping)[field] as ValueType;\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.secondaryGrouping)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nexport function ErrorBarElement({\n facetKey,\n scales,\n orientation,\n errorBar,\n aes,\n sideDistances,\n showTooltips,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: ErrorBarProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, errorBar);\n const fillColor = getAesValue(scales, 'fillColor', aes.fillColor, errorBar);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, errorBar);\n const x = (scales.xPrimary(errorBar.primaryGrouping) ?? 0) + scales.xPrimary.bandwidth() / 2;\n const width = aes.width === 'auto' ? scales.xPrimary.bandwidth() * 0.2 : aes.width;\n const min = scales.y(errorBar.min);\n const max = scales.y(errorBar.max);\n const value = scales.y(errorBar.value);\n const shape = getPointShape(dotShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n const highlightedDot = tooltipsData.selectedData === errorBar && dimmedBackground;\n\n const dot = aes.showDots ? (\n <g transform={isVertical ? `translate(${x},${value})` : `translate(${value},${x})`}>\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(errorBar, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={[numberFormat(errorBar.value)]}\n x={isVertical ? x : value}\n y={isVertical ? value : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipsData.active && tooltipsData.selectedData === errorBar && tooltipsData.currentFacet === facetKey}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n ) : null;\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n fill=\"none\"\n strokeWidth={aes.lineWidth}\n >\n <g transform={isVertical ? `translate(${x},0)` : `translate(0,${x})`}>\n <line\n x1={isVertical ? 0 : min}\n x2={isVertical ? 0 : max}\n y1={isVertical ? min : 0}\n y2={isVertical ? max : 0}\n />\n <line\n x1={isVertical ? -width / 2 : min}\n x2={isVertical ? width / 2 : min}\n y1={isVertical ? min : -width / 2}\n y2={isVertical ? min : width / 2}\n />\n <line\n x1={isVertical ? -width / 2 : max}\n x2={isVertical ? width / 2 : max}\n y1={isVertical ? max : -width / 2}\n y2={isVertical ? max : width / 2}\n />\n </g>\n {highlightedDot ? createPortal(dot, activeElementContainer) : dot}\n </g>\n );\n}\n"],"mappings":";;;;;AA4BA,SAAS,EACL,GACA,GACA,GACA,GACS;AACT,KAAI,KAAS,OAAO,KAAU,YAAY,UAAU,GAAO;AACvD,MAAI,EAAM,SAAS,kBACf,QAAO,EAAO,YAAY,EAAK,gBAAgB,CAAC;AAEpD,MAAI,EAAM,SAAS,oBACf,QAAO,EAAO,cAAc,EAAK,kBAAkB,CAAC;;AAG5D,QAAO;;AAGX,SAAgB,EAAgB,EAC5B,aACA,WACA,gBACA,aACA,QACA,kBACA,iBACA,2BACA,sBACA,mBACc;CACd,IAAM,IAAa,MAAgB,YAC7B,IAAY,EAAY,GAAQ,aAAa,EAAI,WAAW,EAAS,EACrE,IAAY,EAAY,GAAQ,aAAa,EAAI,WAAW,EAAS,EACrE,IAAW,EAAY,GAAQ,YAAY,EAAI,UAAU,EAAS,EAClE,KAAK,EAAO,SAAS,EAAS,gBAAgB,IAAI,KAAK,EAAO,SAAS,WAAW,GAAG,GACrF,IAAQ,EAAI,UAAU,SAAS,EAAO,SAAS,WAAW,GAAG,KAAM,EAAI,OACvE,IAAM,EAAO,EAAE,EAAS,IAAI,EAC5B,IAAM,EAAO,EAAE,EAAS,IAAI,EAC5B,IAAQ,EAAO,EAAE,EAAS,MAAM,EAChC,IAAQ,EAAc,GAAU,EAAI,SAAS,EAAU,EACvD,IAAmB,KAA0B,EAAa,OAC1D,IAAiB,EAAa,iBAAiB,KAAY,GAE3D,IAAM,EAAI,
|
|
1
|
+
{"version":3,"file":"ErrorBarElement.js","names":[],"sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, InheritAesDiscrete, Orientation } from '../../../types';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { ErrorBar } from '../../layers';\nimport type { ErrorBarsData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface ErrorBarProps {\n facetKey: string;\n scales: ChartScales;\n errorBar: ErrorBar;\n orientation: Orientation;\n aes: ErrorBarsData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: ErrorBar\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n return scales.xPrimaryAes(geom.primaryGrouping)[field] as ValueType;\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.secondaryGrouping)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nexport function ErrorBarElement({\n facetKey,\n scales,\n orientation,\n errorBar,\n aes,\n sideDistances,\n showTooltips,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: ErrorBarProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, errorBar);\n const fillColor = getAesValue(scales, 'fillColor', aes.fillColor, errorBar);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, errorBar);\n const x = (scales.xPrimary(errorBar.primaryGrouping) ?? 0) + scales.xPrimary.bandwidth() / 2;\n const width = aes.width === 'auto' ? scales.xPrimary.bandwidth() * 0.2 : aes.width;\n const min = scales.y(errorBar.min);\n const max = scales.y(errorBar.max);\n const value = scales.y(errorBar.value);\n const shape = getPointShape(dotShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n const highlightedDot = tooltipsData.selectedData === errorBar && dimmedBackground;\n\n const dot = aes.showDots ? (\n // Dot border must not scale with the error bar's lineWidth; keep it at the fixed default.\n <g transform={isVertical ? `translate(${x},${value})` : `translate(${value},${x})`} strokeWidth={1}>\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(errorBar, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={[numberFormat(errorBar.value)]}\n x={isVertical ? x : value}\n y={isVertical ? value : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipsData.active && tooltipsData.selectedData === errorBar && tooltipsData.currentFacet === facetKey}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n ) : null;\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n fill=\"none\"\n strokeWidth={aes.lineWidth}\n >\n <g transform={isVertical ? `translate(${x},0)` : `translate(0,${x})`}>\n <line\n x1={isVertical ? 0 : min}\n x2={isVertical ? 0 : max}\n y1={isVertical ? min : 0}\n y2={isVertical ? max : 0}\n />\n <line\n x1={isVertical ? -width / 2 : min}\n x2={isVertical ? width / 2 : min}\n y1={isVertical ? min : -width / 2}\n y2={isVertical ? min : width / 2}\n />\n <line\n x1={isVertical ? -width / 2 : max}\n x2={isVertical ? width / 2 : max}\n y1={isVertical ? max : -width / 2}\n y2={isVertical ? max : width / 2}\n />\n </g>\n {highlightedDot ? createPortal(dot, activeElementContainer) : dot}\n </g>\n );\n}\n"],"mappings":";;;;;AA4BA,SAAS,EACL,GACA,GACA,GACA,GACS;AACT,KAAI,KAAS,OAAO,KAAU,YAAY,UAAU,GAAO;AACvD,MAAI,EAAM,SAAS,kBACf,QAAO,EAAO,YAAY,EAAK,gBAAgB,CAAC;AAEpD,MAAI,EAAM,SAAS,oBACf,QAAO,EAAO,cAAc,EAAK,kBAAkB,CAAC;;AAG5D,QAAO;;AAGX,SAAgB,EAAgB,EAC5B,aACA,WACA,gBACA,aACA,QACA,kBACA,iBACA,2BACA,sBACA,mBACc;CACd,IAAM,IAAa,MAAgB,YAC7B,IAAY,EAAY,GAAQ,aAAa,EAAI,WAAW,EAAS,EACrE,IAAY,EAAY,GAAQ,aAAa,EAAI,WAAW,EAAS,EACrE,IAAW,EAAY,GAAQ,YAAY,EAAI,UAAU,EAAS,EAClE,KAAK,EAAO,SAAS,EAAS,gBAAgB,IAAI,KAAK,EAAO,SAAS,WAAW,GAAG,GACrF,IAAQ,EAAI,UAAU,SAAS,EAAO,SAAS,WAAW,GAAG,KAAM,EAAI,OACvE,IAAM,EAAO,EAAE,EAAS,IAAI,EAC5B,IAAM,EAAO,EAAE,EAAS,IAAI,EAC5B,IAAQ,EAAO,EAAE,EAAS,MAAM,EAChC,IAAQ,EAAc,GAAU,EAAI,SAAS,EAAU,EACvD,IAAmB,KAA0B,EAAa,OAC1D,IAAiB,EAAa,iBAAiB,KAAY,GAE3D,IAAM,EAAI,WAEZ,kBAAC,KAAD;EAAG,WAAW,IAAa,aAAa,EAAE,GAAG,EAAM,KAAK,aAAa,EAAM,GAAG,EAAE;EAAI,aAAa;YAAjG;GACK;GACA,KAAgB,KACb,kBAAC,UAAD;IACI,mBAAmB,EAAa,aAAa,GAAU,EAAS;IAChE,oBAAoB,EAAa,cAAc;IAC/C,GAAE;IACF,MAAK;IACL,QAAO;IACT,CAAA;GAEL,KACG,kBAAC,GAAD;IACI,SAAS,CAAC,EAAa,EAAS,MAAM,CAAC;IACvC,GAAG,IAAa,IAAI;IACpB,GAAG,IAAa,IAAQ;IACT;IACf,YAAA;IACA,QAAQ,EAAa,UAAU,EAAa,iBAAiB,KAAY,EAAa,iBAAiB;IACvG,OAAO,EAAa;IACpB,SAAS,EAAa;IACtB,WAAW;IACb,CAAA;GAEN;MACJ;AACJ,QACI,kBAAC,KAAD;EACI,SAAS,EAAI;EACb,QAAQ;EACR,MAAK;EACL,aAAa,EAAI;YAJrB,CAMI,kBAAC,KAAD;GAAG,WAAW,IAAa,aAAa,EAAE,OAAO,eAAe,EAAE;aAAlE;IACI,kBAAC,QAAD;KACI,IAAI,IAAa,IAAI;KACrB,IAAI,IAAa,IAAI;KACrB,IAAI,IAAa,IAAM;KACvB,IAAI,IAAa,IAAM;KACzB,CAAA;IACF,kBAAC,QAAD;KACI,IAAI,IAAa,CAAC,IAAQ,IAAI;KAC9B,IAAI,IAAa,IAAQ,IAAI;KAC7B,IAAI,IAAa,IAAM,CAAC,IAAQ;KAChC,IAAI,IAAa,IAAM,IAAQ;KACjC,CAAA;IACF,kBAAC,QAAD;KACI,IAAI,IAAa,CAAC,IAAQ,IAAI;KAC9B,IAAI,IAAa,IAAQ,IAAI;KAC7B,IAAI,IAAa,IAAM,CAAC,IAAQ;KAChC,IAAI,IAAa,IAAM,IAAQ;KACjC,CAAA;IACF;MACH,IAAiB,EAAa,GAAK,EAAuB,GAAG,EAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAW,YAAY,EAAsB,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAIzG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,SAAS;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACtB,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,YAAY,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAyCD,wBAAgB,WAAW,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,IAAI,EACJ,GAAG,EACH,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"LineElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAW,YAAY,EAAsB,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAIzG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,SAAS;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;IACtB,aAAa,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,YAAY,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAyCD,wBAAgB,WAAW,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,IAAI,EACJ,GAAG,EACH,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,SAAS,2CAsEX"}
|
|
@@ -41,6 +41,7 @@ function d({ facetKey: e, scales: d, orientation: f, line: p, aes: m, sideDistan
|
|
|
41
41
|
transform: x ? `translate(${r},${c})` : `translate(${c},${r})`,
|
|
42
42
|
strokeDasharray: "none",
|
|
43
43
|
stroke: "none",
|
|
44
|
+
strokeWidth: 1,
|
|
44
45
|
children: [
|
|
45
46
|
D,
|
|
46
47
|
g && y && /* @__PURE__ */ a("circle", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineElement.js","names":[],"sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"sourcesContent":["import { isArray } from 'lodash';\nimport { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, GroupingData, InheritAesDiscrete, Orientation, PointShape } from '../../../types';\nimport { getLineShape } from '../../../utils/getLineShape';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { Line } from '../../layers';\nimport type { LinesData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface LineProps {\n facetKey: string;\n scales: ChartScales;\n line: Line;\n orientation: Orientation;\n aes: LinesData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n secondaryGrouping: GroupingData;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: Line\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n throw new Error('Line cannot have aesthetics by primary grouping');\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.key)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nfunction createPoints(\n points: Record<string, number>,\n primaryKeys: string[],\n scales: ChartScales\n): [number, number, string, number][] {\n const xShift = scales.xPrimary.bandwidth() / 2;\n return primaryKeys.map(\n key =>\n [(scales.xPrimary(key) ?? 0) + xShift, scales.y(points[key]), key, points[key]] as [\n number,\n number,\n string,\n number\n ]\n );\n}\n\nfunction getTooltipContent(secondaryGrouping:GroupingData, secondaryKey: string, value:number) {\n const keyLabel = secondaryGrouping.valueLabels[secondaryKey];\n return keyLabel ? [keyLabel, numberFormat(value)] : [numberFormat(value)];\n}\n\nexport function LineElement({\n facetKey,\n scales,\n orientation,\n line,\n aes,\n sideDistances,\n showTooltips,\n secondaryGrouping,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: LineProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, line);\n const fillColor = getAesValue(scales, 'dotFill', aes.fillColor, line);\n const lineShape = getAesValue(scales, 'lineShape', aes.lineShape, line);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, line);\n const points = createPoints(line.dots, scales.xPrimary.domain(), scales);\n const shape = getPointShape(dotShape as PointShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n strokeDasharray={getLineShape(lineShape)}\n strokeWidth={aes.lineWidth}\n >\n <polyline\n key={line.key}\n points={points.map(([x, y]) => (isVertical ? [x, y] : [y, x])).join(' ')}\n stroke={lineColor}\n fill=\"none\"\n />\n {aes.dotShape !== null && (\n <g>\n {points.map((geomValue) => {\n const [x, y, key, value] = geomValue;\n const data = tooltipsData.selectedData;\n const tooltipSelected = Boolean(data && facetKey === tooltipsData.currentFacet && isArray(data) && data.every((el, idx) => el === geomValue[idx]));\n const highlightedDot = tooltipSelected && dimmedBackground;\n const dot = (\n <g\n key={key}\n transform={isVertical ? `translate(${x},${y})` : `translate(${y},${x})`}\n strokeDasharray=\"none\"\n stroke=\"none\"\n >\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(geomValue, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={getTooltipContent(secondaryGrouping, line.key, value)}\n x={isVertical ? x : y}\n y={isVertical ? y : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipSelected}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n );\n return highlightedDot ? createPortal(dot, activeElementContainer) : dot;\n })}\n </g>\n )}\n </g>\n );\n}\n"],"mappings":";;;;;;;A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E,CAAE,CAAC,KAAK,IAAI;GACxE,QAAQ;GACR,MAAK;GACP,EAJO,EAAK,IAIZ,EACD,EAAI,aAAa,QACd,kBAAC,KAAD,EAAA,UACK,EAAO,KAAK,MAAc;GACvB,IAAM,CAAC,GAAG,GAAG,GAAK,KAAS,GACrB,IAAO,EAAa,cACpB,IAAkB,GAAQ,KAAQ,MAAa,EAAa,gBAAgB,EAAQ,EAAK,IAAI,EAAK,OAAO,GAAI,MAAQ,MAAO,EAAU,GAAK,GAC3I,IAAkB,KAAmB,GACrC,IACF,kBAAC,KAAD;IAEI,WAAW,IAAa,aAAa,EAAE,GAAG,EAAE,KAAK,aAAa,EAAE,GAAG,EAAE;IACrE,iBAAgB;IAChB,QAAO;
|
|
1
|
+
{"version":3,"file":"LineElement.js","names":[],"sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"sourcesContent":["import { isArray } from 'lodash';\nimport { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { AesItem, GroupingData, InheritAesDiscrete, Orientation, PointShape } from '../../../types';\nimport { getLineShape } from '../../../utils/getLineShape';\nimport { getPointShape } from '../../../utils/getPointShape';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { Line } from '../../layers';\nimport type { LinesData } from '../../layers/types';\nimport type { ChartScales } from '../types';\n\ninterface LineProps {\n facetKey: string;\n scales: ChartScales;\n line: Line;\n orientation: Orientation;\n aes: LinesData['aes'];\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n secondaryGrouping: GroupingData;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nfunction getAesValue<ValueType>(\n scales: ChartScales,\n field: keyof AesItem,\n value: ValueType | InheritAesDiscrete,\n geom: Line\n): ValueType {\n if (value && typeof value === 'object' && 'type' in value) {\n if (value.type === 'primaryGrouping') {\n throw new Error('Line cannot have aesthetics by primary grouping');\n }\n if (value.type === 'secondaryGrouping') {\n return scales.xSecondaryAes(geom.key)[field] as ValueType;\n }\n }\n return value as ValueType;\n}\n\nfunction createPoints(\n points: Record<string, number>,\n primaryKeys: string[],\n scales: ChartScales\n): [number, number, string, number][] {\n const xShift = scales.xPrimary.bandwidth() / 2;\n return primaryKeys.map(\n key =>\n [(scales.xPrimary(key) ?? 0) + xShift, scales.y(points[key]), key, points[key]] as [\n number,\n number,\n string,\n number\n ]\n );\n}\n\nfunction getTooltipContent(secondaryGrouping:GroupingData, secondaryKey: string, value:number) {\n const keyLabel = secondaryGrouping.valueLabels[secondaryKey];\n return keyLabel ? [keyLabel, numberFormat(value)] : [numberFormat(value)];\n}\n\nexport function LineElement({\n facetKey,\n scales,\n orientation,\n line,\n aes,\n sideDistances,\n showTooltips,\n secondaryGrouping,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: LineProps) {\n const isVertical = orientation === 'vertical';\n const lineColor = getAesValue(scales, 'lineColor', aes.lineColor, line);\n const fillColor = getAesValue(scales, 'dotFill', aes.fillColor, line);\n const lineShape = getAesValue(scales, 'lineShape', aes.lineShape, line);\n const dotShape = getAesValue(scales, 'dotShape', aes.dotShape, line);\n const points = createPoints(line.dots, scales.xPrimary.domain(), scales);\n const shape = getPointShape(dotShape as PointShape, aes.dotSize, fillColor);\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n\n return (\n <g\n opacity={aes.opacity}\n stroke={lineColor}\n strokeDasharray={getLineShape(lineShape)}\n strokeWidth={aes.lineWidth}\n >\n <polyline\n key={line.key}\n points={points.map(([x, y]) => (isVertical ? [x, y] : [y, x])).join(' ')}\n stroke={lineColor}\n fill=\"none\"\n />\n {aes.dotShape !== null && (\n <g>\n {points.map((geomValue) => {\n const [x, y, key, value] = geomValue;\n const data = tooltipsData.selectedData;\n const tooltipSelected = Boolean(data && facetKey === tooltipsData.currentFacet && isArray(data) && data.every((el, idx) => el === geomValue[idx]));\n const highlightedDot = tooltipSelected && dimmedBackground;\n const dot = (\n <g\n key={key}\n transform={isVertical ? `translate(${x},${y})` : `translate(${y},${x})`}\n strokeDasharray=\"none\"\n stroke=\"none\"\n // Dot border must not scale with the line's lineWidth; keep it at the fixed default.\n strokeWidth={1}\n >\n {shape}\n {showTooltips && tooltipsContainer && (\n <circle\n onMouseOver={() => tooltipsData.onMouseEnter(geomValue, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n r=\"15\"\n fill=\"transparent\"\n stroke=\"none\"\n />\n )}\n {showTooltips && (\n <Tooltip\n content={getTooltipContent(secondaryGrouping, line.key, value)}\n x={isVertical ? x : y}\n y={isVertical ? y : x}\n sideDistances={sideDistances}\n horizontal\n active={tooltipSelected}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n );\n return highlightedDot ? createPortal(dot, activeElementContainer) : dot;\n })}\n </g>\n )}\n </g>\n );\n}\n"],"mappings":";;;;;;;AA+BA,SAAS,EACL,GACA,GACA,GACA,GACS;AACT,KAAI,KAAS,OAAO,KAAU,YAAY,UAAU,GAAO;AACvD,MAAI,EAAM,SAAS,kBACf,OAAU,MAAM,kDAAkD;AAEtE,MAAI,EAAM,SAAS,oBACf,QAAO,EAAO,cAAc,EAAK,IAAI,CAAC;;AAG9C,QAAO;;AAGX,SAAS,EACL,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAO,SAAS,WAAW,GAAG;AAC7C,QAAO,EAAY,KACf,MACI;GAAE,EAAO,SAAS,EAAI,IAAI,KAAK;EAAQ,EAAO,EAAE,EAAO,GAAK;EAAE;EAAK,EAAO;EAAK,CAMtF;;AAGL,SAAS,EAAkB,GAAgC,GAAsB,GAAc;CAC3F,IAAM,IAAW,EAAkB,YAAY;AAC/C,QAAO,IAAW,CAAC,GAAU,EAAa,EAAM,CAAC,GAAG,CAAC,EAAa,EAAM,CAAC;;AAG7E,SAAgB,EAAY,EACxB,aACA,WACA,gBACA,SACA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AEL,KACG,kBAAC,GAAD;MACI,SAAS,EAAkB,GAAmB,EAAK,KAAK,EAAM;MAC9D,GAAG,IAAa,IAAI;MACpB,GAAG,IAAa,IAAI;MACL;MACf,YAAA;MACA,QAAQ;MACR,OAAO,EAAa;MACpB,SAAS,EAAa;MACtB,WAAW;MACb,CAAA;KAEN;MA9BK,EA8BL;AAER,UAAO,IAAiB,EAAa,GAAK,EAAuB,GAAG;IACtE,EACF,CAAA,CAER"}
|
|
@@ -49,10 +49,10 @@ export declare class HeatmapSettingsImpl implements SettingsInterface {
|
|
|
49
49
|
nRows?: number;
|
|
50
50
|
nCols?: number;
|
|
51
51
|
};
|
|
52
|
-
readonly
|
|
52
|
+
readonly x: ColumnName[];
|
|
53
53
|
readonly xGroupBy: ColumnName[];
|
|
54
54
|
readonly xSortBy: ColumnName[];
|
|
55
|
-
readonly
|
|
55
|
+
readonly y: ColumnName[];
|
|
56
56
|
readonly yGroupBy: ColumnName[];
|
|
57
57
|
readonly ySortBy: ColumnName[];
|
|
58
58
|
readonly valueColumn: ColumnName;
|
|
@@ -91,6 +91,7 @@ export declare class HeatmapSettingsImpl implements SettingsInterface {
|
|
|
91
91
|
axisLabelsAngle: 0 | 45 | 90;
|
|
92
92
|
groupLabelsAngle: 0 | 45 | 90;
|
|
93
93
|
sorting: 'asc' | 'desc';
|
|
94
|
+
labelParts: ColumnName['value'][] | null;
|
|
94
95
|
};
|
|
95
96
|
readonly xAxis: {
|
|
96
97
|
title: string;
|
|
@@ -103,6 +104,7 @@ export declare class HeatmapSettingsImpl implements SettingsInterface {
|
|
|
103
104
|
axisLabelsAngle: 0 | 45 | 90;
|
|
104
105
|
groupLabelsAngle: 0 | 45 | 90;
|
|
105
106
|
sorting: 'asc' | 'desc';
|
|
107
|
+
labelParts: ColumnName['value'][] | null;
|
|
106
108
|
};
|
|
107
109
|
readonly legend: {
|
|
108
110
|
show: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeatmapSettingsImpl.d.ts","sourceRoot":"","sources":["../../src/heatmap/HeatmapSettingsImpl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,SAAS,EACT,iBAAiB,EACjB,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAClE,cAAc,EAAE,SAAS,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,UAAU,EAClF,iBAAiB,EACjB,aAAa,EAChB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"HeatmapSettingsImpl.d.ts","sourceRoot":"","sources":["../../src/heatmap/HeatmapSettingsImpl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,SAAS,EACT,iBAAiB,EACjB,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAClE,cAAc,EAAE,SAAS,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,UAAU,EAClF,iBAAiB,EACjB,aAAa,EAChB,MAAM,UAAU,CAAC;AAwBlB,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/B,GAAG,EAAE;QACD,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC;QAC/B,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;QAC7B,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;QAClC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;QAC7B,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;QAClC,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC;KAClC,CAAC;CACL;AAED,UAAU,0BAA2B,SAAQ,yBAAyB;IAClE,QAAQ,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC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