from conjuror.plans.truebeam import MLCTransmission, TrueBeamMachine

# Create and compute the MLC transmission procedure
procedure = MLCTransmission()
machine = TrueBeamMachine(mlc_is_hd=False)
procedure.compute(machine)

# Bank A transmission beam
beam = procedure.beams[1]
fig = beam.animate_mlc(show=False)
# Zoom around the jaw-defined open field
pad = 30  # mm margin
x1, x2 = -procedure.width / 2 - pad, procedure.width / 2 + pad
y1, y2 = -procedure.height / 2 - pad, procedure.height / 2 + pad
fig.update_layout(
    xaxis_scaleanchor="y",
    xaxis_range=[x1, x2],
    yaxis_range=[y1, y2],
    margin=dict(l=10, r=10, t=30, b=10),
)
fig