Skip to content

Feat: scattered chart#28

Open
ctesibius wants to merge 5 commits into
legions-developer:mainfrom
ctesibius:main
Open

Feat: scattered chart#28
ctesibius wants to merge 5 commits into
legions-developer:mainfrom
ctesibius:main

Conversation

@ctesibius
Copy link
Copy Markdown

Description

Type of Change

  • New chart component
  • Bug fix
  • Documentation update
  • Performance improvement
  • Other (please describe)

Screenshots

Checklist

  • Code follows the project's style guidelines
  • Tested in development mode (yarn dev)
  • Tested production build (yarn build)
  • Registry synced (yarn gen-cli)
  • Documentation added/updated

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 19, 2026

@ctesibius is attempting to deploy a commit to the Invoicely OSS Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8df11146-7111-4f07-8b1e-4579d567a8f4

📥 Commits

Reviewing files that changed from the base of the PR and between a9e54ee and 38e058a.

📒 Files selected for processing (2)
  • src/content/docs/bar-chart/static.mdx
  • src/registry/examples/ex-horizontal-layout-bar-chart.tsx

📝 Walkthrough

Walkthrough

This pull request adds four complete chart types (scatter, treemap, funnel, waterfall) with composable Recharts-based components, themed examples, MDX documentation (installation, usage, API), registry/index entries, SVG preview icons, showcase integration, and a Next.js redirect for the scatter docs.

Changes

Chart Types Addition

