1.4 KiB
1.4 KiB
Graph with Reflection on Code
This project demonstrates a simple graph data structure and its visualization using D3.js.
The graph supports adding nodes, directed edges, and reflexive edges (self‑loops).
The UI renders the graph in an SVG canvas with a force‑directed layout.
Features
- Pure JavaScript implementation (no Python or other languages).
- Reflexive edges can be added automatically.
- Interactive visualization with drag support.
- Simple test suite using Jest.
Getting Started
-
Clone the repository
git clone https://git.brojs.ru/kuzakhmetovartur/povtornyy-ekzamen-2-graf-s-refleksiey-na.git cd povtornyy-ekzamen-2-graf-s-refleksiey-na -
Install dependencies
npm install -
Run the application
npm startOpen your browser at
http://localhost:3000(or the port shown in the console). -
Run tests
npm test
Project Structure
├── public
│ └── index.html # Entry point for the browser
├── src
│ ├── index.js # Application bootstrap
│ ├── graph.js # Graph data structure
│ └── ui.js # Rendering logic
├── __tests__
│ └── graph.test.js # Jest tests for Graph
├── package.json
└── README.md
License
MIT License