☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to use selector (queries) inside BokehJS

Community Support
Meir_Tseitlin
Meir_Tseitlin

I am trying to retrieve all elements containing specific tag:

I tried the following 3 options

CustomJS(args=dict(rootDom=rootDom), code="""

 console.log(rootDom);

 //var found = rootDom.select("tags", "myColumn");
 //var found = rootDom.select({"tags", "myColumn"});
 //var found = rootDom.select({type: "tags", name: "myColumn"});

 console.log(found);

 """)

The first one works, but returns empty array. Others return exceptions “Invalid selector”.

The following code works properly on Python side:

elems = rootDom.select({"tags": 'myColumn'})

Thanks!

⌁   Link to post
Bryan
Bryan

Tags are just arbitrary metadata that can be attached for searching the Python object graph. They are not related to dom selectors

···

On Nov 18, 2016, at 08:35, Meir Tseitlin meir@imubit.com wrote:

I am trying to retrieve all elements containing specific tag:

I tried the following 3 options

CustomJS(args=dict(rootDom=rootDom), code="""

 console.log(rootDom);

 //var found = rootDom.select("tags", "myColumn");
 //var found = rootDom.select({"tags", "myColumn"});
 //var found = rootDom.select({type: "tags", name: "myColumn"});

 console.log(found);

 """)
The first one works, but returns empty array. Others return exceptions "Invalid selector".


The following code works properly on Python side:


elems = rootDom.select({“tags”: ‘myColumn’})



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 bokeh+unsubscribe@continuum.io.

To post to this group, send email to bokeh@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f36a5168-d25d-4148-a91d-ec6f116f4a7f%40continuum.io.

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

⌁   Link to post
Meir_Tseitlin
Meir_Tseitlin

This is exactly what I am willing to do - find object by arbitrary metadata, but on JS side.

Thanks

···

On Friday, November 18, 2016 at 4:32:51 PM UTC+2, Bryan Van de ven wrote:

Tags are just arbitrary metadata that can be attached for searching the Python object graph. They are not related to dom selectors

On Nov 18, 2016, at 08:35, Meir Tseitlin me...@imubit.com wrote:

I am trying to retrieve all elements containing specific tag:

I tried the following 3 options

CustomJS(args=dict(rootDom=rootDom), code="""

 console.log(rootDom);

 //var found = rootDom.select("tags", "myColumn");
 //var found = rootDom.select({"tags", "myColumn"});
 //var found = rootDom.select({type: "tags", name: "myColumn"});

 console.log(found);

 """)
The first one works, but returns empty array. Others return exceptions "Invalid selector".


The following code works properly on Python side:


elems = rootDom.select({“tags”: ‘myColumn’})



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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f36a5168-d25d-4148-a91d-ec6f116f4a7f%40continuum.io.

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

⌁   Link to post
Meir_Tseitlin
Meir_Tseitlin

I am trying to attach new classes by settings special tags on elements and than using JS to search for those tags and insert classes in tagged elements.

I am also missing a way to trigger BokehJS callback when HTML created…

···

On Friday, November 18, 2016 at 4:34:15 PM UTC+2, Meir Tseitlin wrote:

This is exactly what I am willing to do - find object by arbitrary metadata, but on JS side.

Thanks

On Friday, November 18, 2016 at 4:32:51 PM UTC+2, Bryan Van de ven wrote:

Tags are just arbitrary metadata that can be attached for searching the Python object graph. They are not related to dom selectors

On Nov 18, 2016, at 08:35, Meir Tseitlin me...@imubit.com wrote:

I am trying to retrieve all elements containing specific tag:

I tried the following 3 options

CustomJS(args=dict(rootDom=rootDom), code="""

 console.log(rootDom);

 //var found = rootDom.select("tags", "myColumn");
 //var found = rootDom.select({"tags", "myColumn"});
 //var found = rootDom.select({type: "tags", name: "myColumn"});

 console.log(found);

 """)
The first one works, but returns empty array. Others return exceptions "Invalid selector".


The following code works properly on Python side:


elems = rootDom.select({“tags”: ‘myColumn’})



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 bokeh+un...@continuum.io.

To post to this group, send email to bo...@continuum.io.

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/f36a5168-d25d-4148-a91d-ec6f116f4a7f%40continuum.io.

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

⌁   Link to post

End of archived discussion · Replies are disabled