genome_spy.LayerSpec

class genome_spy.LayerSpec(axes=Undefined, baseUrl=Undefined, config=Undefined, cursor=Undefined, data=Undefined, datasets=Undefined, description=Undefined, domainInert=Undefined, encoding=Undefined, height=Undefined, layer=Undefined, legends=Undefined, name=Undefined, opacity=Undefined, overhang=Undefined, padding=Undefined, params=Undefined, resolve=Undefined, scales=Undefined, templates=Undefined, title=Undefined, transform=Undefined, view=Undefined, viewportHeight=Undefined, viewportWidth=Undefined, visible=Undefined, width=Undefined, zindex=Undefined, **kwds)View on GitHub

Bases: GenomeSpySchema

Generated wrapper for LayerSpec.

Methods

axes([value, x, y])

Return a copy with axes updated.

baseUrl(value)

Return a copy with baseUrl updated.

config([value, arrow, axis, axisBottom, ...])

Return a copy with a GenomeSpyConfig config.

copy(*[, deep])

Return a copy with optional keyword updates.

cursor([value, expr])

Return a copy with a ExprRef cursor.

data([value, description, ...])

Return a copy with data updated.

datasets(value)

Return a copy with datasets updated.

description(value)

Return a copy with description updated.

domainInert(value)

Return a copy with domainInert updated.

encoding([value, angle, color, direction, ...])

Return a copy with a Encoding encoding.

height([value, grow, maxPx, minPx, px])

Return a copy with a SizeDef height.

layer(value)

Return a copy with layer updated.

legends([value, angle, color, dx, dy, fill, ...])

Return a copy with legends updated.

name(value)

Return a copy with name updated.

opacity([value, channel, expr, ...])

Return a copy with opacity updated.

overhang([value, bottom, left, right, top])

Return a copy with a OverhangConfig overhang.

padding([value, bottom, left, right, top])

Return a copy with padding updated.

params(value)

Return a copy with params updated.

resolve([value, axis, legend, scale])

Return a copy with resolve updated.

resolve_references()

Return this class schema with referenced properties merged in.

scales([value, angle, color, direction, dx, ...])

Return a copy with scales updated.

templates(value)

Return a copy with templates updated.

title([value, align, anchor, angle, ...])

Return a copy with a Title title.

to_dict(*[, validate])

Serialize this schema wrapper to a JSON-compatible dictionary.

to_json(*[, validate])

Serialize this schema wrapper to formatted JSON.

transform(value)

Return a copy with transform updated.

validate(instance)

Validate an instance against this wrapper's schema.

view([value, fill, fillOpacity, shadowBlur, ...])

Return a copy with a ViewBackground view.

viewportHeight([value, anchor, expr, grow, ...])

Return a copy with a ViewportSizeDef viewportHeight.

viewportWidth([value, anchor, expr, grow, ...])

Return a copy with a ViewportSizeDef viewportWidth.

visible(value)

Return a copy with visible updated.

width([value, grow, maxPx, minPx, px])

Return a copy with a SizeDef width.

zindex(value)

Return a copy with zindex updated.

axes(value=Undefined, /, *, x=Undefined, y=Undefined)View on GitHub

Return a copy with axes updated.

Parameters:
  • x (dict[str, Any]) – Schema-defined x property.

  • y (dict[str, Any]) – Schema-defined y property.

baseUrl(value)View on GitHub

Return a copy with baseUrl updated.

config(value=Undefined, /, *, arrow=Undefined, axis=Undefined, axisBottom=Undefined, axisIndex=Undefined, axisLeft=Undefined, axisLocus=Undefined, axisNominal=Undefined, axisOrdinal=Undefined, axisQuantitative=Undefined, axisRight=Undefined, axisTop=Undefined, axisX=Undefined, axisY=Undefined, header=Undefined, headerColumn=Undefined, headerRow=Undefined, legend=Undefined, legendTrack=Undefined, link=Undefined, mark=Undefined, point=Undefined, range=Undefined, rect=Undefined, rule=Undefined, scale=Undefined, style=Undefined, text=Undefined, tick=Undefined, title=Undefined, view=Undefined)View on GitHub

