Skip to content

Improve writing of SVG files #44

@ezwelty

Description

@ezwelty
  • Clarify that SVG child elements are drawn in order, and thus from bottom to top layer as viewed in a vector editor like Adobe Illustrator
  • Add <circle> element creator:
import xml.etree.ElementTree as ET
ET.Element('circle', cx=x, cy=y, **kwargs)
  • Stringify non-string element attributes
  • Add helper for scaling an :
SCALE = 0.25
glimpse.svg.svg(
  glimpse.svg.image(width=width, height=height, transform=f'matrix({SCALE} 0 0 {SCALE} 0 0)'),
  ET.Element('circle', cx=uv * SCALE, cy=uv * SCALE),
  width=str(width * SCALE),
  height=str(height * SCALE)
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions