Skip to content

Commit 94c3c78

Browse files
committed
UPDATE:
1. fixed line graph's alignement and minor bugs 2. removed text area
1 parent 16d55d2 commit 94c3c78

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

qubitverse/visualizer/src/components/NQubitInput.jsx

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function NQubitInput({ setQubits }) {
3636
setTempQ(e.target.value);
3737
const parsed = validate_input(e.target.value);
3838

39-
if (error == '' && parsed !== null) {
39+
if (error == '' || parsed !== null) {
4040
const newData = [];
4141
for (let i = 1; i <= parsed; i++) {
4242
newData.push({
@@ -75,31 +75,10 @@ function NQubitInput({ setQubits }) {
7575
display: "flex"
7676
}}>
7777
<div style={{ height: "600px", width: "50%" }}>
78-
<textarea
79-
readOnly
80-
value={`A qubit (quantum bit) is the fundamental unit of quantum information.
81-
Unlike classical bits which are either 0 or 1, a qubit can be in a superposition ds
82-
of both 0 and 1 states at the same time. This allows quantum computers to
83-
perform complex calculations much faster than classical computers in some cases.`}
84-
style={{
85-
width: '100%',
86-
height: '50%',
87-
padding: '12px',
88-
fontSize: '14px',
89-
fontFamily: 'monospace, monospace',
90-
resize: 'none',
91-
backgroundColor: '#f0f0f0',
92-
color: '#333',
93-
borderRadius: '8px',
94-
border: '1px solid #ccc',
95-
marginBottom: '1rem',
96-
whiteSpace: 'pre-wrap'
97-
}}
98-
/>
9978
<div style={{ height: "480px", width: "100%", marginLeft: "20px" }}>
10079
{lineData.length > 0 ? (
101-
<ResponsiveContainer width="100%" height="100%">
102-
<LineChart data={lineData} margin={{ top: 10, right: 30, left: 0, bottom: 0 }}>
80+
<ResponsiveContainer width="100%" height="100%" style={{ marginTop: "100px", marginLeft: "30px" }}>
81+
<LineChart data={lineData} margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>
10382
<CartesianGrid strokeDasharray="3 3" />
10483
<XAxis dataKey="qubits" label={{ value: 'Qubits', position: 'insideBottom', offset: -5 }} />
10584
<YAxis
@@ -200,4 +179,4 @@ perform complex calculations much faster than classical computers in some cases.
200179
);
201180
}
202181

203-
export default NQubitInput;
182+
export default NQubitInput;

0 commit comments

Comments
 (0)