genome_spy.TopLevelSpec

class genome_spy.TopLevelSpecView on GitHub

Bases: TopLevelMergeMixin, EncodingMethodMixin, TransformMethodMixin

Shared behavior for top-level GenomeSpy specifications.

Methods

add_params(*params)

Return a chart with parameter declarations appended.

display(*[, bundle_url, embed_options, ...])

Display this chart once with temporary rendering options.

encode(*args[, angle, color, direction, dx, ...])

Return a new specification with merged channel encodings.

from_dict(spec, *[, validate])

Construct a renderable chart from a GenomeSpy specification.

from_json(json_string, *[, validate])

Construct a renderable chart from a JSON specification.

save(path, *[, format, bundle_url, ...])

Save the chart as JSON or HTML.

to_dict(*[, include_schema, validate])

Serialize the spec to a JSON-compatible dictionary.

to_html(*[, bundle_url, embed_options, ...])

Render the chart as an HTML snippet.

to_json(*[, include_schema, validate])

Serialize the spec to formatted JSON.

transform(*transforms)

Add one or more arbitrary GenomeSpy transforms.

transform_aggregate(*[, as_, description, ...])

Add a aggregate transform.

transform_alignment_mismatches(*[, cigar, ...])

Add a alignmentMismatches transform.

transform_axis_label_layout(*, channel, ...)

Add a axisLabelLayout transform.

transform_calculate([as_, calculate])

Add one or more formula transforms.

transform_collect(*[, description, groupby, ...])

Add a collect transform.

transform_coordinate_lookup(*, from_, key[, ...])

Add a coordinateLookup transform.

transform_coverage(*, end, start[, as_, ...])

Add a coverage transform.

transform_cross(*, from_[, description])

Add a cross transform.

transform_displace1d(*, length, pos[, as_, ...])

Add a displace1d transform.

transform_filter([expression, description, ...])

Add a filter transform.

transform_filter_scored_labels(*, pos, ...)

Add a filterScoredLabels transform.

transform_flatten([fields, as_, ...])

Add a flatten transform.

transform_flatten_cigar(*[, cigar, ...])

Add a flattenCigar transform.

transform_flatten_compressed_exons(*[, as_, ...])

Add a flattenCompressedExons transform.

transform_flatten_delimited(*, field, separator)

Add a flattenDelimited transform.

transform_flatten_sequence(*[, as_, ...])

Add a flattenSequence transform.

transform_formula(*, as_, expr[, description])

Add a formula transform.

transform_identifier(*[, as_, description])

Add a identifier transform.

transform_linearize_genomic_coordinate(*, ...)

Add a linearizeGenomicCoordinate transform.

transform_lookup(*, from_, key[, as_, ...])

Add a lookup transform.

transform_measure_text(*, as_, field, fontSize)

Add a measureText transform.

transform_merge_facets(*[, description])

Add a mergeFacets transform.

transform_pack_legend_labels(*, labelWidth)

Add a packLegendLabels transform.

transform_pileup(*, end, start[, as_, ...])

Add a pileup transform.

transform_project(*, fields[, as_, description])

Add a project transform.

transform_regex_extract(*, as_, field, regex)

Add a regexExtract transform.

transform_regex_fold(*, asValue, columnRegex)

Add a regexFold transform.

transform_sample([size, description])

Add a sample transform.

transform_set_intersection(*, element, set)

Add a setIntersection transform.

transform_stack(*, groupby[, as_, ...])

Add a stack transform.

transform_truncate_text(*, field, fontSize)

Add a truncateText transform.

transform_window(*, ops[, as_, description, ...])

Add a window transform.

widget(*[, bundle_url, embed_options, ...])

Create a notebook widget for the spec.

with_config([value, arrow, axis, ...])

Return a copy with merged top-level config.

with_scales([value, angle, color, ...])

Return a copy with merged top-level scales.

with_view([value, fill, fillOpacity, ...])

Return a copy with merged top-level view.

Attributes

spec

Return the rendered GenomeSpy specification with JSON display.

add_params(*params)View on GitHub

Return a chart with parameter declarations appended.

Parameter handles are unwrapped only when the chart is serialized, so the same handle can also be reused in expressions, conditions, and filters.

Parameters:

*params – Parameter handles or generated parameter definitions.

Returns:

A new chart with the declarations appended in argument order.

Raises:
  • TypeError – If an argument is not a parameter declaration.

  • ValueError – If an explicit parameter name is declared twice.

Example

>>> import genome_spy as gs
>>> cutoff = gs.param("cutoff", value=0.5)
>>> gs.Chart().add_params(cutoff).to_dict(validate=False)["params"]
[{'name': 'cutoff', 'value': 0.5}]
transform(*transforms)View on GitHub

Add one or more arbitrary GenomeSpy transforms.

Description:

Use this generic method when GenomeSpy supports a transform that does not yet have a dedicated handwritten helper in the Python API. Each transform may be a raw mapping or a generated schema wrapper.

