diff --git a/explorer.py b/explorer.py index 79fa009..eb14731 100644 --- a/explorer.py +++ b/explorer.py @@ -193,6 +193,7 @@ def _swap_axes( new_positions[wid] = {ent: (y, x) for ent, (x, y) in pos_dict.items()} new_ax = dict(axis_def) + # Non-paired keys pass through unchanged # Swap paired scalar keys new_ax["x_label"] = axis_def.get("y_label") new_ax["y_label"] = axis_def.get("x_label") diff --git a/tests/test_political_compass.py b/tests/test_political_compass.py index 760702e..834a86d 100644 --- a/tests/test_political_compass.py +++ b/tests/test_political_compass.py @@ -724,3 +724,10 @@ def test_axis_swap_not_applied_when_x_is_left_right(): "y_label": "Links\u2013Rechts", # both LR — no swap } assert _should_swap_axes(axis_def2) is False + + +def test_axis_swap_not_applied_when_neither_axis_is_left_right(): + from explorer import _should_swap_axes + + assert _should_swap_axes({"x_label": "Foo", "y_label": "Bar"}) is False + assert _should_swap_axes({"x_label": None, "y_label": None}) is False