one-to-many brushing and linking

Hi all,

I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you’d brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.

I have tried to use subarrays in the ColumnDataSource, but to no avail… So this does not work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):

source = ColumnDataSource({

departure_longitudes = [1,2],

departure_latitutes = [3,4],

arrival_longitudes = [[5,6],[7,8,9]],

arrival_latitudes = [[1,2],[3,4,5]]

})

Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:

Thank you,

jan.

Hi Jan,

This is a really awesome feature idea, and I would love it if you could submit and describe it in a Github issue on the Bokeh issue tracker:

  https://github.com/bokeh/bokeh/issues

Unfortunately, I would describe this as currently beyond the capability of Bokeh, at least without adding some custom JavaScript code into the mix. I do think that finding some way to spell and express this kind of linkage should eventually not require the user to add and JS code, so that is why I would like to see the feature request on GH. However, I should note that "adding custom JavaScript" is actually something that is about to get easier in the near future, so perhaps this will not be so bad as a stopgap. If you are still interested in pursuing this use case, even with needing the JS component, let me know and I can try to provide more detailed guidance.

Thanks,

Bryan

···

On Mar 3, 2015, at 2:01 AM, [email protected] wrote:

Hi all,

I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you'd brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.

I have tried to use subarrays in the ColumnDataSource, but to no avail... So this does *not* work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):

<pre>
source = ColumnDataSource({
  departure_longitudes = [1,2],
  departure_latitutes = [3,4],
  arrival_longitudes = [[5,6],[7,8,9]],
  arrival_latitudes = [[1,2],[3,4,5]]
})
</pre>

Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:

Thank you,
jan.

--
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/1c7322d1-3d70-4b4e-a147-b4b243a3b002%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan,

Thanks for your reply. I’ve created a new issue: https://github.com/bokeh/bokeh/issues/2012 => flatten the arrays?

For me it would be OK to write some custom javascript if necessary, but I was actually looking into bokeh for teaching purposes (to switch away from Processing). I’m teaching data visualization at different courses, and for the students (who don’t necessarily know programming) it would be much too difficult to have to resort to javascript for this, I’m afraid. So for the moment I’ll have to stick with Processing… :frowning:

jan.

···

On Tuesday, 3 March 2015 16:50:25 UTC+1, Bryan Van de ven wrote:

Hi Jan,

This is a really awesome feature idea, and I would love it if you could submit and describe it in a Github issue on the Bokeh issue tracker:

    [https://github.com/bokeh/bokeh/issues](https://github.com/bokeh/bokeh/issues)

Unfortunately, I would describe this as currently beyond the capability of Bokeh, at least without adding some custom JavaScript code into the mix. I do think that finding some way to spell and express this kind of linkage should eventually not require the user to add and JS code, so that is why I would like to see the feature request on GH. However, I should note that “adding custom JavaScript” is actually something that is about to get easier in the near future, so perhaps this will not be so bad as a stopgap. If you are still interested in pursuing this use case, even with needing the JS component, let me know and I can try to provide more detailed guidance.

Thanks,

Bryan

On Mar 3, 2015, at 2:01 AM, jan.[email protected] wrote:

Hi all,

I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you’d brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.

I have tried to use subarrays in the ColumnDataSource, but to no avail… So this does not work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):


source = ColumnDataSource({

departure_longitudes = [1,2],

departure_latitutes = [3,4],

arrival_longitudes = [[5,6],[7,8,9]],

arrival_latitudes = [[1,2],[3,4,5]]

})

Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:

Thank you,

jan.


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/1c7322d1-3d70-4b4e-a147-b4b243a3b002%40continuum.io.

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

So,

Peter Wang just reminded me that this would actually be possible to do current, as a Bokeh server side app. That requires using a bokeh-server, but writing server apps is something else we are in the process now of making much simpler. Basically you would respond to the selection one data source, and use that event to set a new selection on the other data sources. Then the other glyphs would highlight appropriately. I would be happy to help provide guidance on this sort of example as well.

Bryan

···

On Mar 3, 2015, at 10:11 AM, Jan Aerts <[email protected]> wrote:

Hi Bryan,

