I have not encountered this behaviour. We only use $ inside AMD modules as a local alias for an explicitly require'd jQuery, AFAIK, and in our main.coffee, we also do:
Bokeh.$ = require("jquery")
# Make sure that we don't clobber any existing definition of \(most
\# likely a previous version of jQuery\.
\_oldJQ = window\.
window.jQuery.noConflict()
if typeof(\) == "undefined"
\# if there was no previous definition of , put our definition into window.\.
window\. = _oldJQ
So I am not sure how we'd be clobbering anything. Where are you suggesting we use jQuery instead of $, exactly? Can you provide an IPython notebook and instructions to minimally reproduce the problem?
Thanks,
Bryan
···
On Dec 25, 2014, at 1:20 PM, Tatiana Likhomanenko <[email protected]> wrote:
Hi!
There is strange behavior observed when I reload (crtl+R) notebook without restarting kernel.
For some strange reason is overridden \(maybe by some other module\), and it can not run (delegate)
So after I reload notebook all the drawn plots are shown well, but new ones after running cells do not appear.
Replacing $ = jQuery breaks the notebook completely.
The simple fix is instead of
$(function(){ code of drawing here})
use
jQuery(function(){ code of drawing here})
IMHO, this is more relevant, since $ may be not only jQuery object (while jQuery object always has the same meaning).
Pay attention this is wrapped by (function(){}), not jQuery, not bokeh..
Thanks,
Tatiana.
26 дек. 2014 г., в 0:29, Bryan Van de Ven [email protected] написал(а):
···
Hi Tatiana,
I have not encountered this behaviour. We only use $ inside AMD modules as a local alias for an explicitly require’d jQuery, AFAIK, and in our main.coffee, we also do:
Bokeh.$ = require(“jquery”)
Make sure that we don’t clobber any existing definition of $ (most
likely a previous version of jQuery.
_oldJQ = window.
window.jQuery.noConflict()
if typeof() == “undefined”
if there was no previous definition of , put our definition into window..
window.$ = _oldJQ
So I am not sure how we’d be clobbering anything. Where are you suggesting we use jQuery instead of $, exactly? Can you provide an IPython notebook and instructions to minimally reproduce the problem?
Thanks,
Bryan
On Dec 25, 2014, at 1:20 PM, Tatiana Likhomanenko [email protected] wrote:
Hi!
There is strange behavior observed when I reload (crtl+R) notebook without restarting kernel.
For some strange reason is overridden (maybe by some other module), and it can not run (delegate)
So after I reload notebook all the drawn plots are shown well, but new ones after running cells do not appear.
Replacing $ = jQuery breaks the notebook completely.
The simple fix is instead of
$(function(){ code of drawing here})
use
jQuery(function(){ code of drawing here})
IMHO, this is more relevant, since $ may be not only jQuery object (while jQuery object always has the same meaning).
Thans for the example, I misunderstood your initial comment. I thought you were saying that Bokeh was overriding \(which was a problem we had long ago\) not that something else was overriding it, and that our use of bare is fragile. I have made an GH issue to address this:
FYI, the example notebook you linked is very old and was created with a very old version of Bokeh (version 0.3). The latest release, Bokeh 0.7, was just last month and has many improvements and features since that notebook was created.
Thanks,
Bryan
···
On Dec 29, 2014, at 10:19 AM, Tatiana Likhomanenko <[email protected]> wrote:
When you look at the source of html page, you’ll find code produced to output the first plot
\(function\(\)\{
var all\_models = \[\{"attributes": \{"plot": \{"type": "Plot", "id": "2b6bb419\-c7d4\-4d1c\-a850\-f455a289a7b7"\}, "location": "min", "bounds": "auto", "doc": null, "id": "783f0d50\-b46f\-4921\-b6ff\-8b7419fd66a5", "dimension": 0\}, ……\.\.
omitted much code
…\.\. \}\];
var modelid = "2b6bb419\-c7d4\-4d1c\-a850\-f455a289a7b7";
var modeltype = "Plot";
var elementid = "7ce001e1\-6af0\-4def\-bfe6\-f408f77a8d1e";
var view;
console\.log\(modelid, modeltype, elementid\);
Bokeh\.load\_models\(all\_models\);
var model = Bokeh\.Collections\(modeltype\)\.get\(modelid\)
window\.model=model;
var view = new model\.default\_view\(
\{model : model\}
\);
window\.view = view;
\_\.delay\(function\(\)\{
('#7ce001e1-6af0-4def-bfe6-f408f77a8d1e').append(view.$el)
}, 1000);
});
Pay attention this is wrapped by \(function\(\)\{\}\), not jQuery, not bokeh\..
Thanks,
Tatiana.
26 дек. 2014 г., в 0:29, Bryan Van de Ven <[email protected]> написал(а):
Hi Tatiana,
I have not encountered this behaviour. We only use $ inside AMD modules as a local alias for an explicitly require'd jQuery, AFAIK, and in our main.coffee, we also do:
Bokeh.$ = require("jquery")
# Make sure that we don't clobber any existing definition of \(most
\# likely a previous version of jQuery\.
\_oldJQ = window\.
window.jQuery.noConflict()
if typeof(\) == "undefined"
\# if there was no previous definition of , put our definition into window.\.
window\. = _oldJQ
So I am not sure how we'd be clobbering anything. Where are you suggesting we use jQuery instead of $, exactly? Can you provide an IPython notebook and instructions to minimally reproduce the problem?
Thanks,
Bryan
On Dec 25, 2014, at 1:20 PM, Tatiana Likhomanenko <[email protected]> wrote:
Hi!
There is strange behavior observed when I reload (crtl+R) notebook without restarting kernel.
For some strange reason is overridden \(maybe by some other module\), and it can not run (delegate)
So after I reload notebook all the drawn plots are shown well, but new ones after running cells do not appear.
Replacing $ = jQuery breaks the notebook completely.
The simple fix is instead of
$(function(){ code of drawing here})
use
jQuery(function(){ code of drawing here})
IMHO, this is more relevant, since $ may be not only jQuery object (while jQuery object always has the same meaning).