CDAT / jupyter-vcdat

A Jupyter Lab extension based on vCDAT.
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Code injector #95

Closed downiec closed 5 years ago

downiec commented 5 years ago

Created a CodeInjector class which handles all the notebook code injection related functions. This allows for improved separation of concerns and makes code injection functionality modular so that the functions can be called from any components that have access to the code injection object. The CodeInjector is instantiated when the sidebar is first initialized and then it can be passed as a prop to any components that need to perform code injection functions. The widgets file is significantly reduced in size and complexity, and the error handling is standardized within the code injector class. Also code injector functions provide more information if an error occurs, including the code used in the command and variables values that were passed to the function. From now on, any new injection functions can be implemented in this one place and can then be run from various other components.