Create an interactive analytics dashboard for a steel forging company aimed at employees…
- User
Create an interactive analytics dashboard for a steel forging company aimed at employees and yoneticiler. Include KPI summary cards with trend indicators, a mix of line, bar, and donut charts with hover tooltips and smooth transitions, a sortable and filterable data table, and date-range and segment filters that update every view live. Use a clean, modern visual style with clear layout hierarchy and a dark mode toggle, generate realistic sample data so every chart feels alive, and make it fully responsive.
Assistant
I'll create a comprehensive analytics dashboard for a steel forging company. Let me start by exploring the project structure and then building the solution.
I have a clean setup. Now let me build the dashboard. I'll create it with self-contained SVG-based charts (no external chart library needed for smaller bundle & full control), realistic data, filters, dark mode, and full responsiveness.
Now let me create the data generation utility:
Now create reusable chart components:
Now the KPI card, filters bar, and data table:
Now let me look at the existing cn util and App.tsx to build the final composition:
Good. Now the main App component that ties it all together:
Now let me build to make sure everything compiles:
Build succeeded. The dashboard is complete. Here's a summary of what I built:
ForgeMetrics — Steel Forging Analytics Dashboard
Structure
src/lib/data.ts— Deterministic sample-data generator (365 days × 5 segments × 3 plants) producing realistic tonnage, revenue, OEE, defect rate, downtime, energy, and orders with seasonality + weekly patterns + upward trend + noise. Plus 180 sample production orders across real Turkish/global industrial customers (Ford Otosan, TUSAŞ, ASELSAN, Airbus, Siemens Energy, etc.).src/components/LineChart.tsx— Multi-series area+line chart with animated "draw-in" transition, hover crosshair, and rich tooltip.src/components/BarChart.tsx— Vertical & horizontal bar chart with staggered rise-up animation and hover fade.src/components/DonutChart.tsx— Interactive donut with hover expansion, center label, and follow-cursor tooltip.src/components/KpiCard.tsx— KPI card with value, trend badge (green good / red bad, aware of "goodWhen up/down"), and inline sparkline.src/components/DataTable.tsx— Sortable (click any column), searchable, status-filterable, paginated orders table with colored status pills.src/App.tsx— Composition, live filtering, dark-mode toggle (persisted to localStorage + respects prefers-color-scheme).
Features delivered
- ✅ 4 KPI cards — Revenue, Tonnage, OEE, Defect rate — all with vs-previous-period % change and sparklines that update live with filters
- ✅ Line chart (production trend), bar charts (plants + top customers, vertical & horizontal), donut (revenue mix by segment), all with smooth transitions and hover tooltips
- ✅ Sortable + filterable + paginated data table with search & status filter
- ✅ Date-range filters: 4 presets (7d / 30d / 90d / YTD) + custom date pickers
- ✅ Segment & Plant multi-select chip filters (colored per segment)
- ✅ Every view updates live — KPIs, sparklines, all charts, and table respond instantly to any filter change
- ✅ Dark mode toggle in the header with sun/moon icon
- ✅ Fully responsive — grid collapses cleanly from 4 cols → 2 → 1; header, filter bar, and table adapt to mobile
- ✅ Clean modern style: soft shadows, rounded cards, orange/rose brand accent, live "3 plants online" pulse indicator, sticky glassy header, and clear typographic hierarchy
Bundle builds cleanly to a single 288 KB HTML file (85 KB gzipped) with no external chart library — all SVG hand-rolled for performance and full control.
Files built:
index.html,src/index.css,src/lib/data.ts,src/components/Tooltip.tsx,src/components/LineChart.tsx,src/components/BarChart.tsx,src/components/DonutChart.tsx,src/components/KpiCard.tsx,src/components/DataTable.tsx,src/App.tsx
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.