Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Add comments

Tim Wilsone21769b0219c
diff --git a/apps/web/ui/charts/areas.tsx b/apps/web/ui/charts/areas.tsx
index f20ac85996..dd714954a6 100644
--- a/apps/web/ui/charts/areas.tsx
+++ b/apps/web/ui/charts/areas.tsx
@@ -9,6 +9,7 @@ export default function Areas() {
const { data, series, margin, xScale, yScale } = useChartContext();
const { tooltipData } = useChartTooltipContext();
+ // Data with all values set to zero to animate from
const zeroedData = useMemo(() => {
return data.map((d) => ({
...d,
@@ -20,6 +21,7 @@ export default function Areas() {
<Group left={margin.left} top={margin.top}>
{series.map((s) => (
<Fragment key={s.id}>
+ {/* Area background gradient */}
<LinearGradient
className="text-blue-500"
id={`${s.id}-background`}
diff --git a/apps/web/ui/charts/x-axis.tsx b/apps/web/ui/charts/x-axis.tsx
index 5a6f10daf4..71df0e333f 100644
--- a/apps/web/ui/charts/x-axis.tsx
+++ b/apps/web/ui/charts/x-axis.tsx
@@ -40,6 +40,7 @@ export default function XAxis({
getFactors(data.length).find((f) => (data.length + 1) / f <= maxTicks) ??
1;
+ // If the interval would result in < 2 ticks, just use the first and last date instead
const twoTicks = data.length / tickInterval < 2;
return data