Exemplo n.º 1
0
def test_AnnularWedge():
    glyph = AnnularWedge()
    assert glyph.x == "x"
    assert glyph.y == "y"
    assert glyph.inner_radius == None
    assert glyph.outer_radius == None
    assert glyph.start_angle == "start_angle"
    assert glyph.end_angle == "end_angle"
    assert glyph.direction == "clock"
    yield check_fill, glyph
    yield check_line, glyph
    yield check_props, glyph, [
        "x", "y", "inner_radius", "outer_radius", "start_angle", "end_angle",
        "direction"
    ], FILL, LINE
Exemplo n.º 2
0
 def setUp(self):
     from bokeh.glyphs import AnnularWedge
     self.test_annular_wedge = AnnularWedge()
Exemplo n.º 3
0
    ))

xdr = DataRange1d(sources=[source.columns("x")])
ydr = DataRange1d(sources=[source.columns("y")])


def screen(value):
    return dict(value=value, units="screen")


glyphs = [
    ("annular_wedge",
     AnnularWedge(x="x",
                  y="y",
                  inner_radius=screen(10),
                  outer_radius=screen(20),
                  start_angle=0.6,
                  end_angle=4.1,
                  fill_color="#8888ee")),
    ("annulus",
     Annulus(x="x",
             y="y",
             inner_radius=screen(10),
             outer_radius=screen(20),
             fill_color="#7FC97F")),
    ("arc",
     Arc(x="x",
         y="y",
         radius=screen(20),
         start_angle=0.6,
         end_angle=4.1,
Exemplo n.º 4
0
    end = angles.tolist() + [end_angle]
    start = [start_angle] + end[:-1]
    base_color = colors[browser]
    fill = [base_color.lighten(i * 0.05) for i in range(len(versions) + 1)]
    text = [
        number if share >= 1 else ""
        for number, share in zip(versions.VersionNumber, versions.Share)
    ]
    x, y = polar_to_cartesian(1.25, start, end)

    source = ColumnDataSource(dict(start=start, end=end, fill=fill))
    glyph = AnnularWedge(x=0,
                         y=0,
                         inner_radius=1,
                         outer_radius=1.5,
                         start_angle="start",
                         end_angle="end",
                         line_color="white",
                         line_width=2,
                         fill_color="fill")
    plot.add_glyph(source, glyph)

    text_angle = [(start[i] + end[i]) / 2 for i in range(len(start))]
    text_angle = [
        angle + pi if pi / 2 < angle < 3 * pi / 2 else angle
        for angle in text_angle
    ]

    if first and text:
        text.insert(0, '(version)')
        offset = pi / 48