DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Project 1: The Performance-First Dashboard
  • Project 2: Accessible Video Player
  • Project 3: Markdown Blog Engine
  • Project 4: Browser-Based Code Editor
  • Project 5: Multi-Tab Whiteboard
  • Project 6: Infinite Scroll Image Gallery
  • Project 7: Recipe Optimizer & Converter
  • Project 8: Budget Tracker with Charts
  • Project 9: Typing Speed Test
  • Project 10: Weather App with Time-Travel
  • Project 11: CSS Grid Layout Builder
  • Project 12: Password Vault (Frontend Only)
  • Project 13: Kanban Board (Trello Clone)
  • Project 14: Quiz App with Leaderboard
  • Project 15: Habit Tracker (GitHub Style)
  • Project 16: E-commerce Product Page
  • Project 17: Unit Converter (Expert Mode)
  • Project 18: Music Visualizer
  • Project 19: Flashcard Learning App
  • Project 20: Custom Form Validator
  • Project 21: Virtual Terminal
  • Project 22: Pomodoro Timer (Focus Pro)
  • Project 23: SVG Path Editor
  • Project 24: Movie Database Matchmaker
  • Project 25: Interactive Resume / Portfolio
  • Project 26: Recipe Scraper UI
  • Project 27: Crypto Tracker (Real-Time)
  • Project 28: Find My Pet (PWA)
  • Project 29: Markdown-to-Slide Tool
  • Project 30: Browser Health Dashboard
← From Beginner to Expert in Fundamentals of Frontend

Project 23: SVG Path Editor

45 min read
SVG Path CommandsBezier CurvesPath SimplificationViewBoxCSS clip-pathLayer Management

📋 Project Brief

Build a visual SVG path editor for creating and manipulating vector graphics. Users manipulate Bezier curve control points, simplify paths, adjust the viewBox, and export the result as CSS clip-path or offset-path values.

✅ Feature Requirements

Feature 1: Bezier Curve Handles

Acceptance Criteria:

  • SVG paths are rendered with visible anchor points and control handles
  • Dragging an anchor point moves the path vertex
  • Dragging a control handle adjusts the curve's curvature
  • Support for cubic (C) and quadratic (Q) Bezier curves
  • New points can be added by clicking on the canvas
  • Points can be deleted with a right-click context menu or Delete key

Feature 2: Path Simplification

Acceptance Criteria:

  • A "Simplify" slider reduces the number of nodes in a path
  • Uses the Ramer-Douglas-Peucker algorithm (or similar)
  • A tolerance slider controls how aggressively nodes are removed
  • The path visually updates in real-time as the slider moves
  • Show node count before/after: "Simplified from 42 to 12 nodes"

Feature 3: ViewBox Control

Acceptance Criteria:

  • Controls to adjust the SVG viewBox: x, y, width, height
  • A visual representation of the viewBox boundaries on the canvas
  • Zoom in/out with scroll wheel or +/- buttons
  • Pan by dragging the canvas background
  • A "Fit to Content" button auto-adjusts the viewBox to contain all paths

Feature 4: Export to CSS

Acceptance Criteria:

  • Export the path as a CSS clip-path: path("...") value
  • Export as clip-path: polygon(...) for simpler shapes
  • Export as raw SVG <path d="...">
  • "Copy to Clipboard" button with visual confirmation for each export format

Feature 5: Layer System

Acceptance Criteria:

  • Support multiple paths on the same canvas
  • A layers panel lists all paths; clicking selects one for editing
  • Layers can be reordered by dragging
  • Layers can be hidden/shown (visibility toggle)
  • Each layer has a color identifier

📊 SVG Path Command Reference

CommandMeaningExample
MMove toM 10 20
LLine toL 50 60
CCubic BezierC 10 20, 30 40, 50 60
QQuadratic BezierQ 10 20, 50 60
ZClose pathZ

🧪 Testing Checklist

  • Unit test path simplification algorithm
  • Unit test SVG path string generation from point data
  • Unit test CSS clip-path and polygon export formatting
  • Integration test: adding/moving points updates the SVG preview and code output
  • A11y: all controls keyboard-accessible; drag operations have keyboard alternatives

🚀 Stretch Goals

  • Import existing SVG files for editing
  • Add a "Draw Freehand" mode that auto-generates path points
  • Implement path boolean operations (union, intersect, subtract)
  • Add animation preview (animate along path using offset-path)

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.