Skip to content

Commit 363c723

Browse files
dots
1 parent 24e13c5 commit 363c723

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

schemascii/wire.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,24 @@ def get_from_grid(cls, grid: _grid.Grid,
6464
return cls(points, self_tag)
6565

6666
def render(self, data, **options) -> str:
67+
scale = options["scale"]
68+
linewidth = options["linewidth"]
6769
# create lines for all of the neighbor pairs
6870
links = []
6971
for p1, p2 in itertools.combinations(self.points, 2):
7072
if abs(p1 - p2) == 1:
7173
links.append((p1, p2))
74+
# find dots
75+
dots = ""
76+
for dot_pt in _utils.find_dots(links):
77+
dots += _utils.XML.circle(
78+
cx=scale * dot_pt.real,
79+
cy=scale * dot_pt.real,
80+
r=linewidth,
81+
class_="dot")
7282
return (_utils.bunch_o_lines(links, **options)
73-
+ (self.tag.to_xml_string(data) if self.tag else ""))
83+
+ (self.tag.to_xml_string(data) if self.tag else "")
84+
+ dots)
7485

7586
@classmethod
7687
def is_wire_character(cls, ch: str) -> bool:

0 commit comments

Comments
 (0)