Skip to content

Commit 53e8f6e

Browse files
committed
fix: 调整入度徽章位置避免遮挡课程编号
1 parent 72a4ff6 commit 53e8f6e

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/components/GraphView.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296

297297
.node .badge-value {
298298
fill: #ffffff;
299-
font-size: 12px;
299+
font-size: 11px;
300300
font-weight: bold;
301301
text-anchor: middle;
302302
dominant-baseline: middle;

src/components/GraphView.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,14 @@ export default function GraphView({
169169

170170
nodeElements.append('circle')
171171
.attr('class', 'badge in-degree-badge')
172-
.attr('cx', 24)
173-
.attr('cy', -24)
174-
.attr('r', 14);
175-
176-
nodeElements.append('text')
177-
.attr('class', 'badge-label')
178-
.attr('x', 24)
179-
.attr('y', -24)
180-
.text('入');
172+
.attr('cx', 28)
173+
.attr('cy', -28)
174+
.attr('r', 12);
181175

182176
nodeElements.append('text')
183177
.attr('class', 'badge-value in-degree-value')
184-
.attr('x', 24)
185-
.attr('y', -16)
178+
.attr('x', 28)
179+
.attr('y', -24)
186180
.text('0');
187181

188182
simulation.on('tick', () => {

0 commit comments

Comments
 (0)