AaronWatters / jp_proxy_widget

Generic Jupyter/IPython widget implementation that will support many types of javascript libraries and interactions.
BSD 2-Clause "Simplified" License
61 stars 13 forks source link

loading jQuery UI CSS results in error #19

Open wood-chris opened 3 years ago

wood-chris commented 3 years ago

Following the tutorial, but trying to load a local copy of the jQuery UI CSS results in an error:

import jp_proxy_widget
from IPython.display import display

myCSStest = jp_proxy_widget.JSProxyWidget()

my_styles = "my_app/jquery-ui.css"

myCSStest.check_jquery()
myCSStest.load_css(my_styles)

myCSStest.js_init("""
element.html('<div><em class="random-style-for-testing">Styled widget element.</em></div>')
""")

display(myCSStest)

results in

Uninitialized Proxy Widget
new error message: TypeError: that.$$el.jQuery(...).prop is not a function
AaronWatters commented 3 years ago

Sorry for the delayed reply. I was not able to reproduce this in a simple way.

Are you using Lab or "classic notebook"? Can you make the style file available somewhere? Does this happen only for jqueryui styles or also for other style files?

thanks!

wood-chris commented 3 years ago

That's ok!

It's in a classic notebook. It might be something weird with me, but I don't know what.

Running the same code in 2 separate notebooks but in the same conda env from a clean kernel results in an error message in one but not the other 🤯

Screenshot 2021-04-14 at 21 27 29 Screenshot 2021-04-14 at 21 28 03

This isn't jquery-ui.css, so does happen with other CSS files. I'm not sure if this is actually anything to do with jp_proxy_widget but I'm not sure where to start with debugging!

AaronWatters commented 3 years ago

Hmmm. One place to look is the javascript console in the browser developer tools.

AaronWatters commented 3 years ago

I'm wondering if this could be a browser or platform issue. What platform (linux/mac/windows) are you using and what browser (chrome, IE, safari, firefox...)?

The package was developed and tested using Chrome/chromium mainly on Macs. I think it should work on Chrome anywhere. It may not work for other browsers in other platforms -- notably Safari and iE.