Get Value into Hypertree data

68 views
Skip to first unread message

himbotop

unread,
Oct 26, 2016, 9:00:40 AM10/26/16
to JavaScript InfoVis Toolkit
Hi all together,

I am currently using the hypertree template and I am visualising data out of a Moodle Database. There I extract the values: id,name,parent,link.

The first three values are used to build up the tree. The value 'link' i want to use to get a link to a Video on the rigth side of the tree (onComplete:function() ).
I am using all these values in the file 'example1.js' by encrypting my json file.

function init(){
 
 jQuery.get("Testerich.php", function(data){
  //alert("HALLO");
  var obj = JSON.parse(data);
  //alert(obj);
  drawTree(obj[0]);
 }).fail(function( jqXHR, textStatus, errorThrown){alert("FAILED " + textStatus + " " + jqXHR.status + " " + errorThrown)});
 
}

Now my Problem is that I dont know how to get the link Display on the right side. I have to put it somehow into the data field to Access it by data.link but I dont know how I have to Change my jsonfile or my databasse to get the right Connections.

Does somebody can help me or had the same problem?

I would be appreciate
Armin

Murray Bourne

unread,
Nov 24, 2016, 10:03:57 PM11/24/16
to JavaScript InfoVis Toolkit
Armin

This forum is very quiet and it seems the developers don't monitor it any more. I'm no expert but I'll try to help.

In my set up, I needed HTML in my nodes, and I believe that's what you are trying to do.

In your init() function, you could put something like this:

fd.graph.eachNode(function(n){
label = fd.labels.getLabel(n.id);
label.innerHTML = '<a href="link-to-video.php">video</a>';
});


Hope it helps.

Regards
Murray
Reply all
Reply to author
Forward
0 new messages