Skip to content

Commit 12051e4

Browse files
committed
adding switch button
1 parent 1d572a0 commit 12051e4

11 files changed

+404
-256
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The application is designed to be as agnostic as possible regarding how and wher
88
## Main Tech/framework used
99

1010
- React: as the backbone of the application
11-
- Highcharts.js: to display data
11+
- Chart.js: to display data
1212
- WebSockets: to provide a fast communication mechanism between a middle layer and the Serial Plotter (see section [How it works](#how-it-works))
1313
- Npm: as the registry
1414

package-lock.json

+40-13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arduino-serial-plotter-webapp",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"dependencies": {},
55
"scripts": {
66
"start": "react-scripts start",
@@ -31,26 +31,30 @@
3131
]
3232
},
3333
"devDependencies": {
34-
"@types/react-router-dom": "^5.3.1",
35-
"eslint-config-prettier": "^8.3.0",
36-
"eslint-plugin-prettier": "^4.0.0",
37-
"prettier": "^2.4.1",
3834
"@testing-library/jest-dom": "^5.14.1",
3935
"@testing-library/react": "^11.2.7",
4036
"@testing-library/user-event": "^12.8.3",
4137
"@types/jest": "^26.0.24",
4238
"@types/node": "^12.20.28",
4339
"@types/react": "^17.0.27",
4440
"@types/react-dom": "^17.0.9",
41+
"@types/react-router-dom": "^5.3.1",
4542
"arduino-sass": "^3.0.1",
4643
"bourbon": "^7.0.0",
47-
"highcharts": "^9.2.2",
48-
"highcharts-react-official": "^3.0.0",
44+
"chart.js": "^3.6.0",
45+
"chartjs-adapter-luxon": "^1.1.0",
46+
"chartjs-plugin-streaming": "^2.0.0",
47+
"eslint-config-prettier": "^8.3.0",
48+
"eslint-plugin-prettier": "^4.0.0",
49+
"luxon": "^2.1.0",
4950
"node-sass": "^6.0.1",
51+
"prettier": "^2.4.1",
5052
"react": "^17.0.2",
53+
"react-chartjs-2": "^3.3.0",
5154
"react-dom": "^17.0.2",
5255
"react-scripts": "4.0.3",
5356
"react-select": "^5.1.0",
57+
"react-switch": "^6.0.0",
5458
"typescript": "^4.4.3",
5559
"web-vitals": "^1.1.2"
5660
}

src/App.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useEffect, useState, useCallback, useRef } from "react";
2-
import { Chart } from "./Chart";
3-
import { MessageToBoard } from "./MessageToBoard";
2+
import { ChartPlotter } from "./ChartPlotter";
43
import { generateRandomMessages, SerialPlotter } from "./utils";
54

65
export default function App() {
@@ -69,6 +68,7 @@ export default function App() {
6968
.map((baud: string) => parseInt(baud)),
7069
darkTheme: urlParams.get("darkTheme") === "true",
7170
wsPort: parseInt(urlParams.get("wsPort") || "3030"),
71+
interpolate: urlParams.get("interpolate") === "true",
7272
generate: urlParams.get("generate") === "true",
7373
};
7474

@@ -95,10 +95,7 @@ export default function App() {
9595

9696
return (
9797
(config && (
98-
<>
99-
<Chart config={config} ref={chartRef} />
100-
<MessageToBoard config={config} websocket={websocket} />
101-
</>
98+
<ChartPlotter config={config} ref={chartRef} websocket={websocket} />
10299
)) ||
103100
null
104101
);

src/Chart.tsx

-105
This file was deleted.

0 commit comments

Comments
 (0)