Esempio n. 1
0
def test_AnnularWedge() -> None:
    glyph = AnnularWedge()
    assert glyph.x == field("x")
    assert glyph.y == field("y")
    assert glyph.inner_radius == field("inner_radius")
    assert glyph.outer_radius == field("outer_radius")
    assert glyph.start_angle == field("start_angle")
    assert glyph.end_angle == field("end_angle")
    assert glyph.direction == "anticlock"
    check_line_properties(glyph)
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
        "inner_radius",
        "inner_radius_units",
        "outer_radius",
        "outer_radius_units",
        "start_angle",
        "start_angle_units",
        "end_angle",
        "end_angle_units",
        "direction",
    ], LINE, FILL, HATCH, GLYPH)
Esempio n. 2
0
def test_X() -> None:
    marker = X()
    check_marker_properties(marker)
    check_line_properties(marker)
    check_fill_properties(marker)
    check_hatch_properties(marker)
    check_properties_existence(marker, MARKER, LINE, FILL, HATCH, GLYPH, ["marker"])
Esempio n. 3
0
def test_BoxAnnotation() -> None:
    box = BoxAnnotation()
    assert box.left is None
    assert box.left_units == "data"
    assert box.right is None
    assert box.right_units == "data"
    assert box.bottom is None
    assert box.bottom_units == "data"
    assert box.top is None
    assert box.top_units == "data"
    assert box.x_range_name == "default"
    assert box.y_range_name == "default"
    assert box.level == "annotation"
    check_line_properties(box, "", "#cccccc", 1, 0.3)
    check_fill_properties(box, "", "#fff9ba", 0.4)
    check_hatch_properties(box)
    check_properties_existence(
        box, ANNOTATION + [
            "left",
            "left_units",
            "right",
            "right_units",
            "bottom",
            "bottom_units",
            "top",
            "top_units",
        ], LINE, FILL, HATCH)
Esempio n. 4
0
def test_Patches() -> None:
    glyph = Patches()
    assert glyph.xs == field("xs")
    assert glyph.ys == field("ys")
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "xs",
        "ys",
    ], FILL, HATCH, LINE, GLYPH)
Esempio n. 5
0
def test_Patch() -> None:
    glyph = Patch()
    assert glyph.x is None
    assert glyph.y is None
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
    ], FILL, HATCH, LINE, GLYPH)
Esempio n. 6
0
def test_MultiPolygons() -> None:
    glyph = MultiPolygons()
    assert glyph.xs is None
    assert glyph.ys is None
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "xs",
        "ys",
    ], FILL, HATCH, LINE, GLYPH)
Esempio n. 7
0
def test_HArea() -> None:
    glyph = HArea()
    assert glyph.y == field("y")
    assert glyph.x1 == field("x1")
    assert glyph.x2 == field("x2")
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "y",
        "x1",
        "x2",
    ], FILL, HATCH, GLYPH)
Esempio n. 8
0
def test_Circle() -> None:
    marker = Circle()
    check_marker_properties(marker)
    assert marker.radius is None
    check_line_properties(marker)
    check_fill_properties(marker)
    check_hatch_properties(marker)
    check_properties_existence(marker, [
        "radius",
        "radius_units",
        "radius_dimension",
    ], MARKER, LINE, FILL, HATCH, GLYPH)
Esempio n. 9
0
def test_VArea() -> None:
    glyph = VArea()
    assert glyph.x == field("x")
    assert glyph.y1 == field("y1")
    assert glyph.y2 == field("y2")
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y1",
        "y2",
    ], FILL, HATCH, GLYPH)
Esempio n. 10
0
def test_VArea() -> None:
    glyph = VArea()
    assert glyph.x is None
    assert glyph.y1 is None
    assert glyph.y2 is None
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y1",
        "y2",
    ], FILL, HATCH, GLYPH)
