style: label Guanghan radiator panels
Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
@@ -145,6 +145,7 @@
|
||||
.radiator { pointer-events: none; }
|
||||
.radiator rect { fill: #6b5814; stroke: var(--radiator); stroke-width: 2; vector-effect: non-scaling-stroke; }
|
||||
.radiator line { stroke: #f8e798; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
|
||||
.radiator-label { fill: #f4df7b; font-size: 15px; font-weight: 650; text-anchor: middle; }
|
||||
|
||||
.click-note {
|
||||
margin: 13px 0 0;
|
||||
@@ -339,18 +340,22 @@
|
||||
<g class="radiator" aria-label="北部大型折叠散热面板">
|
||||
<rect x="820" y="972" width="130" height="16" rx="3"/>
|
||||
<line x1="850" y1="973" x2="850" y2="987"/><line x1="885" y1="973" x2="885" y2="987"/><line x1="920" y1="973" x2="920" y2="987"/>
|
||||
<text class="radiator-label" x="885" y="964">散热器</text>
|
||||
</g>
|
||||
<g class="radiator" aria-label="西部大型折叠散热面板">
|
||||
<rect x="345" y="1232" width="130" height="16" rx="3"/>
|
||||
<line x1="375" y1="1233" x2="375" y2="1247"/><line x1="410" y1="1233" x2="410" y2="1247"/><line x1="445" y1="1233" x2="445" y2="1247"/>
|
||||
<text class="radiator-label" x="410" y="1224">散热器</text>
|
||||
</g>
|
||||
<g class="radiator" aria-label="东部大型折叠散热面板">
|
||||
<rect x="1025" y="1232" width="130" height="16" rx="3"/>
|
||||
<line x1="1055" y1="1233" x2="1055" y2="1247"/><line x1="1090" y1="1233" x2="1090" y2="1247"/><line x1="1125" y1="1233" x2="1125" y2="1247"/>
|
||||
<text class="radiator-label" x="1090" y="1224">散热器</text>
|
||||
</g>
|
||||
<g class="radiator" aria-label="南部大型折叠散热面板">
|
||||
<rect x="790" y="1518" width="130" height="16" rx="3"/>
|
||||
<line x1="820" y1="1519" x2="820" y2="1533"/><line x1="855" y1="1519" x2="855" y2="1533"/><line x1="890" y1="1519" x2="890" y2="1533"/>
|
||||
<text class="radiator-label" x="855" y="1510">散热器</text>
|
||||
</g>
|
||||
|
||||
<!-- Power cross nodes -->
|
||||
|
||||
@@ -54,6 +54,25 @@ class GuanghanTopologySourceTests(unittest.TestCase):
|
||||
r'<(?:g|rect)[^>]+class="[^"]*radiator[^"]*"[^>]+data-module=',
|
||||
)
|
||||
|
||||
def test_each_radiator_has_a_visible_text_label(self) -> None:
|
||||
radiator_groups = re.findall(
|
||||
r'<g class="radiator"[^>]*>(.*?)</g>',
|
||||
self.html,
|
||||
flags=re.S,
|
||||
)
|
||||
self.assertEqual(len(radiator_groups), 4)
|
||||
for group in radiator_groups:
|
||||
self.assertIn(">散热器</text>", group)
|
||||
rect = re.search(r'<rect x="(\d+)" y="(\d+)" width="(\d+)"', group)
|
||||
label = re.search(r'<text[^>]+x="(\d+)" y="(\d+)"[^>]*>散热器</text>', group)
|
||||
self.assertIsNotNone(rect)
|
||||
self.assertIsNotNone(label)
|
||||
rect_x, rect_y, rect_width = map(int, rect.groups())
|
||||
label_x, label_y = map(int, label.groups())
|
||||
self.assertGreaterEqual(label_x, rect_x)
|
||||
self.assertLessEqual(label_x, rect_x + rect_width)
|
||||
self.assertLess(label_y, rect_y)
|
||||
|
||||
def test_future_extensions_exist_only_as_source_comments(self) -> None:
|
||||
comments = "\n".join(re.findall(r"<!--(.*?)-->", self.html, flags=re.S))
|
||||
visible_source = re.sub(r"<!--.*?-->", "", self.html, flags=re.S)
|
||||
|
||||
Reference in New Issue
Block a user