Parameters:

*transforms – One or more transform definitions.

Returns:

A new spec with the transforms appended in order.

Raises:

TypeError – If a transform is not a mapping or schema wrapper.

Example

>>> chart.transform({"type": "collect", "sort": {"field": ["x"]}})
classmethod from_dict(spec, *, validate=True)View on GitHub

Construct a renderable chart from a GenomeSpy specification.

Parameters:
  • spec – Complete GenomeSpy specification.

  • validate – Validate the input against the generated root schema.

Returns:

A chart matching the specification’s structural root variant.

Raises:
  • SchemaValidationError – If validation fails.

  • TypeError – If the specification is not a mapping.

  • ValueError – If no supported root structure is present.

Example

>>> chart = TopLevelSpec.from_dict({"mark": "point"})
classmethod from_json(json_string, *, validate=True)View on GitHub

Construct a renderable chart from a JSON specification.

Parameters:
  • json_string – JSON-encoded GenomeSpy specification.

  • validate – Validate the input against the generated root schema.

Returns:

A chart matching the specification’s structural root variant.

Raises:
  • json.JSONDecodeError – If json_string is invalid JSON.

  • SchemaValidationError – If schema validation fails.

  • TypeError – If the decoded value is not a mapping.

  • ValueError – If no supported root structure is present.

Example

>>> chart = TopLevelSpec.from_json('{"mark": "point"}')
to_dict(*, include_schema=True, validate=True)View on GitHub

Serialize the spec to a JSON-compatible dictionary.

property specView on GitHub

Return the rendered GenomeSpy specification with JSON display.

to_json(*, include_schema=True, validate=True)View on GitHub

Serialize the spec to formatted JSON.