Return a copy with a GenomeSpyConfig config.

Parameters:
  • arrow (ArrowConfig | dict[str, Any]) – Defaults for arrow marks.

  • axis (AxisConfig | AxisConfigKwds) – Defaults shared by all axes.

  • axisBottom (AxisConfig | AxisConfigKwds) – Defaults for bottom-oriented axes.

  • axisIndex (AxisConfig | AxisConfigKwds) – Defaults for axes that visualize GenomeSpy index scales.

  • axisLeft (AxisConfig | AxisConfigKwds) – Defaults for left-oriented axes.

  • axisLocus (AxisConfig | AxisConfigKwds) – Defaults for axes that visualize GenomeSpy locus scales.

  • axisNominal (AxisConfig | AxisConfigKwds) – Defaults for axes that visualize nominal data.

  • axisOrdinal (AxisConfig | AxisConfigKwds) – Defaults for axes that visualize ordinal data.

  • axisQuantitative (AxisConfig | AxisConfigKwds) – Defaults for axes that visualize quantitative data.

  • axisRight (AxisConfig | AxisConfigKwds) – Defaults for right-oriented axes.

  • axisTop (AxisConfig | AxisConfigKwds) – Defaults for top-oriented axes.

  • axisX (AxisConfig | AxisConfigKwds) – Defaults for x axes.

  • axisY (AxisConfig | AxisConfigKwds) – Defaults for y axes.

  • header (FacetHeader | dict[str, Any]) – Defaults for facet category labels, using view-title property names.

  • headerColumn (FacetHeader | dict[str, Any]) – Defaults for column facet labels, overriding general header defaults.

  • headerRow (FacetHeader | dict[str, Any]) – Defaults for row facet labels, overriding general header defaults.

  • legend (LegendConfig | LegendConfigKwds) – Defaults shared by all legends. Set disable to true to suppress automatic legend creation by default.

  • legendTrack (LegendConfig | LegendConfigKwds) – Defaults for legends of track-like views that use index or locus scales on the x channel. __Default value:__ { "style": "track-bottom-legend" }

  • link (LinkConfig | LinkConfigKwds) – Defaults for link marks.

  • mark (MarkConfig | MarkConfigKwds) – Defaults shared by all mark types.

  • point (PointConfig | PointConfigKwds) – Defaults for point marks.

  • range (RangeConfig | RangeConfigKwds) – Named reusable ranges for channels such as shape, size, and color.

  • rect (RectConfig | RectConfigKwds) – Defaults for rect marks.

  • rule (RuleConfig | RuleConfigKwds) – Defaults for rule marks.

  • scale (ScaleConfig | ScaleConfigKwds) – Defaults for scale behavior and scale-type-specific buckets.

  • style (dict[str, Any]) – Named reusable style buckets that marks, axes, legends, titles, and views can reference through their style properties.

  • text (TextConfig | TextConfigKwds) – Defaults for text marks.

  • tick (TickConfig | dict[str, Any]) – Defaults for tick marks.

  • title (TitleConfig | TitleConfigKwds) – Defaults for view titles.

  • view (ViewConfig | ViewConfigKwds) – Defaults for view background styling, including fill, stroke, shadow, and z-order properties.

cursor(value=Undefined, /, *, expr=Undefined)View on GitHub

Return a copy with a ExprRef cursor.

Parameters:

expr (str) – The expression string.

data(value=Undefined, /, *, description=Undefined, dynamicCallbackSource=Undefined, format=Undefined, lazy=Undefined, name=Undefined, sequence=Undefined, url=Undefined, values=Undefined)View on GitHub

Return a copy with data updated.

