arrow group

subplot_dict[‘arrow_start_y’] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]

subplot_dict[‘arrow_end_y’] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]

subplot_source = ColumnDataSource(data=subplot_dict)

subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode=‘scale_width’)

subplot_height = 50

subplot_weight = 190

subplot.add_layout(Arrow(end=NormalHead(line_color=“B2SArrowColors”, line_width=4),

x_start=‘arrow_start_x’, y_start=10, x_end=‘arrow_end_x’, y_end=10, line_width=15, source=subplot_source))

``

I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot

the code below may not work, is it possible to associate source with arrow?

from random import randrange
from bokeh.io import curdoc
from bokeh.plotting import figure
from bokeh.layouts import layout
from bokeh.models import ColumnDataSource, Arrow, NormalHead

plot = figure()
source = ColumnDataSource(data={'x0': [], 'y0': [], 'x1': [], 'y1': []})
# if the plot only contains annotations it screws up range and scrolling
plot.circle(x=0, y=0)
plot.add_layout(
        Arrow(end=NormalHead(), x_start='x0', y_start='y0', x_end='x1',
        y_end='y1', source=source))

``

···

On Thursday, June 14, 2018 at 3:44:11 PM UTC-6, peng wang wrote:

subplot_dict[‘arrow_start_y’] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]

subplot_dict[‘arrow_end_y’] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]

subplot_source = ColumnDataSource(data=subplot_dict)

subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode=‘scale_width’)

subplot_height = 50

subplot_weight = 190

subplot.add_layout(Arrow(end=NormalHead(line_color=“B2SArrowColors”, line_width=4),

x_start=‘arrow_start_x’, y_start=10, x_end=‘arrow_end_x’, y_end=10, line_width=15, source=subplot_source))

``

I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot

Does it mean we can not customize arrowHead color?

welcome any comments. Thanks a lot

···

On Thursday, June 14, 2018 at 3:54:07 PM UTC-6, peng wang wrote:

the code below may not work, is it possible to associate source with arrow?

from random import randrange
from bokeh.io import curdoc
from bokeh.plotting import figure
from bokeh.layouts import layout
from bokeh.models import ColumnDataSource, Arrow, NormalHead

plot = figure()
source = ColumnDataSource(data={'x0': [], 'y0': [], 'x1': [], 'y1': []})
# if the plot only contains annotations it screws up range and scrolling
plot.circle(x=0, y=0)
plot.add_layout(
        Arrow(end=NormalHead(), x_start='x0', y_start='y0', x_end='x1',
        y_end='y1', source=source))

``

On Thursday, June 14, 2018 at 3:44:11 PM UTC-6, peng wang wrote:

subplot_dict[‘arrow_start_y’] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]

subplot_dict[‘arrow_end_y’] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]

subplot_source = ColumnDataSource(data=subplot_dict)

subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode=‘scale_width’)

subplot_height = 50

subplot_weight = 190

subplot.add_layout(Arrow(end=NormalHead(line_color=“B2SArrowColors”, line_width=4),

x_start=‘arrow_start_x’, y_start=10, x_end=‘arrow_end_x’, y_end=10, line_width=15, source=subplot_source))

``

I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot

I already know what the reason is , because of NormalHead(line_color=“B2SArrowColors”)

Arrows are not "vectorizable" like glyphs. They only draw one Arrow (with up to two ArrowHeads) at a time. You can set the colors to individual color constants, like "red" or "#ee64ff". The do not use column names.

Thanks,

Bryan

···

On Jun 14, 2018, at 15:52, peng wang <[email protected]> wrote:

I already know what the reason is , because of NormalHead(line_color="B2SArrowColors")

Does it mean we can not customize arrowHead color?

welcome any comments. Thanks a lot

On Thursday, June 14, 2018 at 3:54:07 PM UTC-6, peng wang wrote:
the code below may not work, is it possible to associate source with arrow?

from random import randrange
from bokeh.io import curdoc
from bokeh.plotting import figure
from bokeh.layouts import layout
from bokeh.models import ColumnDataSource, Arrow, NormalHead

