genome_spy.FacetMapping

class genome_spy.FacetMapping(column=Undefined, row=Undefined, **kwds)View on GitHub

Bases: GenomeSpySchema

Generated wrapper for FacetMapping.

Methods

column([value, description, domain, field, ...])

Return a copy with a FacetFieldDef column.

copy(*[, deep])

Return a copy with optional keyword updates.

resolve_references()

Return this class schema with referenced properties merged in.

row([value, description, domain, field, ...])

Return a copy with a FacetFieldDef row.

to_dict(*[, validate])

Serialize this schema wrapper to a JSON-compatible dictionary.

to_json(*[, validate])

Serialize this schema wrapper to formatted JSON.

validate(instance)

Validate an instance against this wrapper's schema.

column(value=Undefined, /, *, description=Undefined, domain=Undefined, field=Undefined, header=Undefined, sort=Undefined, title=Undefined)View on GitHub

Return a copy with a FacetFieldDef column.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • domain (Sequence[Scalar_T] | ExprRef | dict[str, Any]) – Categories to display, including empty cells. An expression reference can supply a reactive category array. Values outside the domain have no cells. __Default value:__ Categories found in the input data.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • header (FacetHeader | dict[str, Any] | None) – Category label options. null hides labels and the field title, reclaiming their space.

  • sort (Literal['ascending'] | Literal['descending'] | Sequence[Scalar_T]) – Category order. An array places listed values first, followed by unlisted values in domain or input order. Sorting does not add cells. __Default value:__ Domain order when domain is specified; otherwise "ascending".

  • title (str | Title | TitleKwds | None) – A shared title for this facet dimension. A string uses the regular view title style; an object supports view-title placement and styling. Row titles default to the left, and column titles to the top. Set to null to hide the title. __Default value:__ The field name.

row(value=Undefined, /, *, description=Undefined, domain=Undefined, field=Undefined, header=Undefined, sort=Undefined, title=Undefined)View on GitHub

Return a copy with a FacetFieldDef row.

Parameters:
  • description (str) – A description of the encoded field. Can be used for documentation and to explain the meaning of the channel mapping.

  • domain (Sequence[Scalar_T] | ExprRef | dict[str, Any]) – Categories to display, including empty cells. An expression reference can supply a reactive category array. Values outside the domain have no cells. __Default value:__ Categories found in the input data.

  • field (str) – __Required.__ A string defining the name of the field from which to pull a data value. __See also:__ field documentation. __Notes:__ 1) Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \ to escape dots and brackets (e.g., "a\.b" and "a\[0\]"). See more details about escaping in the Vega-Lite field documentation.

  • header (FacetHeader | dict[str, Any] | None) – Category label options. null hides labels and the field title, reclaiming their space.

  • sort (Literal['ascending'] | Literal['descending'] | Sequence[Scalar_T]) – Category order. An array places listed values first, followed by unlisted values in domain or input order. Sorting does not add cells. __Default value:__ Domain order when domain is specified; otherwise "ascending".

  • title (str | Title | TitleKwds | None) – A shared title for this facet dimension. A string uses the regular view title style; an object supports view-title placement and styling. Row titles default to the left, and column titles to the top. Set to null to hide the title. __Default value:__ The field name.

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.