A PoC of an interactive time-series dashboard application built with React and Chart.js. Features multiple chart visualizations, flexible layouts, and real-time data filtering.
- Click and drag on a chart to zoom in on the selected date range.
- Click and drag the chart name or hold
Ctrland drag (orCmdon Mac) to move charts in any mode. - In free mode, click on the little arrow on the bottom right of a chart to resize it.
- 9 Time-Series Charts: Displays metrics including CPU usage, memory consumption, network traffic, active users, API request rates, database query times, disk I/O, error rates, and cache hit ratios
- Multiple Layout Modes:
- Vertical: Stacked single-column layout
- Grid: 3-column grid with snap-to-grid positioning
- Free: Fully customizable drag-and-drop with resizing
- Date Range Filtering: Filter all charts by custom date ranges with calendar picker
- Responsive Design: Adapts to different screen sizes with breakpoint-aware layouts
- Theme Support: Light and dark mode toggle
- Persistent Layouts: Layout configurations are saved to localStorage
- Interactive Charts: Hover synchronization across charts with visual indicators
- Data Caching: Smart caching system for generated time-series data
- Data Generation: Mock data generators create time-series data at 1-second intervals for the selected date range
- Layout System: Uses
react-grid-layoutto manage chart positioning across different layout modes - Chart Rendering: Each chart uses Chart.js with time-series scales and custom plugins for hover synchronization
- State Management: Context providers handle global state for themes, date ranges, and chart hover interactions
- Responsive Behavior: Layout configurations adapt to screen size breakpoints (xxs, xs, sm, md, lg)
- React 19 with TypeScript
- Chart.js with react-chartjs-2 for visualizations
- react-grid-layout for drag-and-drop layouts
- Tailwind CSS for styling
- Vite as build tool
- Shadcn & Radix UI components for UI primitives
- date-fns for date manipulation
- Node.js 18+ and npm
npm installnpm run devThe application will be available at http://localhost:5173
npm run buildnpm run previewnpm run lint # Check for issues
npm run lint:fix # Auto-fix issues
npm run ts-check # TypeScript type checkingsrc/
├── components/ # React components
│ ├── BarChart.tsx # Chart visualization component
│ ├── ChartContainer.tsx
│ ├── Dashboard.tsx # Main dashboard component
│ ├── DateRangePicker.tsx
│ └── ui/ # Reusable UI components from shadcn
├── contexts/ # React context providers
│ ├── ChartHoverContext.tsx
│ ├── DateRangeContext.tsx
│ └── ThemeContext.tsx
├── utils/ # Utility functions and types
└── styles/ # Global styles