How gayathri1462/csvdatavisualizationtool works
Project Type and Purpose
• This is a single-page React application for visualizing and editing CSV data.
• Key purpose: upload CSV, view/edit via spreadsheet UI, generate/download charts (bar, line, pie, stacked bar), and export CSV/chart images.
File Structure Analysis
• Top-level:
• public/: static HTML entry point (index.html).
• src/: all React-specific code.
• README, package.json: project metadata & dependencies.
• src/components/: reusable UI pieces (charts, buttons, dropdowns, search).
• src/screens/: page views or “routes” (CsvUpload, Dashboard, SpreadSheet, Steps).
• src/redux/: state management (slices, rootReducer, store).
• src/utils/: helper functions (CSV conversion, data formatting, chart data extraction).
• Styling: .scss or .module.scss per component/screen, plus global styles.css.
a. Frontend UI Layer
• Screens: CsvUpload, SpreadSheet, Dashboard, Steps
• Components: BarChart, LineChart, DonutChart, StackedBarChart, DownloadBtn, DropDown, Search
b. State Management Layer
• Redux Toolkit slices: csvDataSlice, stepsSlice
• Middleware: Redux Saga (for any async side-effects), redux-persist (for saving state to local storage)
c. Data Processing Layer
• Utils: convertToCSV, formatCSVToDataArray, getChartDataByLabel, etc.
d. Third-Party Libraries
• React Spreadsheet (grid editing)
• Chart.js (rendering charts)
• Ant Design (UI primitives)
e. External Systems (none in this project; axios is available but not used—if it were, show API calls)
Relationships and Interactions
• User uploads CSV → CsvUpload screen invokes utils to parse CSV → dispatch(csvDataSlice.actions.setData).
• Redux persisted store holds raw CSV & processing steps.
• SpreadSheet screen reads csvData from store → displays via React Spreadsheet → dispatch updates on edit.
• Dashboard reads processed data → utils produce chart-ready datasets → Chart.js components render visuals.
• DownloadBtn uses utils (convertToCSV, downloadCSV) or Chart.js export features for saving files.
Architectural Patterns and Principles
• Separation of Concerns: UI vs state vs data processing.
• Unidirectional Data Flow: React → Redux → components → utils → store.
• Modular Components: each chart type and UI element in its own folder.
• Single Source of Truth: Redux store for CSV and step state; persisted across reloads.
Detailed Coverage
• Every slice, screen, and core util is represented.
• Data flow when uploading, editing, rendering, and downloading.
• Middleware (Saga) even if minimal, to indicate async handling capability.
• Chart generation path: raw CSV → formatted data → Chart.js component → canvas/download.