@milaboratories/miplots4 1.1.0 → 1.2.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.
Files changed (139) hide show
  1. package/dist/MiPlots.d.ts.map +1 -1
  2. package/dist/MiPlots.js +16 -14
  3. package/dist/MiPlots.js.map +1 -1
  4. package/dist/common/ContinuousAxis.d.ts +3 -1
  5. package/dist/common/ContinuousAxis.d.ts.map +1 -1
  6. package/dist/common/ContinuousAxis.js +8 -8
  7. package/dist/common/ContinuousAxis.js.map +1 -1
  8. package/dist/common/Legend.d.ts +12 -1
  9. package/dist/common/Legend.d.ts.map +1 -1
  10. package/dist/common/Legend.js +14 -6
  11. package/dist/common/Legend.js.map +1 -1
  12. package/dist/index.d.ts +2 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/selection/ChartRenderer.d.ts +90 -0
  15. package/dist/selection/ChartRenderer.d.ts.map +1 -0
  16. package/dist/selection/ChartRenderer.js +254 -0
  17. package/dist/selection/ChartRenderer.js.map +1 -0
  18. package/dist/selection/SelectionSettingsImpl.d.ts +53 -0
  19. package/dist/selection/SelectionSettingsImpl.d.ts.map +1 -0
  20. package/dist/selection/SelectionSettingsImpl.js +47 -0
  21. package/dist/selection/SelectionSettingsImpl.js.map +1 -0
  22. package/dist/selection/components/Chart/Bars/GroupSelectedBars.d.ts +8 -0
  23. package/dist/selection/components/Chart/Bars/GroupSelectedBars.d.ts.map +1 -0
  24. package/dist/selection/components/Chart/Bars/GroupSelectedBars.js +57 -0
  25. package/dist/selection/components/Chart/Bars/GroupSelectedBars.js.map +1 -0
  26. package/dist/selection/components/Chart/Bars/StackedBars.d.ts +12 -0
  27. package/dist/selection/components/Chart/Bars/StackedBars.d.ts.map +1 -0
  28. package/dist/selection/components/Chart/Bars/StackedBars.js +58 -0
  29. package/dist/selection/components/Chart/Bars/StackedBars.js.map +1 -0
  30. package/dist/selection/components/Chart/Bars/UngroupedBars.d.ts +6 -0
  31. package/dist/selection/components/Chart/Bars/UngroupedBars.d.ts.map +1 -0
  32. package/dist/selection/components/Chart/Bars/UngroupedBars.js +38 -0
  33. package/dist/selection/components/Chart/Bars/UngroupedBars.js.map +1 -0
  34. package/dist/selection/components/Chart/Bars.d.ts +10 -0
  35. package/dist/selection/components/Chart/Bars.d.ts.map +1 -0
  36. package/dist/selection/components/Chart/Bars.js +48 -0
  37. package/dist/selection/components/Chart/Bars.js.map +1 -0
  38. package/dist/selection/components/Chart/ChartAxes.d.ts +7 -0
  39. package/dist/selection/components/Chart/ChartAxes.d.ts.map +1 -0
  40. package/dist/selection/components/Chart/ChartAxes.js +51 -0
  41. package/dist/selection/components/Chart/ChartAxes.js.map +1 -0
  42. package/dist/selection/components/Chart/ChartFrame.d.ts +9 -0
  43. package/dist/selection/components/Chart/ChartFrame.d.ts.map +1 -0
  44. package/dist/selection/components/Chart/ChartFrame.js +41 -0
  45. package/dist/selection/components/Chart/ChartFrame.js.map +1 -0
  46. package/dist/selection/components/Chart/Dividers.d.ts +8 -0
  47. package/dist/selection/components/Chart/Dividers.d.ts.map +1 -0
  48. package/dist/selection/components/Chart/Dividers.js +27 -0
  49. package/dist/selection/components/Chart/Dividers.js.map +1 -0
  50. package/dist/selection/components/Chart/Gridlines.d.ts +10 -0
  51. package/dist/selection/components/Chart/Gridlines.d.ts.map +1 -0
  52. package/dist/selection/components/Chart/Gridlines.js +32 -0
  53. package/dist/selection/components/Chart/Gridlines.js.map +1 -0
  54. package/dist/selection/components/Chart/Ribbons/GroupFlowRibbon.d.ts +9 -0
  55. package/dist/selection/components/Chart/Ribbons/GroupFlowRibbon.d.ts.map +1 -0
  56. package/dist/selection/components/Chart/Ribbons/GroupFlowRibbon.js +36 -0
  57. package/dist/selection/components/Chart/Ribbons/GroupFlowRibbon.js.map +1 -0
  58. package/dist/selection/components/Chart/Ribbons/MultiGroupRibbon.d.ts +6 -0
  59. package/dist/selection/components/Chart/Ribbons/MultiGroupRibbon.d.ts.map +1 -0
  60. package/dist/selection/components/Chart/Ribbons/MultiGroupRibbon.js +22 -0
  61. package/dist/selection/components/Chart/Ribbons/MultiGroupRibbon.js.map +1 -0
  62. package/dist/selection/components/Chart/Ribbons/SimpleRibbon.d.ts +10 -0
  63. package/dist/selection/components/Chart/Ribbons/SimpleRibbon.d.ts.map +1 -0
  64. package/dist/selection/components/Chart/Ribbons/SimpleRibbon.js +33 -0
  65. package/dist/selection/components/Chart/Ribbons/SimpleRibbon.js.map +1 -0
  66. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.d.ts +10 -0
  67. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.d.ts.map +1 -0
  68. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.js +65 -0
  69. package/dist/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.js.map +1 -0
  70. package/dist/selection/components/Chart/Ribbons/ribbonPath.d.ts +10 -0
  71. package/dist/selection/components/Chart/Ribbons/ribbonPath.d.ts.map +1 -0
  72. package/dist/selection/components/Chart/Ribbons/ribbonPath.js +13 -0
  73. package/dist/selection/components/Chart/Ribbons/ribbonPath.js.map +1 -0
  74. package/dist/selection/components/Chart/Ribbons.d.ts +9 -0
  75. package/dist/selection/components/Chart/Ribbons.d.ts.map +1 -0
  76. package/dist/selection/components/Chart/Ribbons.js +58 -0
  77. package/dist/selection/components/Chart/Ribbons.js.map +1 -0
  78. package/dist/selection/components/Chart/StageCounts.d.ts +7 -0
  79. package/dist/selection/components/Chart/StageCounts.d.ts.map +1 -0
  80. package/dist/selection/components/Chart/StageCounts.js +20 -0
  81. package/dist/selection/components/Chart/StageCounts.js.map +1 -0
  82. package/dist/selection/components/Chart/types.d.ts +132 -0
  83. package/dist/selection/components/Chart/types.d.ts.map +1 -0
  84. package/dist/selection/components/Chart.d.ts +22 -0
  85. package/dist/selection/components/Chart.d.ts.map +1 -0
  86. package/dist/selection/components/Chart.js +97 -0
  87. package/dist/selection/components/Chart.js.map +1 -0
  88. package/dist/selection/components/ChartsGroup.d.ts +18 -0
  89. package/dist/selection/components/ChartsGroup.d.ts.map +1 -0
  90. package/dist/selection/components/ChartsGroup.js +181 -0
  91. package/dist/selection/components/ChartsGroup.js.map +1 -0
  92. package/dist/selection/components/FacetCell.d.ts +22 -0
  93. package/dist/selection/components/FacetCell.d.ts.map +1 -0
  94. package/dist/selection/components/FacetCell.js +18 -0
  95. package/dist/selection/components/FacetCell.js.map +1 -0
  96. package/dist/selection/components/types.d.ts +58 -0
  97. package/dist/selection/components/types.d.ts.map +1 -0
  98. package/dist/selection/constants.d.ts +25 -0
  99. package/dist/selection/constants.d.ts.map +1 -0
  100. package/dist/selection/constants.js +4 -0
  101. package/dist/selection/constants.js.map +1 -0
  102. package/dist/selection/createSelectionData.d.ts +50 -0
  103. package/dist/selection/createSelectionData.d.ts.map +1 -0
  104. package/dist/selection/createSelectionData.js +92 -0
  105. package/dist/selection/createSelectionData.js.map +1 -0
  106. package/dist/selection/index.d.ts +26 -0
  107. package/dist/selection/index.d.ts.map +1 -0
  108. package/dist/selection/index.js +96 -0
  109. package/dist/selection/index.js.map +1 -0
  110. package/dist/selection/utils.d.ts +4 -0
  111. package/dist/selection/utils.d.ts.map +1 -0
  112. package/dist/selection/utils.js +13 -0
  113. package/dist/selection/utils.js.map +1 -0
  114. package/dist/types/bubble.d.ts +42 -0
  115. package/dist/types/bubble.d.ts.map +1 -1
  116. package/dist/types/common.d.ts +38 -0
  117. package/dist/types/common.d.ts.map +1 -1
  118. package/dist/types/common.js +1 -0
  119. package/dist/types/common.js.map +1 -1
  120. package/dist/types/dendro.d.ts +103 -0
  121. package/dist/types/dendro.d.ts.map +1 -1
  122. package/dist/types/discrete.d.ts +167 -0
  123. package/dist/types/discrete.d.ts.map +1 -1
  124. package/dist/types/heatmap.d.ts +159 -0
  125. package/dist/types/heatmap.d.ts.map +1 -1
  126. package/dist/types/histogram.d.ts +22 -0
  127. package/dist/types/histogram.d.ts.map +1 -1
  128. package/dist/types/index.d.ts +3 -1
  129. package/dist/types/index.d.ts.map +1 -1
  130. package/dist/types/index.js +1 -0
  131. package/dist/types/scatterplot-umap.d.ts +188 -0
  132. package/dist/types/scatterplot-umap.d.ts.map +1 -1
  133. package/dist/types/scatterplot.d.ts +270 -0
  134. package/dist/types/scatterplot.d.ts.map +1 -1
  135. package/dist/types/selection.d.ts +452 -0
  136. package/dist/types/selection.d.ts.map +1 -0
  137. package/dist/types/selection.js +53 -0
  138. package/dist/types/selection.js.map +1 -0
  139. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UngroupedBars.js","names":[],"sources":["../../../../../src/selection/components/Chart/Bars/UngroupedBars.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { useFunction } from '../../../../utils/hooks/useFunction';\nimport { DESATURATE_ALPHA } from '../../../constants';\nimport { toPercent } from '../../../utils';\nimport type { BarsCommon } from '../types';\n\n// Ungrouped bars: a single bar split into preserved (bottom, vivid) and\n// discarded (top, desaturated).\nexport const UngroupedBars = memo(function UngroupedBars({\n common,\n barColor,\n}: {\n common: BarsCommon;\n barColor: string;\n}) {\n const { stageIndex, stage, geometry, layerOpacity, tooltip } = common;\n const { left, width, centerX, height, yScale } = geometry;\n\n const dividerY = stage.total > 0 ? yScale(toPercent(stage.surviving / stage.total)) : height;\n const preservedHeight = height - dividerY;\n const discardedHeight = dividerY;\n\n const handleEnter = useFunction((section: 'preserved' | 'discarded', anchorY: number) => {\n tooltip.onEnter({ stageIndex, section, stage, anchorX: centerX, anchorY });\n });\n\n return (\n <>\n <rect\n x={left}\n y={dividerY}\n width={width}\n height={preservedHeight}\n fill={barColor}\n opacity={layerOpacity}\n onMouseEnter={() => handleEnter('preserved', dividerY + preservedHeight / 2)}\n onMouseLeave={tooltip.onLeave}\n />\n <rect\n x={left}\n y={0}\n width={width}\n height={discardedHeight}\n fill={barColor}\n opacity={DESATURATE_ALPHA * layerOpacity}\n onMouseEnter={() => handleEnter('discarded', discardedHeight / 2)}\n onMouseLeave={tooltip.onLeave}\n />\n </>\n );\n});\n"],"mappings":";;;;;AASA,MAAa,IAAgB,EAAK,SAAuB,EACvD,WACA,eAIC;CACD,IAAM,EAAE,eAAY,UAAO,aAAU,iBAAc,eAAY,GACzD,EAAE,SAAM,UAAO,YAAS,WAAQ,cAAW,GAE3C,IAAW,EAAM,QAAQ,IAAI,EAAO,EAAU,EAAM,YAAY,EAAM,MAAM,CAAC,GAAG,GAChF,IAAkB,IAAS,GAC3B,IAAkB,GAElB,IAAc,GAAa,GAAoC,MAAoB;AACvF,IAAQ,QAAQ;GAAE;GAAY;GAAS;GAAO,SAAS;GAAS;GAAS,CAAC;GAC1E;AAEF,QACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;EACE,GAAG;EACH,GAAG;EACI;EACP,QAAQ;EACR,MAAM;EACN,SAAS;EACT,oBAAoB,EAAY,aAAa,IAAW,IAAkB,EAAE;EAC5E,cAAc,EAAQ;EACtB,CAAA,EACF,kBAAC,QAAD;EACE,GAAG;EACH,GAAG;EACI;EACP,QAAQ;EACR,MAAM;EACN,SAAS,IAAmB;EAC5B,oBAAoB,EAAY,aAAa,IAAkB,EAAE;EACjE,cAAc,EAAQ;EACtB,CAAA,CACD,EAAA,CAAA;EAEL"}
