class DepthGraph(XYGlyph):
	''' Render a single patch.
	The ``Patch`` glyph is different from most other glyphs in that the vector
	of values only produces one glyph on the Plot.
	'''

	__implementation__ = "DepthGraph.ts"

	# a canonical order for positional args that can be used for any
	# functions derived from this class
	_args = ('x', 'y')

	x = NumberSpec(help="""
	The x-coordinates for the points of the patch.
	.. note::
		A patch may comprise multiple polygons. In this case the
		x-coordinates for each polygon should be separated by NaN
		values in the sequence.
	""")

	y = NumberSpec(help="""
	The y-coordinates for the points of the patch.
	.. note::
		A patch may comprise multiple polygons. In this case the
		y-coordinates for each polygon should be separated by NaN
		values in the sequence.
	""")

	line_props = Include(ScalarLineProps, use_prefix=False, help="""
	The %s values for the patch.
	""")

	fill_props = Include(ScalarFillProps, use_prefix=False, help="""
	The %s values for the patch.
	""")
示例#2
0
class Barb(bokeh.models.XYGlyph):
    __implementation__ = "barb.ts"
    _args = ('x', 'y', 'u', 'v')
    x = DistanceSpec(units_default="screen")
    y = DistanceSpec(units_default="screen")
    u = NumberSpec()
    v = NumberSpec()
示例#3
0
class Barb(bokeh.models.XYGlyph):
    __implementation__ = "barb.ts"
    _args = ("x", "y", "u", "v")
    x = DistanceSpec(units_default="screen")
    y = DistanceSpec(units_default="screen")
    u = NumberSpec()
    v = NumberSpec()
示例#4
0
class Gear(Glyph):
    """ Render gears.

    The details and nomenclature concerning gear construction can
    be quite involved. For more information, consult the `Wikipedia
    article for Gear`_.

    .. _Wikipedia article for Gear: http://en.wikipedia.org/wiki/Gear
    """

    __implementation__ = "gear.ts"

    x = NumberSpec(help="""
    The x-coordinates of the center of the gears.
    """)

    y = NumberSpec(help="""
    The y-coordinates of the center of the gears.
    """)

    angle = AngleSpec(default=0, help="""
    The angle the gears are rotated from horizontal. [rad]
    """)

    module = NumberSpec(help="""
    A scaling factor, given by::

        m = p / pi

    where *p* is the circular pitch, defined as the distance from one
    face of a tooth to the corresponding face of an adjacent tooth on
    the same gear, measured along the pitch circle. [float]
    """)

    teeth = NumberSpec(help="""
    How many teeth the gears have. [int]
    """)

    pressure_angle = NumberSpec(default=20, help="""
    The complement of the angle between the direction that the teeth
    exert force on each other, and the line joining the centers of the
    two gears. [deg]
    """)

    shaft_size = NumberSpec(default=0.3, help="""
    The central gear shaft size as a percentage of the overall gear
    size. [float]
    """)

    internal = NumberSpec(default=False, help="""
    Whether the gear teeth are internal. [bool]
    """)

    line_props = Include(LineProps, use_prefix=False, help="""
    The %s values for the gears.
    """)

    fill_props = Include(FillProps, use_prefix=False, help="""
    The %s values for the gears.
    """)
示例#5
0
class Child(Parent):
    int2 = Int()
    str2 = String(default="foo")
    ds2 = NumberSpec()
    lst2 = List(Int, default=[1,2,3])

    @property
    def str2_proxy(self):
        return self.str2
    @str2_proxy.setter
    def str2_proxy(self, value):
        self.str2 = value*2
示例#6
0
class Parent(hp.HasProps):
    int1 = Int(default=10)
    ds1 = NumberSpec(default=field("x"))
    lst1 = List(String)

    @property
    def foo_prop(self) -> int:
        return 110

    def foo_func(self) -> int:
        return 111

    @property
    def _foo_prop(self) -> int:
        return 1100

    def _foo_func(self) -> int:
        return 1110
示例#7
0
 class Sub(Base, Mixin):
     sub_num = NumberSpec(16)
示例#8
0
 class Mixin(HasProps):
     mixin_num = NumberSpec(14)
示例#9
0
 class Base(HasProps):
     num = NumberSpec(12)
     not_a_dataspec = Float(10)
示例#10
0
class Parent(hp.HasProps):
    int1 = Int(default=10)
    ds1 = NumberSpec()
    lst1 = List(String)
示例#11
0
class Child(Parent):
    int2 = Int()
    str2 = String(default="foo")
    ds2 = NumberSpec()
    lst2 = List(Int, default=[1, 2, 3])
示例#12
0
class DoubleBarbs(Patches):
    __implementation__ = "custom.ts"
    x = NumberSpec()
    y = NumberSpec()