module documentation
SVG builders.
Function | shape |
Convert a shape to a list of XmlElements (a "fragment"). |
Function | soup |
Convert an svg "soup" to a list of XmlElements (a "fragment"). |
Constant | DEFAULT |
Undocumented |
Constant | DEFAULT |
Undocumented |
Constant | DEFAULT |
Undocumented |
Function | _add |
Undocumented |
Function | _add |
Undocumented |
Function | _enum |
Undocumented |
Function | _font |
Undocumented |
Function | _geom |
Undocumented |
Function | _geometry |
Undocumented |
Function | _icon |
Undocumented |
Function | _is |
Undocumented |
Function | _label |
Undocumented |
Function | _label |
Undocumented |
Function | _label |
Undocumented |
Function | _marker |
Undocumented |
Function | _parse |
Undocumented |
Function | _slope |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
Constant | _TYPE |
Undocumented |
def shape_to_fragment(shape:
gws.IShape
, view: gws.MapView
, label: str
= None, style: gws.IStyle
= None) -> list[ gws.IXmlElement]
:
(source)
¶
Convert a shape to a list of XmlElements (a "fragment").
def soup_to_fragment(view:
gws.MapView
, points: list[ gws.Point]
, tags: list[ t.Any]
) -> list[ gws.IXmlElement]
:
(source)
¶
Convert an svg "soup" to a list of XmlElements (a "fragment").
A soup has two components:
- a list of points, in the map coordinate system
- a list of tuples suitable for
xmlx.tag
input (tag-name, {atts}, child1, child2....)
The idea is to represent client-side svg drawings (e.g. dimensions) in a resolution-independent way
First, points are converted to pixels using the view's transform. Then, each tag's attributes are iterated. If any attribute value is an array, it's assumed to be a 'function'. The first element is a function name, the rest are arguments. Attribute 'functions' are
- ['x', n] - returns points[n][0]
- ['y', n] - returns points[n][1]
- ['r', p1, p2, r] - computes a slope between points[p1] points[p2] and returns a string
rotate(slope, points[r].x, points[r].y)
def _geometry(geom:
shapely.geometry.base.BaseGeometry
, atts: dict
= None) -> gws.IXmlElement
:
(source)
¶
Undocumented