Thanks for your reply. I've created a new issue: https://github.com/bokeh/bokeh/issues/2012 => flatten the arrays?

For me it would be OK to write some custom javascript if necessary, but I was actually looking into bokeh for teaching purposes (to switch away from Processing). I'm teaching data visualization at different courses, and for the students (who don't necessarily know programming) it would be much too difficult to have to resort to javascript for this, I'm afraid. So for the moment I'll have to stick with Processing... :frowning:

jan.

On Tuesday, 3 March 2015 16:50:25 UTC+1, Bryan Van de ven wrote:

Hi Jan,

This is a really awesome feature idea, and I would love it if you could submit and describe it in a Github issue on the Bokeh issue tracker:

        https://github.com/bokeh/bokeh/issues

Unfortunately, I would describe this as currently beyond the capability of Bokeh, at least without adding some custom JavaScript code into the mix. I do think that finding some way to spell and express this kind of linkage should eventually not require the user to add and JS code, so that is why I would like to see the feature request on GH. However, I should note that "adding custom JavaScript" is actually something that is about to get easier in the near future, so perhaps this will not be so bad as a stopgap. If you are still interested in pursuing this use case, even with needing the JS component, let me know and I can try to provide more detailed guidance.

Thanks,

Bryan

> On Mar 3, 2015, at 2:01 AM, [email protected] wrote:
>
> Hi all,
>
> I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you'd brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.
>
> I have tried to use subarrays in the ColumnDataSource, but to no avail... So this does *not* work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):
>
> <pre>
> source = ColumnDataSource({
> departure_longitudes = [1,2],
> departure_latitutes = [3,4],
> arrival_longitudes = [[5,6],[7,8,9]],
> arrival_latitudes = [[1,2],[3,4,5]]
> })
> </pre>
>
> Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:
>
> Thank you,
> jan.
>
> --
> 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/1c7322d1-3d70-4b4e-a147-b4b243a3b002%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/73b5e8a2-bd9a-495b-9442-d47224637344%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

That’s great! Is there a simple tutorial available for that? Or could you provide me a code example? Here’s a short snippet of the flight data example I mentioned before which could help to make it more concrete.

#from_airport,from_long,from_lat,to_airport,to_long,to_lat

Balandino,61.838,55.509,Domododevo,38.51,55.681

Balandino,61.838,55.509,Kazan,49.464,56.01

Balandino,61.838,55.509,Tolmachevo,83.084,55.021

Domododevo,38.51,55.681,Balandino,61.838,55.509

Domododevo,38.51,55.681,Khrabrovo,20.987,55.483

Domododevo,38.51,55.681,Kazan,49.464,56.01

Domododevo,38.51,55.681,Beaufort Mcas,-80.539,32.795

Domododevo,38.51,55.681,Penza Airport,45.035,53.184

Domododevo,38.51,55.681,Bugulma Airport,53.336,55.066

j.

···

On 3 March 2015 at 17:23, Bryan Van de Ven [email protected] wrote:

So,

Peter Wang just reminded me that this would actually be possible to do current, as a Bokeh server side app. That requires using a bokeh-server, but writing server apps is something else we are in the process now of making much simpler. Basically you would respond to the selection one data source, and use that event to set a new selection on the other data sources. Then the other glyphs would highlight appropriately. I would be happy to help provide guidance on this sort of example as well.

Bryan

On Mar 3, 2015, at 10:11 AM, Jan Aerts [email protected] wrote:

Hi Bryan,

Thanks for your reply. I’ve created a new issue: https://github.com/bokeh/bokeh/issues/2012 => flatten the arrays?

For me it would be OK to write some custom javascript if necessary, but I was actually looking into bokeh for teaching purposes (to switch away from Processing). I’m teaching data visualization at different courses, and for the students (who don’t necessarily know programming) it would be much too difficult to have to resort to javascript for this, I’m afraid. So for the moment I’ll have to stick with Processing… :frowning:

jan.

On Tuesday, 3 March 2015 16:50:25 UTC+1, Bryan Van de ven wrote:

Hi Jan,

This is a really awesome feature idea, and I would love it if you could submit and describe it in a Github issue on the Bokeh issue tracker:

    [https://github.com/bokeh/bokeh/issues](https://github.com/bokeh/bokeh/issues)

Unfortunately, I would describe this as currently beyond the capability of Bokeh, at least without adding some custom JavaScript code into the mix. I do think that finding some way to spell and express this kind of linkage should eventually not require the user to add and JS code, so that is why I would like to see the feature request on GH. However, I should note that “adding custom JavaScript” is actually something that is about to get easier in the near future, so perhaps this will not be so bad as a stopgap. If you are still interested in pursuing this use case, even with needing the JS component, let me know and I can try to provide more detailed guidance.

Thanks,

Bryan

On Mar 3, 2015, at 2:01 AM, [email protected] wrote:

Hi all,

I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you’d brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.

I have tried to use subarrays in the ColumnDataSource, but to no avail… So this does not work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):


source = ColumnDataSource({

departure_longitudes = [1,2],

departure_latitutes = [3,4],

arrival_longitudes = [[5,6],[7,8,9]],

arrival_latitudes = [[1,2],[3,4,5]]

})

Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:

Thank you,

jan.

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/1c7322d1-3d70-4b4e-a147-b4b243a3b002%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/73b5e8a2-bd9a-495b-9442-d47224637344%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/8AF1571B-5F29-4598-8DCE-337009F7C266%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

================================================
Prof Jan Aerts

KU Leuven - University of Leuven
Kasteelpark Arenberg 10 bus 2446
3001 Leuven-Heverlee

ORCID: http://orcid.org/0000-0002-6416-2717
Tel: +32 16 321053
Fax: +32 16 321970

VAT BE 0419 052173

Hi Bryan,

Would it be possible to provide me with a little example?

Thx,

j.

···

On Tuesday, 3 March 2015 17:23:36 UTC+1, Bryan Van de ven wrote:

So,

Peter Wang just reminded me that this would actually be possible to do current, as a Bokeh server side app. That requires using a bokeh-server, but writing server apps is something else we are in the process now of making much simpler. Basically you would respond to the selection one data source, and use that event to set a new selection on the other data sources. Then the other glyphs would highlight appropriately. I would be happy to help provide guidance on this sort of example as well.

Bryan

On Mar 3, 2015, at 10:11 AM, Jan Aerts [email protected] wrote:

Hi Bryan,

Thanks for your reply. I’ve created a new issue: https://github.com/bokeh/bokeh/issues/2012 => flatten the arrays?

For me it would be OK to write some custom javascript if necessary, but I was actually looking into bokeh for teaching purposes (to switch away from Processing). I’m teaching data visualization at different courses, and for the students (who don’t necessarily know programming) it would be much too difficult to have to resort to javascript for this, I’m afraid. So for the moment I’ll have to stick with Processing… :frowning:

jan.

On Tuesday, 3 March 2015 16:50:25 UTC+1, Bryan Van de ven wrote:

Hi Jan,

This is a really awesome feature idea, and I would love it if you could submit and describe it in a Github issue on the Bokeh issue tracker:

    [https://github.com/bokeh/bokeh/issues](https://github.com/bokeh/bokeh/issues)

Unfortunately, I would describe this as currently beyond the capability of Bokeh, at least without adding some custom JavaScript code into the mix. I do think that finding some way to spell and express this kind of linkage should eventually not require the user to add and JS code, so that is why I would like to see the feature request on GH. However, I should note that “adding custom JavaScript” is actually something that is about to get easier in the near future, so perhaps this will not be so bad as a stopgap. If you are still interested in pursuing this use case, even with needing the JS component, let me know and I can try to provide more detailed guidance.

Thanks,

Bryan

On Mar 3, 2015, at 2:01 AM, [email protected] wrote:

Hi all,

I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you’d brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.

I have tried to use subarrays in the ColumnDataSource, but to no avail… So this does not work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):

source = ColumnDataSource({
  departure_longitudes = [1,2],
  departure_latitutes = [3,4],
  arrival_longitudes = [[5,6],[7,8,9]],
  arrival_latitudes = [[1,2],[3,4,5]]
})

Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:

