Skip to content

Models

subsurfaceio.graphics.models

Classes:

Name Description
Graphic
Graphics
SVGDefinitions
TileConfiguration

Attributes:

Name Type Description
PATTERN_FILL_OPACITY
SVG_PATTERN_SCALE

PATTERN_FILL_OPACITY module-attribute

PATTERN_FILL_OPACITY = 0.999

SVG_PATTERN_SCALE module-attribute

SVG_PATTERN_SCALE = 1.0

Graphic pydantic-model

Bases: BaseModel

Config:

  • frozen: True

Fields:

category pydantic-field

category: str

description pydantic-field

description: str | None = None

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

name pydantic-field

name: str

svg_definitions property

svg_definitions

tiles_configuration pydantic-field

tiles_configuration: tuple[TileConfiguration, ...]

generate_svg

generate_svg(
    solid_fill_color: str = "#000",
    include_definitions: bool = True,
    svg_width: float | None = None,
    svg_height: float | None = None,
) -> str

Render the graphic to an SVG string.

Parameters:

Name Type Description Default
solid_fill_color str

CSS color used for SOLID tiles.

'#000'
include_definitions bool

Whether to embed in the output.

True
svg_width float | None

Actual pixel width; used to resolve 'Expand Horizontal' tiles.

None
svg_height float | None

Actual pixel height; used to resolve 'Expand Vertical' tiles.

None

Graphics pydantic-model

Bases: BaseModel

Fields:

graphics pydantic-field

graphics: dict[str, Graphic]

SVGDefinitions pydantic-model

Bases: BaseModel

Fields:

definitions pydantic-field

definitions: dict[str, str]

render

render() -> str

TileConfiguration pydantic-model

Bases: BaseModel

Config:

  • frozen: True

Fields:

from_pct pydantic-field

from_pct: float = 0

model_config class-attribute instance-attribute

model_config = ConfigDict(frozen=True)

scale pydantic-field

scale: float | None = None

tile_symbol pydantic-field

tile_symbol: str | None

to_pct pydantic-field

to_pct: float = 100

vertical_borders pydantic-field

vertical_borders: (
    Literal["Left", "Right", "Both"] | None
) = None