explicitly put a columndatasource in document

Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.

thanks !!!

It’s actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349

Personally, I’m using a dummy model that has an empty render method.

···

On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:

Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.

thanks !!!

I think actually https://github.com/bokeh/bokeh/issues/3674 might be the more relevant issue, I'm not sure. One of those might just be a dupe of the other.

But yes, until this feature is implemented, the best way to include "extra" data in a document is to go through something like a "dummy" glyph renderer (i.e. add a CDS to a glyph that is invisible). It's not ideal but is definitely workable for now.

Thanks,

Bryan

···

On Nov 9, 2017, at 10:48, Eugene Pakhomov <[email protected]> wrote:

It's actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349

Personally, I'm using a dummy model that has an empty `render` method.

On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:
Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.
thanks !!!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/ba1ed1d3-82d8-4d43-bba1-9cd3dccc569f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thank you Bryan and Eugene

Dummy glyphs, i don’t like because my layout is dynamic.

I would be curious to see the dummy model with empty render method…

thanks for the quick answers, at least it is clear it is not built in yet.

···

On Thursday, November 9, 2017 at 5:48:40 PM UTC+1, Eugene Pakhomov wrote:

It’s actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349

Personally, I’m using a dummy model that has an empty render method.

On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:

Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.

thanks !!!

FWIW I think you can explicitly add a CDS as non-visible a root:

  curdoc().add_root(ColumnDataSource())

But you'll probably have to dig around with JS to get at it (I'm not sure offhand exactly what that would look like).

Bryan

···

On Nov 9, 2017, at 11:46, chupach <[email protected]> wrote:

Thank you Bryan and Eugene

Dummy glyphs, i don't like because my layout is dynamic.
I would be curious to see the dummy model with empty render method...

thanks for the quick answers, at least it is clear it is not built in yet.

On Thursday, November 9, 2017 at 5:48:40 PM UTC+1, Eugene Pakhomov wrote:
It's actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349

Personally, I'm using a dummy model that has an empty `render` method.

On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:
Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.
thanks !!!

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/94601fab-38d8-4d8f-8f93-158e8622e2bf%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan,

I don’t think this will work. 0.12.10 still tries to render all roots without checking whether it can be rendered or not. So this explicit addition of CDS to the list of roots may cause some of the roots to be not rendered. At least if they’re added after the CDS.

Well, in any case, it will result in errors in JS console about non-existing methods.

Regards,

Eugene

···

On Fri, Nov 10, 2017 at 2:02 AM, Bryan Van de ven [email protected] wrote:

On Nov 9, 2017, at 11:46, chupach [email protected] wrote:

Thank you Bryan and Eugene

Dummy glyphs, i don’t like because my layout is dynamic.

I would be curious to see the dummy model with empty render method…

thanks for the quick answers, at least it is clear it is not built in yet.

On Thursday, November 9, 2017 at 5:48:40 PM UTC+1, Eugene Pakhomov wrote:

It’s actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349

Personally, I’m using a dummy model that has an empty render method.

On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:

Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.

thanks !!!

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/94601fab-38d8-4d8f-8f93-158e8622e2bf%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

FWIW I think you can explicitly add a CDS as non-visible a root:

    curdoc().add_root(ColumnDataSource())

But you’ll probably have to dig around with JS to get at it (I’m not sure offhand exactly what that would look like).

Bryan
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/F4AA2E37-B2A5-415B-AB19-86298457CED4%40anaconda.com.

Hi,

Yes it's definitely the case that there is a console error about not being able to render a view for the CDS. I'm not sure that means the approach won't work, however. (I'm not sure it will either, but might be worth exploring which is why I mentioned it)

Thanks,

Bryan

···

On Nov 9, 2017, at 13:06, Eugene Pakhomov <[email protected]> wrote:

Hi Bryan,

I don't think this will work. 0.12.10 still tries to render all roots without checking whether it can be rendered or not. So this explicit addition of CDS to the list of roots may cause some of the roots to be not rendered. At least if they're added after the CDS.
Well, in any case, it will result in errors in JS console about non-existing methods.

