genome_spy.Angle¶
- class genome_spy.Angle(value, /, *, band=Undefined, condition=Undefined, datum=Undefined, description=Undefined, domainInert=Undefined, expr=Undefined, field=Undefined, format=Undefined, resolutionChannel=Undefined, title=Undefined, type=Undefined, legend=Undefined, scale=Undefined)View on GitHub¶
Bases:
ChannelGenerated wrapper for the
angleencoding channel.Methods
band(value)Return a channel with
bandupdated.condition(value)Return a channel with
conditionupdated.datum(value)Return a channel with
datumupdated.description(value)Return a channel with
descriptionupdated.domainInert(value)Return a channel with
domainInertupdated.expr(value)Return a channel with
exprupdated.field(value)Return a channel with
fieldupdated.format(value)Return a channel with
formatupdated.legend([value, backgroundFill, ...])Return a channel with a
Legendlegend.resolutionChannel(value)Return a channel with
resolutionChannelupdated.scale([value, align, assembly, base, bins, ...])Return a channel with a
Scalescale.sort([value, field, order])Return a channel with a
sortconfiguration.title(value)Return a channel with
titleupdated.to_dict()Return the JSON-serializable channel definition.
type(value)Return a channel with
typeupdated.value(value)Return a channel with
valueupdated.Attributes
definitionencoding_name- band(value)View on GitHub¶
Return a channel with
bandupdated.
- condition(value)View on GitHub¶
Return a channel with
conditionupdated.
- datum(value)View on GitHub¶
Return a channel with
datumupdated.
- description(value)View on GitHub¶
Return a channel with
descriptionupdated.
- domainInert(value)View on GitHub¶
Return a channel with
domainInertupdated.
- expr(value)View on GitHub¶
Return a channel with
exprupdated.
- field(value)View on GitHub¶
Return a channel with
fieldupdated.
- format(value)View on GitHub¶
Return a channel with
formatupdated.
- resolutionChannel(value)View on GitHub¶
Return a channel with
resolutionChannelupdated.
- title(value)View on GitHub¶
Return a channel with
titleupdated.
- type(value)View on GitHub¶
Return a channel with
typeupdated.
- value(value)View on GitHub¶
Return a channel with
valueupdated.
- sort(value=Undefined, /, *, field=Undefined, order=Undefined)View on GitHub¶
Return a channel with a
sortconfiguration.
- legend(value=Undefined, /, *, backgroundFill=Undefined, backgroundFillOpacity=Undefined, backgroundStroke=Undefined, backgroundStrokeOpacity=Undefined, backgroundStrokeWidth=Undefined, columns=Undefined, direction=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, labelLimit=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, style=Undefined, symbolFillColor=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, title=Undefined, titleOrient=Undefined, values=Undefined)View on GitHub¶
Return a channel with a
Legendlegend.- Parameters:
backgroundFill (str) – Fill color of the legend background.
backgroundFillOpacity (float) – Opacity of the legend background fill.
backgroundStroke (str) – Stroke color of the legend background.
backgroundStrokeOpacity (float) – Opacity of the legend background stroke.
backgroundStrokeWidth (float) – Stroke width of the legend background border.
columns (float) – The number of columns in which to arrange symbol legend entries.
direction (LegendDirection_T) – The direction in which legend entries are laid out. This is independent of
orient, which selects the legend region. __Default value:__"vertical"gradientLength (float) – Fixed length of the gradient ramp in pixels. This is the width of a horizontal ramp and the height of a vertical ramp. When omitted, the ramp fills available space when its direction is parallel to its legend region. Otherwise its natural length is 200 pixels.
gradientOpacity (float) – Opacity of the gradient ramp. __Default value:__
1gradientStrokeColor (str) – Stroke color of the gradient ramp border.
gradientStrokeWidth (float) – Stroke width of the gradient ramp border in pixels. __Default value:__
0gradientThickness (float) – Thickness of the gradient ramp in pixels. __Default value:__
12labelLimit (float) – Maximum label text width in pixels.
offset (float) – External gap in pixels between the legend and the plot edge.
orient (LegendOrient_T | ExprRef | dict[str, Any]) – The plot side or inside corner where the legend is placed. Side legends are placed outside the plot area. Corner legends are placed inside the plot area.
padding (float) – Internal padding in pixels around the legend content and background.
style (str | Sequence[str] | None) – Named style reference or references resolved from
config.style. If an array is provided, later styles override earlier ones. Set tonullto reset inherited legend styles.symbolFillColor (str) – Symbol fill color. Overrides inherited fill styling, except when the legend encodes fill or uses fill to encode color.
symbolOpacity (float) – Symbol opacity. Overrides inherited mark and encoding opacity, except when the legend encodes opacity. Set to 1 to keep a category key opaque while selections dim the data marks.
symbolSize (float) – Symbol size in pixels squared. Overrides inherited styling, except when the legend encodes size.
symbolStrokeColor (str) – Symbol stroke color. Overrides inherited stroke styling, except when the legend encodes stroke or uses stroke to encode color.
symbolStrokeWidth (float) – Symbol stroke width in pixels. Overrides inherited styling, except when the legend encodes stroke width.
symbolType (str) – Symbol shape. Overrides inherited styling, except when the legend encodes shape.
tickCount (float) – Desired number of ticks for a quantitative gradient legend. Explicit
valuestake precedence over this property. __Default value:__5title (str | None) – Title text for the legend. If
null, the title is removed.titleOrient (LegendTitleOrient_T) – The side of the legend on which to place the title.
values (Sequence[str | float | bool]) – Explicit values to show in the legend. For discrete symbol legends, the values define an ordered subset of entries. For quantitative symbol and gradient legends, the values define the shown representative values or ticks.
- scale(value=Undefined, /, *, align=Undefined, assembly=Undefined, base=Undefined, bins=Undefined, clamp=Undefined, constant=Undefined, domain=Undefined, domainMax=Undefined, domainMid=Undefined, domainMin=Undefined, domainTransition=Undefined, exponent=Undefined, interpolate=Undefined, name=Undefined, nice=Undefined, numberingOffset=Undefined, padding=Undefined, paddingInner=Undefined, paddingOuter=Undefined, range=Undefined, reverse=Undefined, round=Undefined, scheme=Undefined, type=Undefined, zero=Undefined, zoom=Undefined)View on GitHub¶
Return a channel with a
Scalescale.- Parameters:
align (float) – The alignment of the steps within the scale range. This value must lie in the range
[0,1]. A value of0.5indicates that the steps should be centered within the range. A value of0or1may be used to shift the bands to one side, say to position them adjacent to an axis. __Default value:__0.5assembly (str | UrlGenomeDefinition | dict[str, Any] | InlineGenomeDefinition) – Genome assembly definition for locus scales. This can be: - A string reference to a named assembly (built-in or root-configured). - An inline anonymous assembly that defines either
contigsorurl. If undefined, the default genome from the genome store is used.base (float) – The logarithm base of the
logscale (default10).bins (Sequence[float]) – An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels.
clamp (bool) – If
true, values that exceed the data domain are clamped to either the minimum or maximum range value __Default value:__ derived from the Vega-Lite scale config’sclamp(trueby default).constant (float) – A constant determining the slope of the symlog function around zero. Only used for
symlogscales. __Default value:__1domain (ScalarDomain_T | Sequence[ChromosomalLocus | dict[str, Any]] | SelectionDomainRef | dict[str, Any] | ViewportDomainRef | ExprRef | Sequence[float | str | bool | ExprRef | dict[str, Any]]) – Customized domain values. For quantitative fields,
domaincan take the form of a two-element array with minimum and maximum values. Vega-Lite piecewise scales can be created by providing adomainwith more than two entries. For ordinal and nominal fields,domaincan be an array that lists valid input values. The domain can also be defined by an expression reference that evaluates to the domain array. Array elements may also be expression references. All parameter names referenced by a scale, including selection-domain parameters, resolve from the view that owns the scale resolution. For a shared scale, declare controlling parameters on that owning composed view or an ancestor.domainMax (float) – Sets the maximum value in the scale domain, overriding the
domainproperty. This property is only intended for use with scales having continuous domains.domainMid (float) – Inserts a single mid-point value into a two-element domain. The mid-point value must lie between the domain minimum and maximum values. This property can be useful for setting a midpoint for Vega-Lite diverging color scales. The domainMid property is only intended for use with scales supporting continuous, piecewise domains.
domainMin (float) – Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains.
domainTransition (bool) – Controls whether domain updates are applied immediately or with a smooth transition. Set this to
falseto apply domain updates immediately. The default istrue, except for domains that includeExprRef``s, which default to ``falseunless overridden. __Default value:__true, exceptfalseforExprRef-driven domains.exponent (float) – The exponent of the
powscale.interpolate (ScaleInterpolate_T | ScaleInterpolateParams | ScaleInterpolateParamsKwds) – The interpolation method for range values. By default, a general interpolator for numbers, dates, strings and colors (in HCL space) is used. For color ranges, this property allows interpolation in alternative color spaces. Legal values include
rgb,hsl,hsl-long,lab,hcl,hcl-long,cubehelixandcubehelix-long(‘-long’ variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued type property and an optional numeric gamma property applicable to rgb and cubehelix interpolators. For more, see the d3-interpolate documentation. __Default value:__hclname (str) – The name of the scale. Names are optional but allow the scales to be referenced and found with the API.
nice (bool | float | dict[str, Any]) – Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of [0.201479…, 0.996679…], a nice domain might be [0.2, 1.0]. For quantitative scales such as linear,
nicecan be either a boolean flag or a number. Ifniceis a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain. __Default value:__truefor unbinned quantitative fields;falseotherwise.numberingOffset (float) – The offset added to data values when formatting tick labels on index and locus scales. This property does not transform data values. __Default value:__
0padding (float) – For Vega-Lite continuous scales, expands the scale domain to accommodate the specified number of pixels on each of the scale range. The scale range must represent pixels for this parameter to function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the
zero,nice,domainMin, anddomainMaxproperties. For Vega-Lite band scales, shortcut for settingpaddingInnerandpaddingOuterto the same value. For Vega-Lite point scales, alias forpaddingOuter. __Default value:__ For continuous scales, derived from the Vega-Lite scale config’scontinuousPadding. For band and point scales, seepaddingInnerandpaddingOuter. By default, Vega-Lite sets padding such that width/height = number of unique values * step.paddingInner (float) – The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1]. For point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands). __Default value:__ derived from the Vega-Lite scale config’s
bandPaddingInner.paddingOuter (float) – The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1]. __Default value:__ derived from the Vega-Lite scale config’s
bandPaddingOuterfor band scales andpointPaddingfor point scales. By default, Vega-Lite sets outer padding such that width/height = number of unique values * step.range (Sequence[float | str | ExprRef | dict[str, Any]] | str) – The range of the scale. One of: - A string indicating a pre-defined named scale range from Vega-Lite (e.g., example,
"symbol", or"diverging"). - For Vega-Lite continuous scales, two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a Vega-Lite piecewise scale. Array elements may also be expression references, which use the parameter scope of the view that owns the scale resolution. - For Vega-Lite discrete and Vega-Lite discretizing scales, an array of desired output values. Array elements may also be expression references, which use the parameter scope of the view that owns the scale resolution. __Notes:__ 1) For color scales you can also specify a colorschemeinstead ofrange. 2) Any directly specifiedrangeforxandychannels will be ignored. Range can be customized via the view’s corresponding Vega-Lite size (widthandheight).reverse (bool) – If true, reverses the order of the scale range. __Default value:__
false.round (bool) – If
true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid. __Default value:__false.scheme (str | SchemeParams | SchemeParamsKwds) – A string indicating a color Vega-Lite scheme name (e.g.,
"category10"or"blues") or a Vega-Lite scheme parameter object. Discrete color schemes may be used with Vega-Lite discrete or Vega-Lite discretizing scales. Continuous color schemes are intended for use with color scales. For the full list of supported schemes, please refer to the Vega Scheme reference.type (ScaleType_T) – The type of scale. GenomeSpy follows the Vega-Lite scale model; the links below refer to the Vega-Lite documentation: 1) Continuous Scales – mapping continuous domains to continuous output ranges (
"linear","pow","sqrt","symlog","log","time","utc"). 2) Discrete Scales – mapping discrete domains to discrete ("ordinal") or continuous ("band"and"point") output ranges. 3) Discretizing Scales – mapping continuous domains to discrete output ranges"bin-ordinal","quantile","quantize"and"threshold". GenomeSpy also provides index and locus scales for sequence and genomic coordinates. __Default value:__ please see the Vega-Lite scale type table.zero (bool) – If
true, ensures that a zero baseline value is included in the scale domain. __Default value:__truefor x and y channels if the quantitative field is not binned and no customdomainis provided;falseotherwise. __Note:__ Log scales do not supportzero.zoom (bool | ZoomParams | ZoomParamsKwds) – If
trueand the scale is used on a positional channel, it can bee zoomed and translated interactively.
- to_dict()View on GitHub¶
Return the JSON-serializable channel definition.