Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

style: add layer padding to funnel chart

Brad Barbin64bf73debba9
diff --git a/packages/react/src/FunnelChart.tsx b/packages/react/src/FunnelChart.tsx
index 03442280d6..069247e1ed 100644
--- a/packages/react/src/FunnelChart.tsx
+++ b/packages/react/src/FunnelChart.tsx
@@ -8,8 +8,6 @@ import { Fragment, useMemo, useRef, useState } from "react";
import { useIsMobile } from "./hooks";
import { cn } from "./utils/cn";
-const verticalPadding = 30;
-
interface FunnelStep {
id: string;
label: string;
@@ -64,6 +62,9 @@ const layers = [
}
];
+const maxLayerPadding = 12;
+const chartPadding = 40;
+
function FunnelChartContent({
width,
height,
@@ -105,7 +106,10 @@ function FunnelChartContent({
const yScale = scaleLinear({
domain: [highestValue, -highestValue],
- range: [height - verticalPadding, verticalPadding]
+ range: [
+ height - maxLayerPadding - chartPadding,
+ maxLayerPadding + chartPadding
+ ]
});
return (