Regards,
Eugene

On Fri, Nov 10, 2017 at 2:02 AM, Bryan Van de ven <[email protected]> wrote:
FWIW I think you can explicitly add a CDS as non-visible a root:

        curdoc().add_root(ColumnDataSource())

But you'll probably have to dig around with JS to get at it (I'm not sure offhand exactly what that would look like).

Bryan

> On Nov 9, 2017, at 11:46, chupach <[email protected]> wrote:
>
> Thank you Bryan and Eugene
>
> Dummy glyphs, i don't like because my layout is dynamic.
> I would be curious to see the dummy model with empty render method...
>
> thanks for the quick answers, at least it is clear it is not built in yet.
>
>
>
> On Thursday, November 9, 2017 at 5:48:40 PM UTC+1, Eugene Pakhomov wrote:
> It's actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349
>
> Personally, I'm using a dummy model that has an empty `render` method.
>
>
> On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:
> Struggling so much with a simple thing:
>
> To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.
>
> I cannot find a way: declaring a cds in python does not mean it will make it into the document.
>
> Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)
>
> I am sure there must be a way.
> thanks !!!
>
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/94601fab-38d8-4d8f-8f93-158e8622e2bf%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/F4AA2E37-B2A5-415B-AB19-86298457CED4%40anaconda.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAMBZu17DBkgHFNn%3DW%3DMSJKtWOmAQfFOBYOrhgY%2BfNUUUqLXQzA%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hello,

I almost got excited when i noticed that:

curdoc().add_root(ColumnDataSource({‘x’:[1,2,3]},name=‘dummy’))

produced no error in JS console and rendering was fine.

However, in js console, the model in not present in the bokeh document: (by id) in Bokeh.documents._all_models or similarly by name.

So likely a bit early for this. That would be terribly useful however.

Best,

···

On Thursday, November 9, 2017 at 8:13:44 PM UTC+1, Bryan Van de ven wrote:

Hi,

Yes it’s definitely the case that there is a console error about not being able to render a view for the CDS. I’m not sure that means the approach won’t work, however. (I’m not sure it will either, but might be worth exploring which is why I mentioned it)

Thanks,

Bryan

On Nov 9, 2017, at 13:06, Eugene Pakhomov [email protected] wrote:

Hi Bryan,

I don’t think this will work. 0.12.10 still tries to render all roots without checking whether it can be rendered or not. So this explicit addition of CDS to the list of roots may cause some of the roots to be not rendered. At least if they’re added after the CDS.

Well, in any case, it will result in errors in JS console about non-existing methods.

Regards,

Eugene

On Fri, Nov 10, 2017 at 2:02 AM, Bryan Van de ven [email protected] wrote:

FWIW I think you can explicitly add a CDS as non-visible a root:

    curdoc().add_root(ColumnDataSource())

But you’ll probably have to dig around with JS to get at it (I’m not sure offhand exactly what that would look like).

Bryan

On Nov 9, 2017, at 11:46, chupach [email protected] wrote:

Thank you Bryan and Eugene

Dummy glyphs, i don’t like because my layout is dynamic.

I would be curious to see the dummy model with empty render method…

thanks for the quick answers, at least it is clear it is not built in yet.

On Thursday, November 9, 2017 at 5:48:40 PM UTC+1, Eugene Pakhomov wrote:

It’s actually not that simple - more details can be found here: https://github.com/bokeh/bokeh/issues/3349

Personally, I’m using a dummy model that has an empty render method.

On Thursday, November 9, 2017 at 11:44:41 PM UTC+7, chupach wrote:

Struggling so much with a simple thing:

To explicitly tell js to be aware of a cds (to access the data), without attaching it to a callback or other model in a layout, etc.

I cannot find a way: declaring a cds in python does not mean it will make it into the document.

Is there a way to achieve this simple thing ??? (besides using a dummy model attached to the cds)

I am sure there must be a way.

thanks !!!

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/94601fab-38d8-4d8f-8f93-158e8622e2bf%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/F4AA2E37-B2A5-415B-AB19-86298457CED4%40anaconda.com.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.


