Search code examples
javascriptinfovis

how to change injection target to create treemap in jit infovis toolkit?


I need to create 2 squarified treemaps in one web page. I used jit infovis toolkit to help create this treemap. is it possible to create treemaps not using div with id "infovis"?cause when i change the id of div into something else like "test" for example, it cause an error treemap doesn't work. I also already change the "inject into" property in jit javascript function that used to create treemap . Please help


Solution

  • Yes, it is possible to do that.

    In the standard examples of InfoVis, the div "infovis" is contained in the "center-container". The html page generally includes a css file base.css. This file applies certain rules to both "infovis" and "center-container".

    #infovis {
      position:relative;
      width:600px;
      height:600px;
      margin:auto;
      overflow:hidden;
    } 
    

    And for center-container..

    #center-container {
      width:600px;
      left:200px;
      background-color:#1a1a1a;
      color:#ccc;
    }
    

    You can check this in html file which renders the visualization. You should make sure that the div in which you want to inject the visualization, is applied same/similar rules. You may also have to do some more changes in your html file and the css file, to make sure that you have a proper hierarchy of divs and all rules of base.css are applied properly to them. This is all I can say without looking at your html file and your code.