@papernote/ui 1.11.2 → 1.11.3
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/components/FunnelChart.d.ts.map +1 -1
- package/dist/index.esm.js +49 -39
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +49 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FunnelChart.tsx +5 -3
package/package.json
CHANGED
|
@@ -62,9 +62,11 @@ export default function FunnelChart({
|
|
|
62
62
|
|
|
63
63
|
const maxCount = Math.max(...stages.map(s => s.count), 1);
|
|
64
64
|
const stageHeight = height / stages.length;
|
|
65
|
-
const svgWidth =
|
|
65
|
+
const svgWidth = 440;
|
|
66
66
|
const padding = 20;
|
|
67
|
-
const
|
|
67
|
+
const leftLabelSpace = 40; // Space for conversion rate labels on left
|
|
68
|
+
const rightLabelSpace = 160; // Space for stage name + value labels on right
|
|
69
|
+
const funnelWidth = svgWidth - padding * 2 - leftLabelSpace - rightLabelSpace;
|
|
68
70
|
|
|
69
71
|
return (
|
|
70
72
|
<div className={className}>
|
|
@@ -75,7 +77,7 @@ export default function FunnelChart({
|
|
|
75
77
|
const y = idx * stageHeight;
|
|
76
78
|
const topWidth = funnelWidth * ratio;
|
|
77
79
|
const bottomWidth = funnelWidth * nextRatio;
|
|
78
|
-
const centerX = padding + funnelWidth / 2;
|
|
80
|
+
const centerX = padding + leftLabelSpace + funnelWidth / 2;
|
|
79
81
|
const color = stage.color || defaultColors[idx % defaultColors.length];
|
|
80
82
|
|
|
81
83
|
// Conversion rate
|