You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CAMBZu17DBkgHFNn%3DW%3DMSJKtWOmAQfFOBYOrhgY%2BfNUUUqLXQzA%40mail.gmail.com.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.

from bokeh.io import curdoc
from bokeh.models import ColumnDataSource, Button

def test():
mysource = curdoc().select_one({“name”:“mysource”})
print mysource.data

button = Button(label=‘test’)
button.on_click(test)

mysource = ColumnDataSource(data={“a”:,“b”:},name=“mysource”)

curdoc().add_root(button)
curdoc().add_root(mysource)

``

Like this you still can’t find the data source in the console, but you can select it by name in a python callback without it being “attached” to another model.

that is somehow interesting that the cds is in the curdoc.
I don’t exactly see the practical use of it, as one has access to the cds directly in python ?

···

On Friday, November 10, 2017 at 3:57:32 PM UTC+1, Sébastien Roche wrote:

from bokeh.io import curdoc
from bokeh.models import ColumnDataSource, Button

def test():
mysource = curdoc().select_one({“name”:“mysource”})
print mysource.data

button = Button(label=‘test’)
button.on_click(test)

mysource = ColumnDataSource(data={“a”:,“b”:},name=“mysource”)

curdoc().add_root(button)
curdoc().add_root(mysource)

``

Like this you still can’t find the data source in the console, but you can select it by name in a python callback without it being “attached” to another model.

What use would you have for a columndatasource in a document if no model is making use of it?

With a folder app and custom templates it’s possible to pass any nested dictionary to the “js side” from the python code

You can also do that for standalone documents but it is more like a trick than an intended feature.

Hi Sébastien,

You can use a ColumnDataSource as a data source for something not related to Bokeh. For example, I’ve embedded a Bokeh application into a service with UI written in React. And I use ColumnDataSource to pass data between Bokeh server and React widgets.

Regarding nested dictionaries - the won’t sync by themselves, will they?

Regarding your example on “add_root(mysource)” - check out this line https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/embed.coffee#L45

It will fail upon rendering for CDS. At least I don’t know any straightforward way to add CDS as a root and embed a document without it trying to render the CDS.

Hi chupach,

Take a look at this snippet - it’s the dummy view that I use for the aforementioned React application.

 1 from bokeh.core.properties import Instance, List
 2 from bokeh.model import Model
 3 from bokeh.models import ColumnDataSource
 4 5 6 class DataSourceRoot(Model):
 7     sources = List(Instance(ColumnDataSource))
 8 9     __implementation__ = """
10     import {DOMView} from "core/dom_view"
11     import {Model} from "model"
12     import * as p from "core/properties"
13     export class DataSourceRootView extends DOMView
14       renderTo: (element, replace=false) ->
15     export class DataSourceRoot extends Model
16       type: 'DataSourceRoot'
17       default_view: DataSourceRootView
18       @define { sources: [ p.Any ] }
19     """

Regards,

Eugene

···

On Monday, November 13, 2017 at 8:51:03 PM UTC+7, Sébastien Roche wrote:

What use would you have for a columndatasource in a document if no model is making use of it?

With a folder app and custom templates it’s possible to pass any nested dictionary to the “js side” from the python code

You can also do that for standalone documents but it is more like a trick than an intended feature.

They won’t “sync” because they only end up in the JS side. And it’s not actual python dictionaries, it’s just a string of JS code that gets written in one of the scripts of the templates folder. So the initial data can be generated in the python code before the page is made, but then it can only be modified accessed in customJS callbacks. I put a link to a small app that shows it.

https://bitbucket.org/rocheseb/bokeh/src/85c5a396a3a8/applications/data_to_js

···

Le lundi 13 novembre 2017 09:03:59 UTC-5, Eugene Pakhomov a écrit :

Regarding nested dictionaries - the won’t sync by themselves, will they?

That’s exactly my point.
I may be wrong, but I have the impression that chupach needs data synchronization.

  • Eugene
···

