Warning: simplexml_load_string(): Entity: line 2: parser error : Extra content at the end of the document in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 31
Warning: simplexml_load_string(): <b>Warning</b>: session_start(): open(/var/tmp/sessions/sess_beea0f813bc17fc6de in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 31
Warning: simplexml_load_string(): ^ in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 31
Warning: simplexml_load_string(): Entity: line 2: parser error : Extra content at the end of the document in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 31
Warning: simplexml_load_string(): <b>Warning</b>: session_start(): open(/var/tmp/sessions/sess_cfd4e527ed8e3535c8 in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 31
Warning: simplexml_load_string(): ^ in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 31
Warning: Illegal string offset 'result' in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/visualvocabulary.php on line 13
Warning: Illegal string offset 'title' in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/visualvocabulary.php on line 13
Warning: Illegal string offset 'resume' in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 152
Warning: Illegal string offset 'cant_result' in /var/www/html/arquiamigos.org.br/web/visualvocabulary/common/vocabularyservices.php on line 152
var labelType, useGradients, nativeTextSupport, animate;
(function() {
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');
//I'm setting this based on the fact that ExCanvas provides text support for IE
//and that as of today iPhone/iPad current text support is lame
labelType = (!nativeCanvasSupport || (textSupport && !iStuff))? 'Native' : 'HTML';
nativeTextSupport = labelType == 'Native';
useGradients = nativeCanvasSupport;
animate = !(iStuff || !nativeCanvasSupport);
})();
var Log = {
elem: false,
write: function(text){
if (!this.elem)
this.elem = document.getElementById('log');
this.elem.innerHTML = text;
this.elem.style.left = (500 - this.elem.offsetWidth / 2) + 'px';
}
};
function init(){
//init data
var json = {
"id": "http://www.arquiamigos.org.br/thesaurus/services.php","name": "","children": []
}
//end
var infovis = document.getElementById('infovis');
var w = infovis.offsetWidth - 50, h = infovis.offsetHeight - 50;
//init Hypertree
//Cambiar color DAF
var ht = new $jit.Hypertree({
//id of the visualization container
injectInto: 'infovis',
//canvas width and height
width: w,
height: h,
//Change node and edge styles such as
//color, width and dimensions.
Node: {
dim: 9,
color: "#f00"
},
Edge: {
lineWidth: 2,
color: "#088"
},
onBeforeCompute: function(node){
//DAF 20122009
//Log.write("centering");
},
//Attach event handlers and add text to the
//labels. This method is only triggered on label
//creation
onCreateLabel: function(domElement, node){
//DAF 20122009
//domElement.innerHTML = node.name;
if (node.id > 0) {
domElement.innerHTML = "" + node.name + "";
}
else
{
domElement.innerHTML = node.name;
}
$jit.util.addEvent(domElement, 'click', function () {
ht.onClick(node.id);
});
},
//Change node styles when labels are placed
//or moved.
onPlaceLabel: function(domElement, node){
var style = domElement.style;
style.display = '';
style.cursor = 'pointer';
if (node._depth <= 1) {
style.fontSize = "0.8em";
style.color = "#ddd";
} else if(node._depth == 2){
style.fontSize = "0.7em";
style.color = "#555";
} else {
style.display = 'none';
}
var left = parseInt(style.left);
var w = domElement.offsetWidth;
style.left = (left - w / 2) + 'px';
},
onAfterCompute: function(){
//DAF 20122009
//Log.write("done");
//Build the right column relations list.
//This is done by collecting the information (stored in the data property)
//for all the nodes adjacent to the centered node.
var node = ht.graph.getClosestNodeToOrigin("current");
var html = "" + node.name + "
Connections:";
html += "";
node.eachAdjacency(function(adj){
var child = adj.nodeTo;
if (child.data) {
//DAF 24122009
//var rel = (child.data.band == node.name) ? child.data.relation : node.data.relation;
//html += "- " + child.name + " " + "
(relation: " + rel + ")
";
var rel = (child.id == node.id) ? child.data.relation : child.data.cantTerms;
var theLink = (child.id>0) ? "" + child.name + " " : child.name;
html += "- " + theLink + "
" + rel + "
";
}
});
html += "
";
$jit.id('inner-details').innerHTML = html;
}
});
//load JSON data.
ht.loadJSON(json);
//compute positions and plot.
ht.refresh();
//end
ht.controller.onAfterCompute();
}