@@ -0,0 +1,10 @@
1
+ import { StageInfo } from '../../createSelectionData';
2
+ import { ChartStyle, GroupContext, StageGeometry, StageHandlers } from './types';
3
+ export declare const Bars: import('react').NamedExoticComponent<{
4
+ stages: StageInfo[];
5
+ geometry: StageGeometry;
6
+ groupCtx: GroupContext;
7
+ style: ChartStyle;
8
+ handlers: StageHandlers;
9
+ }>;
10
+ //# sourceMappingURL=Bars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bars.d.ts","sourceRoot":"","sources":["../../../../src/selection/components/Chart/Bars.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,KAAK,EAAc,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMlG,eAAO,MAAM,IAAI;YAOP,SAAS,EAAE;cACT,aAAa;cACb,YAAY;WACf,UAAU;cACP,aAAa;EAoDvB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { GroupSelectedBars as e } from "./Bars/GroupSelectedBars.js";
2
+ import { StackedBars as t } from "./Bars/StackedBars.js";
3
+ import { UngroupedBars as n } from "./Bars/UngroupedBars.js";
4
+ import { memo as r } from "react";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ const a = r(function({ stages: r, geometry: a, groupCtx: o, style: s, handlers: c }) {
7
+ let { xScale: l, yScale: u, height: d } = a, { grouped: f, groupNames: p, facetActiveGroup: m, facetHoveredGroup: h, stackOrder: g } = o, { barColor: _, opacity: v, colorMap: y } = s, { onGroupClick: b, onGroupHover: x, onTooltipEnter: S, onTooltipLeave: C } = c, w = l.bandwidth(), T = [];
8
+ for (let [a, o] of r.entries()) {
9
+ if (o.total === 0) continue;
10
+ let r = l(String(a)) ?? 0, s = {
11
+ stageIndex: a,
12
+ stage: o,
13
+ geometry: {
14
+ left: r,
15
+ width: w,
16
+ centerX: r + w / 2,
17
+ height: d,
18
+ yScale: u
19
+ },
20
+ layerOpacity: v,
21
+ tooltip: {
22
+ onEnter: S,
23
+ onLeave: C
24
+ }
25
+ };
26
+ f && p.length > 0 && m ? T.push(/* @__PURE__ */ i(e, {
27
+ common: s,
28
+ facetActiveGroup: m,
29
+ color: y.get(m) ?? _,
30
+ onGroupClick: b
31
+ }, `bars-${a}`)) : f && p.length > 0 ? T.push(/* @__PURE__ */ i(t, {
32
+ common: s,
33
+ stackOrder: g,
34
+ colorMap: y,
35
+ fallbackColor: _,
36
+ hoveredGroup: h,
37
+ onGroupHover: x,
38
+ onGroupClick: b
39
+ }, `bars-${a}`)) : T.push(/* @__PURE__ */ i(n, {
40
+ common: s,
41
+ barColor: _
42
+ }, `bars-${a}`));
43
+ }
44
+ return /* @__PURE__ */ i("g", { children: T });
45
+ });
46
+ export { a as Bars };
47
+
48
+ //# sourceMappingURL=Bars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Bars.js","names":[],"sources":["../../../../src/selection/components/Chart/Bars.tsx"],"sourcesContent":["import { memo } from 'react';\nimport type { ReactElement } from 'react';\n\nimport type { StageInfo } from '../../createSelectionData';\nimport { GroupSelectedBars } from './Bars/GroupSelectedBars';\nimport { StackedBars } from './Bars/StackedBars';\nimport { UngroupedBars } from './Bars/UngroupedBars';\nimport type { BarsCommon, ChartStyle, GroupContext, StageGeometry, StageHandlers } from './types';\n\n// Picks the bar component per stage based on grouping state:\n// - facetActiveGroup set → GroupSelectedBars (single-group overlay)\n// - grouped, no active group → StackedBars (stacked-by-group)\n// - ungrouped → UngroupedBars (single combined bar)\nexport const Bars = memo(function Bars({\n stages,\n geometry,\n groupCtx,\n style,\n handlers,\n}: {\n stages: StageInfo[];\n geometry: StageGeometry;\n groupCtx: GroupContext;\n style: ChartStyle;\n handlers: StageHandlers;\n}) {\n const { xScale, yScale, height } = geometry;\n const { grouped, groupNames, facetActiveGroup, facetHoveredGroup, stackOrder } = groupCtx;\n const { barColor, opacity: layerOpacity, colorMap } = style;\n const { onGroupClick, onGroupHover, onTooltipEnter, onTooltipLeave } = handlers;\n\n const barWidth = xScale.bandwidth();\n const elements: ReactElement[] = [];\n\n for (const [stageIndex, stage] of stages.entries()) {\n if (stage.total === 0) continue;\n const left = xScale(String(stageIndex)) ?? 0;\n const common: BarsCommon = {\n stageIndex,\n stage,\n geometry: { left, width: barWidth, centerX: left + barWidth / 2, height, yScale },\n layerOpacity,\n tooltip: { onEnter: onTooltipEnter, onLeave: onTooltipLeave },\n };\n\n if (grouped && groupNames.length > 0 && facetActiveGroup) {\n elements.push(\n <GroupSelectedBars\n key={`bars-${stageIndex}`}\n common={common}\n facetActiveGroup={facetActiveGroup}\n color={colorMap.get(facetActiveGroup) ?? barColor}\n onGroupClick={onGroupClick}\n />,\n );\n } else if (grouped && groupNames.length > 0) {\n elements.push(\n <StackedBars\n key={`bars-${stageIndex}`}\n common={common}\n stackOrder={stackOrder}\n colorMap={colorMap}\n fallbackColor={barColor}\n hoveredGroup={facetHoveredGroup}\n onGroupHover={onGroupHover}\n onGroupClick={onGroupClick}\n />,\n );\n } else {\n elements.push(\n <UngroupedBars key={`bars-${stageIndex}`} common={common} barColor={barColor} />,\n );\n }\n }\n\n return <g>{elements}</g>;\n});\n"],"mappings":";;;;;AAaA,MAAa,IAAO,EAAK,SAAc,EACrC,WACA,aACA,aACA,UACA,eAOC;CACD,IAAM,EAAE,WAAQ,WAAQ,cAAW,GAC7B,EAAE,YAAS,eAAY,qBAAkB,sBAAmB,kBAAe,GAC3E,EAAE,aAAU,SAAS,GAAc,gBAAa,GAChD,EAAE,iBAAc,iBAAc,mBAAgB,sBAAmB,GAEjE,IAAW,EAAO,WAAW,EAC7B,IAA2B,EAAE;AAEnC,MAAK,IAAM,CAAC,GAAY,MAAU,EAAO,SAAS,EAAE;AAClD,MAAI,EAAM,UAAU,EAAG;EACvB,IAAM,IAAO,EAAO,OAAO,EAAW,CAAC,IAAI,GACrC,IAAqB;GACzB;GACA;GACA,UAAU;IAAE;IAAM,OAAO;IAAU,SAAS,IAAO,IAAW;IAAG;IAAQ;IAAQ;GACjF;GACA,SAAS;IAAE,SAAS;IAAgB,SAAS;IAAgB;GAC9D;AAED,EAAI,KAAW,EAAW,SAAS,KAAK,IACtC,EAAS,KACP,kBAAC,GAAD;GAEU;GACU;GAClB,OAAO,EAAS,IAAI,EAAiB,IAAI;GAC3B;GACd,EALK,QAAQ,IAKb,CACH,GACQ,KAAW,EAAW,SAAS,IACxC,EAAS,KACP,kBAAC,GAAD;GAEU;GACI;GACF;GACV,eAAe;GACf,cAAc;GACA;GACA;GACd,EARK,QAAQ,IAQb,CACH,GAED,EAAS,KACP,kBAAC,GAAD;GAAkD;GAAkB;GAAY,EAA5D,QAAQ,IAAoD,CACjF;;AAIL,QAAO,kBAAC,KAAD,EAAA,UAAI,GAAa,CAAA;EACxB"}
@@ -0,0 +1,7 @@
1
+ import { CellLayout, ChartXAxis, ChartYAxis } from './types';
2
+ export declare const ChartAxes: import('react').NamedExoticComponent<{
3
+ layout: CellLayout;
4
+ xAxis: ChartXAxis;
5
+ yAxis: ChartYAxis;
6
+ }>;
7
+ //# sourceMappingURL=ChartAxes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartAxes.d.ts","sourceRoot":"","sources":["../../../../src/selection/components/Chart/ChartAxes.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAKlE,eAAO,MAAM,SAAS;YAKZ,UAAU;WACX,UAAU;WACV,UAAU;EAkEjB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import "../../../constants.js";
2
+ import { BandAxis as e } from "../../../common/BandAxis.js";
3
+ import { ContinuousAxis as t } from "../../../common/ContinuousAxis.js";
4
+ import { formatPercent as n } from "../../utils.js";
5
+ import { memo as r } from "react";
6
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ const s = r(function({ layout: r, xAxis: s, yAxis: c }) {
8
+ let { xScale: l, yScale: u, width: d, height: f, paddingLeft: p, paddingBottom: m, showXAxis: h, showYAxis: g } = r, { labelsPosition: _ = "center", showTicks: v = !0, hiddenLabels: y = !1, title: b = "" } = s, { showTicks: x = !0, hiddenLabels: S = !1, title: C = "" } = c;
9
+ return /* @__PURE__ */ o(i, { children: [
10
+ h && /* @__PURE__ */ a("g", {
11
+ transform: `translate(0,${f})`,
12
+ children: /* @__PURE__ */ a(e, {
13
+ scale: l,
14
+ orient: "bottom",
15
+ labels: s.labels,
16
+ labelsPosition: _,
17
+ tickSize: v ? 4 : 0,
18
+ hiddenLabels: y
19
+ })
20
+ }),
21
+ g && /* @__PURE__ */ a(t, {
22
+ scale: u,
23
+ orient: "left",
24
+ tickSize: x ? 4 : 0,
25
+ tickFormat: n,
26
+ hiddenLabels: S
27
+ }),
28
+ b && /* @__PURE__ */ a("text", {
29
+ x: d / 2,
30
+ y: f + m - 6,
31
+ textAnchor: "middle",
32
+ fontSize: "14px",
33
+ fontWeight: "500",
34
+ fontFamily: "Manrope",
35
+ fill: "#110529",
36
+ children: b
37
+ }),
38
+ C && /* @__PURE__ */ a("text", {
39
+ transform: `translate(${-p + 14},${f / 2}) rotate(-90)`,
40
+ textAnchor: "middle",
41
+ fontSize: "14px",
42
+ fontWeight: "500",
43
+ fontFamily: "Manrope",
44
+ fill: "#110529",
45
+ children: C
46
+ })
47
+ ] });
48
+ });
49
+ export { s as ChartAxes };
50
+
51
+ //# sourceMappingURL=ChartAxes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartAxes.js","names":[],"sources":["../../../../src/selection/components/Chart/ChartAxes.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { BandAxis } from '../../../common/BandAxis';\nimport { ContinuousAxis } from '../../../common/ContinuousAxis';\nimport { BLACK } from '../../../constants';\nimport { formatPercent } from '../../utils';\nimport type { CellLayout, ChartXAxis, ChartYAxis } from './types';\n\n// X (band) axis at the bottom + Y (continuous, percent) axis on the left.\n// Each is gated by show flag; titles render as separate <text> nodes outside\n// the axis components for layout independence.\nexport const ChartAxes = memo(function ChartAxes({\n layout,\n xAxis,\n yAxis,\n}: {\n layout: CellLayout;\n xAxis: ChartXAxis;\n yAxis: ChartYAxis;\n}) {\n const { xScale, yScale, width, height, paddingLeft, paddingBottom, showXAxis, showYAxis } =\n layout;\n const {\n labelsPosition: xLabelsPosition = 'center',\n showTicks: xShowTicks = true,\n hiddenLabels: xHiddenLabels = false,\n title: xAxisTitle = '',\n } = xAxis;\n const {\n showTicks: yShowTicks = true,\n hiddenLabels: yHiddenLabels = false,\n title: yAxisTitle = '',\n } = yAxis;\n\n return (\n <>\n {showXAxis && (\n <g transform={`translate(0,${height})`}>\n <BandAxis\n scale={xScale}\n orient=\"bottom\"\n labels={xAxis.labels}\n labelsPosition={xLabelsPosition}\n tickSize={xShowTicks ? 4 : 0}\n hiddenLabels={xHiddenLabels}\n />\n </g>\n )}\n {showYAxis && (\n <ContinuousAxis\n scale={yScale}\n orient=\"left\"\n tickSize={yShowTicks ? 4 : 0}\n tickFormat={formatPercent}\n hiddenLabels={yHiddenLabels}\n />\n )}\n {xAxisTitle && (\n <text\n x={width / 2}\n y={height + paddingBottom - 6}\n textAnchor=\"middle\"\n fontSize=\"14px\"\n fontWeight=\"500\"\n fontFamily=\"Manrope\"\n fill={BLACK}\n >\n {xAxisTitle}\n </text>\n )}\n {yAxisTitle && (\n <text\n transform={`translate(${-paddingLeft + 14},${height / 2}) rotate(-90)`}\n textAnchor=\"middle\"\n fontSize=\"14px\"\n fontWeight=\"500\"\n fontFamily=\"Manrope\"\n fill={BLACK}\n >\n {yAxisTitle}\n </text>\n )}\n </>\n );\n});\n"],"mappings":";;;;;;AAWA,MAAa,IAAY,EAAK,SAAmB,EAC/C,WACA,UACA,YAKC;CACD,IAAM,EAAE,WAAQ,WAAQ,UAAO,WAAQ,gBAAa,kBAAe,cAAW,iBAC5E,GACI,EACJ,gBAAgB,IAAkB,UAClC,WAAW,IAAa,IACxB,cAAc,IAAgB,IAC9B,OAAO,IAAa,OAClB,GACE,EACJ,WAAW,IAAa,IACxB,cAAc,IAAgB,IAC9B,OAAO,IAAa,OAClB;AAEJ,QACE,kBAAA,GAAA,EAAA,UAAA;EACG,KACC,kBAAC,KAAD;GAAG,WAAW,eAAe,EAAO;aAClC,kBAAC,GAAD;IACE,OAAO;IACP,QAAO;IACP,QAAQ,EAAM;IACd,gBAAgB;IAChB,UAAU,IAAa,IAAI;IAC3B,cAAc;IACd,CAAA;GACA,CAAA;EAEL,KACC,kBAAC,GAAD;GACE,OAAO;GACP,QAAO;GACP,UAAU,IAAa,IAAI;GAC3B,YAAY;GACZ,cAAc;GACd,CAAA;EAEH,KACC,kBAAC,QAAD;GACE,GAAG,IAAQ;GACX,GAAG,IAAS,IAAgB;GAC5B,YAAW;GACX,UAAS;GACT,YAAW;GACX,YAAW;GACX,MAAA;aAEC;GACI,CAAA;EAER,KACC,kBAAC,QAAD;GACE,WAAW,aAAa,CAAC,IAAc,GAAG,GAAG,IAAS,EAAE;GACxD,YAAW;GACX,UAAS;GACT,YAAW;GACX,YAAW;GACX,MAAA;aAEC;GACI,CAAA;EAER,EAAA,CAAA;EAEL"}
@@ -0,0 +1,9 @@
1
+ import { FrameType } from '../../../types';
2
+ export declare const ChartFrame: import('react').NamedExoticComponent<{
3
+ width: number;
4
+ height: number;
5
+ frameType: FrameType;
6
+ xShowGrid: boolean;
7
+ yShowGrid: boolean;
8
+ }>;
9
+ //# sourceMappingURL=ChartFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartFrame.d.ts","sourceRoot":"","sources":["../../../../src/selection/components/Chart/ChartFrame.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKhD,eAAO,MAAM,UAAU;WAOd,MAAM;YACL,MAAM;eACH,SAAS;eACT,OAAO;eACP,OAAO;EAqClB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import "../../../constants.js";
2
+ import { memo as e } from "react";
3
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
+ const r = e(function({ width: e, height: r, frameType: i, xShowGrid: a, yShowGrid: o }) {
5
+ return i === "empty" ? null : /* @__PURE__ */ n("g", {
6
+ strokeWidth: 1,
7
+ children: [
8
+ (a || i !== "left") && /* @__PURE__ */ t("line", {
9
+ stroke: i === "left" ? "#E1E3EB" : "#110529",
10
+ x1: "0",
11
+ x2: e,
12
+ y1: r,
13
+ y2: r
14
+ }),
15
+ (a || i !== "bottom") && /* @__PURE__ */ t("line", {
16
+ stroke: i === "bottom" ? "#E1E3EB" : "#110529",
17
+ x1: "0",
18
+ x2: "0",
19
+ y1: "0",
20
+ y2: r
21
+ }),
22
+ (a || i === "full") && /* @__PURE__ */ t("line", {
23
+ stroke: i === "full" ? "#110529" : "#E1E3EB",
24
+ x1: e,
25
+ x2: e,
26
+ y1: "0",
27
+ y2: r
28
+ }),
29
+ (o || i === "full") && /* @__PURE__ */ t("line", {
30
+ stroke: i === "full" ? "#110529" : "#E1E3EB",
31
+ x1: "0",
32
+ x2: e,
33
+ y1: "0",
34
+ y2: "0"
35
+ })
36
+ ]
37
+ });
38
+ });
39
+ export { r as ChartFrame };
40
+
41
+ //# sourceMappingURL=ChartFrame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartFrame.js","names":[],"sources":["../../../../src/selection/components/Chart/ChartFrame.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { BLACK, GRID_GRAY } from '../../../constants';\nimport type { FrameType } from '../../../types';\n\n// Border lines around the plot body. `frameType` picks which sides are BLACK\n// (drawn as the prominent axis line) vs GRID_GRAY (drawn for visual closure\n// only when the corresponding gridline is on or `frameType === 'full'`).\nexport const ChartFrame = memo(function ChartFrame({\n width,\n height,\n frameType,\n xShowGrid,\n yShowGrid,\n}: {\n width: number;\n height: number;\n frameType: FrameType;\n xShowGrid: boolean;\n yShowGrid: boolean;\n}) {\n if (frameType === 'empty') return null;\n return (\n <g strokeWidth={1}>\n {(xShowGrid || frameType !== 'left') && (\n <line\n stroke={frameType === 'left' ? GRID_GRAY : BLACK}\n x1=\"0\"\n x2={width}\n y1={height}\n y2={height}\n />\n )}\n {(xShowGrid || frameType !== 'bottom') && (\n <line\n stroke={frameType === 'bottom' ? GRID_GRAY : BLACK}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2={height}\n />\n )}\n {(xShowGrid || frameType === 'full') && (\n <line\n stroke={frameType === 'full' ? BLACK : GRID_GRAY}\n x1={width}\n x2={width}\n y1=\"0\"\n y2={height}\n />\n )}\n {(yShowGrid || frameType === 'full') && (\n <line stroke={frameType === 'full' ? BLACK : GRID_GRAY} x1=\"0\" x2={width} y1=\"0\" y2=\"0\" />\n )}\n </g>\n );\n});\n"],"mappings":";;;AAQA,MAAa,IAAa,EAAK,SAAoB,EACjD,UACA,WACA,cACA,cACA,gBAOC;AAED,QADI,MAAc,UAAgB,OAEhC,kBAAC,KAAD;EAAG,aAAa;YAAhB;IACI,KAAa,MAAc,WAC3B,kBAAC,QAAD;IACE,QAAQ,MAAc,SAAA,YAAA;IACtB,IAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,CAAA;IAEF,KAAa,MAAc,aAC3B,kBAAC,QAAD;IACE,QAAQ,MAAc,WAAA,YAAA;IACtB,IAAG;IACH,IAAG;IACH,IAAG;IACH,IAAI;IACJ,CAAA;IAEF,KAAa,MAAc,WAC3B,kBAAC,QAAD;IACE,QAAQ,MAAc,SAAA,YAAA;IACtB,IAAI;IACJ,IAAI;IACJ,IAAG;IACH,IAAI;IACJ,CAAA;IAEF,KAAa,MAAc,WAC3B,kBAAC,QAAD;IAAM,QAAQ,MAAc,SAAA,YAAA;IAA4B,IAAG;IAAI,IAAI;IAAO,IAAG;IAAI,IAAG;IAAM,CAAA;GAE1F;;EAEN"}
@@ -0,0 +1,8 @@
1
+ import { StageInfo } from '../../createSelectionData';
2
+ import { StageGeometry } from './types';
3
+ export declare const Dividers: import('react').NamedExoticComponent<{
4
+ stages: StageInfo[];
5
+ geometry: StageGeometry;
6
+ suppressed: boolean;
7
+ }>;
8
+ //# sourceMappingURL=Dividers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dividers.d.ts","sourceRoot":"","sources":["../../../../src/selection/components/Chart/Dividers.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C,eAAO,MAAM,QAAQ;YAKX,SAAS,EAAE;cACT,aAAa;gBACX,OAAO;EA4BnB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { DIVIDER_STROKE as e } from "../../constants.js";
2
+ import { toPercent as t } from "../../utils.js";
3
+ import { memo as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ const i = n(function({ stages: n, geometry: i, suppressed: a }) {
6
+ if (a) return null;
7
+ let { xScale: o, yScale: s } = i, c = o.bandwidth(), l = [];
8
+ for (let [i, a] of n.entries()) {
9
+ if (a.total === 0) continue;
10
+ let n = a.surviving / a.total;
11
+ if (1 - n <= 0 || n <= 0) continue;
12
+ let u = o(String(i)) ?? 0, d = s(t(n));
13
+ l.push(/* @__PURE__ */ r("line", {
14
+ x1: u,
15
+ y1: d,
16
+ x2: u + c,
17
+ y2: d,
18
+ stroke: e,
19
+ strokeWidth: 1,
20
+ strokeDasharray: "4,3"
21
+ }, `div-${i}`));
22
+ }
23
+ return /* @__PURE__ */ r("g", { children: l });
24
+ });
25
+ export { i as Dividers };
26
+
27
+ //# sourceMappingURL=Dividers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dividers.js","names":[],"sources":["../../../../src/selection/components/Chart/Dividers.tsx"],"sourcesContent":["import { memo } from 'react';\nimport type { ReactElement } from 'react';\n\nimport { DIVIDER_STROKE } from '../../constants';\nimport type { StageInfo } from '../../createSelectionData';\nimport { toPercent } from '../../utils';\nimport type { StageGeometry } from './types';\n\n// Dashed line between preserved and discarded fractions, per stage. Suppressed\n// when a group is click-pinned (the vivid/desat overlay already shows the\n// boundary).\nexport const Dividers = memo(function Dividers({\n stages,\n geometry,\n suppressed,\n}: {\n stages: StageInfo[];\n geometry: StageGeometry;\n suppressed: boolean;\n}) {\n if (suppressed) return null;\n const { xScale, yScale } = geometry;\n const barWidth = xScale.bandwidth();\n const elements: ReactElement[] = [];\n\n for (const [stageIndex, stage] of stages.entries()) {\n if (stage.total === 0) continue;\n const preservedFrac = stage.surviving / stage.total;\n const discardedFrac = 1 - preservedFrac;\n if (discardedFrac <= 0 || preservedFrac <= 0) continue;\n const barLeft = xScale(String(stageIndex)) ?? 0;\n const dividerY = yScale(toPercent(preservedFrac));\n elements.push(\n <line\n key={`div-${stageIndex}`}\n x1={barLeft}\n y1={dividerY}\n x2={barLeft + barWidth}\n y2={dividerY}\n stroke={DIVIDER_STROKE}\n strokeWidth={1}\n strokeDasharray=\"4,3\"\n />,\n );\n }\n return <g>{elements}</g>;\n});\n"],"mappings":";;;;AAWA,MAAa,IAAW,EAAK,SAAkB,EAC7C,WACA,aACA,iBAKC;AACD,KAAI,EAAY,QAAO;CACvB,IAAM,EAAE,WAAQ,cAAW,GACrB,IAAW,EAAO,WAAW,EAC7B,IAA2B,EAAE;AAEnC,MAAK,IAAM,CAAC,GAAY,MAAU,EAAO,SAAS,EAAE;AAClD,MAAI,EAAM,UAAU,EAAG;EACvB,IAAM,IAAgB,EAAM,YAAY,EAAM;AAE9C,MADsB,IAAI,KACL,KAAK,KAAiB,EAAG;EAC9C,IAAM,IAAU,EAAO,OAAO,EAAW,CAAC,IAAI,GACxC,IAAW,EAAO,EAAU,EAAc,CAAC;AACjD,IAAS,KACP,kBAAC,QAAD;GAEE,IAAI;GACJ,IAAI;GACJ,IAAI,IAAU;GACd,IAAI;GACJ,QAAQ;GACR,aAAa;GACb,iBAAgB;GAChB,EARK,OAAO,IAQZ,CACH;;AAEH,QAAO,kBAAC,KAAD,EAAA,UAAI,GAAa,CAAA;EACxB"}
@@ -0,0 +1,10 @@
1
+ import { ScaleBand, ScaleLinear } from 'd3-scale';
2
+ export declare const Gridlines: import('react').NamedExoticComponent<{
3
+ xScale: ScaleBand<string>;
4
+ yScale: ScaleLinear<number, number>;
5
+ width: number;
6
+ height: number;
7
+ xShow: boolean;
8
+ yShow: boolean;
9
+ }>;
10
+ //# sourceMappingURL=Gridlines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gridlines.d.ts","sourceRoot":"","sources":["../../../../src/selection/components/Chart/Gridlines.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAMvD,eAAO,MAAM,SAAS;YAQZ,SAAS,CAAC,MAAM,CAAC;YACjB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;WAC5B,MAAM;YACL,MAAM;WACP,OAAO;WACP,OAAO;EA0Bd,CAAC"}
@@ -0,0 +1,32 @@
1
+ import "../../../constants.js";
2
+ import { memo as e } from "react";
3
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ const i = e(function({ xScale: e, yScale: i, width: a, height: o, xShow: s, yShow: c }) {
5
+ return /* @__PURE__ */ r(t, { children: [c && /* @__PURE__ */ n("g", {
6
+ stroke: "#E1E3EB",
7
+ children: i.ticks().map((e) => {
8
+ let t = i(e);
9
+ return /* @__PURE__ */ n("line", {
10
+ x1: 0,
11
+ x2: a,
12
+ y1: t,
13
+ y2: t
14
+ }, `yg-${t}`);
15
+ })
16
+ }), s && /* @__PURE__ */ n("g", {
17
+ stroke: "#E1E3EB",
18
+ strokeWidth: 1,
19
+ children: e.domain().slice(0, -1).map((t, r) => {
20
+ let i = e.domain()[r + 1], a = ((e(t) ?? 0) + (e(i) ?? 0) + e.bandwidth()) / 2;
21
+ return /* @__PURE__ */ n("line", {
22
+ x1: a,
23
+ x2: a,
24
+ y1: 0,
25
+ y2: o
26
+ }, `xg-${t}`);
27
+ })
28
+ })] });
29
+ });
30
+ export { i as Gridlines };
31
+
32
+ //# sourceMappingURL=Gridlines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gridlines.js","names":[],"sources":["../../../../src/selection/components/Chart/Gridlines.tsx"],"sourcesContent":["import type { ScaleBand, ScaleLinear } from 'd3-scale';\nimport { memo } from 'react';\n\nimport { GRID_GRAY } from '../../../constants';\n\n// X gridlines run between stages (not under bars); Y gridlines at every tick.\nexport const Gridlines = memo(function Gridlines({\n xScale,\n yScale,\n width,\n height,\n xShow,\n yShow,\n}: {\n xScale: ScaleBand<string>;\n yScale: ScaleLinear<number, number>;\n width: number;\n height: number;\n xShow: boolean;\n yShow: boolean;\n}) {\n return (\n <>\n {yShow && (\n <g stroke={GRID_GRAY}>\n {yScale.ticks().map((tick) => {\n const y = yScale(tick);\n return <line key={`yg-${y}`} x1={0} x2={width} y1={y} y2={y} />;\n })}\n </g>\n )}\n {xShow && (\n <g stroke={GRID_GRAY} strokeWidth={1}>\n {xScale\n .domain()\n .slice(0, -1)\n .map((tick, i) => {\n const next = xScale.domain()[i + 1];\n const x = ((xScale(tick) ?? 0) + (xScale(next) ?? 0) + xScale.bandwidth()) / 2;\n return <line key={`xg-${tick}`} x1={x} x2={x} y1={0} y2={height} />;\n })}\n </g>\n )}\n </>\n );\n});\n"],"mappings":";;;AAMA,MAAa,IAAY,EAAK,SAAmB,EAC/C,WACA,WACA,UACA,WACA,UACA,YAQC;AACD,QACE,kBAAA,GAAA,EAAA,UAAA,CACG,KACC,kBAAC,KAAD;EAAG,QAAA;YACA,EAAO,OAAO,CAAC,KAAK,MAAS;GAC5B,IAAM,IAAI,EAAO,EAAK;AACtB,UAAO,kBAAC,QAAD;IAAsB,IAAI;IAAG,IAAI;IAAO,IAAI;IAAG,IAAI;IAAK,EAA7C,MAAM,IAAuC;IAC/D;EACA,CAAA,EAEL,KACC,kBAAC,KAAD;EAAG,QAAA;EAAmB,aAAa;YAChC,EACE,QAAQ,CACR,MAAM,GAAG,GAAG,CACZ,KAAK,GAAM,MAAM;GAChB,IAAM,IAAO,EAAO,QAAQ,CAAC,IAAI,IAC3B,MAAM,EAAO,EAAK,IAAI,MAAM,EAAO,EAAK,IAAI,KAAK,EAAO,WAAW,IAAI;AAC7E,UAAO,kBAAC,QAAD;IAAyB,IAAI;IAAG,IAAI;IAAG,IAAI;IAAG,IAAI;IAAU,EAAjD,MAAM,IAA2C;IACnE;EACF,CAAA,CAEL,EAAA,CAAA;EAEL"}
@@ -0,0 +1,9 @@
1
+ import { RibbonContext, StagePair } from '../types';
2
+ export declare const GroupFlowRibbon: import('react').NamedExoticComponent<{
3
+ context: RibbonContext;
4
+ yScale: (v: number) => number;
5
+ stages: StagePair;
6
+ groupName: string;
7
+ color: string;
8
+ }>;
9
+ //# sourceMappingURL=GroupFlowRibbon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupFlowRibbon.d.ts","sourceRoot":"","sources":["../../../../../src/selection/components/Chart/Ribbons/GroupFlowRibbon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAMzD,eAAO,MAAM,eAAe;aAOjB,aAAa;YACd,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM;YACrB,SAAS;eACN,MAAM;WACV,MAAM;EAkDb,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { DESATURATE_ALPHA as e, RIBBON_OPACITY as t } from "../../../constants.js";
2
+ import { toPercent as n } from "../../../utils.js";
3
+ import { ribbonPath as r } from "./ribbonPath.js";
4
+ import { memo as i } from "react";
5
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
6
+ const c = i(function({ context: i, yScale: c, stages: l, groupName: u, color: d }) {
7
+ let { x0: f, x1: p, height: m, layerOpacity: h } = i, { current: g, next: _ } = l, v = g.groups.find((e) => e.name === u), y = _.groups.find((e) => e.name === u), b = (y?.surviving ?? 0) + (y?.discarded ?? 0), x = v?.surviving ?? 0;
8
+ if (x <= 0 || b <= 0) return null;
9
+ let S = (y?.surviving ?? 0) / b, C = c(n(x / g.total)), w = c(n(b / _.total)), T = w + (m - w) * (1 - S), E = C + (m - C) * (1 - S);
10
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("path", {
11
+ d: r({
12
+ leftX: f,
13
+ leftYTop: C,
14
+ leftYBottom: E,
15
+ rightX: p,
16
+ rightYTop: w,
17
+ rightYBottom: T
18
+ }),
19
+ fill: d,
20
+ opacity: t * e * h
21
+ }), /* @__PURE__ */ o("path", {
22
+ d: r({
23
+ leftX: f,
24
+ leftYTop: E,
25
+ leftYBottom: m,
26
+ rightX: p,
27
+ rightYTop: T,
28
+ rightYBottom: m
29
+ }),
30
+ fill: d,
31
+ opacity: t * h
32
+ })] });
33
+ });
34
+ export { c as GroupFlowRibbon };
35
+
36
+ //# sourceMappingURL=GroupFlowRibbon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupFlowRibbon.js","names":[],"sources":["../../../../../src/selection/components/Chart/Ribbons/GroupFlowRibbon.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { DESATURATE_ALPHA, RIBBON_OPACITY } from '../../../constants';\nimport { toPercent } from '../../../utils';\nimport type { RibbonContext, StagePair } from '../types';\nimport { ribbonPath } from './ribbonPath';\n\n// Single-group flow (used both for click-selected groups and hover-highlighted\n// groups). Two sub-bands in the group color: top sub-band is destined to be\n// discarded next stage (DESATURATE_ALPHA), bottom sub-band carries forward.\nexport const GroupFlowRibbon = memo(function GroupFlowRibbon({\n context,\n yScale,\n stages,\n groupName,\n color,\n}: {\n context: RibbonContext;\n yScale: (v: number) => number;\n stages: StagePair;\n groupName: string;\n color: string;\n}) {\n const { x0, x1, height, layerOpacity } = context;\n const { current: stage, next: nextStage } = stages;\n\n const groupData = stage.groups.find((g) => g.name === groupName);\n const nextGroupData = nextStage.groups.find((g) => g.name === groupName);\n const nextGroupTotal = (nextGroupData?.surviving ?? 0) + (nextGroupData?.discarded ?? 0);\n const surviving = groupData?.surviving ?? 0;\n if (surviving <= 0 || nextGroupTotal <= 0) return null;\n\n const nextSurvivingFrac = (nextGroupData?.surviving ?? 0) / nextGroupTotal;\n\n const survivingFrac = surviving / stage.total;\n const yTopSurviving = yScale(toPercent(survivingFrac));\n\n const nextGroupFrac = nextGroupTotal / nextStage.total;\n const yTopNextOverlay = yScale(toPercent(nextGroupFrac));\n const yNextDivider = yTopNextOverlay + (height - yTopNextOverlay) * (1 - nextSurvivingFrac);\n\n const splitY = yTopSurviving + (height - yTopSurviving) * (1 - nextSurvivingFrac);\n\n return (\n <>\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: yTopSurviving,\n leftYBottom: splitY,\n rightX: x1,\n rightYTop: yTopNextOverlay,\n rightYBottom: yNextDivider,\n })}\n fill={color}\n opacity={RIBBON_OPACITY * DESATURATE_ALPHA * layerOpacity}\n />\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: splitY,\n leftYBottom: height,\n rightX: x1,\n rightYTop: yNextDivider,\n rightYBottom: height,\n })}\n fill={color}\n opacity={RIBBON_OPACITY * layerOpacity}\n />\n </>\n );\n});\n"],"mappings":";;;;;AAUA,MAAa,IAAkB,EAAK,SAAyB,EAC3D,YACA,WACA,WACA,cACA,YAOC;CACD,IAAM,EAAE,OAAI,OAAI,WAAQ,oBAAiB,GACnC,EAAE,SAAS,GAAO,MAAM,MAAc,GAEtC,IAAY,EAAM,OAAO,MAAM,MAAM,EAAE,SAAS,EAAU,EAC1D,IAAgB,EAAU,OAAO,MAAM,MAAM,EAAE,SAAS,EAAU,EAClE,KAAkB,GAAe,aAAa,MAAM,GAAe,aAAa,IAChF,IAAY,GAAW,aAAa;AAC1C,KAAI,KAAa,KAAK,KAAkB,EAAG,QAAO;CAElD,IAAM,KAAqB,GAAe,aAAa,KAAK,GAGtD,IAAgB,EAAO,EADP,IAAY,EAAM,MACa,CAAC,EAGhD,IAAkB,EAAO,EADT,IAAiB,EAAU,MACM,CAAC,EAClD,IAAe,KAAmB,IAAS,MAAoB,IAAI,IAEnE,IAAS,KAAiB,IAAS,MAAkB,IAAI;AAE/D,QACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,cAAc;GACf,CAAC;EACF,MAAM;EACN,SAAS,IAAiB,IAAmB;EAC7C,CAAA,EACF,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,cAAc;GACf,CAAC;EACF,MAAM;EACN,SAAS,IAAiB;EAC1B,CAAA,CACD,EAAA,CAAA;EAEL"}
@@ -0,0 +1,6 @@
1
+ import { RibbonContext } from '../types';
2
+ export declare const MultiGroupRibbon: import('react').NamedExoticComponent<{
3
+ context: RibbonContext;
4
+ dividerY: number;
5
+ }>;
6
+ //# sourceMappingURL=MultiGroupRibbon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiGroupRibbon.d.ts","sourceRoot":"","sources":["../../../../../src/selection/components/Chart/Ribbons/MultiGroupRibbon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK9C,eAAO,MAAM,gBAAgB;aAIlB,aAAa;cACZ,MAAM;EAiBhB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { AGGREGATE_RIBBON_COLOR as e, RIBBON_OPACITY as t } from "../../../constants.js";
2
+ import { ribbonPath as n } from "./ribbonPath.js";
3
+ import { memo as r } from "react";
4
+ import { jsx as i } from "react/jsx-runtime";
5
+ const a = r(function({ context: r, dividerY: a }) {
6
+ let { x0: o, x1: s, height: c, layerOpacity: l } = r;
7
+ return /* @__PURE__ */ i("path", {
8
+ d: n({
9
+ leftX: o,
10
+ leftYTop: a,
11
+ leftYBottom: c,
12
+ rightX: s,
13
+ rightYTop: 0,
14
+ rightYBottom: c
15
+ }),
16
+ fill: e,
17
+ opacity: t * l
18
+ });
19
+ });
20
+ export { a as MultiGroupRibbon };
21
+
22
+ //# sourceMappingURL=MultiGroupRibbon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultiGroupRibbon.js","names":[],"sources":["../../../../../src/selection/components/Chart/Ribbons/MultiGroupRibbon.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { AGGREGATE_RIBBON_COLOR, RIBBON_OPACITY } from '../../../constants';\nimport type { RibbonContext } from '../types';\nimport { ribbonPath } from './ribbonPath';\n\n// Aggregating multiple group flows into one ribbon would imply a single color\n// where there isn't one — AGGREGATE_RIBBON_COLOR makes the ambiguity explicit.\nexport const MultiGroupRibbon = memo(function MultiGroupRibbon({\n context,\n dividerY,\n}: {\n context: RibbonContext;\n dividerY: number;\n}) {\n const { x0, x1, height, layerOpacity } = context;\n return (\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: dividerY,\n leftYBottom: height,\n rightX: x1,\n rightYTop: 0,\n rightYBottom: height,\n })}\n fill={AGGREGATE_RIBBON_COLOR}\n opacity={RIBBON_OPACITY * layerOpacity}\n />\n );\n});\n"],"mappings":";;;;AAQA,MAAa,IAAmB,EAAK,SAA0B,EAC7D,YACA,eAIC;CACD,IAAM,EAAE,OAAI,OAAI,WAAQ,oBAAiB;AACzC,QACE,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,cAAc;GACf,CAAC;EACF,MAAM;EACN,SAAS,IAAiB;EAC1B,CAAA;EAEJ"}
@@ -0,0 +1,10 @@
1
+ import { RibbonContext } from '../types';
2
+ export declare const SimpleRibbon: import('react').NamedExoticComponent<{
3
+ context: RibbonContext;
4
+ dividerY: number;
5
+ nextDividerY: number;
6
+ nextSurvFrac: number;
7
+ color: string;
8
+ drawSurvivingBand: boolean;
9
+ }>;
10
+ //# sourceMappingURL=SimpleRibbon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleRibbon.d.ts","sourceRoot":"","sources":["../../../../../src/selection/components/Chart/Ribbons/SimpleRibbon.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAK9C,eAAO,MAAM,YAAY;aAQd,aAAa;cACZ,MAAM;kBACF,MAAM;kBACN,MAAM;WACb,MAAM;uBACM,OAAO;EAoC1B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { DESATURATE_ALPHA as e, RIBBON_OPACITY as t } from "../../../constants.js";
2
+ import { ribbonPath as n } from "./ribbonPath.js";
3
+ import { memo as r } from "react";
4
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ const s = r(function({ context: r, dividerY: s, nextDividerY: c, nextSurvFrac: l, color: u, drawSurvivingBand: d }) {
6
+ let { x0: f, x1: p, height: m, layerOpacity: h } = r, g = s + (m - s) * (1 - l);
7
+ return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("path", {
8
+ d: n({
9
+ leftX: f,
10
+ leftYTop: s,
11
+ leftYBottom: g,
12
+ rightX: p,
13
+ rightYTop: 0,
14
+ rightYBottom: c
15
+ }),
16
+ fill: u,
17
+ opacity: t * e * h
18
+ }), d && /* @__PURE__ */ a("path", {
19
+ d: n({
20
+ leftX: f,
21
+ leftYTop: g,
22
+ leftYBottom: m,
23
+ rightX: p,
24
+ rightYTop: c,
25
+ rightYBottom: m
26
+ }),
27
+ fill: u,
28
+ opacity: .25 * h
29
+ })] });
30
+ });
31
+ export { s as SimpleRibbon };
32
+
33
+ //# sourceMappingURL=SimpleRibbon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleRibbon.js","names":[],"sources":["../../../../../src/selection/components/Chart/Ribbons/SimpleRibbon.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { DESATURATE_ALPHA, RIBBON_OPACITY } from '../../../constants';\nimport type { RibbonContext } from '../types';\nimport { ribbonPath } from './ribbonPath';\n\n// Two sub-bands of the overall preserved population: top (discarded next),\n// bottom (carries forward). Used for ungrouped charts and single-group facets.\nexport const SimpleRibbon = memo(function SimpleRibbon({\n context,\n dividerY,\n nextDividerY,\n nextSurvFrac,\n color,\n drawSurvivingBand,\n}: {\n context: RibbonContext;\n dividerY: number;\n nextDividerY: number;\n nextSurvFrac: number;\n color: string;\n drawSurvivingBand: boolean;\n}) {\n const { x0, x1, height, layerOpacity } = context;\n const preservedHeight = height - dividerY;\n const splitY = dividerY + preservedHeight * (1 - nextSurvFrac);\n\n return (\n <>\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: dividerY,\n leftYBottom: splitY,\n rightX: x1,\n rightYTop: 0,\n rightYBottom: nextDividerY,\n })}\n fill={color}\n opacity={RIBBON_OPACITY * DESATURATE_ALPHA * layerOpacity}\n />\n {drawSurvivingBand && (\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: splitY,\n leftYBottom: height,\n rightX: x1,\n rightYTop: nextDividerY,\n rightYBottom: height,\n })}\n fill={color}\n opacity={RIBBON_OPACITY * layerOpacity}\n />\n )}\n </>\n );\n});\n"],"mappings":";;;;AAQA,MAAa,IAAe,EAAK,SAAsB,EACrD,YACA,aACA,iBACA,iBACA,UACA,wBAQC;CACD,IAAM,EAAE,OAAI,OAAI,WAAQ,oBAAiB,GAEnC,IAAS,KADS,IAAS,MACY,IAAI;AAEjD,QACE,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,cAAc;GACf,CAAC;EACF,MAAM;EACN,SAAS,IAAiB,IAAmB;EAC7C,CAAA,EACD,KACC,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW;GACX,cAAc;GACf,CAAC;EACF,MAAM;EACN,SAAA,MAA0B;EAC1B,CAAA,CAEH,EAAA,CAAA;EAEL"}
@@ -0,0 +1,10 @@
1
+ import { RibbonContext, StagePair } from '../types';
2
+ export declare const StackedGroupFlowRibbon: import('react').NamedExoticComponent<{
3
+ context: RibbonContext;
4
+ yScale: (v: number) => number;
5
+ stages: StagePair;
6
+ stackOrder: string[];
7
+ groupName: string;
8
+ color: string;
9
+ }>;
10
+ //# sourceMappingURL=StackedGroupFlowRibbon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackedGroupFlowRibbon.d.ts","sourceRoot":"","sources":["../../../../../src/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQzD,eAAO,MAAM,sBAAsB;aAQxB,aAAa;YACd,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM;YACrB,SAAS;gBACL,MAAM,EAAE;eACT,MAAM;WACV,MAAM;EAgGb,CAAC"}
@@ -0,0 +1,65 @@
1
+ import "../../../constants.js";
2
+ import { toPercent as e } from "../../../utils.js";
3
+ import { ribbonPath as t } from "./ribbonPath.js";
4
+ import { memo as n } from "react";
5
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ const o = n(function({ context: n, yScale: o, stages: s, stackOrder: c, groupName: l, color: u }) {
7
+ let { x0: d, x1: f, height: p, layerOpacity: m } = n, { current: h, next: g } = s, _ = new Map(h.groups.map((e) => [e.name, e])), v = h.total > 0 ? o(e(h.surviving / h.total)) : p, y = 0;
8
+ for (let e of c) {
9
+ let t = _.get(e);
10
+ if (!t) continue;
11
+ let n = t.surviving / h.total * p;
12
+ if (e === l) {
13
+ y = n;
14
+ break;
15
+ }
16
+ v += n;
17
+ }
18
+ if (y <= 0) return null;
19
+ let b = v, x = v + y, S = new Map(g.groups.map((e) => [e.name, e])), C = g.total > 0 ? o(e(g.surviving / g.total)) : p, w = 0, T = null, E = null;
20
+ for (let e of c) {
21
+ let t = S.get(e);
22
+ if (!t) continue;
23
+ let n = t.surviving / g.total * p, r = t.discarded / g.total * p;
24
+ if (e === l) {
25
+ T = n > 0 ? {
26
+ top: C,
27
+ bottom: C + n
28
+ } : null, E = r > 0 ? {
29
+ top: w,
30
+ bottom: w + r
31
+ } : null;
32
+ break;
33
+ }
34
+ C += n, w += r;
35
+ }
36
+ let D = S.get(l), O = D?.surviving ?? 0, k = D?.discarded ?? 0, A = O + k;
37
+ if (A <= 0) return null;
38
+ let j = b + k / A * y;
39
+ return /* @__PURE__ */ a(r, { children: [E && k > 0 && /* @__PURE__ */ i("path", {
40
+ d: t({
41
+ leftX: d,
42
+ leftYTop: b,
43
+ leftYBottom: j,
44
+ rightX: f,
45
+ rightYTop: E.top,
46
+ rightYBottom: E.bottom
47
+ }),
48
+ fill: u,
49
+ opacity: .25 * .4 * m
50
+ }), T && O > 0 && /* @__PURE__ */ i("path", {
51
+ d: t({
52
+ leftX: d,
53
+ leftYTop: j,
54
+ leftYBottom: x,
55
+ rightX: f,
56
+ rightYTop: T.top,
57
+ rightYBottom: T.bottom
58
+ }),
59
+ fill: u,
60
+ opacity: .25 * m
61
+ })] });
62
+ });
63
+ export { o as StackedGroupFlowRibbon };
64
+
65
+ //# sourceMappingURL=StackedGroupFlowRibbon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackedGroupFlowRibbon.js","names":[],"sources":["../../../../../src/selection/components/Chart/Ribbons/StackedGroupFlowRibbon.tsx"],"sourcesContent":["import { memo } from 'react';\n\nimport { DESATURATE_ALPHA, RIBBON_OPACITY } from '../../../constants';\nimport { toPercent } from '../../../utils';\nimport type { RibbonContext, StagePair } from '../types';\nimport { ribbonPath } from './ribbonPath';\n\n// Hover-highlight ribbon for a single group in stacked layout. Connects the\n// group's preserved chunk in stage i (at its stacked Y position) to its\n// preserved+discarded chunks in stage i+1 (each at their own stacked Y\n// positions). Two sub-bands: top portion → discarded next (dimmer), bottom\n// portion → preserved next (vivid). Replaces the unified ribbon on hover.\nexport const StackedGroupFlowRibbon = memo(function StackedGroupFlowRibbon({\n context,\n yScale,\n stages,\n stackOrder,\n groupName,\n color,\n}: {\n context: RibbonContext;\n yScale: (v: number) => number;\n stages: StagePair;\n stackOrder: string[];\n groupName: string;\n color: string;\n}) {\n const { x0, x1, height, layerOpacity } = context;\n const { current: stage, next: nextStage } = stages;\n\n // Stage i: walk stackOrder until we find the hovered group; track the\n // running yP cursor (top of preserved area accumulating downward).\n const stageGroupMap = new Map(stage.groups.map((g) => [g.name, g]));\n const dividerY = stage.total > 0 ? yScale(toPercent(stage.surviving / stage.total)) : height;\n let yPreserved = dividerY;\n let groupSurvivingHeight = 0;\n for (const name of stackOrder) {\n const g = stageGroupMap.get(name);\n if (!g) continue;\n const h = (g.surviving / stage.total) * height;\n if (name === groupName) {\n groupSurvivingHeight = h;\n break;\n }\n yPreserved += h;\n }\n if (groupSurvivingHeight <= 0) return null;\n const yTop = yPreserved;\n const yBottom = yPreserved + groupSurvivingHeight;\n\n // Stage i+1: walk stackOrder for both preserved (yNextPreserved) and\n // discarded (yNextDiscarded) accumulators in parallel; capture the hovered\n // group's chunks.\n const nextStageGroupMap = new Map(nextStage.groups.map((g) => [g.name, g]));\n const nextDividerY =\n nextStage.total > 0 ? yScale(toPercent(nextStage.surviving / nextStage.total)) : height;\n let yNextPreserved = nextDividerY;\n let yNextDiscarded = 0;\n let nextPreservedRect: { top: number; bottom: number } | null = null;\n let nextDiscardedRect: { top: number; bottom: number } | null = null;\n for (const name of stackOrder) {\n const g = nextStageGroupMap.get(name);\n if (!g) continue;\n const preservedHeight = (g.surviving / nextStage.total) * height;\n const discardedHeight = (g.discarded / nextStage.total) * height;\n if (name === groupName) {\n nextPreservedRect =\n preservedHeight > 0\n ? { top: yNextPreserved, bottom: yNextPreserved + preservedHeight }\n : null;\n nextDiscardedRect =\n discardedHeight > 0\n ? { top: yNextDiscarded, bottom: yNextDiscarded + discardedHeight }\n : null;\n break;\n }\n yNextPreserved += preservedHeight;\n yNextDiscarded += discardedHeight;\n }\n\n const nextGroupData = nextStageGroupMap.get(groupName);\n const nextSurviving = nextGroupData?.surviving ?? 0;\n const nextDiscarded = nextGroupData?.discarded ?? 0;\n const nextGroupTotal = nextSurviving + nextDiscarded;\n if (nextGroupTotal <= 0) return null;\n\n // Split source proportionally: top portion → discarded next, bottom → preserved next.\n const splitY = yTop + groupSurvivingHeight * (nextDiscarded / nextGroupTotal);\n\n return (\n <>\n {nextDiscardedRect && nextDiscarded > 0 && (\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: yTop,\n leftYBottom: splitY,\n rightX: x1,\n rightYTop: nextDiscardedRect.top,\n rightYBottom: nextDiscardedRect.bottom,\n })}\n fill={color}\n opacity={RIBBON_OPACITY * DESATURATE_ALPHA * layerOpacity}\n />\n )}\n {nextPreservedRect && nextSurviving > 0 && (\n <path\n d={ribbonPath({\n leftX: x0,\n leftYTop: splitY,\n leftYBottom: yBottom,\n rightX: x1,\n rightYTop: nextPreservedRect.top,\n rightYBottom: nextPreservedRect.bottom,\n })}\n fill={color}\n opacity={RIBBON_OPACITY * layerOpacity}\n />\n )}\n </>\n );\n});\n"],"mappings":";;;;;AAYA,MAAa,IAAyB,EAAK,SAAgC,EACzE,YACA,WACA,WACA,eACA,cACA,YAQC;CACD,IAAM,EAAE,OAAI,OAAI,WAAQ,oBAAiB,GACnC,EAAE,SAAS,GAAO,MAAM,MAAc,GAItC,IAAgB,IAAI,IAAI,EAAM,OAAO,KAAK,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAE/D,IADa,EAAM,QAAQ,IAAI,EAAO,EAAU,EAAM,YAAY,EAAM,MAAM,CAAC,GAAG,GAElF,IAAuB;AAC3B,MAAK,IAAM,KAAQ,GAAY;EAC7B,IAAM,IAAI,EAAc,IAAI,EAAK;AACjC,MAAI,CAAC,EAAG;EACR,IAAM,IAAK,EAAE,YAAY,EAAM,QAAS;AACxC,MAAI,MAAS,GAAW;AACtB,OAAuB;AACvB;;AAEF,OAAc;;AAEhB,KAAI,KAAwB,EAAG,QAAO;CACtC,IAAM,IAAO,GACP,IAAU,IAAa,GAKvB,IAAoB,IAAI,IAAI,EAAU,OAAO,KAAK,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAGvE,IADF,EAAU,QAAQ,IAAI,EAAO,EAAU,EAAU,YAAY,EAAU,MAAM,CAAC,GAAG,GAE/E,IAAiB,GACjB,IAA4D,MAC5D,IAA4D;AAChE,MAAK,IAAM,KAAQ,GAAY;EAC7B,IAAM,IAAI,EAAkB,IAAI,EAAK;AACrC,MAAI,CAAC,EAAG;EACR,IAAM,IAAmB,EAAE,YAAY,EAAU,QAAS,GACpD,IAAmB,EAAE,YAAY,EAAU,QAAS;AAC1D,MAAI,MAAS,GAAW;AAKtB,GAJA,IACE,IAAkB,IACd;IAAE,KAAK;IAAgB,QAAQ,IAAiB;IAAiB,GACjE,MACN,IACE,IAAkB,IACd;IAAE,KAAK;IAAgB,QAAQ,IAAiB;IAAiB,GACjE;AACN;;AAGF,EADA,KAAkB,GAClB,KAAkB;;CAGpB,IAAM,IAAgB,EAAkB,IAAI,EAAU,EAChD,IAAgB,GAAe,aAAa,GAC5C,IAAgB,GAAe,aAAa,GAC5C,IAAiB,IAAgB;AACvC,KAAI,KAAkB,EAAG,QAAO;CAGhC,IAAM,IAAS,IAA+B,IAAgB,IAAxC;AAEtB,QACE,kBAAA,GAAA,EAAA,UAAA,CACG,KAAqB,IAAgB,KACpC,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW,EAAkB;GAC7B,cAAc,EAAkB;GACjC,CAAC;EACF,MAAM;EACN,SAAA,MAAA,KAA6C;EAC7C,CAAA,EAEH,KAAqB,IAAgB,KACpC,kBAAC,QAAD;EACE,GAAG,EAAW;GACZ,OAAO;GACP,UAAU;GACV,aAAa;GACb,QAAQ;GACR,WAAW,EAAkB;GAC7B,cAAc,EAAkB;GACjC,CAAC;EACF,MAAM;EACN,SAAA,MAA0B;EAC1B,CAAA,CAEH,EAAA,CAAA;EAEL"}
@@ -0,0 +1,10 @@
1
+ export type RibbonPathPoints = {
2
+ leftX: number;
3
+ leftYTop: number;
4
+ leftYBottom: number;
5
+ rightX: number;
6
+ rightYTop: number;
7
+ rightYBottom: number;
8
+ };
9
+ export declare function ribbonPath({ leftX, leftYTop, leftYBottom, rightX, rightYTop, rightYBottom, }: RibbonPathPoints): string;
10
+ //# sourceMappingURL=ribbonPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ribbonPath.d.ts","sourceRoot":"","sources":["../../../../../src/selection/components/Chart/Ribbons/ribbonPath.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,SAAS,EACT,YAAY,GACb,EAAE,gBAAgB,GAAG,MAAM,CAS3B"}
@@ -0,0 +1,13 @@
1
+ function e({ leftX: e, leftYTop: t, leftYBottom: n, rightX: r, rightYTop: i, rightYBottom: a }) {
2
+ let o = (e + r) / 2;
3
+ return [
4
+ `M ${e} ${t}`,
5
+ `C ${o} ${t}, ${o} ${i}, ${r} ${i}`,
6
+ `L ${r} ${a}`,
7
+ `C ${o} ${a}, ${o} ${n}, ${e} ${n}`,
8
+ "Z"
9
+ ].join(" ");
10
+ }
11
+ export { e as ribbonPath };
12
+
13
+ //# sourceMappingURL=ribbonPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ribbonPath.js","names":[],"sources":["../../../../../src/selection/components/Chart/Ribbons/ribbonPath.ts"],"sourcesContent":["export type RibbonPathPoints = {\n leftX: number;\n leftYTop: number;\n leftYBottom: number;\n rightX: number;\n rightYTop: number;\n rightYBottom: number;\n};\n\nexport function ribbonPath({\n leftX,\n leftYTop,\n leftYBottom,\n rightX,\n rightYTop,\n rightYBottom,\n}: RibbonPathPoints): string {\n const midX = (leftX + rightX) / 2;\n return [\n `M ${leftX} ${leftYTop}`,\n `C ${midX} ${leftYTop}, ${midX} ${rightYTop}, ${rightX} ${rightYTop}`,\n `L ${rightX} ${rightYBottom}`,\n `C ${midX} ${rightYBottom}, ${midX} ${leftYBottom}, ${leftX} ${leftYBottom}`,\n 'Z',\n ].join(' ');\n}\n"],"mappings":"AASA,SAAgB,EAAW,EACzB,UACA,aACA,gBACA,WACA,cACA,mBAC2B;CAC3B,IAAM,KAAQ,IAAQ,KAAU;AAChC,QAAO;EACL,KAAK,EAAM,GAAG;EACd,KAAK,EAAK,GAAG,EAAS,IAAI,EAAK,GAAG,EAAU,IAAI,EAAO,GAAG;EAC1D,KAAK,EAAO,GAAG;EACf,KAAK,EAAK,GAAG,EAAa,IAAI,EAAK,GAAG,EAAY,IAAI,EAAM,GAAG;EAC/D;EACD,CAAC,KAAK,IAAI"}