plot = figure()
source = ColumnDataSource(data={'x0': , 'y0': , 'x1': , 'y1': })
# if the plot only contains annotations it screws up range and scrolling
plot.circle(x=0, y=0)
plot.add_layout(
        Arrow(end=NormalHead(), x_start='x0', y_start='y0', x_end='x1',
        y_end='y1', source=source))

On Thursday, June 14, 2018 at 3:44:11 PM UTC-6, peng wang wrote:
    subplot_dict['arrow_start_y'] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]
    subplot_dict['arrow_end_y'] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]

    subplot_source = ColumnDataSource(data=subplot_dict)
    subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode='scale_width')
    subplot_height = 50
    subplot_weight = 190
    subplot.add_layout(Arrow(end=NormalHead(line_color="B2SArrowColors", line_width=4),
               x_start='arrow_start_x', y_start=10, x_end='arrow_end_x', y_end=10, line_width=15, source=subplot_source))
    
I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot

--
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/8c9efe56-0add-4306-ac29-ba95a80a5f26%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Bryan. Does it mean I can not change the color by updating source in CustomJS?

···

On Friday, June 15, 2018 at 9:18:48 AM UTC-6, Bryan Van de ven wrote:

Arrows are not “vectorizable” like glyphs. They only draw one Arrow (with up to two ArrowHeads) at a time. You can set the colors to individual color constants, like “red” or “#ee64ff”. The do not use column names.

Thanks,

Bryan

On Jun 14, 2018, at 15:52, peng wang [email protected] wrote:

I already know what the reason is , because of NormalHead(line_color=“B2SArrowColors”)

Does it mean we can not customize arrowHead color?

welcome any comments. Thanks a lot

On Thursday, June 14, 2018 at 3:54:07 PM UTC-6, peng wang wrote:

the code below may not work, is it possible to associate source with arrow?

from random import randrange

from bokeh.io import curdoc

from bokeh.plotting import figure

from bokeh.layouts import layout

from bokeh.models import ColumnDataSource, Arrow, NormalHead

plot = figure()

source = ColumnDataSource(data={‘x0’: , ‘y0’: , ‘x1’: , ‘y1’: })

if the plot only contains annotations it screws up range and scrolling

plot.circle(x=0, y=0)

plot.add_layout(

    Arrow(end=NormalHead(), x_start='x0', y_start='y0', x_end='x1',
    y_end='y1', source=source))

On Thursday, June 14, 2018 at 3:44:11 PM UTC-6, peng wang wrote:

subplot_dict['arrow_start_y'] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]
subplot_dict['arrow_end_y'] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]
subplot_source = ColumnDataSource(data=subplot_dict)
subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode='scale_width')
subplot_height = 50
subplot_weight = 190
subplot.add_layout(Arrow(end=NormalHead(line_color="B2SArrowColors", line_width=4),
           x_start='arrow_start_x', y_start=10, x_end='arrow_end_x', y_end=10, line_width=15, source=subplot_source))

I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot


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/8c9efe56-0add-4306-ac29-ba95a80a5f26%40continuum.io.

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

Hi,

Not by updating any data source, no. You can update the arrow head's line_color property with a color value from CustomJS.

Thanks,

Bryan

···

On Jun 15, 2018, at 08:21, peng wang <[email protected]> wrote:

Thanks Bryan. Does it mean I can not change the color by updating source in CustomJS?

On Friday, June 15, 2018 at 9:18:48 AM UTC-6, Bryan Van de ven wrote:
Arrows are not "vectorizable" like glyphs. They only draw one Arrow (with up to two ArrowHeads) at a time. You can set the colors to individual color constants, like "red" or "#ee64ff". The do not use column names.

Thanks,

Bryan

