Component Architecture
The Fuzzy C-Means clustering application is built with four main React components that work together to provide an interactive clustering visualization experience:- InputPoint - Handles user input for adding data points and centroids
- DataChart - Visualizes points and centroids using Chart.js scatter plots
- MatrixTable - Displays membership matrices in a tabular format
- PointTable - Shows point and centroid coordinates in table form
Component Hierarchy
The components follow a simple, flat hierarchy where each component receives data through props from the parent application state:Point type:
Component Details
InputPoint
Component for adding data points and centroids manually or randomly
DataChart
Scatter plot visualization with dynamic color coding based on membership values
MatrixTable
Table component for displaying membership matrices with centroid-point relationships
PointTable
Simple table for displaying point and centroid coordinates
Technology Stack
The components leverage the following libraries:- React - Core UI framework
- Ant Design - UI components (Table, InputNumber)
- Chart.js with react-chartjs-2 - Data visualization
- TypeScript - Type safety
- Tailwind CSS - Styling
Data Flow
All components follow a unidirectional data flow pattern:- User interactions trigger callback functions passed via props
- Parent component updates application state
- Updated state flows down to components as props
- Components re-render with new data