Skip to content

Commit daab996

Browse files
fix(pygal): address review feedback for area-elevation-profile
Attempt 3/3 - fixes based on AI review
1 parent 89970b6 commit daab996

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

  • plots/area-elevation-profile/implementations

plots/area-elevation-profile/implementations/pygal.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" pyplots.ai
1+
"""pyplots.ai
22
area-elevation-profile: Terrain Elevation Profile Along Transect
33
Library: pygal 3.1.0 | Python 3.14.3
44
Quality: 86/100 | Created: 2026-03-15
@@ -51,7 +51,7 @@
5151
TYPE_COLORS = {
5252
"summit": "#b5342b", # deep red for highest point
5353
"pass": "#c45a00", # orange for mountain passes
54-
"hut": "#8b6914", # warm brown for alpine huts
54+
"hut": "#7b4ea0", # purple for alpine huts (distinct from orange)
5555
"valley": "#2a7f3f", # green for valley floors
5656
"town": "#306998", # blue for towns/settlements
5757
}
@@ -63,7 +63,7 @@
6363
foreground="#2d2d2d",
6464
foreground_strong="#2d2d2d",
6565
foreground_subtle="#e8e8e8",
66-
colors=("#4a7fb5", "#c45a00"),
66+
colors=("#4a7fb5", "#d4690e"),
6767
font_family="DejaVu Sans, Helvetica, Arial, sans-serif",
6868
title_font_family="DejaVu Sans, Helvetica, Arial, sans-serif",
6969
title_font_size=48,
@@ -75,8 +75,8 @@
7575
label_font_family="DejaVu Sans, Helvetica, Arial, sans-serif",
7676
major_label_font_family="DejaVu Sans, Helvetica, Arial, sans-serif",
7777
value_font_family="DejaVu Sans, Helvetica, Arial, sans-serif",
78-
opacity=0.6,
79-
opacity_hover=0.7,
78+
opacity=0.65,
79+
opacity_hover=0.75,
8080
guide_stroke_color="#e8e8e8",
8181
guide_stroke_dasharray="4,4",
8282
major_guide_stroke_color="#d0d0d0",
@@ -120,6 +120,13 @@
120120
xrange=(0, 128),
121121
show_minor_x_labels=False,
122122
show_minor_y_labels=False,
123+
truncate_legend=-1,
124+
dynamic_print_values=True,
125+
print_values=False,
126+
show_x_labels=True,
127+
show_y_labels=True,
128+
x_labels_major_count=7,
129+
y_labels_major_count=6,
123130
)
124131

125132
# Elevation profile as filled XY series
@@ -199,14 +206,14 @@
199206
vline.set("stroke", lm_color)
200207
vline.set("stroke-width", "2")
201208
vline.set("stroke-dasharray", "8,5")
202-
vline.set("opacity", "0.45")
209+
vline.set("opacity", "0.55")
203210

204211
# Landmark name (bold, colored by type)
205212
name_el = ET.SubElement(parent_elem, f"{ns}text")
206213
name_el.set("x", f"{cx + dx:.1f}")
207214
name_el.set("y", f"{cy + y_off:.1f}")
208215
name_el.set("text-anchor", anchor)
209-
name_el.set("font-size", "30")
216+
name_el.set("font-size", "32")
210217
name_el.set("font-family", "DejaVu Sans, Helvetica, Arial, sans-serif")
211218
name_el.set("fill", lm_color)
212219
name_el.set("font-weight", "bold")
@@ -219,17 +226,17 @@
219226
elev_el.set("text-anchor", anchor)
220227
elev_el.set("font-size", "26")
221228
elev_el.set("font-family", "DejaVu Sans, Helvetica, Arial, sans-serif")
222-
elev_el.set("fill", "#777777")
229+
elev_el.set("fill", "#555555")
223230
elev_el.text = f"{lm['elev']:.0f} m"
224231

225232
# Add vertical exaggeration note (spec requirement) - positioned bottom-right
226233
note_el = ET.SubElement(root, f"{ns}text")
227234
note_el.set("x", "4650")
228235
note_el.set("y", f"{plot_bottom_y + 48:.0f}")
229236
note_el.set("text-anchor", "end")
230-
note_el.set("font-size", "24")
237+
note_el.set("font-size", "28")
231238
note_el.set("font-family", "DejaVu Sans, Helvetica, Arial, sans-serif")
232-
note_el.set("fill", "#999999")
239+
note_el.set("fill", "#555555")
233240
note_el.set("font-style", "italic")
234241
note_el.text = "Vertical exaggeration ~10\u00d7 for terrain visibility"
235242

0 commit comments

Comments
 (0)