A React-based tool to compare and visualize JSON sensor data. It highlights differences and allows structured viewing.
Ensure you have Node.js and npm or yarn installed on your machine.
- Clone the repository:
git clone https://github.com/your-username/sensor-comparator.git cd sensor-comparator - Install dependencies:
npm install # or yarn install - Start the development server:
npm run dev # or yarn dev - Open http://localhost:3000 in your browser where x is the port.
- Input JSON data in both text fields.
- Enable or disable comparison mode using the equal button.
- The tool highlights differences between JSON objects:
- 🟥 Missing keys: the key is not in the opposite JSON.
- 🟨 Type mismatches between values.
- Click on objects to expand/collapse nested structures.
✅ Real-time JSON Comparison: Instantly highlights key differences.
✅ Depth Color: Different levels are color-coded for clarity.
✅ Collapsible JSON Blocks: Easily navigate large structures.
✅ Sticky Mode: Keeps objects open for better readability.
✅ Error Handling: Detects and displays JSON parsing errors.
/src
├── components
│ ├── App.tsx # Main application component
│ ├── SensorStruct.tsx # JSON structure parser & comparison logic
│ ├── Block.tsx # Recursive component for rendering JSON objects
│ └── css/ # Stylesheets
├── public/
├── package.json
├── README.md
- Modify
Block.tsxto change styling for different levels. - Adjust
SensorStruct.tsxto tweak comparison rules.
- Fork the repository
- Create a new branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add new feature" - Push to your branch:
git push origin feature-name
- Open a Pull Request.
{"test":1, "test2":"oui", "array":[{"test3": true}], "array2":[{"test4": false}, {"test5": 3}], "testbcptroplongpouroircequecadonnequandcadepasseducadre":"testbcptroplongpouroircequecadonnequandcadepasseducadre", "object":{"jsobject":1}}{"test":1, "array":[{"test3": true}, {"nope":2}, [{"test22":2}]], "object":{"jsobject":1}, "same":"notesame"}
{"test2":"oui", "array":[{"test3": false}, {"nope":3}, {"more":3}], "object":{"jsobject":2}, "same":"noesame"}