Parameters:
  • description (str) – Schema-defined description property.

  • dynamicCallbackSource (bool) – The View class has getDynamicData() methods that provides the data. This is intended for internal use.

  • format (CsvDataFormat | dict[str, Any] | DsvDataFormat | JsonDataFormat | BedDataFormat | BedpeDataFormat | WigDataFormat | VcfDataFormat | OtherDataFormat) – Schema-defined format property.

  • lazy (LazyDataParams | dict[str, Any]) – Schema-defined lazy property.

  • name (str) – Schema-defined name property.

  • sequence (SequenceParams | dict[str, Any]) – Generate a sequence of numbers.

  • url (str | Sequence[str] | ExprRef | dict[str, Any] | UrlList | UrlTemplate) – An URL, a list of URLs, or a URL expansion definition from which to load the data set. A URL template can expand values from an ExprRef and attach the expanded value as a field to loaded rows. Gzip-compressed resources are decompressed transparently when the URL, MIME type, or payload indicates gzip content. Use the format.type property to ensure the loaded data is correctly parsed.

  • values (InlineDataset | dict[str, Any]) – The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects with a data property. Strings are parsed according to the specified format type.

datasets(value)View on GitHub

Return a copy with datasets updated.

description(value)View on GitHub

Return a copy with description updated.

domainInert(value)View on GitHub

Return a copy with domainInert updated.

encoding(value=Undefined, /, *, angle=Undefined, color=Undefined, direction=Undefined, dx=Undefined, dy=Undefined, facetIndex=Undefined, fill=Undefined, fillOpacity=Undefined, key=Undefined, opacity=Undefined, order=Undefined, sample=Undefined, search=Undefined, semanticScore=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, text=Undefined, tooltip=Undefined, uniqueId=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined)View on GitHub

Return a copy with a Encoding encoding.

Parameters:
height(value=Undefined, /, *, grow=Undefined, maxPx=Undefined, minPx=Undefined, px=Undefined)View on GitHub

Return a copy with a SizeDef height.

Parameters:
  • grow (float) – Share of the remaining space. See child sizing for details.

  • maxPx (float) – Maximum size in pixels.

  • minPx (float) – Minimum size in pixels.

  • px (float) – Size in pixels

layer(value)View on GitHub

Return a copy with layer updated.

legends(value=Undefined, /, *, angle=Undefined, color=Undefined, dx=Undefined, dy=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, x2Offset=Undefined, xOffset=Undefined, y2Offset=Undefined, yOffset=Undefined)View on GitHub

Return a copy with legends updated.

Parameters:
  • angle (Legend | LegendKwds) – Schema-defined angle property.

  • color (Legend | LegendKwds) – Schema-defined color property.

  • dx (Legend | LegendKwds) – Schema-defined dx property.

  • dy (Legend | LegendKwds) – Schema-defined dy property.

  • fill (Legend | LegendKwds) – Schema-defined fill property.

  • fillOpacity (Legend | LegendKwds) – Schema-defined fillOpacity property.

  • opacity (Legend | LegendKwds) – Schema-defined opacity property.

  • shape (Legend | LegendKwds) – Schema-defined shape property.

  • size (Legend | LegendKwds) – Schema-defined size property.

  • stroke (Legend | LegendKwds) – Schema-defined stroke property.

  • strokeOpacity (Legend | LegendKwds) – Schema-defined strokeOpacity property.

  • strokeWidth (Legend | LegendKwds) – Schema-defined strokeWidth property.

  • x2Offset (Legend | LegendKwds) – Schema-defined x2Offset property.

  • xOffset (Legend | LegendKwds) – Schema-defined xOffset property.

  • y2Offset (Legend | LegendKwds) – Schema-defined y2Offset property.

  • yOffset (Legend | LegendKwds) – Schema-defined yOffset property.

name(value)View on GitHub

Return a copy with name updated.

opacity(value=Undefined, /, *, channel=Undefined, expr=Undefined, unitsPerPixel=Undefined, values=Undefined)View on GitHub