Layer / File(s) Summary
Scatter Chart Core Component
src/registry/charts/scatter-chart.tsx
Composable scatter plot with root context managing selection/loading state, Scatter series with custom dot variants, color gradients, and glow filters. Includes useLoadingData hook for animated skeleton points and LoadingScatter overlay during loading. Exports Dot, ActiveDot, XAxis, YAxis, Grid, Tooltip, Legend as child composition slots.
Scatter Chart Examples
src/registry/examples/ex-scatter-chart.tsx, ex-gradient-colors-scatter-chart.tsx, ex-loading-state-scatter-chart.tsx, ex-glowing-scatter-chart.tsx
Four examples demonstrating basic clickable scatter series, gradient-colored points, skeleton loading state, and glowing dot rendering with theme-aware chartConfig and desktop/mobile datasets.
Scatter Chart Documentation
src/content/docs/scatter-chart/*
Complete docs including installation (CLI/manual), usage composition patterns, interactive selection via onSelectionChange/isClickable, loading state behavior, example previews, and API reference with prop tables for root component and all subcomponents; links to Recharts documentation.
Treemap Chart Core Component
src/registry/charts/treemap-chart.tsx
Composable treemap using Recharts with Tiles configuration slot, selection state, and TreemapTileContent renderer supporting gradient fills, optional glow, labels, and click-to-select. Includes loading skeleton via animated motion.rect tiles. Exports Tiles, Tooltip, Legend.
Treemap Chart Examples
src/registry/examples/ex-treemap-chart.tsx, ex-glowing-treemap-chart.tsx, ex-loading-state-treemap-chart.tsx
Three examples: basic treemap with clickable tiles and legend, glowing tile variant, and loading state with empty data.
Treemap Chart Documentation
src/content/docs/treemap-chart/*
Installation, usage with Tiles and hierarchy, interactive selection/loading, and API reference for chart container, tile configuration, and subcomponents.
Funnel Chart Core Component
src/registry/charts/funnel-chart.tsx
Vertical bar-based funnel using Recharts with Stages configuration slot, stage-to-stage trapezoid path geometry, selection-driven dimming, and per-stage linear gradients with optional glow filters. Includes loading skeleton via motion.g animated wrapper. Exports Stages, Tooltip, Legend, Grid, XAxis, YAxis.
Funnel Chart Examples
src/registry/examples/ex-funnel-chart.tsx, ex-glowing-funnel-chart.tsx, ex-loading-state-funnel-chart.tsx
Three examples: basic clickable stages with legend, stage highlighting via glowingStages, and loading state with shimmer.
Funnel Chart Documentation
src/content/docs/funnel-chart/*
Installation, usage composition, interactive stage/legend selection, loading state with isLoading/loadingStages, and comprehensive API reference covering funnel-specific properties and all child components.
Waterfall Chart Core Component
src/registry/charts/waterfall-chart.tsx
Stacked bar chart supporting start, increase, decrease, total types, computing cumulative bases and absolute values via prepareWaterfallData. Features Bars configuration slot, per-bar gradients/glow filters, selection dimming, and loading data generation. Exports Bars, Tooltip, Legend, Grid, XAxis, YAxis.
Waterfall Chart Examples
src/registry/examples/ex-waterfall-chart.tsx, ex-glowing-waterfall-chart.tsx, ex-loading-state-waterfall-chart.tsx
Three examples: basic waterfall with clickable bars and legend, glowing bar variant for selected stages, and loading state with empty data.
Waterfall Chart Documentation
src/content/docs/waterfall-chart/*
Installation, usage with data mapping (nameKey/valueKey/typeKey), selection/loading behavior, waterfall type semantics, and detailed API covering bar configuration, axes, and background rendering options.
Registry, Icons, Navigation, and Docs Integration
registry.json, src/registry/registry-chart.ts, src/registry/registry-example.ts, src/registry/__index__.tsx, src/assets/icons/index.tsx, src/globals/functions/getNavItemIcon.tsx, src/components/docs/svg-previews/*, src/components/docs/mdx/components/showcase-grid.tsx, src/content/docs/meta.json, next.config.ts
Registry entries for four chart components and multiple examples with declared registry/runtime dependencies; adds ScatterChartIcon, TreemapChartIcon, FunnelChartIcon, WaterfallChartIcon; updates getNavItemIcon slug normalization and icon mapping; adds SVG previews and showcase entry for Scatter Chart; updates docs metadata and adds permanent Next.js redirect from /docs/scatter-chart to /docs/scatter-chart/static.

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 59.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feat: scattered chart' is partially related to the changeset. It highlights the main component addition (scatter chart), but uses a typo ('scattered' instead of 'scatter') and is vague about the broader scope of the PR, which adds four chart types and extensive supporting infrastructure.
Description check ✅ Passed The description is related to the changeset. It indicates a 'New chart component' was added and references completed checklist items (documentation, testing, registry sync), which align with the scatter chart addition and the broader changes observed in the summary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1d033e4-b430-4cc2-beb8-cd937486f915

📥 Commits

Reviewing files that changed from the base of the PR and between 50055d8 and 23142f9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (16)
  • next.config.ts
  • package.json
  • registry.json
  • src/components/docs/mdx/components/showcase-grid.tsx
  • src/components/docs/svg-previews/scatter-preview.tsx
  • src/content/docs/meta.json
  • src/content/docs/scatter-chart/meta.json
  • src/content/docs/scatter-chart/static.mdx
  • src/registry/__index__.tsx
  • src/registry/charts/scatter-chart.tsx
  • src/registry/examples/ex-glowing-scatter-chart.tsx
  • src/registry/examples/ex-gradient-colors-scatter-chart.tsx
  • src/registry/examples/ex-loading-state-scatter-chart.tsx
  • src/registry/examples/ex-scatter-chart.tsx
  • src/registry/registry-chart.ts
  • src/registry/registry-example.ts

Comment thread package.json Outdated
"@radix-ui/react-toggle": "^1.1.10",
"@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8",
"@shikijs/transformers": "^3.23.0",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify `@shikijs/transformers` package exists and check version compatibility

# Check if `@shikijs/transformers`@3.23.0 exists on npm
echo "=== Checking `@shikijs/transformers`@3.23.0 availability ==="
npm view `@shikijs/transformers`@3.23.0 version 2>/dev/null || echo "Version 3.23.0 not found"

# Check latest version of `@shikijs/transformers`
echo -e "\n=== Latest `@shikijs/transformers` version ==="
npm view `@shikijs/transformers` version

# Check peerDependencies or dependencies of transformers package
echo -e "\n=== `@shikijs/transformers`@3.23.0 dependency requirements ==="
npm view `@shikijs/transformers`@3.23.0 peerDependencies dependencies

# Check if shiki 3.23.0 is available
echo -e "\n=== Checking shiki@3.23.0 availability ==="
npm view shiki@3.23.0 version 2>/dev/null || echo "Version 3.23.0 not found"

# Check latest shiki version
echo -e "\n=== Latest shiki version ==="
npm view shiki version

Repository: legions-developer/evilcharts

Length of output: 397


🏁 Script executed:

# Check the actual package.json content around these dependencies
cat -n package.json | sed -n '45,80p'

Repository: legions-developer/evilcharts

Length of output: 1430


🏁 Script executed:

# Verify the relationship between shiki and `@shikijs` packages
npm view shiki peerDependencies dependencies 2>/dev/null | head -20

Repository: legions-developer/evilcharts

Length of output: 340


🏁 Script executed:

# Check what version of `@shikijs/core` shiki@3.20.0 depends on
npm view shiki@3.20.0 dependencies

Repository: legions-developer/evilcharts

Length of output: 346


Version mismatch: align @shikijs/transformers with shiki core package.

The @shikijs/transformers package at version ^3.23.0 depends on @shikijs/core@3.23.0, while shiki@^3.20.0 (line 76) depends on @shikijs/core@3.20.0. This creates a hard dependency conflict that npm cannot resolve, causing build failures or runtime errors.

Update shiki to ^3.23.0 to align the @shikijs/core dependency:

diff
-    "shiki": "^3.20.0",
+    "shiki": "^3.23.0",

Comment on lines +5 to +10
<svg
className="text-primary relative z-10 h-full w-full"
viewBox="0 0 900 480"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Hide decorative preview SVG from assistive tech.

On Line 5, this appears to be decorative-only, but it can still be exposed as a graphic to screen readers. Mark it as hidden/presentational to reduce noise.

Suggested fix
     <svg
       className="text-primary relative z-10 h-full w-full"
+      aria-hidden="true"
+      focusable="false"
+      role="presentation"
       viewBox="0 0 900 480"
       fill="none"
       xmlns="http://www.w3.org/2000/svg"
     >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<svg
className="text-primary relative z-10 h-full w-full"
viewBox="0 0 900 480"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<svg
className="text-primary relative z-10 h-full w-full"
aria-hidden="true"
focusable="false"
role="presentation"
viewBox="0 0 900 480"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>

Comment on lines +229 to +230
<ApiRow name="scatterProps" type="ComponentProps<typeof Scatter>">
Escape hatch for raw props forwarded to the underlying Recharts Scatter component.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

scatterProps API type is documented incorrectly.

Line 229 currently points to ComponentProps<typeof Scatter>, but the component accepts Recharts Scatter props (with data, dataKey, and name omitted). The current docs can mislead consumers.

📝 Suggested doc correction
-  <ApiRow name="scatterProps" type="ComponentProps<typeof Scatter>">
+  <ApiRow
+    name="scatterProps"
+    type='Omit<ComponentProps<typeof RechartsScatter>, "data" | "dataKey" | "name">'
+  >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<ApiRow name="scatterProps" type="ComponentProps<typeof Scatter>">
Escape hatch for raw props forwarded to the underlying Recharts Scatter component.
<ApiRow
name="scatterProps"
type='Omit<ComponentProps<typeof RechartsScatter>, "data" | "dataKey" | "name">'
>
Escape hatch for raw props forwarded to the underlying Recharts Scatter component.

Comment thread src/registry/charts/scatter-chart.tsx
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evilcharts Ready Ready Preview, Comment May 21, 2026 7:21pm

Request Review

@legions-developer
Copy link
Copy Markdown
Owner

was there any reason to delete all those cute icons?

image

ctesibius and others added 2 commits May 23, 2026 13:58
Normalize fumadocs folder ids so chart sidebar icons render again, add ScatterChartIcon and JSDoc coverage for the scatter chart component, and remove accidental package-lock.json and @shikijs/transformers dependency.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce composable chart primitives with examples, docs, registry entries, and sidebar navigation for hierarchical breakdowns, conversion funnels, and variance bridges.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/registry/charts/scatter-chart.tsx (1)

175-176: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Selection highlighting shouldn't depend on series clickability.

selectedDataKey can already change through Legend and defaultSelectedDataKey, but non-clickable series never dim because opacity is gated by isClickable. That makes legend-driven/default selection look broken on read-only series.

Suggested fix
   const isSelected = selectedDataKey === null || selectedDataKey === dataKey;
-  const opacity = isClickable && !isSelected ? 0.25 : 1;
+  const opacity = !isSelected ? 0.25 : 1;

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 21ba6c19-04e8-4c79-93e0-7be3962e1f5e

📥 Commits

Reviewing files that changed from the base of the PR and between 23142f9 and 5af3473.

📒 Files selected for processing (31)
  • next.config.ts
  • registry.json
  • src/assets/icons/index.tsx
  • src/components/docs/mdx/components/showcase-grid.tsx
  • src/components/docs/svg-previews/funnel-preview.tsx
  • src/components/docs/svg-previews/treemap-preview.tsx
  • src/components/docs/svg-previews/waterfall-preview.tsx
  • src/content/docs/funnel-chart/meta.json
  • src/content/docs/funnel-chart/static.mdx
  • src/content/docs/meta.json
  • src/content/docs/treemap-chart/meta.json
  • src/content/docs/treemap-chart/static.mdx
  • src/content/docs/waterfall-chart/meta.json
  • src/content/docs/waterfall-chart/static.mdx
  • src/globals/functions/getNavItemIcon.tsx
  • src/registry/__index__.tsx
  • src/registry/charts/funnel-chart.tsx
  • src/registry/charts/scatter-chart.tsx
  • src/registry/charts/treemap-chart.tsx
  • src/registry/charts/waterfall-chart.tsx
  • src/registry/examples/ex-funnel-chart.tsx
  • src/registry/examples/ex-glowing-funnel-chart.tsx
  • src/registry/examples/ex-glowing-treemap-chart.tsx
  • src/registry/examples/ex-glowing-waterfall-chart.tsx
  • src/registry/examples/ex-loading-state-funnel-chart.tsx
  • src/registry/examples/ex-loading-state-treemap-chart.tsx
  • src/registry/examples/ex-loading-state-waterfall-chart.tsx
  • src/registry/examples/ex-treemap-chart.tsx
  • src/registry/examples/ex-waterfall-chart.tsx
  • src/registry/registry-chart.ts
  • src/registry/registry-example.ts
✅ Files skipped from review due to trivial changes (8)
  • src/content/docs/waterfall-chart/meta.json
  • src/content/docs/funnel-chart/meta.json
  • src/content/docs/treemap-chart/meta.json
  • src/registry/examples/ex-glowing-waterfall-chart.tsx
  • src/components/docs/svg-previews/funnel-preview.tsx
  • src/content/docs/treemap-chart/static.mdx
  • next.config.ts
  • src/registry/index.tsx


## Usage

The funnel chart is composible. `<EvilFunnelChart>` wraps a vertically laid out Recharts `<BarChart>` with custom trapezoid shapes per stage (`stageKey`) and measured values (`valueKey`). Compose `<Grid />`, `<XAxis />`, `<YAxis />`, `<Stages />`, `<Tooltip />`, `<Legend />` as needed, and set optional `backgroundVariant` on the chart root — Recharts has no standalone funnel primitive, but every native chart prop can pass through `chartProps` alongside the underlying <Link href="https://recharts.github.io/en-US/api/BarChart/" _blank>BarChart</Link> escape hatch documented below.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix user-facing copy typos in the docs.

Line 85 has “composible” and Line 283 should use a hyphen (“Stage-keyed”).

✏️ Proposed patch
-The funnel chart is composible. `<EvilFunnelChart>` wraps a vertically laid out Recharts `<BarChart>` with custom trapezoid shapes per stage (`stageKey`) and measured values (`valueKey`). Compose `<Grid />`, `<XAxis />`, `<YAxis />`, `<Stages />`, `<Tooltip />`, `<Legend />` as needed, and set optional `backgroundVariant` on the chart root — Recharts has no standalone funnel primitive, but every native chart prop can pass through `chartProps` alongside the underlying <Link href="https://recharts.github.io/en-US/api/BarChart/" _blank>BarChart</Link> escape hatch documented below.
+The funnel chart is composable. `<EvilFunnelChart>` wraps a vertically laid out Recharts `<BarChart>` with custom trapezoid shapes per stage (`stageKey`) and measured values (`valueKey`). Compose `<Grid />`, `<XAxis />`, `<YAxis />`, `<Stages />`, `<Tooltip />`, `<Legend />` as needed, and set optional `backgroundVariant` on the chart root — Recharts has no standalone funnel primitive, but every native chart prop can pass through `chartProps` alongside the underlying <Link href="https://recharts.github.io/en-US/api/BarChart/" _blank>BarChart</Link> escape hatch documented below.
@@
-Stage keyed legend syncing dimming + selection mirrored from `<Stages />`.
+Stage-keyed legend syncing dimming + selection mirrored from `<Stages />`.

Also applies to: 283-283


## Usage

The waterfall chart is composible on top of stacked `<Bar />` geometries (transparent “base” + visible segment). Provide rows with semantic `WaterfallType` (`start`, `increase`, `decrease`, `total`) encoded at `typeKey` (defaults to `"type"`), display names (`nameKey`), deltas (`valueKey`), gradients via `chartConfig`. Compose `<Grid />`, `<XAxis />`, `<YAxis />`, `<Bars />`, `<Tooltip />`, `<Legend />` as needed plus optional `backgroundVariant` on the root — remaining behavior forwards into Recharts `<BarChart />`; see <Link href="https://recharts.github.io/en-US/api/BarChart/" _blank>BarChart docs</Link> when extending through `chartProps`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix visible typos in docs prose.

There are user-facing spelling issues: “composible” should be “composable”, and “horizonal” should be “horizontal”.

Also applies to: 231-231

Comment thread src/registry/charts/funnel-chart.tsx Outdated
Comment on lines +565 to +571
const resolveFunnelParts = (children: ReactNode) => {
const parts: ReactNode[] = [];

Children.forEach(children, (child) => {
if (!isValidElement(child)) return;
if (child.type === Stages || child.type === Background) return;
parts.push(child);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

The exported <Background /> slot never renders.

resolveFunnelParts() removes <Background />, but the root does not render those filtered children anywhere else. That makes the public composable Background API ineffective.

Comment thread src/registry/charts/treemap-chart.tsx Outdated
Comment thread src/registry/charts/treemap-chart.tsx
Comment thread src/registry/charts/waterfall-chart.tsx Outdated
Comment thread src/registry/charts/waterfall-chart.tsx
ctesibius and others added 2 commits May 23, 2026 14:30
Dim shapes whenever shared selection is set so legend and defaultSelected* work without shape isClickable, and remove the non-functional Background child export in favor of root backgroundVariant.

Co-authored-by: Cursor <cursoragent@cursor.com>
Promote the horizontal layout preview on the bar chart page, add the missing XAxis so January renders, and align colors and data with the basic bar example.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants