diff --git a/altair/utils/core.py b/altair/utils/core.py index 43bc1b4d5..380fb5a59 100644 --- a/altair/utils/core.py +++ b/altair/utils/core.py @@ -541,7 +541,12 @@ def decorate(f): # Supplement the docstring of f with information from Obj if Obj.__doc__: + + # Patch in a reference to the class this docstring is copied from, + # to generate a hyperlink doclines = Obj.__doc__.splitlines() + doclines[0] = f"Refer to :class:`{Obj.__name__}`" + if f.__doc__: doc = f.__doc__ + "\n".join(doclines[1:]) else: diff --git a/altair/vegalite/v3/schema/mixins.py b/altair/vegalite/v3/schema/mixins.py index 0278d400d..5554b0cb5 100644 --- a/altair/vegalite/v3/schema/mixins.py +++ b/altair/vegalite/v3/schema/mixins.py @@ -21,9 +21,7 @@ def mark_area(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpa text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'area' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'area' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -57,9 +55,7 @@ def mark_bar(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpac text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'bar' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'bar' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -93,9 +89,7 @@ def mark_line(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpa text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'line' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'line' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -130,9 +124,7 @@ def mark_trail(self, align=Undefined, angle=Undefined, baseline=Undefined, binSp thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'trail' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'trail' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -167,9 +159,7 @@ def mark_point(self, align=Undefined, angle=Undefined, baseline=Undefined, binSp thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'point' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'point' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -203,9 +193,7 @@ def mark_text(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpa text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'text' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'text' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -239,9 +227,7 @@ def mark_tick(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpa text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'tick' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'tick' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -275,9 +261,7 @@ def mark_rect(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpa text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'rect' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'rect' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -311,9 +295,7 @@ def mark_rule(self, align=Undefined, angle=Undefined, baseline=Undefined, binSpa text=Undefined, theta=Undefined, thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'rule' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'rule' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -348,9 +330,7 @@ def mark_circle(self, align=Undefined, angle=Undefined, baseline=Undefined, binS thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'circle' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'circle' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -385,9 +365,7 @@ def mark_square(self, align=Undefined, angle=Undefined, baseline=Undefined, binS thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'square' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'square' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -422,9 +400,7 @@ def mark_geoshape(self, align=Undefined, angle=Undefined, baseline=Undefined, bi thickness=Undefined, tooltip=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'geoshape' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'geoshape' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, baseline=baseline, binSpacing=binSpacing, clip=clip, color=color, cornerRadius=cornerRadius, cursor=cursor, dir=dir, dx=dx, dy=dy, @@ -448,9 +424,7 @@ def mark_geoshape(self, align=Undefined, angle=Undefined, baseline=Undefined, bi def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds): - """Set the chart's mark to 'boxplot' - - For information on additional arguments, see :class:`BoxPlotDef` + """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`) """ kwds = dict(box=box, clip=clip, color=color, extent=extent, median=median, opacity=opacity, orient=orient, outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) @@ -463,9 +437,7 @@ def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Un def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opacity=Undefined, orient=Undefined, rule=Undefined, ticks=Undefined, **kwds): - """Set the chart's mark to 'errorbar' - - For information on additional arguments, see :class:`ErrorBarDef` + """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`) """ kwds = dict(clip=clip, color=color, extent=extent, opacity=opacity, orient=orient, rule=rule, ticks=ticks, **kwds) @@ -479,9 +451,7 @@ def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opaci def mark_errorband(self, band=Undefined, borders=Undefined, clip=Undefined, color=Undefined, extent=Undefined, interpolate=Undefined, opacity=Undefined, orient=Undefined, tension=Undefined, **kwds): - """Set the chart's mark to 'errorband' - - For information on additional arguments, see :class:`ErrorBandDef` + """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`) """ kwds = dict(band=band, borders=borders, clip=clip, color=color, extent=extent, interpolate=interpolate, opacity=opacity, orient=orient, tension=tension, **kwds) diff --git a/altair/vegalite/v4/schema/mixins.py b/altair/vegalite/v4/schema/mixins.py index bb1860f29..8d6176dcd 100644 --- a/altair/vegalite/v4/schema/mixins.py +++ b/altair/vegalite/v4/schema/mixins.py @@ -32,9 +32,7 @@ def mark_arc(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Un url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'arc' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'arc' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -91,9 +89,7 @@ def mark_area(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'area' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'area' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -150,9 +146,7 @@ def mark_bar(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Un url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'bar' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'bar' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -209,9 +203,7 @@ def mark_image(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole= tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'image' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'image' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -268,9 +260,7 @@ def mark_line(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'line' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'line' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -327,9 +317,7 @@ def mark_point(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole= tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'point' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'point' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -386,9 +374,7 @@ def mark_rect(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'rect' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'rect' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -445,9 +431,7 @@ def mark_rule(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'rule' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'rule' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -504,9 +488,7 @@ def mark_text(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'text' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'text' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -563,9 +545,7 @@ def mark_tick(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'tick' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'tick' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -622,9 +602,7 @@ def mark_trail(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole= tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'trail' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'trail' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -681,9 +659,7 @@ def mark_circle(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'circle' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'circle' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -740,9 +716,7 @@ def mark_square(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'square' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'square' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -800,9 +774,7 @@ def mark_geoshape(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRo url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'geoshape' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'geoshape' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -838,9 +810,7 @@ def mark_geoshape(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRo def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds): - """Set the chart's mark to 'boxplot' - - For information on additional arguments, see :class:`BoxPlotDef` + """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`) """ kwds = dict(box=box, clip=clip, color=color, extent=extent, median=median, opacity=opacity, orient=orient, outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) @@ -854,9 +824,7 @@ def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Un def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opacity=Undefined, orient=Undefined, rule=Undefined, size=Undefined, thickness=Undefined, ticks=Undefined, **kwds): - """Set the chart's mark to 'errorbar' - - For information on additional arguments, see :class:`ErrorBarDef` + """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`) """ kwds = dict(clip=clip, color=color, extent=extent, opacity=opacity, orient=orient, rule=rule, size=size, thickness=thickness, ticks=ticks, **kwds) @@ -870,9 +838,7 @@ def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opaci def mark_errorband(self, band=Undefined, borders=Undefined, clip=Undefined, color=Undefined, extent=Undefined, interpolate=Undefined, opacity=Undefined, orient=Undefined, tension=Undefined, **kwds): - """Set the chart's mark to 'errorband' - - For information on additional arguments, see :class:`ErrorBandDef` + """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`) """ kwds = dict(band=band, borders=borders, clip=clip, color=color, extent=extent, interpolate=interpolate, opacity=opacity, orient=orient, tension=tension, **kwds) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 87b1bcaf1..12dc75775 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -885,7 +885,7 @@ def _add_transform(self, *transforms): def transform_aggregate(self, aggregate=Undefined, groupby=Undefined, **kwds): """ - Add an AggregateTransform to the schema. + Add an :class:`AggregateTransform` to the schema. Parameters ---------- @@ -959,7 +959,7 @@ def transform_aggregate(self, aggregate=Undefined, groupby=Undefined, **kwds): def transform_bin(self, as_=Undefined, field=Undefined, bin=True, **kwargs): """ - Add a BinTransform to the schema. + Add a :class:`BinTransform` to the schema. Parameters ---------- @@ -1015,7 +1015,7 @@ def transform_bin(self, as_=Undefined, field=Undefined, bin=True, **kwargs): def transform_calculate(self, as_=Undefined, calculate=Undefined, **kwargs): """ - Add a CalculateTransform to the schema. + Add a :class:`CalculateTransform` to the schema. Parameters ---------- @@ -1088,7 +1088,7 @@ def transform_density( minsteps=Undefined, steps=Undefined, ): - """Add a DensityTransform to the spec. + """Add a :class:`DensityTransform` to the spec. Attributes ---------- @@ -1154,7 +1154,7 @@ def transform_impute( value=Undefined, ): """ - Add an ImputeTransform to the schema. + Add an :class:`ImputeTransform` to the schema. Parameters ---------- @@ -1217,7 +1217,7 @@ def transform_joinaggregate( self, joinaggregate=Undefined, groupby=Undefined, **kwargs ): """ - Add a JoinAggregateTransform to the schema. + Add a :class:`JoinAggregateTransform` to the schema. Parameters ---------- @@ -1268,7 +1268,7 @@ def transform_joinaggregate( # TODO: Update docstring def transform_filter(self, filter, **kwargs): """ - Add a FilterTransform to the schema. + Add a :class:`FilterTransform` to the schema. Parameters ---------- @@ -1300,7 +1300,7 @@ def transform_filter(self, filter, **kwargs): return self._add_transform(core.FilterTransform(filter=filter, **kwargs)) def transform_flatten(self, flatten, as_=Undefined): - """Add a FlattenTransform to the schema. + """Add a :class:`FlattenTransform` to the schema. Parameters ---------- @@ -1328,7 +1328,7 @@ def transform_flatten(self, flatten, as_=Undefined): ) def transform_fold(self, fold, as_=Undefined): - """Add a FoldTransform to the spec. + """Add a :class:`FoldTransform` to the spec. Parameters ---------- @@ -1353,7 +1353,7 @@ def transform_fold(self, fold, as_=Undefined): def transform_loess( self, on, loess, as_=Undefined, bandwidth=Undefined, groupby=Undefined ): - """Add a LoessTransform to the spec. + """Add a :class:`LoessTransform` to the spec. Parameters ---------- @@ -1395,7 +1395,7 @@ def transform_lookup( default=Undefined, **kwargs, ): - """Add a DataLookupTransform or SelectionLookupTransform to the chart + """Add a :class:`DataLookupTransform` or :class:`SelectionLookupTransform` to the chart Attributes ---------- @@ -1445,7 +1445,7 @@ def transform_lookup( def transform_pivot( self, pivot, value, groupby=Undefined, limit=Undefined, op=Undefined ): - """Add a pivot transform to the chart. + """Add a :class:`PivotTransform` to the chart. Parameters ---------- @@ -1491,7 +1491,7 @@ def transform_quantile( probs=Undefined, step=Undefined, ): - """Add a quantile transform to the chart + """Add a :class:`QuantileTransform` to the chart Parameters ---------- @@ -1540,7 +1540,7 @@ def transform_regression( order=Undefined, params=Undefined, ): - """Add a RegressionTransform to the chart. + """Add a :class:`RegressionTransform` to the chart. Parameters ---------- @@ -1596,7 +1596,7 @@ def transform_regression( def transform_sample(self, sample=1000): """ - Add a SampleTransform to the schema. + Add a :class:`SampleTransform` to the schema. Parameters ---------- @@ -1616,7 +1616,7 @@ def transform_sample(self, sample=1000): def transform_stack(self, as_, stack, groupby, offset=Undefined, sort=Undefined): """ - Add a StackTransform to the schema. + Add a :class:`StackTransform` to the schema. Parameters ---------- @@ -1653,7 +1653,7 @@ def transform_timeunit( self, as_=Undefined, field=Undefined, timeUnit=Undefined, **kwargs ): """ - Add a TimeUnitTransform to the schema. + Add a :class:`TimeUnitTransform` to the schema. Parameters ---------- @@ -1738,7 +1738,7 @@ def transform_window( sort=Undefined, **kwargs, ): - """Add a WindowTransform to the schema + """Add a :class:`WindowTransform` to the schema Parameters ---------- diff --git a/altair/vegalite/v5/schema/mixins.py b/altair/vegalite/v5/schema/mixins.py index 5abe99e58..3359bbe95 100644 --- a/altair/vegalite/v5/schema/mixins.py +++ b/altair/vegalite/v5/schema/mixins.py @@ -32,9 +32,7 @@ def mark_arc(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Un url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'arc' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'arc' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -91,9 +89,7 @@ def mark_area(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'area' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'area' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -150,9 +146,7 @@ def mark_bar(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Un url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'bar' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'bar' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -209,9 +203,7 @@ def mark_image(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole= tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'image' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'image' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -268,9 +260,7 @@ def mark_line(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'line' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'line' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -327,9 +317,7 @@ def mark_point(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole= tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'point' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'point' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -386,9 +374,7 @@ def mark_rect(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'rect' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'rect' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -445,9 +431,7 @@ def mark_rule(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'rule' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'rule' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -504,9 +488,7 @@ def mark_text(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'text' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'text' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -563,9 +545,7 @@ def mark_tick(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole=U tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'tick' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'tick' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -622,9 +602,7 @@ def mark_trail(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole= tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'trail' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'trail' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -681,9 +659,7 @@ def mark_circle(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'circle' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'circle' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -740,9 +716,7 @@ def mark_square(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRole tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'square' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'square' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -800,9 +774,7 @@ def mark_geoshape(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRo url=Undefined, width=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined, **kwds): - """Set the chart's mark to 'geoshape' - - For information on additional arguments, see :class:`MarkDef` + """Set the chart's mark to 'geoshape' (see :class:`MarkDef`) """ kwds = dict(align=align, angle=angle, aria=aria, ariaRole=ariaRole, ariaRoleDescription=ariaRoleDescription, aspect=aspect, bandSize=bandSize, @@ -838,9 +810,7 @@ def mark_geoshape(self, align=Undefined, angle=Undefined, aria=Undefined, ariaRo def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Undefined, median=Undefined, opacity=Undefined, orient=Undefined, outliers=Undefined, rule=Undefined, size=Undefined, ticks=Undefined, **kwds): - """Set the chart's mark to 'boxplot' - - For information on additional arguments, see :class:`BoxPlotDef` + """Set the chart's mark to 'boxplot' (see :class:`BoxPlotDef`) """ kwds = dict(box=box, clip=clip, color=color, extent=extent, median=median, opacity=opacity, orient=orient, outliers=outliers, rule=rule, size=size, ticks=ticks, **kwds) @@ -854,9 +824,7 @@ def mark_boxplot(self, box=Undefined, clip=Undefined, color=Undefined, extent=Un def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opacity=Undefined, orient=Undefined, rule=Undefined, size=Undefined, thickness=Undefined, ticks=Undefined, **kwds): - """Set the chart's mark to 'errorbar' - - For information on additional arguments, see :class:`ErrorBarDef` + """Set the chart's mark to 'errorbar' (see :class:`ErrorBarDef`) """ kwds = dict(clip=clip, color=color, extent=extent, opacity=opacity, orient=orient, rule=rule, size=size, thickness=thickness, ticks=ticks, **kwds) @@ -870,9 +838,7 @@ def mark_errorbar(self, clip=Undefined, color=Undefined, extent=Undefined, opaci def mark_errorband(self, band=Undefined, borders=Undefined, clip=Undefined, color=Undefined, extent=Undefined, interpolate=Undefined, opacity=Undefined, orient=Undefined, tension=Undefined, **kwds): - """Set the chart's mark to 'errorband' - - For information on additional arguments, see :class:`ErrorBandDef` + """Set the chart's mark to 'errorband' (see :class:`ErrorBandDef`) """ kwds = dict(band=band, borders=borders, clip=clip, color=color, extent=extent, interpolate=interpolate, opacity=opacity, orient=orient, tension=tension, **kwds) diff --git a/doc/user_guide/API.rst b/doc/user_guide/API.rst index 94f89230b..9f2f47e9a 100644 --- a/doc/user_guide/API.rst +++ b/doc/user_guide/API.rst @@ -147,6 +147,7 @@ API Functions binding_radio binding_range binding_select + check_fields_and_encodings concat condition graticule @@ -157,6 +158,7 @@ API Functions selection selection_interval selection_multi + selection_point selection_single sequence sphere @@ -282,6 +284,7 @@ Low-Level Schema Wrappers Day DensityTransform DerivedStream + Dict DictInlineDataset DictSelectionInit DictSelectionInitInterval @@ -328,6 +331,7 @@ Low-Level Schema Wrappers FieldOrDatumDefWithConditionStringDatumDefText FieldOrDatumDefWithConditionStringFieldDefText FieldOrDatumDefWithConditionStringFieldDefstring + FieldRange FieldRangePredicate FieldValidPredicate FilterTransform @@ -410,7 +414,6 @@ Low-Level Schema Wrappers Orientation OverlayMarkDef Padding - Parameter ParameterExtent ParameterName ParameterPredicate diff --git a/tools/generate_schema_wrapper.py b/tools/generate_schema_wrapper.py index 2520df997..0a51869c2 100644 --- a/tools/generate_schema_wrapper.py +++ b/tools/generate_schema_wrapper.py @@ -491,9 +491,7 @@ def generate_vegalite_channel_wrappers(schemafile, version, imports=None): MARK_METHOD = ''' def mark_{mark}({def_arglist}): - """Set the chart's mark to '{mark}' - - For information on additional arguments, see :class:`{mark_def}` + """Set the chart's mark to '{mark}' (see :class:`{mark_def}`) """ kwds = dict({dict_arglist}) copy = self.copy(deep=False)