Return a copy with opacity updated.

Parameters:
  • channel (PrimaryPositionalChannel_T | Literal['auto']) – The positional channel whose scale domain controls the opacity. If set to "auto", both x and y scales may contribute. If omitted, x is used when available and y is used as a fallback.

  • expr (str) – The expression string.

  • unitsPerPixel (Sequence[float | ExprRef | dict[str, Any]]) – Opacity stops expressed as units (base pairs, for example) per pixel. The values must be positive. Each stop is paired with an opacity in values at the same index. Stops can be constants or expression references.

  • values (Sequence[float]) – Opacity values that match the given unitsPerPixel stops. Values outside the stop range are clamped to the nearest stop.

overhang(value=Undefined, /, *, bottom=Undefined, left=Undefined, right=Undefined, top=Undefined)View on GitHub

Return a copy with a OverhangConfig overhang.

Parameters:
  • bottom (bool) – Schema-defined bottom property.

  • left (bool) – Schema-defined left property.

  • right (bool) – Schema-defined right property.

  • top (bool) – Schema-defined top property.

padding(value=Undefined, /, *, bottom=Undefined, left=Undefined, right=Undefined, top=Undefined)View on GitHub

Return a copy with padding updated.

Parameters:
  • bottom (float) – Schema-defined bottom property.

  • left (float) – Schema-defined left property.

  • right (float) – Schema-defined right property.

  • top (float) – Schema-defined top property.

params(value)View on GitHub

Return a copy with params updated.

resolve(value=Undefined, /, *, axis=Undefined, legend=Undefined, scale=Undefined)View on GitHub

Return a copy with resolve updated.

Parameters:
scales(value=Undefined, /, *, angle=Undefined, color=Undefined, direction=Undefined, dx=Undefined, dy=Undefined, fill=Undefined, fillOpacity=Undefined, opacity=Undefined, shape=Undefined, size=Undefined, stroke=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, x=Undefined, x2=Undefined, x2Offset=Undefined, xOffset=Undefined, y=Undefined, y2=Undefined, y2Offset=Undefined, yOffset=Undefined)View on GitHub

Return a copy with scales updated.

Parameters:
  • angle (Scale | ScaleKwds) – Schema-defined angle property.

  • color (Scale | ScaleKwds) – Schema-defined color property.

  • direction (Scale | ScaleKwds) – Schema-defined direction property.

  • dx (Scale | ScaleKwds) – Schema-defined dx property.

  • dy (Scale | ScaleKwds) – Schema-defined dy property.

  • fill (Scale | ScaleKwds) – Schema-defined fill property.

  • fillOpacity (Scale | ScaleKwds) – Schema-defined fillOpacity property.

  • opacity (Scale | ScaleKwds) – Schema-defined opacity property.

  • shape (Scale | ScaleKwds) – Schema-defined shape property.

  • size (Scale | ScaleKwds) – Schema-defined size property.

  • stroke (Scale | ScaleKwds) – Schema-defined stroke property.

  • strokeOpacity (Scale | ScaleKwds) – Schema-defined strokeOpacity property.

  • strokeWidth (Scale | ScaleKwds) – Schema-defined strokeWidth property.

  • x (Scale | ScaleKwds) – Schema-defined x property.

  • x2 (Scale | ScaleKwds) – Schema-defined x2 property.

  • x2Offset (Scale | ScaleKwds) – Schema-defined x2Offset property.

  • xOffset (Scale | ScaleKwds) – Schema-defined xOffset property.

  • y (Scale | ScaleKwds) – Schema-defined y property.

  • y2 (Scale | ScaleKwds) – Schema-defined y2 property.

  • y2Offset (Scale | ScaleKwds) – Schema-defined y2Offset property.

  • yOffset (Scale | ScaleKwds) – Schema-defined yOffset property.

templates(value)View on GitHub

Return a copy with templates updated.

