Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interactive=False parameter to plotting functions #8

Open
kennysong opened this issue Oct 10, 2023 · 6 comments
Open

Add interactive=False parameter to plotting functions #8

kennysong opened this issue Oct 10, 2023 · 6 comments

Comments

@kennysong
Copy link
Contributor

Right now you can only show one plot at a time since Plotly runs a server that generates each plot.

Add an interactive parameter (True by default) to make Plotly output a static chart.

@Vela-zz
Copy link
Contributor

Vela-zz commented Nov 1, 2023

Hello, I am interested in this project. Is there anyone handle this issue right now? if not I want to handle it.

@kennysong
Copy link
Contributor Author

Hi @Vela-zz! Feel free to take on this issue. I think it's a bit non-trivial though. Another option to explore is if we can run multiple Plotly servers in one notebook kernel so that there can be multiple interactive charts running at the same time.

@kennysong
Copy link
Contributor Author

FYI this might be a slightly easier issue to take on: #38

@Vela-zz
Copy link
Contributor

Vela-zz commented Nov 3, 2023

thanks for your help! I may try the #38 to get familiar with how langcheck render a graph by using plotly dash.

@Vela-zz
Copy link
Contributor

Vela-zz commented Nov 6, 2023

Is using plotl.js plot the graph and embed them by "display, HTML, Javascript" module from IPython.core.display be an alternative solution for this?
I used BertViz before, they support multi-interacitve plot in one notebook, they plot their graph like this https://github.com/jessevig/bertviz/blob/master/bertviz/model_view.js
https://github.com/jessevig/bertviz/blob/master/bertviz/model_view.py

plot graph using chart.js or d3.js works most of time, but plotly.js is a little bit of weired.

@kennysong
Copy link
Contributor Author

Thanks for the reference to BertViz! I looked at their head_view implementation since it includes a dropdown:

head-view

https://github.com/jessevig/bertviz/blob/b42b61ec58f6fc72a55e987b24e55d141e80c4bb/bertviz/head_view.js#L70C4-L70C4

IIUC, the frontend stores all of the chart data in const config on load, and then modifies the chart client-side in JS when the user changes the dropdown.

Plotly is different and runs a Python server where new data is fetched from a Python endpoint every time the user types in the search boxes.

There's pros and cons to each approach. I'm not opposed to switching to a more client-side chart framework, but it would be a pretty major refactoring, so would prefer to see if there's an easier way we can extend Plotly Dash first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants