Skip to content

Commit

Permalink
hyperlinks in information panel
Browse files Browse the repository at this point in the history
  • Loading branch information
kdickson93 committed Jun 27, 2018
1 parent 6d986cc commit c6aedc3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Expand Up @@ -2,6 +2,7 @@
"type": "network",
"version": "1.0",
"data": "data.json",

"logo": {
"file": "https://wiserd.ac.uk/themes/wiserd/img/xlogo.png.pagespeed.ic.PLELxAJrmX.png",
"link": "https://wiserd.ac.uk",
Expand Down
21 changes: 13 additions & 8 deletions dataportal3/static/data_visualisations/31052018_network/js/main.js
Expand Up @@ -563,21 +563,26 @@ function nodeActive(a) {
for (var attr in f.attributes) {
var d = f.attributes[attr],
h = "";
if (attr!=image_attribute) {
h = '<span><strong>' + attr + ':</strong> ' + d + '</span><br/>'
}
if (attr!=image_attribute) {
if (d.search("http") != -1) {
h = '<div class="' + attr.replace(/\s+/g,'') + '">' + attr.link(d) + '</div>';
} else {
h = '<span><strong>' + attr + ':</strong> ' + d + '</span><br/>'
}
}
//temp_array.push(f.attributes[g].attr);
e.push(h)
}

if (image_attribute) {
//image_index = jQuery.inArray(image_attribute, temp_array);
$GP.info_name.html("<div><img src=" + f.attributes[image_attribute] + " style=\"vertical-align:middle\" /> <span onmouseover=\"sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex['" + b.id + '\'])" onmouseout="sigInst.refresh()">' + b.label + "</span></div>");
if (typeof(f.attributes[image_attribute]) != "undefined") {
//image_index = jQuery.inArray(image_attribute, temp_array);
$GP.info_name.html('<img onmouseover="sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex[\'' + b.id + '\'])" onmouseout="sigInst.refresh()" class="node-image" src="' + f.attributes[image_attribute] + '" /></div><div id="node-title" onmouseover="sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex[\'' + b.id + '\'])" onmouseout="sigInst.refresh()">' + b.label + '</div>');
} else {
$GP.info_name.html("<div><span onmouseover=\"sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex['" + b.id + '\'])" onmouseout="sigInst.refresh()">' + b.label + "</span></div>");
$GP.info_name.html("<div><span onmouseover=\"sigInst._core.plotter.drawHoverNode(sigInst._core.graph.nodesIndex['" + b.id + '\'])" onmouseout="sigInst.refresh()">' + b.label + "</span></div>");
}
// Image field for attribute pane
$GP.info_data.html(e.join("<br/>"))
//$GP.info_data.html(e.join("<br/>"))
$GP.info_data.html(e.join(""))
}
$GP.info_data.show();
$GP.info_p.html("Connections:");
Expand Down

0 comments on commit c6aedc3

Please sign in to comment.