Skip to content

Commit dc14e62

Browse files
committed
clean lint and prettier, set up github pages workflow
1 parent 4563e95 commit dc14e62

20 files changed

+876
-505
lines changed

package-lock.json

Lines changed: 639 additions & 335 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"dev": "vite --host",
88
"build": "vite build",
99
"lint": "eslint src",
10-
"preview": "vite preview"
10+
"preview": "vite preview",
11+
"prettier": "prettier src --write"
1112
},
1213
"dependencies": {
1314
"@emotion/react": "^11.14.0",
@@ -18,17 +19,13 @@
1819
"@yaffle/expression": "^0.0.47",
1920
"algebrite": "^1.4.0",
2021
"bootstrap": "^5.3.6",
21-
"chart.js": "^4.5.0",
22-
"chartjs-plugin-crosshair": "^2.0.0",
2322
"echarts": "^5.6.0",
2423
"echarts-for-react": "^3.0.2",
2524
"mathml-to-latex": "^1.5.0",
2625
"pako": "^2.1.0",
2726
"react": "^19.1.0",
28-
"react-chartjs-2": "^5.3.0",
2927
"react-dom": "^19.1.0",
30-
"uplot": "^1.6.32",
31-
"visiojs": "file:../visiojs/package"
28+
"visiojs": "^0.0.0"
3229
},
3330
"devDependencies": {
3431
"@eslint/js": "^9.25.0",
@@ -39,6 +36,7 @@
3936
"eslint-plugin-react-hooks": "^5.2.0",
4037
"eslint-plugin-react-refresh": "^0.4.19",
4138
"globals": "^16.0.0",
39+
"prettier": "^3.6.2",
4240
"rollup-plugin-visualizer": "^6.0.3",
4341
"uplot-react": "^1.2.2",
4442
"vite": "^6.3.5",

sitemap.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://onlinecircuitsolver.com/</loc>
5+
<lastmod>2025-07-28</lastmod>
6+
<changefreq>monthly</changefreq>
7+
<priority>1.0</priority>
8+
</url>
9+
</urlset>

src/App.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
background-color: rgb(37, 50, 64);
33
}
44
.bg-green {
5-
background-color: rgb(184, 255, 241)
5+
background-color: rgb(184, 255, 241);
66
}
77
.bg-lightgreen {
88
background-color: rgb(231 255 250) !important;
@@ -12,25 +12,27 @@
1212
cursor: pointer;
1313
}
1414

15-
.noPointerClass{
15+
.noPointerClass {
1616
pointer-events: none;
1717
}
1818

19-
.katex { font-size: 3em !important; }
19+
.katex {
20+
font-size: 3em !important;
21+
}
2022

2123
.bi {
2224
display: inline-block;
23-
vertical-align: -.125em;
25+
vertical-align: -0.125em;
2426
fill: currentcolor;
2527
}
2628

2729
.draw2d_InputPort {
28-
fill: #F7F7F7;
30+
fill: #f7f7f7;
2931
stroke: #d7d7d7;
3032
}
3133

3234
.draw2d_OutputPort {
33-
fill: #F7F7F7;
35+
fill: #f7f7f7;
3436
stroke: #d7d7d7;
3537
}
3638

@@ -60,4 +62,4 @@
6062
color: #000000;
6163
text-anchor: middle;
6264
dominant-baseline: text-after-edge;
63-
}
65+
}

src/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useEffect, useState } from "react";
22
import "./App.css";
3+
import "visiojs/dist/visiojs.css"; // Import VisioJS styles
34
// import { startupSchematic } from "./startupSchematic.js";
45
import pako from "pako";
56
import "bootstrap/dist/css/bootstrap.min.css";
@@ -22,7 +23,6 @@ import Container from "@mui/material/Container";
2223
import Snackbar from "@mui/material/Snackbar";
2324
import SnackbarContent from "@mui/material/SnackbarContent";
2425

