I was thinking it would be nice to have the circuit layout formatting separated from the main compilation so that the circuit can be viewed in the UI prior to the compilation.
As a first iteration, rather than rewriting the main compilation block, set up a new api method called render_circuit_layout so that when an example circuit is selected from the dropdown, the circuit diagram gets rendered before the compilation request is submitted. I would fire the axios request on the dropdown select onChange.
Can elaborate further