Skip to content

Commit 20ee37f

Browse files
fix chart scaling
1 parent f31cce0 commit 20ee37f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

core/tests/test_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,16 @@ def test_is_pio_job_running_multiple() -> None:
146146
unit = get_unit_name()
147147

148148
assert not any(is_pio_job_running(["stirring", "od_reading"]))
149+
assert is_pio_job_running(["stirring"]) == [False]
149150

150151
with start_stirring(target_rpm=0, experiment=experiment, unit=unit):
151152
assert any(is_pio_job_running(["stirring", "od_reading"]))
152153
assert is_pio_job_running(["stirring", "od_reading"]) == [True, False]
153154
assert is_pio_job_running(["od_reading", "stirring"]) == [False, True]
155+
assert is_pio_job_running(["stirring"]) == [True]
154156

155157
assert not any(is_pio_job_running(["stirring", "od_reading"]))
158+
assert is_pio_job_running(["stirring"]) == [False]
156159

157160

158161
def test_get_running_pio_job_id_single() -> None:

frontend/src/components/Chart.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ function Chart(props) {
287287
}
288288

289289
const updateWidth = () => {
290-
const nextWidth = Math.max(400, node.clientWidth || 600);
290+
const nextWidth = Math.max(240, node.clientWidth || 600);
291291
setChartWidth(nextWidth);
292292
};
293293

@@ -709,7 +709,7 @@ function Chart(props) {
709709
<div ref={chartContainerRef} style={{ position: "relative" }}>
710710
<VictoryChart
711711
key={chartStateKey}
712-
style={{ parent: { maxWidth: "700px", width: "100%" } }}
712+
style={{ parent: { width: "100%" } }}
713713
title={title}
714714
domainPadding={10}
715715
padding={{ left: 70, right: 50, bottom: legendBottomPadding, top: 50 }}
@@ -739,7 +739,7 @@ function Chart(props) {
739739
>
740740
<VictoryLabel
741741
text={title}
742-
x={360}
742+
x={chartWidth / 2}
743743
y={30}
744744
textAnchor="middle"
745745
style={{
@@ -797,8 +797,8 @@ function Chart(props) {
797797
}}
798798
/>
799799
<VictoryLegend
800-
x={65}
801-
y={285}
800+
x={70}
801+
y={chartHeight - legendBottomPadding + 40}
802802
symbolSpacer={6}
803803
itemsPerRow={legendItemsPerRow}
804804
name="legend"

0 commit comments

Comments
 (0)