> On Jun 14, 2018, at 15:52, peng wang <[email protected]> wrote:
>
> I already know what the reason is , because of NormalHead(line_color="B2SArrowColors")
>
> Does it mean we can not customize arrowHead color?
>
>
> welcome any comments. Thanks a lot
>
> On Thursday, June 14, 2018 at 3:54:07 PM UTC-6, peng wang wrote:
> the code below may not work, is it possible to associate source with arrow?
>
> from random import randrange
> from bokeh.io import curdoc
> from bokeh.plotting import figure
> from bokeh.layouts import layout
> from bokeh.models import ColumnDataSource, Arrow, NormalHead
>
> plot = figure()
> source = ColumnDataSource(data={'x0': , 'y0': , 'x1': , 'y1': })
> # if the plot only contains annotations it screws up range and scrolling
> plot.circle(x=0, y=0)
> plot.add_layout(
> Arrow(end=NormalHead(), x_start='x0', y_start='y0', x_end='x1',
> y_end='y1', source=source))
>
>
>
>
> On Thursday, June 14, 2018 at 3:44:11 PM UTC-6, peng wang wrote:
> subplot_dict['arrow_start_y'] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]
> subplot_dict['arrow_end_y'] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]
>
> subplot_source = ColumnDataSource(data=subplot_dict)
> subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode='scale_width')
> subplot_height = 50
> subplot_weight = 190
> subplot.add_layout(Arrow(end=NormalHead(line_color="B2SArrowColors", line_width=4),
> x_start='arrow_start_x', y_start=10, x_end='arrow_end_x', y_end=10, line_width=15, source=subplot_source))
>
>
>
>
>
>
> I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot
>
> --
> 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/8c9efe56-0add-4306-ac29-ba95a80a5f26%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/af975ea8-3b63-4dea-af5f-87b378b4dd2e%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

you bet, thanks a lot

···

On Friday, June 15, 2018 at 9:29:01 AM UTC-6, Bryan Van de ven wrote:

Hi,

Not by updating any data source, no. You can update the arrow head’s line_color property with a color value from CustomJS.

Thanks,

Bryan

On Jun 15, 2018, at 08:21, peng wang [email protected] wrote:

Thanks Bryan. Does it mean I can not change the color by updating source in CustomJS?

On Friday, June 15, 2018 at 9:18:48 AM UTC-6, Bryan Van de ven wrote:

Arrows are not “vectorizable” like glyphs. They only draw one Arrow (with up to two ArrowHeads) at a time. You can set the colors to individual color constants, like “red” or “#ee64ff”. The do not use column names.

Thanks,

Bryan

On Jun 14, 2018, at 15:52, peng wang [email protected] wrote:

I already know what the reason is , because of NormalHead(line_color=“B2SArrowColors”)

Does it mean we can not customize arrowHead color?

welcome any comments. Thanks a lot

On Thursday, June 14, 2018 at 3:54:07 PM UTC-6, peng wang wrote:
the code below may not work, is it possible to associate source with arrow?

from random import randrange
from bokeh.io import curdoc
from bokeh.plotting import figure
from bokeh.layouts import layout
from bokeh.models import ColumnDataSource, Arrow, NormalHead

plot = figure()
source = ColumnDataSource(data={‘x0’: , ‘y0’: , ‘x1’: , ‘y1’: })

if the plot only contains annotations it screws up range and scrolling

plot.circle(x=0, y=0)
plot.add_layout(
Arrow(end=NormalHead(), x_start=‘x0’, y_start=‘y0’, x_end=‘x1’,
y_end=‘y1’, source=source))

On Thursday, June 14, 2018 at 3:44:11 PM UTC-6, peng wang wrote:
subplot_dict[‘arrow_start_y’] = [10, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 15]
subplot_dict[‘arrow_end_y’] = [20, 20, 20, 20, 20, 20, 25, 25, 25, 25, 25, 25]

subplot_source = ColumnDataSource(data=subplot_dict)
subplot = figure(x_range = [0, 80], y_range = [0, 30], plot_width=100, plot_height=50, toolbar_location=None, sizing_mode='scale_width')
subplot_height = 50
subplot_weight = 190
subplot.add_layout(Arrow(end=NormalHead(line_color="B2SArrowColors", line_width=4),
           x_start='arrow_start_x', y_start=10, x_end='arrow_end_x', y_end=10, line_width=15, source=subplot_source))

I like to create a group of arrows based on source, but if I run code above, only one arrow is displayed. any comments? thanks a lot


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/8c9efe56-0add-4306-ac29-ba95a80a5f26%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/af975ea8-3b63-4dea-af5f-87b378b4dd2e%40continuum.io.

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