How to add a background picture to a Jit infovis spacetree

342 views Asked by At

I need to add a picture to a spacetree to serve as a background to a spacetree. I have tried several ways but succeeded at none, mainly for the following 2 reasons: - positioning on the canvas (coordinates 0,0 do not seem to be the correct positioning. it is in the minus!) - each time the spacetree redraws, it clear the canvas.

Any help will be sincerely appreciated.

guys, what I did is straight forward: if you use the example from the infovis spacetree, please add the following right after : st.compute(); //optional: make a translation of the tree st.geom.translate(new $jit.Complex(-200, 0), "current");

//what I added 
//where myimage is an image I load in the DOM normally.

var ctx = st.canvas.getCtx(); 
var imageObj = document.getElementById("myimage"); 
ctx.drawImage(imageObj, -700, -500);
0

There are 0 answers