Paul McGuinness
unread,May 14, 2013, 8:56:54 AM5/14/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to javascript-information...@googlegroups.com
Hi All,
This one has been driving me mad... unless I override the 'labelType' to 'HTML' (see below), I can't see any labels in my ForceDirected tree.
I'm using the standard code, with one extra line (highlighted). I've checked the obvious by setting the body background colour to black / white in case of CSS issues, but am getting nowhere.
Firebug doesn't seem to expose much in terms of 'canvas', so I can't even see if it has 'drawn' the labels.
Any suggestions?
Cheers,
Paul
var ua = navigator.userAgent,
iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i),
typeOfCanvas = typeof HTMLCanvasElement,
nativeCanvasSupport = (typeOfCanvas == 'object' || typeOfCanvas == 'function'),
textSupport = nativeCanvasSupport && (typeof document.createElement('canvas').getContext('2d').fillText == 'function');
labelType = (!nativeCanvasSupport || (textSupport && !iStuff))? 'Native' : 'HTML';
labelType='HTML'; // override...
nativeTextSupport = labelType == 'Native';
useGradients = nativeCanvasSupport;
animate = !(iStuff || !nativeCanvasSupport);