On Monday, November 13, 2017 at 9:31:05 PM UTC+7, Sébastien Roche wrote:

They won’t “sync” because they only end up in the JS side. And it’s not actual python dictionaries, it’s just a string of JS code that gets written in one of the scripts of the templates folder. So the initial data can be generated in the python code before the page is made, but then it can only be modified accessed in customJS callbacks. I put a link to a small app that shows it.

https://bitbucket.org/rocheseb/bokeh/src/85c5a396a3a8/applications/data_to_js

Le lundi 13 novembre 2017 09:03:59 UTC-5, Eugene Pakhomov a écrit :

Regarding nested dictionaries - the won’t sync by themselves, will they?

Thx Sébastien & Eugene for all the insights and for the snippet. These are useful.

i have rather large datasources which, once defined, will let’s say not often change (naturally synced).

My two cases:

  1. A source attached to a plot. The user changing tab means pointing to a different cds, the plot object remains the same.

We don’t want to update the cds with the full sync client-server machinery, but rather the cds to point to a different cds already in the js side.

For comfort/speed of use, avoid copying/syncing, everything already ready for use in the browser.

  1. A js callback use one of the cds (which corresponds to a given “tab”). Of course one can pass all the cds to the callback and have the js callback decide which one to use (and that may be what i will end up doing). I prefer to have a master cds pointing to one of them (irrelevant in the python side). —> Back to case 1.

Best,

···

On Monday, November 13, 2017 at 3:33:34 PM UTC+1, Eugene Pakhomov wrote:

That’s exactly my point.
I may be wrong, but I have the impression that chupach needs data synchronization.

  • Eugene

On Monday, November 13, 2017 at 9:31:05 PM UTC+7, Sébastien Roche wrote:

They won’t “sync” because they only end up in the JS side. And it’s not actual python dictionaries, it’s just a string of JS code that gets written in one of the scripts of the templates folder. So the initial data can be generated in the python code before the page is made, but then it can only be modified accessed in customJS callbacks. I put a link to a small app that shows it.

https://bitbucket.org/rocheseb/bokeh/src/85c5a396a3a8/applications/data_to_js

Le lundi 13 novembre 2017 09:03:59 UTC-5, Eugene Pakhomov a écrit :

Regarding nested dictionaries - the won’t sync by themselves, will they?

Regarding the first case, you can just add two glyphs and switch “visible” property: https://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#visible-property
No need to juggle data sources.

Regarding the second case, it depends on what you mean by “tabs”. If it’s just a set of buttons that switch between different sources for the same plot, they can just toggle “visible” property of the corresponding glyphs.

  • Eugene
···

On Tuesday, November 14, 2017 at 12:12:30 AM UTC+7, chupach wrote:

Thx Sébastien & Eugene for all the insights and for the snippet. These are useful.

i have rather large datasources which, once defined, will let’s say not often change (naturally synced).

My two cases:

  1. A source attached to a plot. The user changing tab means pointing to a different cds, the plot object remains the same.

We don’t want to update the cds with the full sync client-server machinery, but rather the cds to point to a different cds already in the js side.

For comfort/speed of use, avoid copying/syncing, everything already ready for use in the browser.

  1. A js callback use one of the cds (which corresponds to a given “tab”). Of course one can pass all the cds to the callback and have the js callback decide which one to use (and that may be what i will end up doing). I prefer to have a master cds pointing to one of them (irrelevant in the python side). —> Back to case 1.

Best,

On Monday, November 13, 2017 at 3:33:34 PM UTC+1, Eugene Pakhomov wrote:

That’s exactly my point.
I may be wrong, but I have the impression that chupach needs data synchronization.

  • Eugene

On Monday, November 13, 2017 at 9:31:05 PM UTC+7, Sébastien Roche wrote:

They won’t “sync” because they only end up in the JS side. And it’s not actual python dictionaries, it’s just a string of JS code that gets written in one of the scripts of the templates folder. So the initial data can be generated in the python code before the page is made, but then it can only be modified accessed in customJS callbacks. I put a link to a small app that shows it.

