Infographic Editor is a modern, interactive web application for creating, editing, and exporting infographics. It features a drag-and-drop canvas, customizable nodes and edges, context menus, keyboard shortcuts, and export/import functionality. Built with Next.js, Tailwind CSS, Radix UI, and Zustand for state management, it offers a seamless and beautiful user experience.
- π¨ Drag-and-Drop Canvas: Easily add, move, and connect nodes.
- π’ Customizable Nodes: Support for different shapes (circle, rectangle, ellipse), colors, and styles.
- π§© Context Menus: Right-click for quick actions on nodes and canvas.
- β¨οΈ Keyboard Shortcuts: Undo, redo, add, and delete nodes with your keyboard.
- ποΈ Sidebar: Edit node properties and global styles.
- π€ Export: Download your infographic as JSON or image (PNG/SVG).
- π₯ Import: Load infographics from JSON files.
- πΉοΈ Toolbar: Undo/redo, fit view, and center canvas controls.
- π Theme Support: Light and dark mode with theme switcher.
- π§© Radix UI Components: Accessible, beautiful UI elements.
βββ app/ # Next.js app directory
β βββ globals.css # Global styles
β βββ layout.tsx # App layout
β βββ page.tsx # Main page
βββ components/ # UI and editor components
β βββ infographic-editor.tsx # Main editor logic
β βββ canvas.tsx # Canvas rendering
β βββ custom-node.tsx # Node rendering
β βββ context-menu.tsx # Context menu logic
β βββ sidebar.tsx # Sidebar for node/global editing
β βββ toolbar.tsx # Toolbar controls
β βββ ui/ # Radix UI-based components
βββ hooks/ # Custom React hooks
β βββ use-infographic-store.ts # Zustand store
β βββ use-keyboard-shortcuts.ts
β βββ use-toast.ts
βββ lib/ # Utility functions
β βββ export-utils.ts # Export/import helpers
β βββ graph-utils.ts # Node/edge helpers
β βββ utils.ts # Misc utilities
βββ public/ # Static assets (images, video)
βββ styles/ # Additional styles
βββ types/ # TypeScript types
β βββ graph.ts # Node/edge types
βββ package.json # Project metadata & scripts
βββ ...
git clone https://github.com/your-username/infographic-editor.git
cd infographic-editor_2pnpm installpnpm devOpen http://localhost:3000 in your browser.
- Add Nodes: Click the canvas or use the sidebar to add root nodes.
- Edit Nodes: Select a node to edit its label, shape, and styles in the sidebar.
- Connect Nodes: Drag from one node's handle to another.
- Context Menu: Right-click nodes or canvas for quick actions.
- Export/Import: Use the sidebar to export as JSON/image or import from JSON.
- Undo/Redo: Use toolbar buttons or keyboard shortcuts (Ctrl+Z / Ctrl+Y).
| Shortcut | Action |
|---|---|
| Ctrl + Z | Undo |
| Ctrl + Y | Redo |
| Delete | Delete Node |
| N | Add Node |
| B | Toggle Sidebar |
| Command | Description |
|---|---|
pnpm dev |
Start development server |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm lint |
Lint code |
-
Place your demo GIF file (e.g.,
demo.gif) in thepublic/directory. -
Reference it in the README using:
<img src="/demo.gif" alt="Demo GIF" width="100%" />
This project is licensed under the MIT License.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
For questions or feedback, please open an issue or contact the maintainer.