@papernote/ui 1.11.3 → 1.11.4
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 +39 -47
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +39 -47
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -0
- package/package.json +1 -1
- package/src/components/FunnelChart.tsx +14 -12
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -62,9 +62,9 @@ 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 = 450;
|
|
66
66
|
const padding = 20;
|
|
67
|
-
const leftLabelSpace =
|
|
67
|
+
const leftLabelSpace = 50; // Space for conversion rate labels on left
|
|
68
68
|
const rightLabelSpace = 160; // Space for stage name + value labels on right
|
|
69
69
|
const funnelWidth = svgWidth - padding * 2 - leftLabelSpace - rightLabelSpace;
|
|
70
70
|
|
|
@@ -141,17 +141,19 @@ export default function FunnelChart({
|
|
|
141
141
|
</text>
|
|
142
142
|
)}
|
|
143
143
|
|
|
144
|
-
{/* Conversion rate on left */}
|
|
144
|
+
{/* Conversion rate on left — shows stage-to-stage conversion */}
|
|
145
145
|
{showConversion && conversionRate !== null && (
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
<g>
|
|
147
|
+
<text
|
|
148
|
+
x={centerX - funnelWidth / 2 - 16}
|
|
149
|
+
y={y + 4}
|
|
150
|
+
textAnchor="end"
|
|
151
|
+
className="fill-ink-500"
|
|
152
|
+
style={{ fontSize: '10px', fontWeight: 500 }}
|
|
153
|
+
>
|
|
154
|
+
↓ {conversionRate}%
|
|
155
|
+
</text>
|
|
156
|
+
</g>
|
|
155
157
|
)}
|
|
156
158
|
</g>
|
|
157
159
|
);
|