How to use the altair.vegalite.v1.schema._interface.jstraitlets.JSONInstance function in altair

To help you get started, we’ve selected a few altair examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github altair-viz / altair / altair / vegalite / v1 / schema / _interface / schema.py View on Github external
Default datetime format for axis and legend labels. The format
        can be set directly on each axis and legend.
    viewport : number
        The width and height of the on-screen viewport, in pixels. If
        necessary, clipping and scrolling will be applied.
    """
    _additional_traits = True
    _required_traits = []
    _trait_name_map = {}
    axis = jst.JSONInstance(_localname('AxisConfig'), help='Axis Config')
    background = jst.JSONString(help='CSS color property to use as background of visualization. [...]')
    cell = jst.JSONInstance(_localname('CellConfig'), help='Cell Config')
    countTitle = jst.JSONString(help='Default axis and legend title for count fields.')
    facet = jst.JSONInstance(_localname('FacetConfig'), help='Facet Config')
    legend = jst.JSONInstance(_localname('LegendConfig'), help='Legend Config')
    mark = jst.JSONInstance(_localname('MarkConfig'), help='Mark Config')
    numberFormat = jst.JSONString(help='D3 Number format for axis labels and text tables. For example [...]')
    overlay = jst.JSONInstance(_localname('OverlayConfig'), help='Mark Overlay Config')
    scale = jst.JSONInstance(_localname('ScaleConfig'), help='Scale Config')
    timeFormat = jst.JSONString(help='Default datetime format for axis and legend labels. The format [...]')
    viewport = jst.JSONNumber(help='The width and height of the on-screen viewport, in pixels. If [...]')

    def __init__(self, axis=jst.undefined, background=jst.undefined, cell=jst.undefined, countTitle=jst.undefined, facet=jst.undefined, legend=jst.undefined, mark=jst.undefined, numberFormat=jst.undefined, overlay=jst.undefined, scale=jst.undefined, timeFormat=jst.undefined, viewport=jst.undefined, **kwargs):
        kwds = dict(axis=axis, background=background, cell=cell, countTitle=countTitle, facet=facet, legend=legend, mark=mark, numberFormat=numberFormat, overlay=overlay, scale=scale, timeFormat=timeFormat, viewport=viewport)
        kwargs.update({k:v for k, v in kwds.items() if v is not jst.undefined})
        super(Config, self).__init__(**kwargs)


class Data(jst.JSONHasTraits):
    """Data class
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / channel_collections.py View on Github external
_skip_on_export = ['channel_names']
    channel_names = ['color', 'column', 'detail', 'label', 'opacity', 'order', 'path', 'row', 'shape', 'size', 'text', 'x', 'x2', 'y', 'y2']
    
    color = jst.JSONInstance(_localname('Color'), help='Color of the marks – either fill or stroke color based on mark [...]')
    column = jst.JSONInstance(_localname('Column'), help='Horizontal facets for trellis plots.')
    detail = jst.JSONAnyOf([jst.JSONInstance(_localname('Detail')), jst.JSONArray(jst.JSONInstance(_localname('Detail')))], help='Additional levels of detail for grouping data in aggregate views [...]')
    label = jst.JSONInstance(_localname('Label'))
    opacity = jst.JSONInstance(_localname('Opacity'), help='Opacity of the marks – either can be a value or in a range.')
    order = jst.JSONAnyOf([jst.JSONInstance(_localname('Order')), jst.JSONArray(jst.JSONInstance(_localname('Order')))], help='Layer order for non-stacked marks, or stack order for stacked marks.')
    path = jst.JSONAnyOf([jst.JSONInstance(_localname('Path')), jst.JSONArray(jst.JSONInstance(_localname('Path')))], help='Order of data points in line marks.')
    row = jst.JSONInstance(_localname('Row'), help='Vertical facets for trellis plots.')
    shape = jst.JSONInstance(_localname('Shape'), help="The symbol's shape (only for `point` marks). The supported [...]")
    size = jst.JSONInstance(_localname('Size'), help='Size of the mark. - For `point`, `square` and `circle` – the [...]')
    text = jst.JSONInstance(_localname('Text'), help='Text of the `text` mark.')
    x = jst.JSONInstance(_localname('X'), help='X coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    x2 = jst.JSONInstance(_localname('X2'), help='X2 coordinates for ranged `bar`, `rule`, `area`')
    y = jst.JSONInstance(_localname('Y'), help='Y coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    y2 = jst.JSONInstance(_localname('Y2'), help='Y2 coordinates for ranged `bar`, `rule`, `area`')


class UnitEncoding(schema.UnitEncoding):
    """Object for storing channel encodings

    Attributes
    ----------
    color: Color
        Color of the marks – either fill or stroke color based on mark
        type.
        (By default, fill color for `area`, `bar`, `tick`, `text`,
        `circle`, and `square` /
        stroke color for `line` and `point`.)
    detail: AnyOf([Detail, Array(Detail)])
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / channel_collections.py View on Github external
`line`, `rule`, `text`, and `tick`
        (or to width and height for `bar` and `area` marks).
    x2: X2
        X2 coordinates for ranged `bar`, `rule`, `area`
    y: Y
        Y coordinates for `point`, `circle`, `square`,
        `line`, `rule`, `text`, and `tick`
        (or to width and height for `bar` and `area` marks).
    y2: Y2
        Y2 coordinates for ranged `bar`, `rule`, `area`
    """
    _skip_on_export = ['channel_names']
    channel_names = ['color', 'column', 'detail', 'label', 'opacity', 'order', 'path', 'row', 'shape', 'size', 'text', 'x', 'x2', 'y', 'y2']
    
    color = jst.JSONInstance(_localname('Color'), help='Color of the marks – either fill or stroke color based on mark [...]')
    column = jst.JSONInstance(_localname('Column'), help='Horizontal facets for trellis plots.')
    detail = jst.JSONAnyOf([jst.JSONInstance(_localname('Detail')), jst.JSONArray(jst.JSONInstance(_localname('Detail')))], help='Additional levels of detail for grouping data in aggregate views [...]')
    label = jst.JSONInstance(_localname('Label'))
    opacity = jst.JSONInstance(_localname('Opacity'), help='Opacity of the marks – either can be a value or in a range.')
    order = jst.JSONAnyOf([jst.JSONInstance(_localname('Order')), jst.JSONArray(jst.JSONInstance(_localname('Order')))], help='Layer order for non-stacked marks, or stack order for stacked marks.')
    path = jst.JSONAnyOf([jst.JSONInstance(_localname('Path')), jst.JSONArray(jst.JSONInstance(_localname('Path')))], help='Order of data points in line marks.')
    row = jst.JSONInstance(_localname('Row'), help='Vertical facets for trellis plots.')
    shape = jst.JSONInstance(_localname('Shape'), help="The symbol's shape (only for `point` marks). The supported [...]")
    size = jst.JSONInstance(_localname('Size'), help='Size of the mark. - For `point`, `square` and `circle` – the [...]')
    text = jst.JSONInstance(_localname('Text'), help='Text of the `text` mark.')
    x = jst.JSONInstance(_localname('X'), help='X coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    x2 = jst.JSONInstance(_localname('X2'), help='X2 coordinates for ranged `bar`, `rule`, `area`')
    y = jst.JSONInstance(_localname('Y'), help='Y coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    y2 = jst.JSONInstance(_localname('Y2'), help='Y2 coordinates for ranged `bar`, `rule`, `area`')


class UnitEncoding(schema.UnitEncoding):
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / channel_collections.py View on Github external
class Facet(schema.Facet):
    """Object for storing channel encodings

    Attributes
    ----------
    column: Column
        
    row: Row
        
    """
    _skip_on_export = ['channel_names']
    channel_names = ['column', 'row']
    
    column = jst.JSONInstance(_localname('Column'))
    row = jst.JSONInstance(_localname('Row'))
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / jstraitlets.py View on Github external
def make_dynamic_default(self):
        if self.allow_undefined and self.default_value is undefined:
            return undefined
        else:
            return super(JSONInstance, self).make_dynamic_default()
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / channel_collections.py View on Github external
x2: X2
        X2 coordinates for ranged `bar`, `rule`, `area`
    y: Y
        Y coordinates for `point`, `circle`, `square`,
        `line`, `rule`, `text`, and `tick`
        (or to width and height for `bar` and `area` marks).
    y2: Y2
        Y2 coordinates for ranged `bar`, `rule`, `area`
    """
    _skip_on_export = ['channel_names']
    channel_names = ['color', 'column', 'detail', 'label', 'opacity', 'order', 'path', 'row', 'shape', 'size', 'text', 'x', 'x2', 'y', 'y2']
    
    color = jst.JSONInstance(_localname('Color'), help='Color of the marks – either fill or stroke color based on mark [...]')
    column = jst.JSONInstance(_localname('Column'), help='Horizontal facets for trellis plots.')
    detail = jst.JSONAnyOf([jst.JSONInstance(_localname('Detail')), jst.JSONArray(jst.JSONInstance(_localname('Detail')))], help='Additional levels of detail for grouping data in aggregate views [...]')
    label = jst.JSONInstance(_localname('Label'))
    opacity = jst.JSONInstance(_localname('Opacity'), help='Opacity of the marks – either can be a value or in a range.')
    order = jst.JSONAnyOf([jst.JSONInstance(_localname('Order')), jst.JSONArray(jst.JSONInstance(_localname('Order')))], help='Layer order for non-stacked marks, or stack order for stacked marks.')
    path = jst.JSONAnyOf([jst.JSONInstance(_localname('Path')), jst.JSONArray(jst.JSONInstance(_localname('Path')))], help='Order of data points in line marks.')
    row = jst.JSONInstance(_localname('Row'), help='Vertical facets for trellis plots.')
    shape = jst.JSONInstance(_localname('Shape'), help="The symbol's shape (only for `point` marks). The supported [...]")
    size = jst.JSONInstance(_localname('Size'), help='Size of the mark. - For `point`, `square` and `circle` – the [...]')
    text = jst.JSONInstance(_localname('Text'), help='Text of the `text` mark.')
    x = jst.JSONInstance(_localname('X'), help='X coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    x2 = jst.JSONInstance(_localname('X2'), help='X2 coordinates for ranged `bar`, `rule`, `area`')
    y = jst.JSONInstance(_localname('Y'), help='Y coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    y2 = jst.JSONInstance(_localname('Y2'), help='Y2 coordinates for ranged `bar`, `rule`, `area`')


class UnitEncoding(schema.UnitEncoding):
    """Object for storing channel encodings
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / schema.py View on Github external
_additional_traits = True
    _required_traits = []
    _trait_name_map = {}
    color = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Color of the marks – either fill or stroke color based on mark [...]')
    detail = jst.JSONAnyOf([jst.JSONInstance(_localname('FieldDef')), jst.JSONArray(jst.JSONInstance(_localname('FieldDef')))], help='Additional levels of detail for grouping data in aggregate views [...]')
    label = jst.JSONInstance(_localname('FieldDef'))
    opacity = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Opacity of the marks – either can be a value or in a range.')
    order = jst.JSONAnyOf([jst.JSONInstance(_localname('OrderChannelDef')), jst.JSONArray(jst.JSONInstance(_localname('OrderChannelDef')))], help='Layer order for non-stacked marks, or stack order for stacked marks.')
    path = jst.JSONAnyOf([jst.JSONInstance(_localname('OrderChannelDef')), jst.JSONArray(jst.JSONInstance(_localname('OrderChannelDef')))], help='Order of data points in line marks.')
    shape = jst.JSONInstance(_localname('ChannelDefWithLegend'), help="The symbol's shape (only for `point` marks). The supported [...]")
    size = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Size of the mark. - For `point`, `square` and `circle` – the [...]')
    text = jst.JSONInstance(_localname('FieldDef'), help='Text of the `text` mark.')
    x = jst.JSONInstance(_localname('PositionChannelDef'), help='X coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    x2 = jst.JSONInstance(_localname('FieldDef'), help='X2 coordinates for ranged `bar`, `rule`, `area`')
    y = jst.JSONInstance(_localname('PositionChannelDef'), help='Y coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    y2 = jst.JSONInstance(_localname('FieldDef'), help='Y2 coordinates for ranged `bar`, `rule`, `area`')

    def __init__(self, color=jst.undefined, detail=jst.undefined, label=jst.undefined, opacity=jst.undefined, order=jst.undefined, path=jst.undefined, shape=jst.undefined, size=jst.undefined, text=jst.undefined, x=jst.undefined, x2=jst.undefined, y=jst.undefined, y2=jst.undefined, **kwargs):
        kwds = dict(color=color, detail=detail, label=label, opacity=opacity, order=order, path=path, shape=shape, size=size, text=text, x=x, x2=x2, y=y, y2=y2)
        kwargs.update({k:v for k, v in kwds.items() if v is not jst.undefined})
        super(UnitEncoding, self).__init__(**kwargs)


class UnitSpec(jst.JSONHasTraits):
    """UnitSpec class

    

    Attributes
    ----------
    config : Config
        Configuration object
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / schema.py View on Github external
timeFormat : string
        Default datetime format for axis and legend labels. The format
        can be set directly on each axis and legend.
    viewport : number
        The width and height of the on-screen viewport, in pixels. If
        necessary, clipping and scrolling will be applied.
    """
    _additional_traits = True
    _required_traits = []
    _trait_name_map = {}
    axis = jst.JSONInstance(_localname('AxisConfig'), help='Axis Config')
    background = jst.JSONString(help='CSS color property to use as background of visualization. [...]')
    cell = jst.JSONInstance(_localname('CellConfig'), help='Cell Config')
    countTitle = jst.JSONString(help='Default axis and legend title for count fields.')
    facet = jst.JSONInstance(_localname('FacetConfig'), help='Facet Config')
    legend = jst.JSONInstance(_localname('LegendConfig'), help='Legend Config')
    mark = jst.JSONInstance(_localname('MarkConfig'), help='Mark Config')
    numberFormat = jst.JSONString(help='D3 Number format for axis labels and text tables. For example [...]')
    overlay = jst.JSONInstance(_localname('OverlayConfig'), help='Mark Overlay Config')
    scale = jst.JSONInstance(_localname('ScaleConfig'), help='Scale Config')
    timeFormat = jst.JSONString(help='Default datetime format for axis and legend labels. The format [...]')
    viewport = jst.JSONNumber(help='The width and height of the on-screen viewport, in pixels. If [...]')

    def __init__(self, axis=jst.undefined, background=jst.undefined, cell=jst.undefined, countTitle=jst.undefined, facet=jst.undefined, legend=jst.undefined, mark=jst.undefined, numberFormat=jst.undefined, overlay=jst.undefined, scale=jst.undefined, timeFormat=jst.undefined, viewport=jst.undefined, **kwargs):
        kwds = dict(axis=axis, background=background, cell=cell, countTitle=countTitle, facet=facet, legend=legend, mark=mark, numberFormat=numberFormat, overlay=overlay, scale=scale, timeFormat=timeFormat, viewport=viewport)
        kwargs.update({k:v for k, v in kwds.items() if v is not jst.undefined})
        super(Config, self).__init__(**kwargs)


class Data(jst.JSONHasTraits):
    """Data class
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / schema.py View on Github external
X2 coordinates for ranged `bar`, `rule`, `area`
    y : PositionChannelDef
        Y coordinates for `point`, `circle`, `square`,
        `line`, `rule`, `text`, and `tick`
        (or to width and height for `bar` and `area` marks).
    y2 : FieldDef
        Y2 coordinates for ranged `bar`, `rule`, `area`
    """
    _additional_traits = True
    _required_traits = []
    _trait_name_map = {}
    color = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Color of the marks – either fill or stroke color based on mark [...]')
    column = jst.JSONInstance(_localname('PositionChannelDef'), help='Horizontal facets for trellis plots.')
    detail = jst.JSONAnyOf([jst.JSONInstance(_localname('FieldDef')), jst.JSONArray(jst.JSONInstance(_localname('FieldDef')))], help='Additional levels of detail for grouping data in aggregate views [...]')
    label = jst.JSONInstance(_localname('FieldDef'))
    opacity = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Opacity of the marks – either can be a value or in a range.')
    order = jst.JSONAnyOf([jst.JSONInstance(_localname('OrderChannelDef')), jst.JSONArray(jst.JSONInstance(_localname('OrderChannelDef')))], help='Layer order for non-stacked marks, or stack order for stacked marks.')
    path = jst.JSONAnyOf([jst.JSONInstance(_localname('OrderChannelDef')), jst.JSONArray(jst.JSONInstance(_localname('OrderChannelDef')))], help='Order of data points in line marks.')
    row = jst.JSONInstance(_localname('PositionChannelDef'), help='Vertical facets for trellis plots.')
    shape = jst.JSONInstance(_localname('ChannelDefWithLegend'), help="The symbol's shape (only for `point` marks). The supported [...]")
    size = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Size of the mark. - For `point`, `square` and `circle` – the [...]')
    text = jst.JSONInstance(_localname('FieldDef'), help='Text of the `text` mark.')
    x = jst.JSONInstance(_localname('PositionChannelDef'), help='X coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    x2 = jst.JSONInstance(_localname('FieldDef'), help='X2 coordinates for ranged `bar`, `rule`, `area`')
    y = jst.JSONInstance(_localname('PositionChannelDef'), help='Y coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    y2 = jst.JSONInstance(_localname('FieldDef'), help='Y2 coordinates for ranged `bar`, `rule`, `area`')

    def __init__(self, color=jst.undefined, column=jst.undefined, detail=jst.undefined, label=jst.undefined, opacity=jst.undefined, order=jst.undefined, path=jst.undefined, row=jst.undefined, shape=jst.undefined, size=jst.undefined, text=jst.undefined, x=jst.undefined, x2=jst.undefined, y=jst.undefined, y2=jst.undefined, **kwargs):
        kwds = dict(color=color, column=column, detail=detail, label=label, opacity=opacity, order=order, path=path, row=row, shape=shape, size=size, text=text, x=x, x2=x2, y=y, y2=y2)
        kwargs.update({k:v for k, v in kwds.items() if v is not jst.undefined})
        super(Encoding, self).__init__(**kwargs)
github altair-viz / altair / altair / vegalite / v1 / schema / _interface / schema.py View on Github external
Y2 coordinates for ranged `bar`, `rule`, `area`
    """
    _additional_traits = True
    _required_traits = []
    _trait_name_map = {}
    color = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Color of the marks – either fill or stroke color based on mark [...]')
    column = jst.JSONInstance(_localname('PositionChannelDef'), help='Horizontal facets for trellis plots.')
    detail = jst.JSONAnyOf([jst.JSONInstance(_localname('FieldDef')), jst.JSONArray(jst.JSONInstance(_localname('FieldDef')))], help='Additional levels of detail for grouping data in aggregate views [...]')
    label = jst.JSONInstance(_localname('FieldDef'))
    opacity = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Opacity of the marks – either can be a value or in a range.')
    order = jst.JSONAnyOf([jst.JSONInstance(_localname('OrderChannelDef')), jst.JSONArray(jst.JSONInstance(_localname('OrderChannelDef')))], help='Layer order for non-stacked marks, or stack order for stacked marks.')
    path = jst.JSONAnyOf([jst.JSONInstance(_localname('OrderChannelDef')), jst.JSONArray(jst.JSONInstance(_localname('OrderChannelDef')))], help='Order of data points in line marks.')
    row = jst.JSONInstance(_localname('PositionChannelDef'), help='Vertical facets for trellis plots.')
    shape = jst.JSONInstance(_localname('ChannelDefWithLegend'), help="The symbol's shape (only for `point` marks). The supported [...]")
    size = jst.JSONInstance(_localname('ChannelDefWithLegend'), help='Size of the mark. - For `point`, `square` and `circle` – the [...]')
    text = jst.JSONInstance(_localname('FieldDef'), help='Text of the `text` mark.')
    x = jst.JSONInstance(_localname('PositionChannelDef'), help='X coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    x2 = jst.JSONInstance(_localname('FieldDef'), help='X2 coordinates for ranged `bar`, `rule`, `area`')
    y = jst.JSONInstance(_localname('PositionChannelDef'), help='Y coordinates for `point`, `circle`, `square`, `line`, `rule`, [...]')
    y2 = jst.JSONInstance(_localname('FieldDef'), help='Y2 coordinates for ranged `bar`, `rule`, `area`')

    def __init__(self, color=jst.undefined, column=jst.undefined, detail=jst.undefined, label=jst.undefined, opacity=jst.undefined, order=jst.undefined, path=jst.undefined, row=jst.undefined, shape=jst.undefined, size=jst.undefined, text=jst.undefined, x=jst.undefined, x2=jst.undefined, y=jst.undefined, y2=jst.undefined, **kwargs):
        kwds = dict(color=color, column=column, detail=detail, label=label, opacity=opacity, order=order, path=path, row=row, shape=shape, size=size, text=text, x=x, x2=x2, y=y, y2=y2)
        kwargs.update({k:v for k, v in kwds.items() if v is not jst.undefined})
        super(Encoding, self).__init__(**kwargs)


class EqualFilter(jst.JSONHasTraits):
    """EqualFilter class