[IPython-dev] Loading nbextension on widget instantiation

Nicholas Bollweg nick.bollweg at gmail.com
Thu Jun 19 14:08:29 EDT 2014


Sorry: I should have provided a link! _view_static, _view_module and
_view_style, in the mixin
<https://github.com/bollwyvl/cookiecutter-ipython-widget/blob/master/%7B%7Bcookiecutter.repo_name%7D%7D/%7B%7Bcookiecutter.pkg_name%7D%7D/widgets/%7B%7Bcookiecutter.widget_file%7D%7D.py#L23>
.

Would there be a benefit to these being traitlets? I haven't spent much
>> time with them (aside for front-end oriented widget stuff).
>
> Sorry, to what being traitlets?
>

None of these will be used client-side, as opposed to _view_name, which is
(in create_view), but is there still some reason for them to be traitlets?

My thinking here being these rules-of-thumb (proposed):

   - *For a given library of widgets, put your static assets together so
   that they can be copied into nbextensions when needed.*
   - *For a given Widget+View, load a single script (and if necessary,
   stylesheet): handle all other things with require() and @import,
   respectively.*

At first glance, this seems a bit restrictive: one script? But once
requirejs is thrown in the mix, this actually makes good sense, as most
requirejs-aware libraries (i.e. d3) won't even attach to the global scope!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140619/049675e3/attachment.html>


More information about the IPython-dev mailing list