to_html(*, bundle_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/bundle/index.es.js', embed_options=None, controls=Undefined, controls_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/src/controls.js', inspector_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/inspector@0.87.0/dist/index.es.js', container_id=None)View on GitHub

Render the chart as an HTML snippet.

Description:

The snippet loads the pinned GenomeSpy browser modules. Controls affect only this HTML representation and are not serialized into the chart specification.

Parameters:
  • bundle_url – Browser module containing GenomeSpy’s embed function.

  • embed_options – Options passed directly to embed.

  • controls – Controls to mount, True for defaults, or False to disable them.

  • controls_module_url – Browser module containing Core controls.

  • inspector_module_url – Browser module containing the Inspector control.

  • container_id – Optional HTML id for the chart container.

Returns:

An HTML snippet containing the chart specification and embed code.

Raises:
  • TypeError – If the controls value has an invalid type.

  • ValueError – If a control name is unknown or duplicated.

Example

>>> chart.to_html(controls=["svg", "png"])
save(path, *, format=None, bundle_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/bundle/index.es.js', embed_options=None, controls=Undefined, controls_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/src/controls.js', inspector_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/inspector@0.87.0/dist/index.es.js')View on GitHub

Save the chart as JSON or HTML.

Description:

The filename suffix selects the format unless format is given. Rendering controls and embed options apply only to HTML output.

Parameters:
  • path – Destination path.

  • format – Explicit "json" or "html" format.

  • bundle_url – Browser module containing GenomeSpy’s embed function.

  • embed_options – Options passed directly to embed for HTML output.

  • controls – HTML controls, True for defaults, or False to disable them.

  • controls_module_url – Browser module containing Core controls.

  • inspector_module_url – Browser module containing the Inspector control.

Returns:

None.

Raises:

ValueError – If the format is unsupported or HTML-only options are supplied for JSON output.

Example

>>> chart.save("chart.html", controls=False)
widget(*, bundle_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/bundle/index.es.js', embed_options=None, controls=Undefined, controls_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/src/controls.js', inspector_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/inspector@0.87.0/dist/index.es.js', parameter_names=(), parameter_values=None, enable_click_events=False)View on GitHub

Create a notebook widget for the spec.

Parameters:
  • bundle_url – GenomeSpy bundle URL used by the widget.

  • embed_options – Options passed to GenomeSpy’s embed function.

  • controls – Display controls, or False to disable them.

  • controls_module_url – Browser module containing Core controls.

  • inspector_module_url – Browser module containing the Inspector control.

  • parameter_names – Named GenomeSpy parameters synchronized with the widget’s parameter_values trait.

  • parameter_values – Initial values for the synchronized parameters.

  • enable_click_events – Whether clicked mark data is synchronized to clicked_datum and click_revision.

Returns:

An anywidget-backed JupyterChart.

Raises:
  • TypeError – If the controls value has an invalid type.

  • ValueError – If a control name is unknown or duplicated.

Example

>>> widget = chart.widget(controls=["png", "inspector"])
display(*, bundle_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/bundle/index.es.js', embed_options=None, controls=Undefined, controls_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/core@0.87.0/dist/src/controls.js', inspector_module_url='https://cdn.jsdelivr.net/npm/@genome-spy/inspector@0.87.0/dist/index.es.js')View on GitHub

Display this chart once with temporary rendering options.

Description:

This mirrors Altair’s display-time configuration: the supplied options affect this display call without changing chart JSON.

Parameters:
  • bundle_url – Browser module containing GenomeSpy’s embed function.

  • embed_options – Options passed directly to embed.

  • controls – Controls to mount, True for defaults, or False to disable them.

  • controls_module_url – Browser module containing Core controls.

  • inspector_module_url – Browser module containing the Inspector control.

Returns:

None.

Raises:
  • ImportError – If IPython is unavailable.

  • TypeError – If the controls value has an invalid type.

  • ValueError – If a control name is unknown or duplicated.

Example

>>> chart.display(controls=False)
encode(*args, angle=Undefined, color=Undefined, direction=Undefined, dx=Undefined, dy=Undefined, facetIndex=Undefined, fill=Undefined, fillOpacity=Undefined, key=Undefined, opacity=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, xOffset=Undefined, y=Undefined, y2=Undefined, yOffset=Undefined)View on GitHub

Return a new specification with merged channel encodings.

Parameters:
  • angle (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType) – Rotation angle of point and text marks.

  • color (FieldOrDatumDefWithConditionMarkPropFieldDefTypeStringNull | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefStringNull | MarkPropExprDefType | ValueDefWithConditionStringNullType) – Color of the marks – either fill or stroke color based on the filled property of mark definition. Note: 1) For fine-grained control over both fill and stroke colors of the marks, please use the fill and stroke channels. The fill or stroke encodings have higher precedence than color, thus may override the color encoding if conflicting encodings are specified. 2) See the GenomeSpy scale documentation for more information about customizing color schemes.

  • direction (DirectionDef | dict[str, Any]) – Direction of arrow marks. Encoded values are mapped with a discrete scale whose range values must be "forward" or "reverse". This channel is supported by arrow marks only and does not create a legend.

  • dx (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType | MarkPropExprDef) – Legacy horizontal pixel offset for point marks.

  • dy (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType | MarkPropExprDef) – Legacy vertical pixel offset for point marks. Positive values move in the opposite direction from yOffset.

  • facetIndex (FieldDefWithoutScale | dict[str, Any]) – For internal use

  • fill (FieldOrDatumDefWithConditionMarkPropFieldDefTypeStringNull | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefStringNull | MarkPropExprDefType | ValueDefWithConditionStringNullType) – Fill color of the marks. Note: The fill encoding has higher precedence than color, thus may override the color encoding if conflicting encodings are specified.

  • fillOpacity (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType) – Fill opacity of the marks.

  • key (FieldDefWithoutScale | dict[str, Any] | Sequence[FieldDefWithoutScale | dict[str, Any]]) – One or more data fields that uniquely identify rows for stable point selections and bookmarking across sessions. Unlike uniqueId (an implicit surrogate key), key fields must be stable in the source data. Use a single field definition for simple keys, or an array of field definitions for composite keys. For composite keys, field order is significant.

  • opacity (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType) – Opacity of the marks.

  • sample (FieldDefWithoutScale | dict[str, Any]) – Facet identifier for interactive filtering, sorting, and grouping in the App.

  • search (FieldDefWithoutScale | dict[str, Any] | Sequence[FieldDefWithoutScale | dict[str, Any]]) – One or more fields used by the App’s location/search input to match rows in this view. Use a single field definition for simple search, or an array for matching against multiple fields. A row matches when any configured search field matches the entered term.

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

  • shape (FieldOrDatumDefWithConditionMarkPropFieldDefTypeForShapeStringNull | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefStringNull | MarkPropExprDefTypeForShape | ValueDefWithConditionStringNullTypeForShape) – Shape of the mark. For point marks the supported values include: - plotting shapes: "circle", "square", "cross", "diamond", "triangle-up", "triangle-down", "triangle-right", or "triangle-left". - stroke-only "x" and "+" shapes, whose line thickness is controlled by strokeWidth - centered directional shape "triangle"

  • size (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType) – Size of the mark. - For "point" – the symbol size, or pixel area of the mark. - For "text" – the text’s font size. - For "arrow" – the stem thickness in pixels.

  • stroke (FieldOrDatumDefWithConditionMarkPropFieldDefTypeStringNull | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefStringNull | MarkPropExprDefType | ValueDefWithConditionStringNullType) – Stroke color of the marks. Note: The stroke encoding has higher precedence than color, thus may override the color encoding if conflicting encodings are specified.

  • strokeOpacity (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType) – Stroke opacity of the marks.

  • strokeWidth (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType) – Stroke width of the marks.

  • text (StringFieldDef | dict[str, Any] | StringDatumDef | ExprDef | ValueDefString) – Text of the text mark.

  • tooltip (StringFieldDef | dict[str, Any] | StringDatumDef | ExprDef | ValueDefString | Sequence[StringFieldDef | dict[str, Any] | StringDatumDef | ExprDef | ValueDefString] | None) – Fields, expressions, or values shown by the default tooltip handler. If omitted, the default tooltip handler shows the hovered datum’s properties. If null, the default tooltip handler shows no raw datum rows for this mark. Use an array to show multiple rows in a specific order.

  • uniqueId (FieldDefWithoutScale | dict[str, Any]) – For internal use

  • x (dict[str, Any] | None) – X coordinates of the marks. The value of this channel can be a number between zero and one.

  • x2 (Position2Def | dict[str, Any] | None) – X2 coordinates of the marks. The value of this channel can be a number between zero and one.

  • xOffset (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType | MarkPropExprDef | None) – Horizontal offset from the encoded x position, in logical pixels.

  • y (PositionFieldDef | dict[str, Any] | ChromPosDef | PositionDatumDef | PositionExprDef | ValueDefNumber | None) – Y coordinates of the marks. The value of this channel can be a number between zero and one.

  • y2 (Position2Def | dict[str, Any] | None) – Y2 coordinates of the marks. The value of this channel can be a number between zero and one.

  • yOffset (FieldOrDatumDefWithConditionMarkPropFieldDefTypeNumber | dict[str, Any] | FieldOrDatumDefWithConditionScaleDatumDefNumber | MarkPropExprDefType | ValueDefWithConditionNumberType | MarkPropExprDef | None) – Vertical offset from the encoded y position, in logical pixels.

transform_aggregate(*, as_=Undefined, description=Undefined, fields=Undefined, groupby=Undefined, ops=Undefined)View on GitHub

Add a aggregate transform.

Parameters:
  • as_ (Sequence[str]) – The names for the output fields corresponding to each aggregated field. If not provided, names will be automatically created using the operation and field names (e.g., sum_field, average_field).

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • fields (Sequence[Field_T]) – The data fields to apply aggregate functions to. This array should correspond with the ops and as arrays. If no fields or operations are specified, a count aggregation will be applied by default.

  • groupby (Sequence[Field_T]) – The fields by which to group the data. If these are not defined, all rows will be grouped into a single category.

  • ops (Sequence[AggregateOp_T]) – The aggregation operations to be performed on the fields, such as "sum", "q1", "median", "q3", or "count".

transform_alignment_mismatches(*, cigar=Undefined, copyFields=Undefined, description=Undefined, md=Undefined, quality=Undefined, sequence=Undefined, start=Undefined)View on GitHub

Add a alignmentMismatches transform.

Parameters:
  • cigar (Field_T) – The CIGAR string. __Default value:__ "cigar"

  • copyFields (Sequence[str]) – Top-level input fields copied to the emitted mismatch rows. If omitted, all input fields are copied. This can be used to avoid copying bulky fields such as read sequence or base quality arrays while still allowing the transform to read its input fields.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • md (Field_T) – MD tag field. __Default value:__ "md"

  • quality (Field_T) – Base quality field. __Default value:__ "qual"

  • sequence (Field_T) – Read sequence field. __Default value:__ "seq"

  • start (Field_T) – The read’s reference start coordinate. __Default value:__ "start"

transform_axis_label_layout(*, channel, labelAlign, labelAngle, labelBaseline, labelFlush, labelFlushOffset, labelFlushZoomExtent, labelFontSize, labelOffset, labelOverlap, labelSeparation, labelVisible, labelWidth, chromLabelAlign=Undefined, chromLabelPadding=Undefined, chromLabelSpacing=Undefined, chromLabelWidth=Undefined, description=Undefined)View on GitHub

Add a axisLabelLayout transform.

Parameters:
  • channel (PrimaryPositionalChannel_T) – Schema-defined channel property.

  • labelAlign (Literal['left', 'center', 'right']) – Schema-defined labelAlign property.

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

  • labelBaseline (Baseline_T) – Schema-defined labelBaseline property.

  • labelFlush (Literal[False] | float) – Schema-defined labelFlush property.

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

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

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

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

  • labelOverlap (Literal[False, 'auto', 'parity', 'greedy']) – Schema-defined labelOverlap property.

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

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

  • labelWidth (Field_T) – Schema-defined labelWidth property.

  • chromLabelAlign (Literal['left', 'center', 'right']) – Schema-defined chromLabelAlign property.

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

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

  • chromLabelWidth (Field_T) – Schema-defined chromLabelWidth property.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_calculate(as_=Undefined, calculate=Undefined, **kwargs)View on GitHub

Add one or more formula transforms.

Pass both direct arguments for one transform, or use keyword arguments to append one transform per output in insertion order.

Parameters:
  • as_ (str) – The (new) field where the computed value is written to

  • calculate (str) – An expression string

  • **kwargs (str | ExpressionOperand) – Additional output field names mapped to calculate values.

Returns:

A new specification with the transform or transforms appended.

Return type:

Self

Raises:

TypeError – If only one of as_ and calculate is provided.

Example

>>> chart.transform_calculate(doubled="datum.value * 2")
transform_collect(*, description=Undefined, groupby=Undefined, sort=Undefined)View on GitHub

Add a collect transform.

Parameters:
  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • groupby (Sequence[Field_T]) – Arranges the data into consecutive batches based on the groups. This is mainly intended for internal use so that faceted data can be handled as batches.

  • sort (CompareParams | CompareParamsKwds) – The sort order.

transform_coordinate_lookup(*, from_, key, as_=Undefined, channel=Undefined, default=Undefined, description=Undefined, fields=Undefined, values=Undefined)View on GitHub

Add a coordinateLookup transform.

Parameters:
  • from_ (CoordinateLookupInput | dict[str, Any]) – The lazy side input and its optional transforms. Rows outside the loaded side-input domain are not passed through.

  • key (Field_T | Sequence[Field_T]) – Coordinate field or [chrom, pos] fields in the lazy side input. The same fields in the primary data determine both the exact match and whether a row is within the loaded side-input interval.

  • as_ (Sequence[str]) – Output field names. Defaults to values. Requires an explicit values array.

  • channel (PrimaryPositionalChannel_T) – The positional channel shared with the lazy side input. __Default value:__ "x"

  • default (Any) – Value written when no side-input row matches. __Default value:__ null

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • fields (Field_T | Sequence[Field_T] | None) – Coordinate field or [chrom, pos] fields in the primary data. Defaults to key.

  • values (Sequence[Field_T] | None) – Fields to copy from a matching side-input row. Defaults to all fields except key.

transform_coverage(*, end, start, as_=Undefined, asChrom=Undefined, asEnd=Undefined, asStart=Undefined, chrom=Undefined, description=Undefined, weight=Undefined)View on GitHub

Add a coverage transform.

Parameters:
  • end (Field_T) – The field representing the end coordinate of the segment (exclusive).

  • start (Field_T) – The field representing the start coordinate of the segment (inclusive).

  • as_ (str) – The output field for the computed coverage.

  • asChrom (str) – The output field for the chromosome. Default: Same as chrom

  • asEnd (str) – The output field for the end coordinate. Default: Same as end

  • asStart (str) – The output field for the start coordinate. Default: Same as start

  • chrom (Field_T) – An optional chromosome field that is passed through. TODO: groupby

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • weight (Field_T) – A field representing an optional weight for the segment. Can be used with copy ratios, for example.

transform_cross(*, from_, description=Undefined)View on GitHub

Add a cross transform.

Parameters:
  • from_ (CrossInput | dict[str, Any]) – The finite eager foreign data and its optional preprocessing transforms.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_displace1d(*, length, pos, as_=Undefined, description=Undefined, extent=Undefined, positionFactor=Undefined)View on GitHub

Add a displace1d transform.

Parameters:
  • length (float | Field_T | ExprRef | dict[str, Any]) – The full collision length, including any desired spacing, or a field containing that length. The value uses the same units as the scaled positions and output displacement. An expression provides a reactive scalar length shared by all rows.

  • pos (Field_T) – The field containing the original position. Input rows must be ordered by ascending pos * positionFactor.

  • as_ (str) – The output field for signed displacement. __Default value:__ "displacement"

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • extent (Sequence[float] | ExprRef | dict[str, Any]) – Preferred outer bounds for the placed collision intervals, expressed in the original pos coordinate system. The bounds are multiplied by positionFactor together with the item positions. When all items cannot fit, they remain non-overlapping and extend beyond the bounds by the minimum necessary amount. An expression can update the bounds reactively.

  • positionFactor (float | ExprRef | dict[str, Any]) – A multiplier applied to pos before placement. An expression can convert position units to logical pixels and react to zoom or layout changes. Use an ascending pos sort for a positive factor and a descending sort for a negative factor. Place a collect transform before this transform to buffer input for expression-driven updates. __Default value:__ 1

transform_filter(expression=Undefined, *, description=Undefined, empty=Undefined, expr=Undefined, fields=Undefined, param=Undefined)View on GitHub

Add a filter transform.

Parameters:
  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • empty (bool) – If true, the filter retains all rows when the selection is empty. Default: true

  • expr (str) – An expression string. The row is removed if the expression evaluates to false.

  • fields (dict[str, Any]) – An optional mapping of positional channels to fields. Used to determine which fields are checked against the selection intervals.

  • param (str) – A selection parameter. The row is removed if it is not part of the selection.

transform_filter_scored_labels(*, pos, score, width, asMidpoint=Undefined, channel=Undefined, description=Undefined, lane=Undefined, padding=Undefined, pos2=Undefined)View on GitHub

Add a filterScoredLabels transform.

Parameters:
  • pos (Field_T) – The field representing element’s start position on the domain.

  • score (Field_T) – The field representing the score used for prioritization.

  • width (Field_T) – The field representing element’s width in pixels.

  • asMidpoint (str) – Outputs the average of pos and pos2 as the midpoint of the element. This is useful for elements that have a width, such as transcripts. The midpoint is clamped to the visible region of the element.

  • channel (Literal['x', 'y']) – Default: "x"

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • lane (Field_T) – An optional field representing element’s lane, e.g., if transcripts are shown using a piled up layout. Each line is processed separately.

  • padding (float) – Padding (in pixels) around the element. Default: 0

  • pos2 (Field_T) – The field representing element’s end position on the domain. If not specified, the pos field is used.

transform_flatten(fields=Undefined, as_=Undefined, *, description=Undefined, index=Undefined)View on GitHub

Add a flatten transform.

Parameters:
  • fields (Sequence[Field_T] | Field_T) – The field(s) to flatten. If no field is defined, the input row itself is treated as an array to be flattened.

  • as_ (Sequence[str] | str) – The output field name(s) for the flattened field. Default: the input fields.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • index (str) – The output field name for the zero-based index of the array values. If unspecified, an index field is not added.

transform_flatten_cigar(*, cigar=Undefined, copyFields=Undefined, description=Undefined, start=Undefined)View on GitHub

Add a flattenCigar transform.

Parameters:
  • cigar (Field_T) – The CIGAR string. __Default value:__ "cigar"

  • copyFields (Sequence[str]) – Top-level input fields copied to the emitted CIGAR operation rows. If omitted, all input fields are copied. This can be used to avoid copying bulky fields such as read sequence or base quality arrays while still allowing the transform to read its input fields.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • start (Field_T) – The read’s reference start coordinate. __Default value:__ "start"

transform_flatten_compressed_exons(*, as_=Undefined, description=Undefined, exons=Undefined, start=Undefined)View on GitHub

Add a flattenCompressedExons transform.

Parameters:
  • as_ (Sequence[str]) – Field names for the flattened exons. Default: ["exonStart", "exonEnd"]

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • exons (Field_T) – The field containing the exons. Default: "exons"

  • start (Field_T) – Start coordinate of the gene body. Default: "start"

transform_flatten_delimited(*, field, separator, as_=Undefined, description=Undefined)View on GitHub

Add a flattenDelimited transform.

Parameters:
  • field (Sequence[Field_T] | Field_T) – The field(s) to split and flatten

  • separator (Sequence[str] | str) – Separator(s) used on the field(s) TODO: Rename to delimiter

  • as_ (Sequence[str] | str) – The output field name(s) for the flattened field. Default: the input fields.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_flatten_sequence(*, as_=Undefined, description=Undefined, field=Undefined)View on GitHub

Add a flattenSequence transform.

Parameters:
  • as_ (Sequence[str]) – Name of the fields where the zero-based index number and flattened sequence letter are written to. Default: ["pos", "sequence"]

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • field (Field_T) – The field to flatten. Default: "sequence"

transform_formula(*, as_, expr, description=Undefined)View on GitHub

Add a formula transform.

Parameters:
  • as_ (str) – The (new) field where the computed value is written to

  • expr (str) – An expression string

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_identifier(*, as_=Undefined, description=Undefined)View on GitHub

Add a identifier transform.

Parameters:
  • as_ (str) – The field where the identifier is stored. __Default value:__ "_uniqueId"

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_linearize_genomic_coordinate(*, as_, chrom, pos, channel=Undefined, description=Undefined, offset=Undefined)View on GitHub

Add a linearizeGenomicCoordinate transform.

Parameters:
  • as_ (str | Sequence[str]) – The output field or fields for linearized coordinates.

  • chrom (Field_T) – The chromosome/contig field

  • pos (Field_T | Sequence[Field_T]) – The field or fields that contain intra-chromosomal positions

  • channel (Literal['x', 'y']) – Get the genome assembly from the scale of the channel. Default: "x"

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • offset (float | Sequence[float]) – An offset or offsets that allow for adjusting the numbering base. The offset is subtracted from the positions. GenomeSpy uses internally zero-based indexing with half-open intervals. UCSC-based formats (BED, etc.) generally use this scheme. However, for example, VCF files use one-based indexing and must be adjusted by setting the offset to 1. Default: 0

transform_lookup(*, from_, key, as_=Undefined, default=Undefined, description=Undefined, fields=Undefined, values=Undefined)View on GitHub

Add a lookup transform.

Parameters:
  • from_ (UrlData | dict[str, Any] | InlineData | NamedData | DynamicCallbackData | LazyData | LookupSelfInput) – The non-lazy data source that provides the lookup table, or the current input data.

  • key (Field_T | Sequence[Field_T]) – The key field or fields in the lookup table. When multiple fields are provided, they form a composite key.

  • as_ (Sequence[str]) – Output field names. Defaults to values. Requires an explicit values array.

  • default (Any) – Value written when no side-input row matches. __Default value:__ null

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • fields (Field_T | Sequence[Field_T] | None) – The fields in the input data to match against the lookup-table key. This array must have the same length and order as key. Defaults to key.

  • values (Sequence[Field_T] | None) – Fields to copy from a matching side-input row. Defaults to all fields except key.

transform_measure_text(*, as_, field, fontSize, description=Undefined, font=Undefined, fontStyle=Undefined, fontWeight=Undefined)View on GitHub

Add a measureText transform.

Parameters:
  • as_ (str) – The output field where the measured width is written.

  • field (Field_T) – The field that contains the text to be measured.

  • fontSize (float | ExprRef | dict[str, Any]) – The font size in pixels.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • font (str) – The font typeface. Uses the same asynchronously loaded SDF fonts as the "text" mark. Default: "Lato"

  • fontStyle (FontStyle_T) – The font style. Valid values: "normal" and "italic". Default: "normal"

  • fontWeight (FontWeight_T) – The font weight. The following strings and numbers are valid values: "thin" (100), "light" (300), "regular" (400), "normal" (400), "medium" (500), "bold" (700), "black" (900) Default: "regular"

transform_merge_facets(*, description=Undefined)View on GitHub

Add a mergeFacets transform.

Parameters:

description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_pack_legend_labels(*, labelWidth, columnPadding=Undefined, columns=Undefined, description=Undefined, direction=Undefined, fontSize=Undefined, labelOffset=Undefined, rowPadding=Undefined, symbolOffset=Undefined, symbolSize=Undefined, symbolStrokeWidth=Undefined, xOffset=Undefined, yExtent=Undefined, yOffset=Undefined)View on GitHub

Add a packLegendLabels transform.

Parameters:
  • labelWidth (Field_T) – The field that contains measured label width in pixels.

  • columnPadding (float) – Padding between columns in pixels. Default: 0

  • columns (float) – The number of columns in which to arrange entries.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • direction (Literal['vertical', 'horizontal']) – The direction in which entries are laid out. Default: "vertical"

  • fontSize (float) – Label font size in pixels. Default: 10

  • labelOffset (float) – Offset between the symbol and label in pixels. Default: 0

  • rowPadding (float) – Padding between rows in pixels. Default: 0

  • symbolOffset (float) – Horizontal offset for generated symbol coordinates in pixels. Default: 0

  • symbolSize (float | Field_T) – Symbol size in pixels squared, or a field containing per-entry symbol sizes in pixels squared. Default: 100

  • symbolStrokeWidth (float | Field_T) – Symbol stroke width in pixels, or a field containing per-entry stroke widths in pixels. Default: 0

  • xOffset (float) – Horizontal offset for all generated entry coordinates in pixels. Default: 0

  • yExtent (float | ExprRef | dict[str, Any]) – Height of the pixel-space layout area. When provided, the transform also emits inverted y coordinates for GenomeSpy’s unit y range.

  • yOffset (float) – Vertical offset for all generated entry coordinates in pixels. Default: 0

transform_pileup(*, end, start, as_=Undefined, description=Undefined, preference=Undefined, preferredOrder=Undefined, spacing=Undefined)View on GitHub

Add a pileup transform.

Parameters:
  • end (Field_T) – The field representing the end coordinate of the segment (exclusive).

  • start (Field_T) – The field representing the start coordinate of the segment (inclusive).

  • as_ (str) – The output field name for the computed lane. Default: "lane".

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • preference (Field_T) – An optional field indicating the preferred lane. Use together with the preferredOrder property.

  • preferredOrder (Sequence[str] | Sequence[float] | Sequence[bool]) – The order of the lane preferences. The first element contains the value that should place the segment on the first lane and so forth. If the preferred lane is occupied, the first available lane is taken.

  • spacing (float) – The spacing between adjacent segments on the same lane in coordinate units. Default: 1.

transform_project(*, fields, as_=Undefined, description=Undefined)View on GitHub

Add a project transform.

Parameters:
  • fields (Sequence[Field_T]) – The fields to be projected.

  • as_ (Sequence[str]) – New names for the projected fields. If omitted, the names of the source fields are used.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_regex_extract(*, as_, field, regex, description=Undefined, skipInvalidInput=Undefined)View on GitHub

Add a regexExtract transform.

Parameters:
  • as_ (str | Sequence[str]) – The new field or an array of fields where the extracted values are written.

  • field (Field_T) – The source field

  • regex (str) – A valid JavaScript regular expression with at least one group. For example: "^Sample(\d+)$". Read more at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • skipInvalidInput (bool) – Do not complain about invalid input. Just skip it and leave the new fields undefined on the affected row. Default: false

transform_regex_fold(*, asValue, columnRegex, asKey=Undefined, description=Undefined, skipRegex=Undefined)View on GitHub

Add a regexFold transform.

Parameters:
  • asValue (Sequence[str] | str) – A new column name for the extracted values.

  • columnRegex (Sequence[str] | str) – A regular expression that matches to column names. The regex must have one capturing group that is used for extracting the key (e.g., a sample id) from the column name.

  • asKey (str) – Default: "sample"

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • skipRegex (str) – An optional regex that matches to fields that should not be included in the new folded rows.

transform_sample(size=Undefined, *, description=Undefined)View on GitHub

Add a sample transform.

Parameters:
  • size (float) – The maximum sample size. Default: 500

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

transform_set_intersection(*, element, set, description=Undefined, membership=Undefined)View on GitHub

Add a setIntersection transform.

Parameters:
  • element (Field_T | Sequence[Field_T]) – Field identifying an element. Multiple fields form a compound identifier.

  • set (Field_T) – Field identifying a set.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • membership (Field_T) – Optional field containing a Boolean membership value. The values 0 and 1 are also accepted. When omitted, every input row denotes membership.

transform_stack(*, groupby, as_=Undefined, baseField=Undefined, cardinality=Undefined, description=Undefined, field=Undefined, offset=Undefined, sort=Undefined)View on GitHub

Add a stack transform.

Parameters:
  • groupby (Sequence[Field_T]) – The fields to be used for forming groups for different stacks.

  • as_ (Sequence[str]) – Fields to write the stacked values. Default: ["y0", "y1"]

  • baseField (Field_T) – The field that contains the base or amino acid. Used for information content calculation when the offset is "information". Rows that have null in the baseField are considered gaps and they are taken into account when scaling the the locus’ information content.

  • cardinality (float) – Cardinality, e.g., the number if distinct bases or amino acids. Used for information content calculation when the offset is "information". Default: 4

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • field (Field_T) – The field to stack. If no field is defined, a constant value of one is assumed.

  • offset (Literal['zero', 'center', 'normalize', 'information']) – How to offset the values in a stack. "zero" (default) starts stacking at 0. "center" centers the values around zero. "normalize" computes intra-stack percentages and normalizes the values to the range of [0, 1]. "information" computes a layout for a sequence logo. The total height of the stack reflects the group’s information content.

  • sort (CompareParams | CompareParamsKwds) – The sort order of data in each stack.

transform_truncate_text(*, field, fontSize, as_=Undefined, description=Undefined, ellipsis=Undefined, font=Undefined, fontStyle=Undefined, fontWeight=Undefined, limit=Undefined)View on GitHub

Add a truncateText transform.

Parameters:
  • field (Field_T) – The field that contains the text to be truncated.

  • fontSize (float) – The font size in pixels.

  • as_ (str) – The output field where the truncated text is written. Default: Same as field.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • ellipsis (str) – Text appended after truncation. Default: "...".

  • font (str) – The font typeface. Uses the same asynchronously loaded SDF fonts as the "text" mark. Default: "Lato"

  • fontStyle (FontStyle_T) – The font style. Valid values: "normal" and "italic". Default: "normal"

  • fontWeight (FontWeight_T) – The font weight. Default: "regular"

  • limit (float) – Maximum text width in pixels.

transform_window(*, ops, as_=Undefined, description=Undefined, fields=Undefined, frame=Undefined, groupby=Undefined, ignorePeers=Undefined, params=Undefined, sort=Undefined)View on GitHub

Add a window transform.

Parameters:
  • ops (Sequence[WindowOp_T]) – Window and aggregate operations to calculate. Entries align with fields, params, and as.

  • as_ (Sequence[str | None]) – Output field names. A missing or null entry uses the operation and field name joined with an underscore, such as sum_score. Operations without a field use only the operation name, such as rank.

  • description (str) – A description of the transform step. Can be used for documentation and agent context.

  • fields (Sequence[Field_T | None]) – Input fields for operations that use a field. Use null for operations such as rank and count that do not use one.

  • frame (Sequence[float | None]) – Inclusive offsets from the current sorted row that define the window. null leaves the corresponding side unbounded. __Default value:__ [null, 0]

  • groupby (Sequence[Field_T]) – Fields that divide the input into independent window partitions.

  • ignorePeers (bool) – Use row offsets without expanding frame boundaries to include sorted rows with equal values. __Default value:__ false

  • params (Sequence[float | None]) – Optional operation parameters. lag and lead use an offset, while ntile and nth_value use a positive integer.

  • sort (CompareParams | CompareParamsKwds) – Fields used to sort rows before window functions are calculated. Without sorting, rows retain their input order and no rows are peers.

with_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, 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 merged top-level 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.

  • 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.

with_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, xOffset=Undefined, y=Undefined, y2=Undefined, yOffset=Undefined)View on GitHub

Return a copy with merged top-level scales.

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.

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

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

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

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

with_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 merged top-level view.

Parameters:
  • fill (str) – 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) – 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