Skip to content

Commit 86d0459

Browse files
committed
index page label margin
1 parent cd1f19e commit 86d0459

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

static/design.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
src: url('../static/geist/fonts/Geist/otf/Geist-Bold.otf');
1414
}
1515

16-
16+
@font-face {
17+
font-family: 'geist_medium';
18+
src: url('../static/geist/fonts/Geist/otf/Geist-Medium.otf');
19+
}
1720

1821
.title_text {
1922
font-size: 24px;
@@ -30,6 +33,11 @@
3033
font-family: 'geist_light', sans-serif
3134
}
3235

36+
.type_labels {
37+
font-size: 16px;
38+
font-family: 'geist_medium', sans-serif
39+
}
40+
3341
a, a:visited, a:hover, a:active {
3442
color: lightseagreen;
3543
text-decoration: underline;

static/nodes.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ async function drawNodes(nodes) {
55
.data(nodes)
66
.enter()
77
.append("svg")
8-
.attr('width', 600)
8+
.attr('width', 1200)
99
.attr('height', d => {
1010
const rowCount = Math.ceil(d.instances.length / 24);
1111
const lowestY = (rowCount - 1) * 25 + 40;
@@ -14,8 +14,8 @@ async function drawNodes(nodes) {
1414

1515
section.append('text')
1616
.text(d => d.class_label)
17-
.attr('x', 0).attr('y', 30)
18-
.attr('class', 'regular_text')
17+
.attr('x', 300).attr('y', 32)
18+
.attr('class', 'type_labels')
1919

2020
section.selectAll("circle")
2121
.data(d => d.instances)
@@ -24,7 +24,7 @@ async function drawNodes(nodes) {
2424
.text(d => d.entity_label)
2525
.attr('class', 'regular_text circle_labels')
2626
.attr('id', (d, i) => 'text_' + d.entity_link.split('/').pop())
27-
.attr("x",(d,i) => ((i % 24)*25)+11+15)
27+
.attr("x",(d,i) => ((i % 24)*25)+11+15+300)
2828
.attr("y", (d, i) => (Math.floor(i / 24) * 25) + 60+5)
2929
.attr("opacity",0)
3030

@@ -35,19 +35,21 @@ async function drawNodes(nodes) {
3535
.attr('class', 'round')
3636
.attr('id', (d,i) => d.entity_link.split('/').pop())
3737
.attr("r", 10)
38-
.attr("cx",(d,i) => ((i % 24)*25)+11)
38+
.attr("cx",(d,i) => ((i % 24)*25)+11+300)
3939
.attr("cy", (d,i) => (Math.floor(i / 24)*25)+60)
4040
.attr('fill', "#dddddd")
4141
.attr('stroke', "black")
4242
.attr('stroke-width', '1px')
4343
.attr('opacity', 0.8)
4444
.on('mouseover', function (k, d) {
4545
d3.selectAll('.round').transition().duration(200).attr('opacity', 0.1);
46+
d3.selectAll('.type_labels').transition().duration(200).attr('opacity', 0.1);
4647
d3.select(this).transition().duration(200).attr('opacity', 0.8);;
4748
d3.select('#'+'text_'+d.entity_link.split('/').pop()).transition().duration(200).attr('opacity', 1)
4849
})
4950
.on('mouseout', function (k, d) {
5051
d3.selectAll('.round').transition().duration(200).attr('opacity', 0.8);
52+
d3.selectAll('.type_labels').transition().duration(200).attr('opacity', 0.8);
5153
d3.selectAll('.circle_labels').transition().duration(200).attr('opacity', 0);
5254
})
5355
.on('click', function (k, d) {

templates/index.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,12 @@
22

33
{% block content %}
44

5-
<div style="width: 600px; display: block; margin: 0 auto; padding-top:40px">
6-
7-
5+
<div style="width: 1200px; display: block; margin: 0 auto; padding-top:40px;">
86
<div id="screen"></div>
97
<br>
108
<br>
119
<br>
1210
<br>
13-
14-
<!--{% for c in data %}
15-
{% if c.instances %}
16-
<tspan class="bold_text">{{ c.class_label}}</tspan><br><br>
17-
{% for i in c.instances %}
18-
<tspan class="regular_text"><a href="{{ i.entity_link }}">{{ i.entity_label }}</a></tspan><br>
19-
{% endfor %}
20-
<br>
21-
{% endif %}
22-
{% endfor %}-->
23-
2411
</div>
2512

2613
<script src="https://d3js.org/d3.v7.min.js"></script>

0 commit comments

Comments
 (0)