Skip to content

Commit 0c4d419

Browse files
Parent/relation type columns added to the tabular view
1 parent 9e034a5 commit 0c4d419

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

src/static/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ <h1>Selected Nodes</h1>
5454
<th>Score</th>
5555
<th>Frequency</th>
5656
<th>Spread</th>
57+
<th>Relation</th>
58+
<th>Parent</th>
5759
</tr>
5860
</thead>
5961
<tbody>

src/static/js/tabular/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ onSelectionUpdate((selection) => {
1212
table.textContent = "";
1313
for (let i = 0; i < data.length; i++) {
1414
let row = table.insertRow(i),
15-
node = data[i];
15+
node = data[i],
16+
c;
1617
row.insertCell(0).textContent = node.id;
1718
row.insertCell(1).textContent = node.label;
1819
row.insertCell(2).textContent = node.entities[0].score;
1920
row.insertCell(3).textContent = node.entities[0].frequency;
2021
row.insertCell(4).textContent = node.entities[0].spread;
22+
(c = row.insertCell(5)).textContent = node.edgeType || "?";
23+
c.className = `${ node.edgeType }Item`;
24+
row.insertCell(6).textContent = (node.parent || { label: "root" }).label || "?";
2125
}
2226
});
2327

src/static/scss/basic.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ table {
2828

2929
}
3030

31+
.relatedItem {
32+
color: $relatedColor;
33+
}
34+
35+
.similarItem {
36+
color: $similarColor;
37+
}
38+
39+
.otherItem, .undefinedItem {
40+
color: $otherColor;
41+
}
42+
3143
input[type=text], input[type=number] {
3244
border: 0;
3345
border-bottom: 1px solid gray;

src/static/scss/const.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ $colorA: #02ad8b;
66
$colorB: #e08f00;
77
$colorC: #4c79c1;
88

9+
$relatedColor: #ffb840;
10+
$similarColor: #7ca1ff;
11+
$otherColor: red;
12+
913
$zIndexInterface: 100;
1014
$zIndexOnTop: 200;

src/static/scss/graph.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "mixins";
2+
@import "const";
23

34
#graph {
45

@@ -10,10 +11,10 @@
1011

1112
.links line {
1213
&.similar {
13-
stroke: #7ca1ff;
14+
stroke: $similarColor;
1415
}
1516
&.related {
16-
stroke: #ffb840;
17+
stroke: $relatedColor;
1718
}
1819
&.other {
1920
stroke: #bbb;
@@ -27,11 +28,11 @@
2728
circle {
2829
stroke: #fff;
2930
stroke-width: 1px;
30-
fill: red;
31+
fill: $otherColor;
3132
}
3233

3334
&.entity circle {
34-
fill: #7ca1ff;
35+
fill: $similarColor;
3536
}
3637

3738
&.folder circle {
@@ -43,7 +44,7 @@
4344
}
4445

4546
&.root circle {
46-
fill: #ffb840;
47+
fill: $relatedColor;
4748
}
4849

4950
text {

0 commit comments

Comments
 (0)