https://bitbucket.org/rocheseb/bokeh/src/85c5a396a3a8/applications/data_to_js

Le lundi 13 novembre 2017 09:03:59 UTC-5, Eugene Pakhomov a écrit :

Regarding nested dictionaries - the won’t sync by themselves, will they?

hello Eugene,

Thanks a lot for the suggestion.

Not only 2 tabs… many (and actually several figures).

So, maybe we should worry on the rendering speed if so many glyphs are attached to the plots, when most of them ending up being inactive (visible=false) (as they belong to different tabs) ??? (but at least no more need to sync the bulk of data, besides the visible attribute). Not sure then.

Just to give an order of mag, 10 tabs with 5 figures with ~5 curves each. And about 1000 points per curve. I.e. ~50 glyphs of 1000 points per figure.

Maybe that is not that much data after all.

It looks also a bit quite poor from our software design point of view, but that is manageable, if this is the way to go (the user can interactively add/remove an arbitrary number of curves from arbitrary observables. Curves can represent the same observable from different datasets (the different tabs)).

thanks again.

···

On Monday, November 13, 2017 at 6:46:25 PM UTC+1, Eugene Pakhomov wrote:

Regarding the first case, you can just add two glyphs and switch “visible” property: https://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#visible-property
No need to juggle data sources.

Regarding the second case, it depends on what you mean by “tabs”. If it’s just a set of buttons that switch between different sources for the same plot, they can just toggle “visible” property of the corresponding glyphs.

  • Eugene

On Tuesday, November 14, 2017 at 12:12:30 AM UTC+7, chupach wrote:

Thx Sébastien & Eugene for all the insights and for the snippet. These are useful.

i have rather large datasources which, once defined, will let’s say not often change (naturally synced).

My two cases:

  1. A source attached to a plot. The user changing tab means pointing to a different cds, the plot object remains the same.

We don’t want to update the cds with the full sync client-server machinery, but rather the cds to point to a different cds already in the js side.

For comfort/speed of use, avoid copying/syncing, everything already ready for use in the browser.

  1. A js callback use one of the cds (which corresponds to a given “tab”). Of course one can pass all the cds to the callback and have the js callback decide which one to use (and that may be what i will end up doing). I prefer to have a master cds pointing to one of them (irrelevant in the python side). —> Back to case 1.

Best,

On Monday, November 13, 2017 at 3:33:34 PM UTC+1, Eugene Pakhomov wrote:

That’s exactly my point.
I may be wrong, but I have the impression that chupach needs data synchronization.

  • Eugene

On Monday, November 13, 2017 at 9:31:05 PM UTC+7, Sébastien Roche wrote:

They won’t “sync” because they only end up in the JS side. And it’s not actual python dictionaries, it’s just a string of JS code that gets written in one of the scripts of the templates folder. So the initial data can be generated in the python code before the page is made, but then it can only be modified accessed in customJS callbacks. I put a link to a small app that shows it.

https://bitbucket.org/rocheseb/bokeh/src/85c5a396a3a8/applications/data_to_js

Le lundi 13 novembre 2017 09:03:59 UTC-5, Eugene Pakhomov a écrit :

Regarding nested dictionaries - the won’t sync by themselves, will they?

Hello Sébastien,

that is very nice. I did not know about it.

Not only to pass data but also to define functions when the app starts.

For me was not clear that could be that simple.

Thanks for this.

···

On Monday, November 13, 2017 at 3:31:05 PM UTC+1, Sébastien Roche wrote:

They won’t “sync” because they only end up in the JS side. And it’s not actual python dictionaries, it’s just a string of JS code that gets written in one of the scripts of the templates folder. So the initial data can be generated in the python code before the page is made, but then it can only be modified accessed in customJS callbacks. I put a link to a small app that shows it.

https://bitbucket.org/rocheseb/bokeh/src/85c5a396a3a8/applications/data_to_js

Le lundi 13 novembre 2017 09:03:59 UTC-5, Eugene Pakhomov a écrit :

Regarding nested dictionaries - the won’t sync by themselves, will they?