The motion of massless Dirac-electrons in graphene mimics the propagation of photons. This makes it possible to control the charge-carriers with components based on geometrical-optics and has led to proposals for an all-graphene electron-optics platform. An open question arising from the possibility of reducing the component-size to the nanometer-scale is how to access and understand the transition from optical-transport to quantum-confinement. Here we report on the realization of a circular p-n junction that can be continuously tuned from the nanometer-scale, where quantum effects are dominant, to the micrometer scale where optical-guiding takes over. We find that in the nanometer-scale junction electrons are trapped in states that resemble atomic-collapse at a supercritical charge. As the junction-size increases, the transition to optical-guiding is signaled by the emergence of whispering-gallery modes and Fabry-Perot interference. The creation of tunable junctions that straddle the crossover between quantum-confinement and optical-guiding, paves the way to novel design-architectures for controlling electronic transport.