A React + TypeScript project that provides an interactive data visualization dashboard using Recharts, Redux Toolkit, and Tailwind CSS. Users can input queries to retrieve and visualize business insights in various chart formats (Bar, Line, Pie).
ā
Query Input with Auto-Suggestions (Smart recommendations for business-related queries)
ā
Multiple Chart Types (Bar, Line, Pie - switchable via dropdown)
ā
History Tab (Click previous queries to reload their results)
ā
Error Handling (Displays "No Data Found" for invalid queries)
ā
Loading State (Indicates processing while fetching data)
ā
Hover Effects (Enhanced Pie chart with better tooltip and interactivity)
š src
āāā š assets
āāā š components
ā āāā QueryInput.tsx
ā āāā ResultDisplay.tsx
ā āāā ChartDisplay.tsx
ā āāā QueryHistory.tsx
āāā š pages
ā āāā Dashboard.tsx
āāā š redux
ā āāā querySlice.ts
ā āāā store.ts
āāā š utils
ā āāā mockSuggestions.ts
āāā App.tsx
āāā main.tsx
User can enter a query related to Sales, Revenue, Orders, Profit, Expenses, etc.
š¹ Example Queries:
š¹ Users can toggle between Bar, Line, and Pie charts using a dropdown.
š¹ Smooth transitions and tooltips enhance data visualization.
š¹ Click any past query from the history tab to reload its results.
git clone https://github.com/Tomkndn/gen-ai-dashboard
cd gen-ai-dashboard
npm install
npm run dev
š Open http://localhost:5173/ (or the specified port) in your browser.
Since this is a frontend-based project, it does not fetch live data. Instead, it generates randomized mock data based on query keywords.
š” Valid Keywords: "sales", "revenue", "customer", "order", "profit", "expenses", "marketing", "inventory"
ā Invalid Keywords: Display "No data found for this query."
In future, this can be integrated with GPT-powered AI analytics APIs.
š” To change the default chart colors, update the gradient definitions in ChartDisplay.tsx
:
<defs>
<linearGradient id="barColor" x1="0" y1="0" x2="0" y2="1">
<stop offset="0%" stopColor="#6366F1" />
<stop offset="100%" stopColor="#4F46E5" />
</linearGradient>
</defs>
Modify colors for Bar, Line, and Pie charts as needed! šØ
š Possible Improvements:
Contributions are welcome! š
1ļøā£ Fork the repository
2ļøā£ Create a new branch (feature/new-feature
)
3ļøā£ Commit your changes (git commit -m "Added new feature"
)
4ļøā£ Push to GitHub (git push origin feature/new-feature
)
5ļøā£ Open a Pull Request š
š” Have Suggestions? Drop an issue or PR on GitHub! š