This Black Scholes calculator is an attempt to turn a Jupyter notebook into something that looks a bit like a traditional web page.
This kind of notebook, coupled with Jupyterhub, enables building and deploying webapps (admittedly limited in terms of UI) simply and fast.
This is what I am trying to do in a corporate LAN.
In this exemple, I put a relatively complex input form and the results associated within a single composite ipywidget.
Then I hide the code cells with a button and offer an 'Init' button (restart kernel & run all cells).
So the only thing a user needs to do is click it when the notebook starts.
So I hope it can help people to build simili web apps inside the notebook.
Also I would be glad to have to feedback particularly if what I wrote can be improved or does not follow best practises.
Here are some remarks / questions about ipywidgets and frontend js derived from this attempt:
1/
I found that the (Bounded)FloatText change event triggers as soon as a single digit changes.
As a result, it triggers before you can input a number with several digits. Which can be too often.
Example: the case where the FloatText is used to control a max boundary, any change with triggers all observe methods with a single digit number to start with.
Is there a way to have more control over what triggers a change event ?
For example a 'blur' event on the input box
To avoid this unfortunate behavior, I created custom widgets based on HTML input type='number'. Its behavior (and little arrows) is more appropriate, I think, and maybe it could become the default ? I think it would be convenient to have direct access to most possible values of type available in
http://www.w3schools.com/tags/att_input_type.asp. One can always create custom widgets to do that, but people won't know what is available, so maybe it could be in the main lib. What do you think ?
2/
Re ipywidgets styling, all widgets have a background_color property but it does not seem to have any styling effect.
Should this property be ignored ?
More generally, is there a way to pass arbitrary css to the widgets ?
To change colors, fonts, etc
3/
Re the list of available widgets, where can I read their python class and javascript code ?
If they are accessible, then it is easy for everyone to make a small variation from a custom widget with a simple copy/paste/adjust.
Exemple: I would like to modify the layout of the RadioButton widget to put the name above the radio buttons, not on the left, so as to take less horizontal space.
4/
Can you recommend a concise way to make the 'Init' and 'Show/Hide' code buttons with ipywidgets.
As opposed to 'manual javascript', as I have done.
5/
The 'save notebook with snapshot' works partly, it seems.
When I reopen the notebook, I get a glimpse of the image soon replaced by some text.
In nbviewer, the image appears twice along with the same parasite text.
Is this behavior identified ?
I am aware that I am asking a lot of questions and that people have little spare time.
But I would be grateful for even rough directions or pointers.
By the way, I find Jupyter & its ecosystem more and more exciting !
Thx