diff --git a/lib/microwaveprop_web/live/skewt_svg.ex b/lib/microwaveprop_web/live/skewt_svg.ex index 42b0fc4c..07f335f5 100644 --- a/lib/microwaveprop_web/live/skewt_svg.ex +++ b/lib/microwaveprop_web/live/skewt_svg.ex @@ -43,18 +43,29 @@ defmodule MicrowavepropWeb.SkewtSvg do cleaned = clean_profile(profile) parcel = Keyword.get(opts, :parcel_trace, []) + plot_w = @right - @left + plot_h = @bottom - @top + [ ~s||, style_block(), + # Define a rectangular clip the plot interior shares so any + # grid/trace polyline whose vertices stretch past the frame + # (e.g. skewed isotherms exiting the right edge near the top) + # is visually cropped. The frame and axis labels live *outside* + # this group, so the box outline still reads clean. + ~s||, + ~s||, isobars(), isotherms(), dry_adiabats(), moist_adiabats(), mixing_ratio_lines(), - frame(), - axis_labels(), profile_traces(cleaned), parcel_trace_line(parcel), + "", + frame(), + axis_labels(), cursor_layer(), "" ]