Esempio n. 11
0
def test_HArea() -> None:
    glyph = HArea()
    assert glyph.y is None
    assert glyph.x1 is None
    assert glyph.x2 is None
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "y",
        "x1",
        "x2",
    ], FILL, HATCH, GLYPH)
Esempio n. 12
0
def test_HBar() -> None:
    glyph = HBar()
    assert glyph.y == field("y")
    assert glyph.height is None
    assert glyph.left == 0
    assert glyph.right is None
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "y",
        "height",
        "left",
        "right",
    ], FILL, HATCH, LINE, GLYPH)
Esempio n. 13
0
def test_VBar() -> None:
    glyph = VBar()
    assert glyph.x == field("x")
    assert glyph.width is None
    assert glyph.top is None
    assert glyph.bottom == 0
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "width",
        "top",
        "bottom",
    ], FILL, HATCH, LINE, GLYPH)
Esempio n. 14
0
def test_Quad() -> None:
    glyph = Quad()
    assert glyph.left is None
    assert glyph.right is None
    assert glyph.bottom is None
    assert glyph.top is None
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_line_properties(glyph)
    check_properties_existence(glyph, [
        "left",
        "right",
        "bottom",
        "top",
    ], FILL, HATCH, LINE, GLYPH)
Esempio n. 15
0
def test_Annulus() -> None:
    glyph = Annulus()
    assert glyph.x == field("x")
    assert glyph.y == field("y")
    assert glyph.inner_radius == field("inner_radius")
    assert glyph.outer_radius == field("outer_radius")
    check_line_properties(glyph)
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
        "inner_radius",
        "inner_radius_units",
        "outer_radius",
        "outer_radius_units",
    ], LINE, FILL, HATCH, GLYPH)
Esempio n. 16
0
def test_PolyAnnotation() -> None:
    poly = PolyAnnotation()
    assert poly.xs == []
    assert poly.xs_units == "data"
    assert poly.ys == []
    assert poly.ys_units == "data"
    assert poly.x_range_name == "default"
    assert poly.y_range_name == "default"
    assert poly.level == "annotation"
    check_line_properties(poly, "", "#cccccc", 1, 0.3)
    check_fill_properties(poly, "", "#fff9ba", 0.4)
    check_hatch_properties(poly)
    check_properties_existence(poly, ANNOTATION + [
        "xs",
        "xs_units",
        "ys",
        "ys_units",
    ], LINE, FILL, HATCH)
Esempio n. 17
0
def test_Oval() -> None:
    glyph = Oval()
    assert glyph.x == field("x")
    assert glyph.y == field("y")
    assert glyph.width is None
    assert glyph.height is None
    assert glyph.angle == 0
    check_line_properties(glyph)
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
        "width",
        "width_units",
        "height",
        "height_units",
        "angle",
        "angle_units",
    ], LINE, FILL, HATCH, GLYPH)
Esempio n. 18
0
def test_Rect() -> None:
    glyph = Rect()
    assert glyph.x == field("x")
    assert glyph.y == field("y")
    assert glyph.width == field("width")
    assert glyph.height == field("height")
    assert glyph.angle == 0
    assert glyph.dilate is False
    check_line_properties(glyph)
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
        "width",
        "width_units",
        "height",
        "height_units",
        "angle",
        "angle_units",
        "dilate",
    ], LINE, FILL, HATCH, GLYPH)
Esempio n. 19
0
def test_Wedge() -> None:
    glyph = Wedge()
    assert glyph.x == field("x")
    assert glyph.y == field("y")
    assert glyph.radius is None
    assert glyph.start_angle is None
    assert glyph.end_angle is None
    assert glyph.direction == "anticlock"
    check_line_properties(glyph)
    check_fill_properties(glyph)
    check_hatch_properties(glyph)
    check_properties_existence(glyph, [
        "x",
        "y",
        "radius",
        "radius_units",
        "start_angle",
        "start_angle_units",
        "end_angle",
        "end_angle_units",
        "direction",
    ], LINE, FILL, HATCH, GLYPH)