title(value=Undefined, /, *, align=Undefined, anchor=Undefined, angle=Undefined, baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, offset=Undefined, orient=Undefined, reserve=Undefined, style=Undefined, subtitle=Undefined, subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, subtitlePadding=Undefined, text=Undefined, zindex=Undefined)View on GitHub

Return a copy with a Title title.

Parameters:
  • align (Align_T) – Horizontal text alignment for title text. One of "left", "center", or "right".

  • anchor (TitleAnchor_T) – The anchor position for placing the title and subtitle text. One of "start", "middle", or "end". For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.

  • angle (float | ExprRef | dict[str, Any]) – Angle in degrees of title and subtitle text.

  • baseline (Baseline_T) – Vertical text baseline for title and subtitle text. One of "alphabetic" (default), "top", "middle", or "bottom".

  • color (str | ExprRef | dict[str, Any]) – Text color for title text.

  • dx (float) – Delta offset for title and subtitle text x-coordinate.

  • dy (float) – Delta offset for title and subtitle text y-coordinate.

  • font (str) – Font name for title text.

  • fontSize (float | ExprRef | dict[str, Any]) – Font size in pixels for title text.

  • fontStyle (FontStyle_T) – Font style for title text.

  • fontWeight (FontWeight_T) – Font weight for title text. This can be either a string (e.g "bold", "normal") or a number (100, 200, 300, …, 900 where "normal" = 400 and "bold" = 700).

  • frame (TitleFrame_T) – The reference frame for the title anchor. "group" anchors the title along the plot area. "bounds" anchors the title along the full bounds, including axes, legends, and other reserved space. __Default value:__ "group"

  • offset (float) – The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.

  • orient (TitleOrient_T) – Default title orientation ("none", "top", "bottom", "left", or "right")

  • reserve (bool) – Whether the title reserves layout space outside the plot area. Reserved titles are placed outside axes, legends, and other guide space on the same side. Setting this to false lets the title render without affecting layout, enabling wilder layouts where titles may overlap nearby content. __Default value:__ true

  • style (str | Sequence[str]) – A mark style property to apply to the title text mark. If not specified, a default style of "group-title" is applied.

  • subtitle (str | ExprRef | dict[str, Any]) – The subtitle text.

  • subtitleColor (str | ExprRef | dict[str, Any]) – Text color for subtitle text.

  • subtitleFont (str) – Font name for subtitle text.

  • subtitleFontSize (float | ExprRef | dict[str, Any]) – Font size in pixels for subtitle text.

  • subtitleFontStyle (FontStyle_T) – Font style for subtitle text.

  • subtitleFontWeight (FontWeight_T) – Font weight for subtitle text. This can be either a string (e.g "bold", "normal") or a number (100, 200, 300, …, 900 where "normal" = 400 and "bold" = 700).

  • subtitlePadding (float) – Padding in pixels between title and subtitle text. __Default value:__ 3

  • text (str | ExprRef | dict[str, Any]) – The title text.

  • zindex (float) – Z-order of the title relative to the view content. Values greater than 0 render after the view marks. Values less than or equal to 0 render before the marks. __Default value:__ 1

transform(value)View on GitHub

Return a copy with transform updated.

view(value=Undefined, /, *, fill=Undefined, fillOpacity=Undefined, shadowBlur=Undefined, shadowColor=Undefined, shadowOffsetX=Undefined, shadowOffsetY=Undefined, shadowOpacity=Undefined, stroke=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, strokeZindex=Undefined, style=Undefined, zindex=Undefined)View on GitHub

Return a copy with a ViewBackground view.

