Skip to content

qgrid - plotly conflict #373

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

Closed
djchou opened this issue Dec 9, 2015 · 7 comments · Fixed by #412
Closed

qgrid - plotly conflict #373

djchou opened this issue Dec 9, 2015 · 7 comments · Fixed by #412

Comments

@djchou
Copy link

djchou commented Dec 9, 2015

I'm using plotly offline in a jupyter notebook. I'm coming across an error that i can't seem to debug.

Here is my code:

import qgrid
import Quandl
import plotly
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot

aapl = Quandl.get('yahoo/aapl')
qgrid.nbinstall(overwrite=True)

works ok

qgrid.show_grid(aapl)

init_notebook_mode()

no longer works ok

qgrid.show_grid(aapl)

The error message is
"
Javascript error adding output!
TypeError: Cannot read property 's' of undefined
See your browser Javascript console for more details.
"

@akansal1
Copy link

I am getting javascript type error : require not a function, for custom widget, on import and initialization of plotly in offline mode

@akansal1
Copy link

akansal1 commented Jan 3, 2016

I do not understand JS but I think following lines of code in offline.py causing errors:

display(HTML('<script type="text/javascript">' +
             # ipython's includes `require` as a global, which
             # conflicts with plotly.js. so, unrequire it.
             'require=requirejs=define=undefined;' +
             '</script>' +
             '<script type="text/javascript">' +
             get_plotlyjs() +
             '</script>'))

@aggFTW
Copy link

aggFTW commented Jan 12, 2016

I saw this too, same error. Ideas?

@djchou what are you trying to do with both qgrid and plotly?

@djchou
Copy link
Author

djchou commented Jan 12, 2016

One displays tables well, the other displays graphs well. It makes sense to have both in the same notebook

@etpinard
Copy link
Contributor

See plotly/plotly.js#90 for more info.

@aggFTW
Copy link

aggFTW commented Jan 13, 2016

Agreed @djchou. I was just wondering if you were building a UI/library that used both or just your own personal notebook :)

We are building a visualization widget for Ipython at https://github.com/jupyter-incubator/sparkmagic/tree/master/remotespark/datawidgets in case you want to take a look!

The intention is to decouple it from the sparkmagic project and put the widget into its own repo 👍

@etpinard
Copy link
Contributor

etpinard commented Feb 2, 2016

This issue would be perfect for a community contributor.

In this block, we need to remove the require=requirejs=define=undefined; hack and import plotly.js using the Require.js require as done in this plotly-notebook-js block.

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

Successfully merging a pull request may close this issue.

4 participants