Пример #1
0
def test_Annulus():
    glyph = Annulus()
    assert glyph.x == "x"
    assert glyph.y == "y"
    assert glyph.inner_radius == None
    assert glyph.outer_radius == None
    yield check_fill, glyph
    yield check_line, glyph
    yield check_props, glyph, ["x", "y", "inner_radius",
                               "outer_radius"], FILL, LINE
Пример #2
0
def test_Annulus() -> None:
    glyph = Annulus()
    assert glyph.x == field("x")
    assert glyph.y == field("y")
    assert glyph.inner_radius is None
    assert glyph.outer_radius is None
    check_fill_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
        "inner_radius",
        "inner_radius_units",
        "outer_radius",
        "outer_radius_units",
    ], FILL, LINE, GLYPH)
Пример #3
0
def test_Annulus():
    glyph = Annulus()
    assert glyph.x is None
    assert glyph.y is None
    assert glyph.inner_radius is None
    assert glyph.outer_radius is None
    yield check_fill_properties, glyph
    yield check_line_properties, glyph
    yield (check_properties_existence, glyph, [
        "x",
        "y",
        "inner_radius",
        "inner_radius_units",
        "outer_radius",
        "outer_radius_units",
    ], FILL, LINE, GLYPH)
Пример #4
0
def test_Annulus():
    glyph = Annulus()
    assert glyph.x is None
    assert glyph.y is None
    assert glyph.inner_radius is None
    assert glyph.outer_radius is None
    yield check_fill, glyph
    yield check_line, glyph
    yield (check_props, glyph, [
        "x",
        "y",
        "inner_radius",
        "inner_radius_units",
        "outer_radius",
        "outer_radius_units",
    ], FILL, LINE)
Пример #5
0
    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,
         line_color="#BEAED4",
         line_width=3)),
    ("bezier",
     Bezier(x0="x",
            y0="y",
            x1="xp02",
            y1="y",
Пример #6
0
xdr = DataRange1d()
ydr = DataRange1d()

plot = Plot(title=None,
            x_range=xdr,
            y_range=ydr,
            plot_width=300,
            plot_height=300,
            h_symmetry=False,
            v_symmetry=False,
            min_border=0,
            toolbar_location=None)

glyph = Annulus(x="x",
                y="y",
                inner_radius=.2,
                outer_radius=.4,
                fill_color="#7fc97f")
plot.add_glyph(source, glyph)

xaxis = LinearAxis()
plot.add_layout(xaxis, 'below')

yaxis = LinearAxis()
plot.add_layout(yaxis, 'left')

plot.add_layout(Grid(dimension=0, ticker=xaxis.ticker))
plot.add_layout(Grid(dimension=1, ticker=yaxis.ticker))

curdoc().add_root(plot)