refactor: use scatter plot format for SVD components 3-10

- Changed _render_party_axis_chart_1d from horizontal bar chart to scatter plot
- Same format as components 1-2: markers on horizontal line with axis arrows- Axis labels now show correct direction with arrows (← left | right →)
- Ensures consistent visualization across all SVD components
This commit is contained in:
2026-04-02 21:39:09 +02:00
parent fa019d8a9c
commit a5e95c33d7
2 changed files with 76 additions and 37 deletions
+7 -3
View File
@@ -281,7 +281,7 @@ def test_partial_party_traces():
def test_render_party_axis_chart_1d_renders():
"""Test that _render_party_axis_chart_1d creates a figure with proper structure."""
"""Test that _render_party_axis_chart_1d creates a scatter plot with markers (same format as components 1-2)."""
from unittest.mock import MagicMock, patch
from explorer import _render_party_axis_chart_1d
@@ -310,8 +310,12 @@ def test_render_party_axis_chart_1d_renders():
# Get the figure passed to plotly_chart
fig = mock_plotly_chart.call_args[0][0]
assert fig is not None, "Figure should not be None"
# Check that figure has traces (the bar chart)
assert len(fig.data) > 0, "Figure should have traces"
# Check that figure has 2 traces (baseline line + markers)
assert len(fig.data) == 2, "Figure should have 2 traces (baseline + markers)"
# First trace is the baseline line
assert fig.data[0].mode == "lines", "First trace should be a line"
# Second trace is the marker scatter
assert "markers" in fig.data[1].mode, "Second trace should have markers"
def test_render_party_axis_chart_1d_empty_coords():