@milaboratories/miplots4 1.0.126 → 1.0.128
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/DataFrame.d.ts +7 -5
- package/dist/DataFrame.d.ts.map +1 -1
- package/dist/DataFrame.js +67 -60
- package/dist/DataFrame.js.map +1 -1
- package/dist/bubble/components/Chart.d.ts +3 -3
- package/dist/bubble/components/Chart.d.ts.map +1 -1
- package/dist/bubble/components/Chart.js +23 -23
- package/dist/bubble/components/Chart.js.map +1 -1
- package/dist/common/Tooltip.d.ts +1 -1
- package/dist/common/Tooltip.d.ts.map +1 -1
- package/dist/common/Tooltip.js +17 -17
- package/dist/common/Tooltip.js.map +1 -1
- package/dist/discrete/components/layers/BinnedDotsElement.d.ts +2 -2
- package/dist/discrete/components/layers/BinnedDotsElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/BinnedDotsElement.js +9 -9
- package/dist/discrete/components/layers/BinnedDotsElement.js.map +1 -1
- package/dist/discrete/components/layers/BoxElement.d.ts +2 -2
- package/dist/discrete/components/layers/BoxElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/BoxElement.js +19 -19
- package/dist/discrete/components/layers/BoxElement.js.map +1 -1
- package/dist/discrete/components/layers/DotsGroupElement.d.ts +3 -3
- package/dist/discrete/components/layers/DotsGroupElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/DotsGroupElement.js +10 -10
- package/dist/discrete/components/layers/DotsGroupElement.js.map +1 -1
- package/dist/discrete/components/layers/ErrorBarElement.d.ts +2 -2
- package/dist/discrete/components/layers/ErrorBarElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/ErrorBarElement.js +15 -15
- package/dist/discrete/components/layers/ErrorBarElement.js.map +1 -1
- package/dist/discrete/components/layers/LineElement.d.ts +2 -2
- package/dist/discrete/components/layers/LineElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/LineElement.js +12 -12
- package/dist/discrete/components/layers/LineElement.js.map +1 -1
- package/dist/discrete/components/layers/LogoElement.d.ts +2 -2
- package/dist/discrete/components/layers/LogoElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/LogoElement.js +19 -19
- package/dist/discrete/components/layers/LogoElement.js.map +1 -1
- package/dist/discrete/components/layers/PairedPointsElement.d.ts +2 -2
- package/dist/discrete/components/layers/PairedPointsElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/PairedPointsElement.js +37 -37
- package/dist/discrete/components/layers/PairedPointsElement.js.map +1 -1
- package/dist/discrete/components/layers/StackedBarElement.d.ts +3 -3
- package/dist/discrete/components/layers/StackedBarElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/StackedBarElement.js +18 -18
- package/dist/discrete/components/layers/StackedBarElement.js.map +1 -1
- package/dist/discrete/components/layers/ViolinElement.d.ts +4 -4
- package/dist/discrete/components/layers/ViolinElement.d.ts.map +1 -1
- package/dist/discrete/components/layers/ViolinElement.js +7 -7
- package/dist/discrete/components/layers/ViolinElement.js.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.d.ts +2 -2
- package/dist/heatmap/components/Annotations/Annotation.d.ts.map +1 -1
- package/dist/heatmap/components/Annotations/Annotation.js +16 -16
- package/dist/heatmap/components/Annotations/Annotation.js.map +1 -1
- package/dist/heatmap/components/Chart.d.ts +1 -1
- package/dist/heatmap/components/Chart.d.ts.map +1 -1
- package/dist/heatmap/components/Chart.js +28 -28
- package/dist/heatmap/components/Chart.js.map +1 -1
- package/dist/histogram/components/Chart.d.ts +2 -2
- package/dist/histogram/components/Chart.d.ts.map +1 -1
- package/dist/histogram/components/Chart.js +22 -22
- package/dist/histogram/components/Chart.js.map +1 -1
- package/dist/scatterplot/components/Chart.d.ts +6 -11
- package/dist/scatterplot/components/Chart.d.ts.map +1 -1
- package/dist/scatterplot/components/Chart.js +101 -331
- package/dist/scatterplot/components/Chart.js.map +1 -1
- package/dist/scatterplot/components/ChartAxis.d.ts +20 -0
- package/dist/scatterplot/components/ChartAxis.d.ts.map +1 -0
- package/dist/scatterplot/components/ChartAxis.js +52 -0
- package/dist/scatterplot/components/ChartAxis.js.map +1 -0
- package/dist/scatterplot/components/ChartAxisTitles.d.ts +15 -0
- package/dist/scatterplot/components/ChartAxisTitles.d.ts.map +1 -0
- package/dist/scatterplot/components/ChartAxisTitles.js +56 -0
- package/dist/scatterplot/components/ChartAxisTitles.js.map +1 -0
- package/dist/scatterplot/components/ChartFacetTitle.d.ts +11 -0
- package/dist/scatterplot/components/ChartFacetTitle.d.ts.map +1 -0
- package/dist/scatterplot/components/ChartFacetTitle.js +37 -0
- package/dist/scatterplot/components/ChartFacetTitle.js.map +1 -0
- package/dist/scatterplot/components/ChartLayersData.d.ts +39 -0
- package/dist/scatterplot/components/ChartLayersData.d.ts.map +1 -0
- package/dist/scatterplot/components/ChartLayersData.js +250 -0
- package/dist/scatterplot/components/ChartLayersData.js.map +1 -0
- package/dist/scatterplot/components/ChartTooltip.d.ts +18 -0
- package/dist/scatterplot/components/ChartTooltip.d.ts.map +1 -0
- package/dist/scatterplot/components/ChartTooltip.js +58 -0
- package/dist/scatterplot/components/ChartTooltip.js.map +1 -0
- package/dist/scatterplot/components/ChartTrendsData.d.ts +11 -0
- package/dist/scatterplot/components/ChartTrendsData.d.ts.map +1 -0
- package/dist/scatterplot/components/ChartTrendsData.js +65 -0
- package/dist/scatterplot/components/ChartTrendsData.js.map +1 -0
- package/dist/scatterplot/components/ChartsGroup.d.ts +3 -3
- package/dist/scatterplot/components/ChartsGroup.d.ts.map +1 -1
- package/dist/scatterplot/components/ChartsGroup.js +81 -73
- package/dist/scatterplot/components/ChartsGroup.js.map +1 -1
- package/dist/scatterplot/dots.d.ts +0 -2
- package/dist/scatterplot/dots.d.ts.map +1 -1
- package/dist/scatterplot/dots.js +26 -22
- package/dist/scatterplot/dots.js.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.d.ts +3 -9
- package/dist/scatterplot-umap/ChartRenderer.d.ts.map +1 -1
- package/dist/scatterplot-umap/ChartRenderer.js +183 -186
- package/dist/scatterplot-umap/ChartRenderer.js.map +1 -1
- package/dist/scatterplot-umap/components/Lasso.js +97 -97
- package/dist/scatterplot-umap/components/Lasso.js.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.d.ts +1 -5
- package/dist/scatterplot-umap/components/LowerSVG.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/LowerSVG.js +51 -52
- package/dist/scatterplot-umap/components/LowerSVG.js.map +1 -1
- package/dist/scatterplot-umap/components/SVGLayer.d.ts +1 -1
- package/dist/scatterplot-umap/components/SVGLayer.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/SVGLayer.js +39 -41
- package/dist/scatterplot-umap/components/SVGLayer.js.map +1 -1
- package/dist/scatterplot-umap/components/UpperSVG.d.ts +1 -1
- package/dist/scatterplot-umap/components/UpperSVG.d.ts.map +1 -1
- package/dist/scatterplot-umap/components/UpperSVG.js +18 -18
- package/dist/scatterplot-umap/components/UpperSVG.js.map +1 -1
- package/dist/scatterplot-umap/index.d.ts +2 -6
- package/dist/scatterplot-umap/index.d.ts.map +1 -1
- package/dist/scatterplot-umap/index.js +62 -66
- package/dist/scatterplot-umap/index.js.map +1 -1
- package/dist/scatterplot-umap/types.d.ts +0 -4
- package/dist/scatterplot-umap/types.d.ts.map +1 -1
- package/dist/utils/hooks/useFunction.d.ts +2 -0
- package/dist/utils/hooks/useFunction.d.ts.map +1 -0
- package/dist/utils/hooks/useFunction.js +9 -0
- package/dist/utils/hooks/useFunction.js.map +1 -0
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBarElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"names":[],"mappings":"
|
|
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,2CAuEf"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { j as c } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
function f(l,
|
|
2
|
+
import { r as G } from "../../../node_modules/react-dom/index.js";
|
|
3
|
+
import { Tooltip as b } from "../../../common/Tooltip.js";
|
|
4
|
+
import { getPointShape as k } from "../../../utils/getPointShape.js";
|
|
5
|
+
import { numberFormat as E } from "../../../utils/numberFormat.js";
|
|
6
|
+
function f(l, o, r, t) {
|
|
7
7
|
if (r && typeof r == "object" && "type" in r) {
|
|
8
8
|
if (r.type === "primaryGrouping")
|
|
9
|
-
return l.xPrimaryAes(
|
|
9
|
+
return l.xPrimaryAes(t.primaryGrouping)[o];
|
|
10
10
|
if (r.type === "secondaryGrouping")
|
|
11
|
-
return l.xSecondaryAes(
|
|
11
|
+
return l.xSecondaryAes(t.secondaryGrouping)[o];
|
|
12
12
|
}
|
|
13
13
|
return r;
|
|
14
14
|
}
|
|
15
15
|
function L({
|
|
16
16
|
facetKey: l,
|
|
17
|
-
scales:
|
|
17
|
+
scales: o,
|
|
18
18
|
orientation: r,
|
|
19
|
-
errorBar:
|
|
19
|
+
errorBar: t,
|
|
20
20
|
aes: i,
|
|
21
21
|
sideDistances: j,
|
|
22
22
|
showTooltips: h,
|
|
@@ -24,12 +24,12 @@ function L({
|
|
|
24
24
|
tooltipsContainer: s,
|
|
25
25
|
tooltipsData: e
|
|
26
26
|
}) {
|
|
27
|
-
const n = r === "vertical", a = f(
|
|
27
|
+
const n = r === "vertical", a = f(o, "lineColor", i.lineColor, t), C = f(o, "fillColor", i.fillColor, t), P = f(o, "dotShape", i.dotShape, t), d = (o.xPrimary(t.primaryGrouping) ?? 0) + o.xPrimary.bandwidth() / 2, x = i.width === "auto" ? o.xPrimary.bandwidth() * 0.2 : i.width, m = o.y(t.min), y = o.y(t.max), u = o.y(t.value), S = k(P, i.dotSize, C), $ = p && e.fixed, w = e.selectedData === t && $, g = i.showDots ? /* @__PURE__ */ c.jsxs("g", { transform: n ? `translate(${d},${u})` : `translate(${u},${d})`, children: [
|
|
28
28
|
S,
|
|
29
29
|
h && s && /* @__PURE__ */ c.jsx(
|
|
30
30
|
"circle",
|
|
31
31
|
{
|
|
32
|
-
onMouseOver: () => e.
|
|
32
|
+
onMouseOver: () => e.onMouseEnter(t, l),
|
|
33
33
|
onMouseLeave: () => e.onMouseLeave(),
|
|
34
34
|
r: "15",
|
|
35
35
|
fill: "transparent",
|
|
@@ -37,14 +37,14 @@ function L({
|
|
|
37
37
|
}
|
|
38
38
|
),
|
|
39
39
|
h && /* @__PURE__ */ c.jsx(
|
|
40
|
-
|
|
40
|
+
b,
|
|
41
41
|
{
|
|
42
|
-
content: [
|
|
42
|
+
content: [E(t.value)],
|
|
43
43
|
x: n ? d : u,
|
|
44
44
|
y: n ? u : d,
|
|
45
45
|
sideDistances: j,
|
|
46
46
|
horizontal: !0,
|
|
47
|
-
active: e.active && e.selectedData ===
|
|
47
|
+
active: e.active && e.selectedData === t && e.currentFacet === l,
|
|
48
48
|
fixed: e.fixed,
|
|
49
49
|
onClose: e.onClose,
|
|
50
50
|
container: s
|
|
@@ -88,7 +88,7 @@ function L({
|
|
|
88
88
|
}
|
|
89
89
|
)
|
|
90
90
|
] }),
|
|
91
|
-
w ?
|
|
91
|
+
w ? G.createPortal(g, p) : g
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
94
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBarElement.js","sources":["../../../../src/discrete/components/layers/ErrorBarElement.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"ErrorBarElement.js","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"],"names":["getAesValue","scales","field","value","geom","ErrorBarElement","facetKey","orientation","errorBar","aes","sideDistances","showTooltips","activeElementContainer","tooltipsContainer","tooltipsData","isVertical","lineColor","fillColor","dotShape","x","width","min","max","shape","getPointShape","dimmedBackground","highlightedDot","dot","jsxs","jsx","Tooltip","numberFormat","createPortal"],"mappings":";;;;;AA4BA,SAASA,EACLC,GACAC,GACAC,GACAC,GACS;AACT,MAAID,KAAS,OAAOA,KAAU,YAAY,UAAUA,GAAO;AACvD,QAAIA,EAAM,SAAS;AACf,aAAOF,EAAO,YAAYG,EAAK,eAAe,EAAEF,CAAK;AAEzD,QAAIC,EAAM,SAAS;AACf,aAAOF,EAAO,cAAcG,EAAK,iBAAiB,EAAEF,CAAK;AAAA,EAEjE;AACA,SAAOC;AACX;AAEO,SAASE,EAAgB;AAAA,EAC5B,UAAAC;AAAA,EACA,QAAAL;AAAA,EACA,aAAAM;AAAA,EACA,UAAAC;AAAA,EACA,KAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;A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GACJ;AAAA,QACCM,IAAiBM,EAAAA,aAAaL,GAAKf,CAAsB,IAAIe;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1E;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TooltipsData } from '../../../common/Tooltip';
|
|
2
|
-
import {
|
|
2
|
+
import { GroupingData, Orientation } from '../../../types';
|
|
3
3
|
import { Line } from '../../layers';
|
|
4
4
|
import { LinesData } from '../../layers/types';
|
|
5
|
-
import {
|
|
5
|
+
import { ChartScales } from '../types';
|
|
6
6
|
interface LineProps {
|
|
7
7
|
facetKey: string;
|
|
8
8
|
scales: ChartScales;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"names":[],"mappings":"
|
|
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,2CAoEX"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as s } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { l as z } from "../../../node_modules/lodash/lodash.js";
|
|
3
|
+
import { r as B } from "../../../node_modules/react-dom/index.js";
|
|
4
|
+
import { Tooltip as G } from "../../../common/Tooltip.js";
|
|
5
|
+
import { getLineShape as W } from "../../../utils/getLineShape.js";
|
|
6
|
+
import { getPointShape as O } from "../../../utils/getPointShape.js";
|
|
5
7
|
import { numberFormat as j } from "../../../utils/numberFormat.js";
|
|
6
|
-
import { l as O } from "../../../node_modules/lodash/lodash.js";
|
|
7
|
-
import { r as W } from "../../../node_modules/react-dom/index.js";
|
|
8
8
|
function m(e, n, o, r) {
|
|
9
9
|
if (o && typeof o == "object" && "type" in o) {
|
|
10
10
|
if (o.type === "primaryGrouping")
|
|
@@ -37,13 +37,13 @@ function V({
|
|
|
37
37
|
tooltipsContainer: y,
|
|
38
38
|
tooltipsData: i
|
|
39
39
|
}) {
|
|
40
|
-
const a = o === "vertical", x = m(n, "lineColor", t.lineColor, r), b = m(n, "dotFill", t.fillColor, r), C = m(n, "lineShape", t.lineShape, r), P = m(n, "dotShape", t.dotShape, r), u = R(r.dots, n.xPrimary.domain(), n), E =
|
|
40
|
+
const a = o === "vertical", x = m(n, "lineColor", t.lineColor, r), b = m(n, "dotFill", t.fillColor, r), C = m(n, "lineShape", t.lineShape, r), P = m(n, "dotShape", t.dotShape, r), u = R(r.dots, n.xPrimary.domain(), n), E = O(P, t.dotSize, b), M = l && i.fixed;
|
|
41
41
|
return /* @__PURE__ */ s.jsxs(
|
|
42
42
|
"g",
|
|
43
43
|
{
|
|
44
44
|
opacity: t.opacity,
|
|
45
45
|
stroke: x,
|
|
46
|
-
strokeDasharray:
|
|
46
|
+
strokeDasharray: W(C),
|
|
47
47
|
strokeWidth: t.lineWidth,
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ s.jsx(
|
|
@@ -56,7 +56,7 @@ function V({
|
|
|
56
56
|
r.key
|
|
57
57
|
),
|
|
58
58
|
t.dotShape !== null && /* @__PURE__ */ s.jsx("g", { children: u.map((p) => {
|
|
59
|
-
const [c, d, $,
|
|
59
|
+
const [c, d, $, A] = p, h = i.selectedData, S = !!(h && e === i.currentFacet && z.isArray(h) && h.every((v, w) => v === p[w])), F = S && M, g = /* @__PURE__ */ s.jsxs(
|
|
60
60
|
"g",
|
|
61
61
|
{
|
|
62
62
|
transform: a ? `translate(${c},${d})` : `translate(${d},${c})`,
|
|
@@ -67,7 +67,7 @@ function V({
|
|
|
67
67
|
f && y && /* @__PURE__ */ s.jsx(
|
|
68
68
|
"circle",
|
|
69
69
|
{
|
|
70
|
-
onMouseOver: () => i.
|
|
70
|
+
onMouseOver: () => i.onMouseEnter(p, e),
|
|
71
71
|
onMouseLeave: () => i.onMouseLeave(),
|
|
72
72
|
r: "15",
|
|
73
73
|
fill: "transparent",
|
|
@@ -75,9 +75,9 @@ function V({
|
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
77
|
f && /* @__PURE__ */ s.jsx(
|
|
78
|
-
|
|
78
|
+
G,
|
|
79
79
|
{
|
|
80
|
-
content: T(L, r.key,
|
|
80
|
+
content: T(L, r.key, A),
|
|
81
81
|
x: a ? c : d,
|
|
82
82
|
y: a ? d : c,
|
|
83
83
|
sideDistances: k,
|
|
@@ -92,7 +92,7 @@ function V({
|
|
|
92
92
|
},
|
|
93
93
|
$
|
|
94
94
|
);
|
|
95
|
-
return
|
|
95
|
+
return F ? B.createPortal(g, l) : g;
|
|
96
96
|
}) })
|
|
97
97
|
]
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineElement.js","sources":["../../../../src/discrete/components/layers/LineElement.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"LineElement.js","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"],"names":["getAesValue","scales","field","value","geom","createPoints","points","primaryKeys","xShift","key","getTooltipContent","secondaryGrouping","secondaryKey","keyLabel","numberFormat","LineElement","facetKey","orientation","line","aes","sideDistances","showTooltips","activeElementContainer","tooltipsContainer","tooltipsData","isVertical","lineColor","fillColor","lineShape","dotShape","shape","getPointShape","dimmedBackground","jsxs","getLineShape","jsx","x","y","geomValue","data","tooltipSelected","isArray","el","idx","highlightedDot","dot","Tooltip","createPortal"],"mappings":";;;;;;;AA+BA,SAASA,EACLC,GACAC,GACAC,GACAC,GACS;AACT,MAAID,KAAS,OAAOA,KAAU,YAAY,UAAUA,GAAO;AACvD,QAAIA,EAAM,SAAS;AACf,YAAM,IAAI,MAAM,iDAAiD;AAErE,QAAIA,EAAM,SAAS;AACf,aAAOF,EAAO,cAAcG,EAAK,GAAG,EAAEF,CAAK;AAAA,EAEnD;AACA,SAAOC;AACX;AAEA,SAASE,EACLC,GACAC,GACAN,GACkC;AAClC,QAAMO,IAASP,EAAO,SAAS,UAAA,IAAc;AAC7C,SAAOM,EAAY;AAAA,IACf,OACI,EAAEN,EAAO,SAASQ,CAAG,KAAK,KAAKD,GAAQP,EAAO,EAAEK,EAAOG,CAAG,CAAC,GAAGA,GAAKH,EAAOG,CAAG,CAAC;AAAA,EAAA;AAO1F;AAEA,SAASC,EAAkBC,GAAgCC,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AaF,GAAKvB,CAAsB,IAAIuB;AAAA,QACxE,CAAC,EAAA,CACL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TooltipsData } from '../../../common/Tooltip';
|
|
2
|
-
import {
|
|
2
|
+
import { Orientation } from '../../../types';
|
|
3
3
|
import { LogoPlotLayer } from '../../DiscreteSettingsImpl';
|
|
4
4
|
import { LogoStack } from '../../layers';
|
|
5
|
-
import {
|
|
5
|
+
import { ChartScales } from '../types';
|
|
6
6
|
interface LogoElementProps {
|
|
7
7
|
facetKey: string;
|
|
8
8
|
scales: ChartScales;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/LogoElement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LogoElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/LogoElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,UAAU,gBAAgB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,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,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,WAAW,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,WAAW,EACX,IAAI,EACJ,GAAG,EACH,aAAa,EACb,YAAY,EACZ,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,gBAAgB,2CA6FlB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { j as e } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { r as W } from "../../../node_modules/react-dom/index.js";
|
|
3
|
+
import { Tooltip as _ } from "../../../common/Tooltip.js";
|
|
4
|
+
import { numberFormat as q } from "../../../utils/numberFormat.js";
|
|
5
|
+
import { seqAlphabet as E } from "./seqAlphabet.js";
|
|
6
6
|
const A = () => /* @__PURE__ */ e.jsx("path", { d: "M 0 49 h 100 v 2 h -100 z" });
|
|
7
7
|
function J({
|
|
8
8
|
facetKey: x,
|
|
9
9
|
scales: h,
|
|
10
|
-
orientation:
|
|
10
|
+
orientation: P,
|
|
11
11
|
geom: r,
|
|
12
12
|
aes: l,
|
|
13
|
-
sideDistances:
|
|
13
|
+
sideDistances: C,
|
|
14
14
|
showTooltips: H,
|
|
15
15
|
elementsAmount: w,
|
|
16
16
|
normalize: F,
|
|
@@ -18,7 +18,7 @@ function J({
|
|
|
18
18
|
tooltipsContainer: L,
|
|
19
19
|
tooltipsData: n
|
|
20
20
|
}) {
|
|
21
|
-
const o =
|
|
21
|
+
const o = P === "vertical", c = h.xPrimary.bandwidth(), d = (h.xPrimary(r.primaryGrouping) ?? 0) + c / 2, s = l.width === "auto" ? c * 0.95 : Math.min(c, l.width), m = (c - s) / 2, g = [...h.xSecondary.domain()].filter((t) => r.valuesMap[t]).sort((t, a) => {
|
|
22
22
|
const M = r.valuesMap[t], i = r.valuesMap[a];
|
|
23
23
|
return M.height - i.height;
|
|
24
24
|
}), b = {};
|
|
@@ -32,15 +32,15 @@ function J({
|
|
|
32
32
|
y2: p + a
|
|
33
33
|
}, p += a;
|
|
34
34
|
});
|
|
35
|
-
const
|
|
35
|
+
const R = $ && n.fixed;
|
|
36
36
|
return /* @__PURE__ */ e.jsx("g", { opacity: l.opacity, children: g.map((t) => {
|
|
37
37
|
if (!r.valuesMap[t])
|
|
38
38
|
return null;
|
|
39
|
-
const { y1: a, y2: M } = b[t], i = h.y(a), u = h.y(M), f = Math.abs(i - u) - 2 * m,
|
|
40
|
-
if (!j && !
|
|
39
|
+
const { y1: a, y2: M } = b[t], i = h.y(a), u = h.y(M), f = Math.abs(i - u) - 2 * m, z = typeof l.fillColor == "string" ? l.fillColor : l.fillColor[t], G = o ? -s / 2 : Math.min(i, u) + m, O = o ? Math.min(i, u) + m : -s / 2, j = t === "-";
|
|
40
|
+
if (!j && !E[t])
|
|
41
41
|
return;
|
|
42
|
-
const v = `logo_${r.key}_${t}`, V = n.currentFacet === x && n.selectedData === v &&
|
|
43
|
-
/* @__PURE__ */ e.jsx("g", { transform: `translate(${
|
|
42
|
+
const v = `logo_${r.key}_${t}`, V = n.currentFacet === x && n.selectedData === v && R, y = /* @__PURE__ */ e.jsxs("g", { transform: o ? `translate(${d},0)` : `translate(0, ${d})`, children: [
|
|
43
|
+
/* @__PURE__ */ e.jsx("g", { transform: `translate(${G},${O})`, children: j ? /* @__PURE__ */ e.jsx(
|
|
44
44
|
"g",
|
|
45
45
|
{
|
|
46
46
|
transform: o ? `scale(${s / 100},1) translate(0,${f / 2 - 50})` : `scale(${f / 100},1) translate(0,${s / 2 - 50}) `,
|
|
@@ -50,13 +50,13 @@ function J({
|
|
|
50
50
|
"g",
|
|
51
51
|
{
|
|
52
52
|
transform: o ? `scale(${s / 100},${f / 100})` : `scale(${f / 100},${s / 100})`,
|
|
53
|
-
fill:
|
|
54
|
-
onMouseOver: () => n.
|
|
53
|
+
fill: z,
|
|
54
|
+
onMouseOver: () => n.onMouseEnter(v, x),
|
|
55
55
|
onMouseLeave: () => n.onMouseLeave(),
|
|
56
56
|
children: /* @__PURE__ */ e.jsx(
|
|
57
57
|
"path",
|
|
58
58
|
{
|
|
59
|
-
d:
|
|
59
|
+
d: E[t],
|
|
60
60
|
fillRule: "evenodd",
|
|
61
61
|
clipRule: "evenodd"
|
|
62
62
|
}
|
|
@@ -64,12 +64,12 @@ function J({
|
|
|
64
64
|
}
|
|
65
65
|
) }),
|
|
66
66
|
H && /* @__PURE__ */ e.jsx(
|
|
67
|
-
|
|
67
|
+
_,
|
|
68
68
|
{
|
|
69
|
-
content: [t,
|
|
69
|
+
content: [t, q(r.valuesMap[t].height) + (F ? "%" : "")],
|
|
70
70
|
x: o ? d : (i + u) / 2,
|
|
71
71
|
y: o ? (i + u) / 2 : d,
|
|
72
|
-
sideDistances:
|
|
72
|
+
sideDistances: C,
|
|
73
73
|
horizontal: o,
|
|
74
74
|
offset: w > 1 ? c / 2 : c / 4,
|
|
75
75
|
active: v === n.selectedData && n.currentFacet === x,
|
|
@@ -79,7 +79,7 @@ function J({
|
|
|
79
79
|
}
|
|
80
80
|
)
|
|
81
81
|
] }, t);
|
|
82
|
-
return V ?
|
|
82
|
+
return V ? W.createPortal(y, $) : y;
|
|
83
83
|
}) });
|
|
84
84
|
}
|
|
85
85
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoElement.js","sources":["../../../../src/discrete/components/layers/LogoElement.tsx"],"sourcesContent":["import type { TooltipsData} from '../../../common/Tooltip';\nimport {Tooltip} from '../../../common/Tooltip';\nimport type {
|
|
1
|
+
{"version":3,"file":"LogoElement.js","sources":["../../../../src/discrete/components/layers/LogoElement.tsx"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport type { TooltipsData } from '../../../common/Tooltip';\nimport { Tooltip } from '../../../common/Tooltip';\nimport type { Orientation } from '../../../types';\nimport { numberFormat } from '../../../utils/numberFormat';\nimport type { LogoPlotLayer } from '../../DiscreteSettingsImpl';\nimport type { LogoStack } from '../../layers';\nimport type { ChartScales } from '../types';\nimport { seqAlphabet } from './seqAlphabet';\n\nconst emptyGlyph = () => (<path d='M 0 49 h 100 v 2 h -100 z' />);\n\ninterface LogoElementProps {\n facetKey: string;\n scales: ChartScales;\n geom: LogoStack;\n orientation: Orientation;\n aes: LogoPlotLayer['aes'];\n normalize: boolean;\n sideDistances: {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n showTooltips: boolean;\n elementsAmount: number;\n tooltipsData: TooltipsData<unknown>;\n activeElementContainer?: Element;\n tooltipsContainer?: Element;\n}\n\nexport function LogoElement({\n facetKey,\n scales,\n orientation,\n geom,\n aes,\n sideDistances,\n showTooltips,\n elementsAmount,\n normalize,\n activeElementContainer,\n tooltipsContainer,\n tooltipsData,\n}: LogoElementProps) {\n const isVertical = orientation === 'vertical';\n const boxOuterWidth = scales.xPrimary.bandwidth();\n const boxXPosition = (scales.xPrimary(geom.primaryGrouping) ?? 0) + boxOuterWidth / 2;\n const boxWidth = aes.width === 'auto' ? boxOuterWidth * 0.95 : Math.min(boxOuterWidth, aes.width);\n const offset = (boxOuterWidth - boxWidth) / 2;\n const secondaryKeys = [...scales.xSecondary.domain()]\n .filter(key => geom.valuesMap[key])\n .sort((a, b) => {\n const aH = geom.valuesMap[a];\n const bH = geom.valuesMap[b];\n return aH.height - bH.height;\n });\n const yValues:Record<string, {y1: number, y2: number}> = {};\n let currentHeight = 0;\n secondaryKeys.forEach(secondaryKey => {\n if (!geom.valuesMap[secondaryKey]) {\n return;\n }\n const height = geom.valuesMap[secondaryKey].height;\n yValues[secondaryKey] = {\n y1: currentHeight,\n y2: currentHeight + height,\n };\n currentHeight += height;\n });\n const dimmedBackground = activeElementContainer && tooltipsData.fixed;\n\n return (\n <g opacity={aes.opacity}>\n {secondaryKeys.map(key => {\n if (!geom.valuesMap[key]) {\n return null;\n }\n const {y1, y2} = yValues[key];\n const y1Px = scales.y(y1);\n const y2Px = scales.y(y2);\n const boxHeight = Math.abs(y1Px - y2Px) - 2 * offset;\n const fillColor = typeof aes.fillColor === 'string' ? aes.fillColor : aes.fillColor[key];\n const x = isVertical ? -boxWidth / 2 : Math.min(y1Px, y2Px) + offset;\n const y = isVertical ? Math.min(y1Px, y2Px) + offset : -boxWidth / 2;\n const isEmpty = key === '-';\n if (!isEmpty && !seqAlphabet[key as keyof typeof seqAlphabet]) {\n return;\n }\n const globalKey = `logo_${geom.key}_${key}`;\n const highlightedElement = tooltipsData.currentFacet === facetKey && tooltipsData.selectedData === globalKey && dimmedBackground;\n\n const element = (\n <g key={key} transform={isVertical ? `translate(${boxXPosition},0)` : `translate(0, ${boxXPosition})`}>\n <g transform={`translate(${x},${y})`}>\n {isEmpty ? (\n <g\n transform={isVertical\n ? `scale(${boxWidth / 100},1) translate(0,${boxHeight / 2 - 50})`\n : `scale(${boxHeight / 100},1) translate(0,${boxWidth / 2 - 50}) `}\n >\n {emptyGlyph()}\n </g>\n ) : (\n <g\n transform={isVertical ? `scale(${boxWidth / 100},${boxHeight / 100})` : `scale(${boxHeight / 100},${boxWidth / 100})`}\n fill={fillColor}\n onMouseOver={() => tooltipsData.onMouseEnter(globalKey, facetKey)}\n onMouseLeave={() => tooltipsData.onMouseLeave()}\n >\n <path\n d={seqAlphabet[key as keyof typeof seqAlphabet]}\n fillRule=\"evenodd\" clipRule=\"evenodd\"\n />\n </g>\n )}\n </g>\n {showTooltips && (\n <Tooltip\n content={[key, numberFormat(geom.valuesMap[key].height) + (normalize ? '%' : '')]}\n x={isVertical ? boxXPosition : (y1Px + y2Px) / 2}\n y={isVertical ? (y1Px + y2Px) / 2 : boxXPosition}\n sideDistances={sideDistances}\n horizontal={isVertical}\n offset={elementsAmount > 1 ? boxOuterWidth / 2 : boxOuterWidth / 4}\n active={globalKey === tooltipsData.selectedData && tooltipsData.currentFacet === facetKey}\n fixed={tooltipsData.fixed}\n onClose={tooltipsData.onClose}\n container={tooltipsContainer}\n />\n )}\n </g>\n );\n return highlightedElement ? createPortal(element, activeElementContainer) : element;\n })}\n </g>\n );\n}\n"],"names":["emptyGlyph","jsx","LogoElement","facetKey","scales","orientation","geom","aes","sideDistances","showTooltips","elementsAmount","normalize","activeElementContainer","tooltipsContainer","tooltipsData","isVertical","boxOuterWidth","boxXPosition","boxWidth","offset","secondaryKeys","key","a","b","aH","bH","yValues","currentHeight","secondaryKey","height","dimmedBackground","y1","y2","y1Px","y2Px","boxHeight","fillColor","x","y","isEmpty","seqAlphabet","globalKey","highlightedElement","element","jsxs","Tooltip","numberFormat","createPortal"],"mappings":";;;;;AAUA,MAAMA,IAAa,MAAOC,gBAAAA,EAAAA,IAAC,QAAA,EAAK,GAAE,4BAAA,CAA4B;AAsBvD,SAASC,EAAY;AAAA,EACxB,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,cAAAC;AACJ,GAAqB;AACjB,QAAMC,IAAaV,MAAgB,YAC7BW,IAAgBZ,EAAO,SAAS,UAAA,GAChCa,KAAgBb,EAAO,SAASE,EAAK,eAAe,KAAK,KAAKU,IAAgB,GAC9EE,IAAWX,EAAI,UAAU,SAASS,IAAgB,OAAO,KAAK,IAAIA,GAAeT,EAAI,KAAK,GAC1FY,KAAUH,IAAgBE,KAAY,GACtCE,IAAgB,CAAC,GAAGhB,EAAO,WAAW,OAAA,CAAQ,EAC/C,OAAO,CAAAiB,MAAOf,EAAK,UAAUe,CAAG,CAAC,E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AgB;AAAA,UACjE,QAAQyB,MAAc3B,EAAa,gBAAgBA,EAAa,iBAAiBX;AAAA,UACjF,OAAOW,EAAa;AAAA,UACpB,SAASA,EAAa;AAAA,UACtB,WAAWD;AAAA,QAAA;AAAA,MAAA;AAAA,IACf,EAAA,GApCAQ,CAsCR;AAEJ,WAAOqB,IAAqBK,EAAAA,aAAaJ,GAAS/B,CAAsB,IAAI+B;AAAA,EAChF,CAAC,EAAA,CACL;AAER;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TooltipsData } from '../../../common/Tooltip';
|
|
2
|
-
import {
|
|
2
|
+
import { Orientation } from '../../../types';
|
|
3
3
|
import { PairedPoints } from '../../layers';
|
|
4
4
|
import { PairedPointsData } from '../../layers/types';
|
|
5
|
-
import {
|
|
5
|
+
import { ChartScales } from '../types';
|
|
6
6
|
interface PairedPointsProps {
|
|
7
7
|
facetKey: string;
|
|
8
8
|
scales: ChartScales;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PairedPointsElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/PairedPointsElement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PairedPointsElement.d.ts","sourceRoot":"","sources":["../../../../src/discrete/components/layers/PairedPointsElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAA+B,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAI3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,UAAU,iBAAiB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC7B,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,mBAAmB,CAAC,EAChC,QAAQ,EACR,MAAM,EACN,WAAW,EACX,IAAI,EACJ,GAAG,EACH,aAAa,EACb,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,GACf,EAAE,iBAAiB,2CA2GnB"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { j as d } from "../../../node_modules/react/jsx-runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getLineShape as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
function y(i, e, c,
|
|
2
|
+
import { r as $ } from "../../../node_modules/react-dom/index.js";
|
|
3
|
+
import { Tooltip as g } from "../../../common/Tooltip.js";
|
|
4
|
+
import { getLineShape as B } from "../../../utils/getLineShape.js";
|
|
5
|
+
import { getPointShape as F } from "../../../utils/getPointShape.js";
|
|
6
|
+
import { numberFormat as b } from "../../../utils/numberFormat.js";
|
|
7
|
+
function y(i, e, c, r) {
|
|
8
8
|
if (c && typeof c == "object" && "type" in c) {
|
|
9
9
|
if (c.type === "primaryGrouping")
|
|
10
|
-
return i.xPrimaryAes(
|
|
10
|
+
return i.xPrimaryAes(r)[e];
|
|
11
11
|
if (c.type === "secondaryGrouping")
|
|
12
|
-
return i.xSecondaryAes(
|
|
12
|
+
return i.xSecondaryAes(r)[e];
|
|
13
13
|
}
|
|
14
14
|
return c;
|
|
15
15
|
}
|
|
@@ -17,69 +17,69 @@ function N({
|
|
|
17
17
|
facetKey: i,
|
|
18
18
|
scales: e,
|
|
19
19
|
orientation: c,
|
|
20
|
-
geom:
|
|
20
|
+
geom: r,
|
|
21
21
|
aes: t,
|
|
22
|
-
sideDistances:
|
|
22
|
+
sideDistances: v,
|
|
23
23
|
showTooltips: u,
|
|
24
24
|
activeElementContainer: f,
|
|
25
25
|
tooltipsContainer: x,
|
|
26
|
-
tooltipsData:
|
|
26
|
+
tooltipsData: n
|
|
27
27
|
}) {
|
|
28
|
-
const h = c === "vertical", C = y(e, "lineColor", t.lineColor,
|
|
28
|
+
const h = c === "vertical", C = y(e, "lineColor", t.lineColor, r.id), L = y(e, "lineShape", t.lineShape, r.id), z = y(e, "fillColor", t.dotFill, r.key1), _ = y(e, "dotShape", t.dotShape, r.key1), A = y(e, "fillColor", t.dotFill, r.key2), E = y(e, "dotShape", t.dotShape, r.key2), G = F(_, t.dotSize, z), O = F(E, t.dotSize, A);
|
|
29
29
|
function l(o) {
|
|
30
|
-
return
|
|
30
|
+
return r.grouping === "primary" ? (e.xPrimary(o) ?? 0) + e.xPrimary.bandwidth() / 2 : (e.xPrimary(r.id) ?? 0) + (e.xSecondary(o) ?? 0) + e.xSecondary.bandwidth() / 2;
|
|
31
31
|
}
|
|
32
|
-
const M = f &&
|
|
33
|
-
return /* @__PURE__ */ d.jsx("g", { opacity: t.opacity, children:
|
|
34
|
-
const k = h ? l(
|
|
32
|
+
const M = f && n.fixed;
|
|
33
|
+
return /* @__PURE__ */ d.jsx("g", { opacity: t.opacity, children: r.pairs.map((o) => {
|
|
34
|
+
const k = h ? l(r.key1) : e.y(o.key1.value), S = h ? l(r.key2) : e.y(o.key2.value), m = h ? e.y(o.key1.value) : l(r.key1), P = h ? e.y(o.key2.value) : l(r.key2), j = `pairedPoints_${o.id}_${o.key1.id}`, s = `pairedPoints_${o.id}_${o.key2.id}`, V = n.currentFacet === i && n.selectedData === j && M, W = n.currentFacet === i && n.selectedData === s && M, p = /* @__PURE__ */ d.jsxs("g", { transform: `translate(${k},${m})`, children: [
|
|
35
35
|
G,
|
|
36
36
|
u && x && /* @__PURE__ */ d.jsx(
|
|
37
37
|
"circle",
|
|
38
38
|
{
|
|
39
|
-
onMouseOver: () =>
|
|
40
|
-
onMouseLeave: () =>
|
|
39
|
+
onMouseOver: () => n.onMouseEnter(j, i),
|
|
40
|
+
onMouseLeave: () => n.onMouseLeave(),
|
|
41
41
|
r: "15",
|
|
42
42
|
fill: "transparent",
|
|
43
43
|
stroke: "none"
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
46
|
u && /* @__PURE__ */ d.jsx(
|
|
47
|
-
|
|
47
|
+
g,
|
|
48
48
|
{
|
|
49
|
-
content: [o.id,
|
|
49
|
+
content: [o.id, b(o.key1.value)],
|
|
50
50
|
x: k,
|
|
51
51
|
y: m,
|
|
52
|
-
sideDistances:
|
|
52
|
+
sideDistances: v,
|
|
53
53
|
horizontal: !0,
|
|
54
|
-
active: j ===
|
|
55
|
-
fixed:
|
|
56
|
-
onClose:
|
|
54
|
+
active: j === n.selectedData && n.currentFacet === i,
|
|
55
|
+
fixed: n.fixed,
|
|
56
|
+
onClose: n.onClose,
|
|
57
57
|
container: x
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
|
-
] }),
|
|
61
|
-
|
|
60
|
+
] }), a = /* @__PURE__ */ d.jsxs("g", { transform: `translate(${S},${P})`, children: [
|
|
61
|
+
O,
|
|
62
62
|
u && x && /* @__PURE__ */ d.jsx(
|
|
63
63
|
"circle",
|
|
64
64
|
{
|
|
65
|
-
onMouseOver: () =>
|
|
66
|
-
onMouseLeave: () =>
|
|
65
|
+
onMouseOver: () => n.onMouseEnter(s, i),
|
|
66
|
+
onMouseLeave: () => n.onMouseLeave(),
|
|
67
67
|
r: "15",
|
|
68
68
|
fill: "transparent",
|
|
69
69
|
stroke: "none"
|
|
70
70
|
}
|
|
71
71
|
),
|
|
72
72
|
u && /* @__PURE__ */ d.jsx(
|
|
73
|
-
|
|
73
|
+
g,
|
|
74
74
|
{
|
|
75
|
-
content: [o.id,
|
|
75
|
+
content: [o.id, b(o.key2.value)],
|
|
76
76
|
x: S,
|
|
77
77
|
y: P,
|
|
78
|
-
sideDistances:
|
|
78
|
+
sideDistances: v,
|
|
79
79
|
horizontal: !0,
|
|
80
|
-
active:
|
|
81
|
-
fixed:
|
|
82
|
-
onClose:
|
|
80
|
+
active: s === n.selectedData && n.currentFacet === i,
|
|
81
|
+
fixed: n.fixed,
|
|
82
|
+
onClose: n.onClose,
|
|
83
83
|
container: x
|
|
84
84
|
}
|
|
85
85
|
)
|
|
@@ -93,13 +93,13 @@ function N({
|
|
|
93
93
|
x2: S,
|
|
94
94
|
y2: P,
|
|
95
95
|
stroke: C,
|
|
96
|
-
strokeDasharray:
|
|
96
|
+
strokeDasharray: B(L),
|
|
97
97
|
strokeWidth: t.lineWidth,
|
|
98
98
|
fill: "none"
|
|
99
99
|
}
|
|
100
100
|
),
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
V ? $.createPortal(p, f) : p,
|
|
102
|
+
W ? $.createPortal(p, f) : a
|
|
103
103
|
] }, o.id);
|
|
104
104
|
}) });
|
|
105
105
|
}
|