Skip to content

Models

subsurfaceio.tiles.models

Classes:

Name Description
Tile
Tiles

Tile pydantic-model

Bases: BaseModel

Config:

  • frozen: True

Fields:

  • name (str)
  • description (str | None)
  • width (float)
  • height (float)
  • mapping (Literal['Repeat', 'Expand to fit', 'Repeat Horizontal/Expand Vertical', 'Expand Horizontal/Repeat Vertical', 'Maintain Proportions', 'Maintain Size', 'Maintain Size - Expand Borders'])

description pydantic-field

description: str | None = None

height pydantic-field

height: float

mapping pydantic-field

mapping: Literal[
    "Repeat",
    "Expand to fit",
    "Repeat Horizontal/Expand Vertical",
    "Expand Horizontal/Repeat Vertical",
    "Maintain Proportions",
    "Maintain Size",
    "Maintain Size - Expand Borders",
] = "Repeat"

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

name pydantic-field

name: str

width pydantic-field

width: float

definition_id

definition_id(
    width: float | None = None, height: float | None = None
) -> str

generate_definition_svg cached

generate_definition_svg(
    width_for_expand_horizontal: float | None = None,
    height_for_expand_vertical: float | None = None,
)

Return the SVG or definition for this tile.

Parameters:

Name Type Description Default
width_for_expand_horizontal float | None

Rendered pixel width; required when mapping is 'Expand Horizontal/Repeat Vertical'.

None
height_for_expand_vertical float | None

Rendered pixel height; required when mapping is 'Repeat Horizontal/Expand Vertical'.

None

Raises:

Type Description
NotImplementedError

For mappings not yet supported.

ValueError

When a required dimension is missing.

Tiles pydantic-model

Bases: BaseModel

Fields:

tiles pydantic-field

tiles: dict[str, Tile]