-
Notifications
You must be signed in to change notification settings - Fork 283
Open
Labels
bugSomething isn't workingSomething isn't working
Description
in FastHTML 0.12.21 in file svg.py the Line is defined with default values for stroke and stroke_width:
def Line(x1, y1, x2=0, y2=0, stroke='black', w=None, stroke_width=1, **kwargs): ...This results that using a line with only coordinates, will also auto generate: stroke="black" stroke-width="1"
This is wrong as it overrides attributes defined in a parent tag like <g>.
Eg. this will fail to achieve the result of having red and thick lines:
G(stroke="red", stroke_width="20" )(
Line(x1=0, y1=0, x2=100, y2=100),
Line(x1=0, y1=0, x2=10, y2=100),
)Instead of desired outputs like:
<line x1="0" y1="0" x2="100" y2="100">will generate lines that have unwanted attributes, that override the parent:
<line x1="0" y1="0" x2="100" y2="100" stroke="black" stroke-width="1">Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working