How to use the altair.vegalite.v1.schema.core.VegaLiteSchema 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 / core.py View on Github external
class AggregateOp(VegaLiteSchema):
    """AggregateOp schema wrapper

    enum('values', 'count', 'valid', 'missing', 'distinct', 'sum', 'mean', 'average',
    'variance', 'variancep', 'stdev', 'stdevp', 'median', 'q1', 'q3', 'modeskew', 'min', 'max',
    'argmin', 'argmax')
    """
    _schema = {'$ref': '#/definitions/AggregateOp'}
    _rootschema = Root._schema

    def __init__(self, *args):
        super(AggregateOp, self).__init__(*args)


class Type(VegaLiteSchema):
    """Type schema wrapper

    enum('quantitative', 'ordinal', 'temporal', 'nominal')
    """
    _schema = {'$ref': '#/definitions/Type'}
    _rootschema = Root._schema

    def __init__(self, *args):
        super(Type, self).__init__(*args)


class TimeUnit(VegaLiteSchema):
    """TimeUnit schema wrapper

    enum('year', 'month', 'day', 'date', 'hours', 'minutes', 'seconds', 'milliseconds',
    'yearmonth', 'yearmonthdate', 'yearmonthdatehours', 'yearmonthdatehoursminutes',
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
``"quantitative"``, ``"temporal"``, ``"ordinal"``,  and ``"nominal"`` )  or an
        initial character of the type name ( ``"Q"``, ``"T"``, ``"O"``, ``"N"`` ).  This
        property is case insensitive.
    value : anyOf(string, float, boolean)
        A constant value in visual domain.
    """
    _schema = {'$ref': '#/definitions/FieldDef'}
    _rootschema = Root._schema

    def __init__(self, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined,
                 title=Undefined, type=Undefined, value=Undefined, **kwds):
        super(FieldDef, self).__init__(aggregate=aggregate, bin=bin, field=field, timeUnit=timeUnit,
                                       title=title, type=type, value=value, **kwds)


class ChannelDefWithLegend(VegaLiteSchema):
    """ChannelDefWithLegend schema wrapper

    Mapping(required=[])

    Attributes
    ----------
    aggregate : AggregateOp
        Aggregation function for the field  (e.g., ``mean``, ``sum``, ``median``, ``min``,
        ``max``, ``count`` ).
    bin : anyOf(Bin, boolean)
        Flag for binning a ``quantitative`` field, or a bin property object  for binning
        parameters.
    field : string
        Name of the field from which to pull a data value.
    legend : Legend
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
and ``tick``  (or to width and height for ``bar`` and ``area`` marks).
    y2 : FieldDef
        Y2 coordinates for ranged ``bar``, ``rule``, ``area``
    """
    _schema = {'$ref': '#/definitions/UnitEncoding'}
    _rootschema = Root._schema

    def __init__(self, color=Undefined, detail=Undefined, label=Undefined, opacity=Undefined,
                 order=Undefined, path=Undefined, shape=Undefined, size=Undefined, text=Undefined,
                 x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds):
        super(UnitEncoding, self).__init__(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, **kwds)


class LayerSpec(VegaLiteSchema):
    """LayerSpec schema wrapper

    Mapping(required=[layers])

    Attributes
    ----------
    layers : List(UnitSpec)
        Unit specs that will be layered.
    config : Config
        Configuration object
    data : Data
        An object describing the data source
    description : string
        An optional description of this mark for commenting purpose.  This property has no
        effect on the output visualization.
    height : float
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
return VegaLiteSchema.__subclasses__()


class Root(VegaLiteSchema):
    """Root schema wrapper

    anyOf(ExtendedUnitSpec, FacetSpec, LayerSpec)
    """
    _schema = load_schema()
    _rootschema = _schema

    def __init__(self, *args, **kwds):
        super(Root, self).__init__(*args, **kwds)


class ExtendedUnitSpec(VegaLiteSchema):
    """ExtendedUnitSpec schema wrapper

    Mapping(required=[mark])
    Schema for a unit Vega-Lite specification, with the syntactic sugar extensions:


    *
      ``row`` and ``column`` are included in the encoding.

    *
      (Future) label, box plot

    Note: the spec could contain facet.

    Attributes
    ----------
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
The width and height of the on-screen viewport, in pixels. If necessary, clipping
        and scrolling will be applied.
    """
    _schema = {'$ref': '#/definitions/Config'}
    _rootschema = Root._schema

    def __init__(self, axis=Undefined, background=Undefined, cell=Undefined, countTitle=Undefined,
                 facet=Undefined, legend=Undefined, mark=Undefined, numberFormat=Undefined,
                 overlay=Undefined, scale=Undefined, timeFormat=Undefined, viewport=Undefined, **kwds):
        super(Config, self).__init__(axis=axis, background=background, cell=cell, countTitle=countTitle,
                                     facet=facet, legend=legend, mark=mark, numberFormat=numberFormat,
                                     overlay=overlay, scale=scale, timeFormat=timeFormat,
                                     viewport=viewport, **kwds)


class CellConfig(VegaLiteSchema):
    """CellConfig schema wrapper

    Mapping(required=[])

    Attributes
    ----------
    clip : boolean

    fill : string
        The fill color.
    fillOpacity : float
        The fill opacity (value between [0,1]).
    height : float

    stroke : string
        The stroke color.
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
line : boolean
        Whether to overlay line with point.
    lineStyle : MarkConfig
        Default style for the overlayed point.
    pointStyle : MarkConfig
        Default style for the overlayed point.
    """
    _schema = {'$ref': '#/definitions/OverlayConfig'}
    _rootschema = Root._schema

    def __init__(self, area=Undefined, line=Undefined, lineStyle=Undefined, pointStyle=Undefined, **kwds):
        super(OverlayConfig, self).__init__(area=area, line=line, lineStyle=lineStyle,
                                            pointStyle=pointStyle, **kwds)


class AreaOverlay(VegaLiteSchema):
    """AreaOverlay schema wrapper

    enum('line', 'linepoint', 'none')
    """
    _schema = {'$ref': '#/definitions/AreaOverlay'}
    _rootschema = Root._schema

    def __init__(self, *args):
        super(AreaOverlay, self).__init__(*args)


class ScaleConfig(VegaLiteSchema):
    """ScaleConfig schema wrapper

    Mapping(required=[])
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
pointStyle=pointStyle, **kwds)


class AreaOverlay(VegaLiteSchema):
    """AreaOverlay schema wrapper

    enum('line', 'linepoint', 'none')
    """
    _schema = {'$ref': '#/definitions/AreaOverlay'}
    _rootschema = Root._schema

    def __init__(self, *args):
        super(AreaOverlay, self).__init__(*args)


class ScaleConfig(VegaLiteSchema):
    """ScaleConfig schema wrapper

    Mapping(required=[])

    Attributes
    ----------
    bandSize : anyOf(BandSize, float)
        Default band size for (1) ``y`` ordinal scale,  and (2) ``x`` ordinal scale when the
         mark is not ``text``.
    barSizeRange : List(float)
        Default range for bar size scale
    fontSizeRange : List(float)
        Default range for font size scale
    nominalColorRange : anyOf(List(string), string)
        Default range for nominal color scale
    opacity : List(float)
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
If ``true``, ensures that a zero baseline value is included in the scale domain.
        Default value: ``true`` for ``x`` and ``y`` channel if the quantitative field is not
         binned  and no custom ``domain`` is provided; ``false`` otherwise.
    """
    _schema = {'$ref': '#/definitions/Scale'}
    _rootschema = Root._schema

    def __init__(self, bandSize=Undefined, clamp=Undefined, domain=Undefined, exponent=Undefined,
                 nice=Undefined, padding=Undefined, range=Undefined, round=Undefined, type=Undefined,
                 useRawDomain=Undefined, zero=Undefined, **kwds):
        super(Scale, self).__init__(bandSize=bandSize, clamp=clamp, domain=domain, exponent=exponent,
                                    nice=nice, padding=padding, range=range, round=round, type=type,
                                    useRawDomain=useRawDomain, zero=zero, **kwds)


class ScaleType(VegaLiteSchema):
    """ScaleType schema wrapper

    enum('linear', 'log', 'pow', 'sqrt', 'quantile', 'quantize', 'ordinal', 'time', 'utc')
    """
    _schema = {'$ref': '#/definitions/ScaleType'}
    _rootschema = Root._schema

    def __init__(self, *args):
        super(ScaleType, self).__init__(*args)


class BandSize(VegaLiteSchema):
    """BandSize schema wrapper

    enum('fit')
    """
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
def __init__(self, bandSize=Undefined, barSizeRange=Undefined, fontSizeRange=Undefined,
                 nominalColorRange=Undefined, opacity=Undefined, padding=Undefined,
                 pointSizeRange=Undefined, round=Undefined, ruleSizeRange=Undefined,
                 sequentialColorRange=Undefined, shapeRange=Undefined, textBandWidth=Undefined,
                 tickSizeRange=Undefined, useRawDomain=Undefined, **kwds):
        super(ScaleConfig, self).__init__(bandSize=bandSize, barSizeRange=barSizeRange,
                                          fontSizeRange=fontSizeRange,
                                          nominalColorRange=nominalColorRange, opacity=opacity,
                                          padding=padding, pointSizeRange=pointSizeRange, round=round,
                                          ruleSizeRange=ruleSizeRange,
                                          sequentialColorRange=sequentialColorRange,
                                          shapeRange=shapeRange, textBandWidth=textBandWidth,
                                          tickSizeRange=tickSizeRange, useRawDomain=useRawDomain, **kwds)


class AxisConfig(VegaLiteSchema):
    """AxisConfig schema wrapper

    Mapping(required=[])

    Attributes
    ----------
    axisColor : string
        Color of axis line.
    axisWidth : float
        Width of the axis line
    characterWidth : float
        Character width for automatically determining title max length.
    grid : boolean
        A flag indicate if gridlines should be created in addition to ticks. If ``grid`` is
        unspecified, the default value is ``true`` for ROW and COL. For X and Y, the default
         value is ``true`` for quantitative and time fields and ``false`` otherwise.
github altair-viz / altair / altair / vegalite / v1 / schema / core.py View on Github external
``json.values.features``  from the loaded JSON object.
    type : DataFormatType
        Type of input data: ``"json"``, ``"csv"``, ``"tsv"``.  The default format type is
        determined by the extension of the file url.  If no extension is detected,
        ``"json"`` will be used by default.
    """
    _schema = {'$ref': '#/definitions/DataFormat'}
    _rootschema = Root._schema

    def __init__(self, feature=Undefined, mesh=Undefined, parse=Undefined, property=Undefined,
                 type=Undefined, **kwds):
        super(DataFormat, self).__init__(feature=feature, mesh=mesh, parse=parse, property=property,
                                         type=type, **kwds)


class DataFormatType(VegaLiteSchema):
    """DataFormatType schema wrapper

    enum('json', 'csv', 'tsv', 'topojson')
    """
    _schema = {'$ref': '#/definitions/DataFormatType'}
    _rootschema = Root._schema

    def __init__(self, *args):
        super(DataFormatType, self).__init__(*args)


class Transform(VegaLiteSchema):
    """Transform schema wrapper

    Mapping(required=[])