Thank you,
jan.


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/1c7322d1-3d70-4b4e-a147-b4b243a3b002%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/73b5e8a2-bd9a-495b-9442-d47224637344%40continuum.io.

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

Hi Jan,

I’ll try to cook a meaningful related example in the next days.

Fabio

···

On Wednesday, March 11, 2015 at 4:06:48 PM UTC+1, Jan Aerts wrote:

Hi Bryan,

Would it be possible to provide me with a little example?

Thx,

j.

Hi Jan,

I’ve started a PR with a small example that should be helpful for your use case. I’ll keep the PR open for a few days as I’m also working on a more complex app example with extended functionality. Please take a look… it should be already useful. :slight_smile:

Cheers

Fabio

···

On Wednesday, March 11, 2015 at 4:06:48 PM UTC+1, Jan Aerts wrote:

Hi Bryan,

Would it be possible to provide me with a little example?

Thx,

j.

On Tuesday, 3 March 2015 17:23:36 UTC+1, Bryan Van de ven wrote:

So,

Peter Wang just reminded me that this would actually be possible to do current, as a Bokeh server side app. That requires using a bokeh-server, but writing server apps is something else we are in the process now of making much simpler. Basically you would respond to the selection one data source, and use that event to set a new selection on the other data sources. Then the other glyphs would highlight appropriately. I would be happy to help provide guidance on this sort of example as well.

Bryan

On Mar 3, 2015, at 10:11 AM, Jan Aerts [email protected] wrote:

Hi Bryan,

Thanks for your reply. I’ve created a new issue: https://github.com/bokeh/bokeh/issues/2012 => flatten the arrays?

For me it would be OK to write some custom javascript if necessary, but I was actually looking into bokeh for teaching purposes (to switch away from Processing). I’m teaching data visualization at different courses, and for the students (who don’t necessarily know programming) it would be much too difficult to have to resort to javascript for this, I’m afraid. So for the moment I’ll have to stick with Processing… :frowning:

jan.

On Tuesday, 3 March 2015 16:50:25 UTC+1, Bryan Van de ven wrote:

Hi Jan,

This is a really awesome feature idea, and I would love it if you could submit and describe it in a Github issue on the Bokeh issue tracker:

    [https://github.com/bokeh/bokeh/issues](https://github.com/bokeh/bokeh/issues)

Unfortunately, I would describe this as currently beyond the capability of Bokeh, at least without adding some custom JavaScript code into the mix. I do think that finding some way to spell and express this kind of linkage should eventually not require the user to add and JS code, so that is why I would like to see the feature request on GH. However, I should note that “adding custom JavaScript” is actually something that is about to get easier in the near future, so perhaps this will not be so bad as a stopgap. If you are still interested in pursuing this use case, even with needing the JS component, let me know and I can try to provide more detailed guidance.

Thanks,

Bryan

On Mar 3, 2015, at 2:01 AM, [email protected] wrote:

Hi all,

I have a question regarding brushing and linking where there exists a one-to-many relationship between the two plots. Imagine having 2 plots: one with geo-locations of departure airports, and one with geo-locations of arrival airports (see script 17 at http://vda-lab.be/blog/hands-on-data-visualization-using-processing for the exact script I want to convert to python). If you’d brush some departure airports, then all their arrival airports should be highlighted in the other plot as well. The problem is that there are more than one arrival airport per departure airport, resulting in different lengths of arrays in the ColumnDataSource.

I have tried to use subarrays in the ColumnDataSource, but to no avail… So this does not work (given 2 departure airports; the first having 2 arrival airports, and the second having 3):

source = ColumnDataSource({
  departure_longitudes = [1,2],
  departure_latitutes = [3,4],
  arrival_longitudes = [[5,6],[7,8,9]],
  arrival_latitudes = [[1,2],[3,4,5]]
})

Any help much appreciated to get one-to-many brushing-and-linking working, so that I can teach python bokeh in the future rather than Processing :slight_smile:

Thank you,
jan.


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/1c7322d1-3d70-4b4e-a147-b4b243a3b002%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/73b5e8a2-bd9a-495b-9442-d47224637344%40continuum.io.

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