ragraph.plot.svg
¶
SVG shapes¶
This module contains two base classes, being the Line
options for SVG
shapes and an SVG
mapping for the shapes themselves. You will also find
several methods to obtain several basic shapes conveniently.
Line
¶
SVG
¶
|
Bases: Mapping
SVG shape mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
visible |
Optional[bool]
|
Toggles shape visibility. |
None
|
type |
Optional[str]
|
One of 'circle', 'rect', 'path' or 'line'. |
None
|
layer |
Optional[str]
|
'above' draws shape above traces, 'below' under them. |
None
|
xref |
Optional[str]
|
x coordinate axis. 'paper' or 'x', 'x1', 'x2', etc. |
None
|
xsizemode |
Optional[str]
|
'scaled' or 'pixel'. Relative or absolute sizing w.r.t. axis. |
None
|
xanchor |
Optional[str]
|
If sizemode is set to 'pixel', reference on axis to anchor shape to. |
None
|
x0 |
Optional[float]
|
Starting x position. |
None
|
x1 |
Optional[float]
|
Ending x position. |
None
|
yref |
Optional[str]
|
y coordinate axis. 'paper' or 'y', 'y1', 'y2', etc. |
None
|
ysizemode |
Optional[str]
|
'scaled' or 'pixel'. Relative or absolute sizing w.r.t. axis. |
None
|
yanchor |
Optional[str]
|
If sizemode is set to 'pixel', reference on axis to anchor shape to. |
None
|
y0 |
Optional[float]
|
Starting y position. |
None
|
y1 |
Optional[float]
|
Ending y position. |
None
|
path |
Optional[str]
|
For shapetype 'path', a valid SVG path, with data values as coordinates when referencing axis and absolute pixels with respect to anchors when the 'pixel' sizemode is set. |
None
|
opacity |
Optional[float]
|
The opacity between 0.0 and 1.0. |
None
|
line |
Optional[Union[Dict[str, Any], Line]]
|
Line mapping options. See |
None
|
fillcolor |
Optional[str]
|
Interior shape color. |
None
|
fillrule |
Optional[str]
|
Determines which regions of complex paths constitute the interior. One of "evenodd" or "nonzero". |
None
|
editable |
Optional[bool]
|
Whether the shape could be activated for edit or not. |
None
|
name |
Optional[str]
|
Only used with templates. |
None
|
templateitemname |
Optional[str]
|
Used to refer to a named item in this array in the template. |
None
|
Source code in ragraph/plot/svg.py
editable
¶
fillcolor
¶
fillrule
¶
Determines which regions of complex paths constitute the interior. One of 'evenodd' or 'nonzero'.
layer
¶
line
¶
name
¶
opacity
¶
path
¶
For shapetype 'path', a valid SVG path, with data values as coordinates when referencing axis and absolute pixels with respect to anchors when the 'pixel' sizemode is set.
templateitemname
¶
type
¶
visible
¶
x0
¶
x1
¶
xanchor
¶
xref
¶
xsizemode
¶
y0
¶
y1
¶
yanchor
¶
yref
¶
get_curvedline
¶
|
Get curved line (quadratic Bezier) SVG mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x0 |
float
|
Starting x position. |
required |
x1 |
float
|
Control point x position. |
required |
x2 |
float
|
Ending x position. |
required |
y0 |
float
|
Starting y position. |
required |
y1 |
float
|
Control point y position. |
required |
y2 |
float
|
Ending y position. |
required |
**kwargs |
Any
|
Overrides for the |
{}
|
Returns:
Type | Description |
---|---|
SVG
|
Quadratic Bezier SVG shape mapping. |
Source code in ragraph/plot/svg.py
get_line
¶
Get straight line SVG mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x0 |
float
|
Starting x position. |
required |
x1 |
float
|
Ending x position. |
required |
y0 |
float
|
Starting y position. |
required |
y1 |
float
|
Ending y position. |
required |
**kwargs |
Any
|
Overrides for the |
{}
|
Returns:
Type | Description |
---|---|
SVG
|
SVG shape mapping. |
Source code in ragraph/plot/svg.py
get_rectangle
¶
Get a rectangle SVG mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x0 |
float
|
Starting x position. |
required |
x1 |
float
|
Ending x position. |
required |
y0 |
float
|
Starting y position. |
required |
y1 |
float
|
Ending y position. |
required |
**kwargs |
Any
|
Overrides for the |
{}
|
Returns:
Type | Description |
---|---|
SVG
|
SVG shape mapping. |
Source code in ragraph/plot/svg.py
get_wedge
¶
|
Get a wedge SVG mapping.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
float
|
x position of the wedge center. |
required |
y |
float
|
y position of the wedge center. |
required |
r |
float
|
radius of the wedge. |
required |
start_angle |
float
|
Starting angle (radians) of the wedge. |
required |
end_angle |
float
|
Ending angle (radians) of the wedge. |
required |
**kwargs |
Any
|
Overrides for the |
{}
|
Returns:
Type | Description |
---|---|
SVG
|
SVG shape mapping. |