25-
2626
const initialComponents = {
2727
L0: {
2828
type: "inductor",
@@ -201,13 +201,13 @@ function App() {
201201
"components",
202202
Object.keys(componentValues)
203203
.map((key) => compToURL(key, componentValues[key]))
204-
.join("__")
204+
.join("__"),
205205
);
206206
url.searchParams.set(
207207
"settings",
208208
Object.keys(settings)
209209
.map((key) => `${key}_${settings[key]}`)
210-
.join("__")
210+
.join("__"),
211211
);
212212

213213
const jsonString = JSON.stringify(schemHistory.state[schemHistory.pointer]);

src/ChoseTF.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function ChoseTF({ setResults, nodes, fullyConnectedComponents, component
5757
const editedMathMl = `<math><mfrac><mrow><mi>${p}</mi></mrow><mrow><msub><mi>${
5858
drivers[0] == "vin" ? "V" : "I"
5959
}</mi><mi>in</mi></msub></mrow></mfrac><mo>=</mo>${mathml}</math>`;
60-
setResults({text: textResult, mathML: editedMathMl, complexResponse: complex_response, bilinearRaw: "", bilinearMathML: "" });
60+
setResults({ text: textResult, mathML: editedMathMl, complexResponse: complex_response, bilinearRaw: "", bilinearMathML: "" });
6161
// setTextResult(textResult);
6262
// setMathML(editedMathMl);
6363
// setComplexResponse(complex_response);

src/ComponentAdjuster.jsx

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,51 @@ import MenuItem from "@mui/material/MenuItem";
88

99
import Card from "@mui/material/Card";
1010
import CardContent from "@mui/material/CardContent";
11-
import FormControl from '@mui/material/FormControl';
12-
11+
import FormControl from "@mui/material/FormControl";
1312

1413
import { units } from "./common";
1514

1615
export function ComponentAdjuster({ componentValues, setComponentValues }) {
17-
function handleValueChange (name, value) {
16+
function handleValueChange(name, value) {
1817
setComponentValues((prevValues) => ({
1918
...prevValues,
20-
[name]: { ...prevValues[name], value: value }
19+
[name]: { ...prevValues[name], value: value },
2120
}));
22-
};
23-
function handleUnitChange (name, value) {
21+
}
22+
function handleUnitChange(name, value) {
2423
setComponentValues((prevValues) => ({
2524
...prevValues,
26-
[name]: { ...prevValues[name], unit: value }
25+
[name]: { ...prevValues[name], unit: value },
2726
}));
28-
};
27+
}
2928

3029
return (
3130
<Grid container spacing={2}>
3231
{Object.keys(componentValues).map((key) => (
33-
<Grid size={{md:3}} key={key}>
34-
<Card sx={{ p:1, m:1, width:"100%" }}>
35-
<Stack direction="row" spacing={0} alignItems="center" sx={{ borderRadius: 1 }}>
36-
<Typography variant="h5" sx={{ mr: 1 }}>
37-
{key}
38-
</Typography>
39-
<TextField
40-
name={key}
41-
value={componentValues[key].value}
42-
sx={{ width: "8ch" }}
43-
size="small"
44-
onChange={(e)=>handleValueChange(key, e.target.value)}
45-
// fullWidth
46-
/>
47-
<FormControl size="small">
48-
<Select
49-
value={componentValues[key].unit}
50-
onChange={(e) => handleUnitChange(key, e.target.value)}
51-
>
32+
<Grid size={{ md: 3 }} key={key}>
33+
<Card sx={{ p: 1, m: 1, width: "100%" }}>
34+
<Stack direction="row" spacing={0} alignItems="center" sx={{ borderRadius: 1 }}>
35+
<Typography variant="h5" sx={{ mr: 1 }}>
36+
{key}
37+
</Typography>
38+
<TextField
39+
name={key}
40+
value={componentValues[key].value}
41+
sx={{ width: "8ch" }}
42+
size="small"
43+
onChange={(e) => handleValueChange(key, e.target.value)}
44+
// fullWidth
45+
/>
46+
<FormControl size="small">
47+
<Select value={componentValues[key].unit} onChange={(e) => handleUnitChange(key, e.target.value)}>
5248
{Object.keys(units[componentValues[key].type]).map((opt) => (
5349
<MenuItem key={opt} value={opt} size="small">
5450
{opt}
5551
</MenuItem>
5652
))}
5753
</Select>
58-
</FormControl>
59-
</Stack>
54+
</FormControl>
55+
</Stack>
6056
</Card>
6157
</Grid>
6258
))}

src/DisplayMathML.jsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,27 @@ export function DisplayMathML({ title, mathML, handleRequestBilin, textResult, c
5959
/>
6060
</Snackbar>
6161
<Grid container spacing={1}>
62-
<Grid size={{xs:12, sm:10}}>
63-
<Grid size={12} sx={{ my: 2 }}>
64-
<h3>{title} Transform</h3>
62+
<Grid size={{ xs: 12, sm: 10 }}>
63+
<Grid size={12} sx={{ my: 2 }}>
64+
<h3>{title} Transform</h3>
65+
</Grid>
66+
<Grid size={12} style={{ overflow: "auto" }} sx={{ fontSize: "1.6em" }}>
67+
{mathML == "" && title == "Bilinear" ? (
68+
<Button
69+
variant="contained"
70+
color="info"
71+
onClick={() => {
72+
handleRequestBilin();
73+
}}
74+
>
75+
Calculate bilinear transform
76+
</Button>
77+
) : (
78+
<DangerousSetIn mathMLString={mathML} />
79+
)}
80+
</Grid>
6581
</Grid>
66-
<Grid size={12} style={{ overflow: "auto" }} sx={{ fontSize: "1.6em" }}>
67-
{mathML == "" && title == "Bilinear" ? (
68-
<Button
69-
variant="contained"
70-
color="info"
71-
onClick={() => {
72-
handleRequestBilin();
73-
}}
74-
>
75-
Calculate bilinear transform
76-
</Button>
77-
) : (
78-
<DangerousSetIn mathMLString={mathML} />
79-
)}
80-
</Grid>
81-
</Grid>
82-
<Grid size={{xs:12, sm:2}}>
82+
<Grid size={{ xs: 12, sm: 2 }}>
8383
<Button
8484
variant="outlined"
8585
color="secondary"

src/Footer.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ function Footer() {
1313
<Toolbar>
1414
<Stack spacing={1} sx={{ width: "100%" }} direction={{ xs: "column", sm: "row" }}>
1515
<Typography sx={{ flexGrow: 1 }}>
16-
© {new Date().getFullYear()} Will Kelsey. This work is licensed under a Creative Commons Attribution 4.0 International License. You may
17-
not resell this tool
16+
© {new Date().getFullYear()} Will Kelsey. This work is licensed under a Creative Commons Attribution 4.0 International License. You may not resell this tool
1817
</Typography>
1918
<Typography sx={{ px: 2 }}>v2.0</Typography>
2019
<div

src/FreqAdjusters.jsx

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ import MenuItem from "@mui/material/MenuItem";
88

99
import Card from "@mui/material/Card";
1010
import CardContent from "@mui/material/CardContent";
11-
import FormControl from '@mui/material/FormControl';
12-
11+
import FormControl from "@mui/material/FormControl";
1312

1413
import { units } from "./common";
1514

1615
export function FreqAdjusters({ settings, setSettings }) {
17-
function handleValueChange (name, value) {
16+
function handleValueChange(name, value) {
1817
setSettings((prevValues) => ({
1918
...prevValues,
20-
[name]: value
19+
[name]: value,
2120
}));
22-
};
21+
}
2322
// function handleUnitChange (name, value) {
2423
// setComponentValues((prevValues) => ({
2524
// ...prevValues,
@@ -29,34 +28,37 @@ export function FreqAdjusters({ settings, setSettings }) {
2928

3029
return (
3130
<Grid container spacing={2}>
32-
{[['fmin', 'fminUnit'], ['fmax', 'fmaxUnit'], ['resolution', null]].map((key) => (
33-
<Grid size={{xs:12, sm:6, md:4}} key={key[0]}>
34-
<Card sx={{ p:1, m:1}}>
35-
<Stack direction="row" spacing={0} alignItems="center" sx={{ borderRadius: 1 }}>
36-
<Typography variant="h5" sx={{ mr: 1 }}>
37-
{key[0]}
38-
</Typography>
39-
<TextField
40-
name={key[0]}
41-
value={settings[key[0]]}
42-
sx={{ width: "8ch" }}
43-
size="small"
44-
onChange={(e)=>handleValueChange(key[0], e.target.value)}
45-
// fullWidth
46-
/>
47-
{key[1]!==null && <FormControl size="small">
48-
<Select
49-
value={settings[key[1]]}
50-
onChange={(e) => handleValueChange(key[1], e.target.value)}
51-
>
52-
{Object.keys(units['frequency']).map((opt) => (
53-
<MenuItem key={opt} value={opt} size="small">
54-
{opt}
55-
</MenuItem>
56-
))}
57-
</Select>
58-
</FormControl>}
59-
</Stack>
31+
{[
32+
["fmin", "fminUnit"],
33+
["fmax", "fmaxUnit"],
34+
["resolution", null],
35+
].map((key) => (
36+
<Grid size={{ xs: 12, sm: 6, md: 4 }} key={key[0]}>
37+
<Card sx={{ p: 1, m: 1 }}>
38+
<Stack direction="row" spacing={0} alignItems="center" sx={{ borderRadius: 1 }}>
39+
<Typography variant="h5" sx={{ mr: 1 }}>
40+
{key[0]}
41+
</Typography>
42+
<TextField
43+
name={key[0]}
44+
value={settings[key[0]]}
45+
sx={{ width: "8ch" }}
46+
size="small"
47+
onChange={(e) => handleValueChange(key[0], e.target.value)}
48+
// fullWidth
49+
/>
50+
{key[1] !== null && (
51+
<FormControl size="small">
52+
<Select value={settings[key[1]]} onChange={(e) => handleValueChange(key[1], e.target.value)}>
53+
{Object.keys(units["frequency"]).map((opt) => (
54+
<MenuItem key={opt} value={opt} size="small">
55+
{opt}
56+
</MenuItem>
57+
))}
58+
</Select>
59+
</FormControl>
60+
)}
61+
</Stack>
6062
</Card>
6163
</Grid>
6264
))}

0 commit comments

Comments
 (0)