Javascript InfoVis Spacetree - dynamically hide / show tooltips

I searched this and couldn't find an answer. I will also ask about this in the Google Analytics group for InfoVis Toolkit.

I was wondering if it is possible to dynamically hide / show tooltips using InfoVis spacetree. They are currently enabled and I have set up tips like this:

Tips: {
        enable: true,
        type: 'HTML',
        offsetX: 10,
        offsetY: 10,
        onShow: function (tip, node)
            tip.innerHTML = getToolTip(node);


but I can't find links on how I can disable them later. For example, I want the user to be able to check a checkbox to hide / show tooltips and then display them accordingly. I tried () (st is the name of my spacetree) but it doesn't do anything. If I do alert ( I get the object, but I don't know what functions are available for the object.

Any help would be greatly appreciated! Thank!


source to share

1 answer

I am using ForceDirected and have a similar problem. I would like to keep the tooltip for a certain period of time after the user leaves the node with the cursor ...



works for me (have you ever tried passing an argument to hide?). I cannot tell you whether to convey true or false, they both work for me ...

In general, you can try something like:

Tips: {  
      enable: true,
      type: 'HTMl',
      onShow: function(tip, node, isLeaf, domElement) {
          //Check if checkbox is checked
          var checked = $('input[type=checkbox]').is(':checked');

          if (checked == true){
            tip.innerHTML =  getToolTip(node);
          } else {


Anyway, this is just an idea and I don't have time to test it (pseudocode? ..)

Hope this helped!




All Articles