Parameters:
  • fill (str | ExprRef | dict[str, Any]) – Fill color of the view background.

  • fillOpacity (float) – Opacity of the view background fill.

  • shadowBlur (float | ExprRef | dict[str, Any]) – The blur radius of the drop shadow in pixels. Higher values produce a more diffuse shadow. Default value: 0

  • shadowColor (str | ExprRef | dict[str, Any]) – The color of the drop shadow. Any valid CSS color string is allowed. Default value: "black"

  • shadowOffsetX (float | ExprRef | dict[str, Any]) – The horizontal offset of the drop shadow in pixels. Positive values move the shadow to the right. Default value: 0

  • shadowOffsetY (float | ExprRef | dict[str, Any]) – The vertical offset of the drop shadow in pixels. Positive values move the shadow downward. Default value: 0

  • shadowOpacity (float | ExprRef | dict[str, Any]) – The opacity of the drop shadow. Value between 0 (fully transparent) and 1 (fully opaque). Default value: 0 (disabled)

  • stroke (str | ExprRef | dict[str, Any]) – Stroke color of the view background.

  • strokeOpacity (float) – Opacity of the view background stroke.

  • strokeWidth (float) – Stroke width of the view background border.

  • strokeZindex (float) – Z-order of the background stroke relative to the view content. Values greater than 0 render after the view marks. Values less than or equal to 0 render before the marks. __Default value:__ 0, or 10 when the view content is clipped or scrollable.

  • style (str | Sequence[str]) – Named style reference(s) resolved from config.style. If an array is provided, later styles override earlier ones. __Default value:__ "cell"

  • zindex (float) – Z-order of the background fill relative to the view content. Values greater than 0 render after the view marks. Values less than or equal to 0 render before the marks. __Default value:__ 0

viewportHeight(value=Undefined, /, *, anchor=Undefined, expr=Undefined, grow=Undefined, maxPx=Undefined, minPx=Undefined, px=Undefined)View on GitHub

Return a copy with a ViewportSizeDef viewportHeight.

Parameters:
  • anchor (Literal['start', 'end']) – Edge used for initial placement and preserved when content or viewport dimensions change. "start" means left for width and top for height; "end" means right or bottom. Content smaller than the viewport aligns to that edge too. Manual scrolling changes the pixel distance from it. __Default value:__ "start"

  • expr (str) – The expression string.

  • grow (float) – Share of the remaining space. See child sizing for details.

  • maxPx (float) – Maximum size in pixels.

  • minPx (float) – Minimum size in pixels.

  • px (float) – Size in pixels

viewportWidth(value=Undefined, /, *, anchor=Undefined, expr=Undefined, grow=Undefined, maxPx=Undefined, minPx=Undefined, px=Undefined)View on GitHub

Return a copy with a ViewportSizeDef viewportWidth.

Parameters:
  • anchor (Literal['start', 'end']) – Edge used for initial placement and preserved when content or viewport dimensions change. "start" means left for width and top for height; "end" means right or bottom. Content smaller than the viewport aligns to that edge too. Manual scrolling changes the pixel distance from it. __Default value:__ "start"

  • expr (str) – The expression string.

  • grow (float) – Share of the remaining space. See child sizing for details.

  • maxPx (float) – Maximum size in pixels.

  • minPx (float) – Minimum size in pixels.

  • px (float) – Size in pixels

visible(value)View on GitHub

Return a copy with visible updated.

width(value=Undefined, /, *, grow=Undefined, maxPx=Undefined, minPx=Undefined, px=Undefined)View on GitHub

Return a copy with a SizeDef width.

Parameters:
  • grow (float) – Share of the remaining space. See child sizing for details.

  • maxPx (float) – Maximum size in pixels.

  • minPx (float) – Minimum size in pixels.

  • px (float) – Size in pixels

zindex(value)View on GitHub

Return a copy with zindex updated.

copy(*, deep=True, **kwds)View on GitHub

Return a copy with optional keyword updates.

classmethod resolve_references()View on GitHub

Return this class schema with referenced properties merged in.

to_dict(*, validate=True)View on GitHub

Serialize this schema wrapper to a JSON-compatible dictionary.

to_json(*, validate=True)View on GitHub

Serialize this schema wrapper to formatted JSON.

classmethod validate(instance)View on GitHub

Validate an instance against this wrapper’s schema.