Commit bb5c998
authored
plotly.io HTML functions, modular renderers framework, future flags system (#1474)
* plotly.io.renderers implementation
* Use _repr_mimebundle_ to automatically display figures on repr in the Jupyter Notebook.
* Browser renderers to show figure in browser tabs. Avoids writing out tmp file by create single use web server to serve the html content to the browser.
* Expose renderer base classes
* Auto-detect VSCode, Kaggle, and Colab environments and initialize renderer appropriately
* Added IFrameRenderer. Use include_plotlyjs='directory' for iframe renderer.
* Added initial to_html functions to plotly.io
* Reimplement plotly.offline.plot using plotly.io.write_html/to_div. Updated tests only slightly to reflect the change in how resizing is handled now. Before there was a custom callback resize script, now
we rely on the plotly.js 'responsive' config option
* Reimplement plotly.offline.iplot and init_notebook_mode pio.show
* Add responsive=True config when figure width/height aren't set
* Add MathJax configuration when initializing HTML renderer in notebook
* Reimplement HTML Renderers using the plotly.io html functions
* Add support for custom JS snippets in exported HTML. Now there is a post_script argument to the HTML functions that allows a user to specify some custom JavaScript to run after plot creation. This can be used by plot/iplot to implement the previous save image behavior without needing to add explicit save image options to the HTML functions.
* Remove default renderer and make rendering figure on display an option
that is false by default. Now the behavior of figure display, init_notebook_mode, iplot, and plot
are all backward compatible by default.
* Added future flag system under _plotly_future_ to control
default renderer settings and default template.
* Remove legacy unused _plot_html function
* Move combination renderers test to orca test suite
* Add ipython to orca environment for renderer tests
* Added chromium browser renderer
* Fix plotly mimetype renderer when used with numpy arrays/pandas Series
* Lazily initialize default renderers. This way we can keep notebook_connected as a default renderer, but it won't attempt notebook initialization unless in is explicitly shown. So this won't happen, for example, when using plotly.py in a Dash app
* Use 'browser' default renderer if ipython isn't available
* Trigger notebook renderer activation on `init_notebook_mode` call. This will improve backward compatibility with the legacy init_notebook_mode() function.1 parent 706f5b0 commit bb5c998
File tree
18 files changed
+2034
-337
lines changed- .circleci
- _plotly_future_
- plotly
- io
- offline
- tests
- test_core/test_offline
- test_io
- test_optional/test_offline
- test_orca
18 files changed
+2034
-337
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
395 | 411 | | |
396 | 412 | | |
397 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments