Using the ipywidgets framework would be a natural way to do this - it provides a way to automatically sync data between the web browser and the kernel. For example, we have a scenegraph-like api already with pythreejs (wrapping three.js), which can call back to python code when the camera viewpoint changes, when the user picks a point in the 3d scene, etc.
If you needed to use osg.js, someone would need to write code wrapping osg.js and exposing it to the notebook. If you could use the scenegraph for pythreejs, then perhaps all that is needed for basic functionality is converting from freecad into the pythreejs scenegraph.