jupyter 集成javascript chart的方法
-
https://github.com/niloch/iplotter
iplotter is a simple package for generating interactive charts in ipython/jupyter notebooks using popular JavaScript Libraries from python data structures (dictionaries, lists, etc.) -
https://github.com/nicohlr/ipychart
This package is a Python package made for data vizualisation. It allows to create dynamic, refined and customizable charts using Python. It is particularly suitable for Data Scientists who are looking for a smart way to display and present their data directly from the output cells of their notebooks.Ipychart is an ipywidget . Ipywidgets are tools developed by the creators of Jupyter themselves. It allows using pure Javascript code directly in the Jupyter environment, which is a Python environment. This bridge between Javascript and Python is made available in open source with the possibility for anyone to create a custom ipywidget. This package, which is therefore a custom ipywidget, utilizes the power of this link between Javascript and Python to make the Chart.js Javascript library available to all Python users.
https://ipywidgets.readthedocs.io/en/stable/
Jupyter Widgets are interactive browser controls for Jupyter notebooks. Examples include:
Basic form controls like sliders, checkboxes, text inputs
Container controls like tabs, accordions, horizontal and vertical layout boxes, grid layouts
Advanced controls like maps, 2d and 3d visualizations, datagrids, and more -
https://livingwithmachines.ac.uk/d3-javascript-visualisation-in-a-python-jupyter-notebook/
这个文章里面提到了一个思路 就是Python 来处理数据 然后保存为json 然后从js里面访问 -
https://github.com/pyecharts/pyecharts
Python Echarts Plotting Library -
https://www.youtube.com/watch?v=jmVcpa0_pAE
https://gist.github.com/drorhilman/c5ae2f5d6661ea12fd2b5d0c078f9700
from IPython.display import HTML
这个视频的核心思路是使用IPython 的HTML类 生成一个包含echarts的网页 -
http://markibrahim.me/musings/notebooks/beautiful_javascript_charts.html
https://github.com/niloch/iplotter (已经不维护了)
JavaScript charting in ipython/jupyter notebooks -
使用python对 C3.js
plotly.js
Chart.js
Chartist.js
Google Charts
进行了封装
和pyecharts的思路类似 直接用python对js进行封装 这样的好处是使用起来比较友好 -
https://gist.github.com/aialenti/8cf4702ae8be7f79936b4c75f1a4024a
感觉还比较清晰
这个方案是从js直接调用python的接口获取的panda数据
IPython.notebook.kernel.execute 这个JS API 可以直接调用Python的函数 -
-
https://towardsdatascience.com/introducing-notebookjs-seamless-integration-between-python-and-javascript-in-computational-e654ec3fbd18
Introducing notebookJS: seamless integration between Python and JavaScript in Computational Notebooks