ipython / ipython/ipykernel

API for identifying overlaying frontend to help libraries interacting with the UI

Đang mở
#380 0 bình luận 4 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
734
Fork
412
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Mô tả

Due to this talk
[Discussion about the trial to detect correct renderer in altair](https://github.com/altair-viz/altair/issues/1291)

It would be nice to have information provided for query by an ipykernel-API about the overlaying frontend.

Imagine someone wrote following code in jupyter notebook to visualize something like this:

```
import altair as alt
from vega_datasets import data
cars = data.cars()
alt.renderers.enable('notebook') #jupyter notebook
#alt.renderers.enable('default') #jupyter lab
#dynamic
alt.Chart(cars).mark_point().encode(
x='Horsepower',
y='Miles_per_Gallon',
color='Origin',
)
```
Now the user wants to share the code by his cars.ipynb file.
Another user wants to use it in jupyter lab and wonders why the graph is not shown.
He has again to modify the code, change e.g. 'notebook' to 'default' to make it run.

With an API from ipykernel which is identifying the frontend, the graphic-library could manage the configuration of the renderer by itself to set the optimal renderer and even give a warning when not supported even wrong renderer is used.

In the above link is a proposal hack to identify a frontend, but however, it should be registered in a correct way in the ipykernel.

Maybe someone would like to deal with it or implement that, that would be great!

The implementation of this proposal would mean a much simpler and more dynamic exchange and the faster use of different ipy user interfaces, because the user-code has not to be touched again.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.