'+ received[i][1] + '';
object_type = "object";
infObject_button += '';
}
if (received[i][2] != "") {
letter = letter + "
Segnatura: " + received[i][2];
}
if (received[i][3] != "") {
letter = letter + "
Data: " + received[i][3];
}
letter = letter + '
Nessun risultato trovato
"; document.getElementById("object_receive").innerHTML = messaggio; } } function handle_send(json) { console.log(json); const sent = []; var i=0; $.each( json['results']['bindings'], function (index, value) { uri = value['document_uri']['value']; title = value['document_name']['value']; segnatura = value['segnatura']['value']; var data = ""; var InfObj = ""; if (value.hasOwnProperty('time_span')) { data = value['time_span']['value']; } if (value.hasOwnProperty('InfObj')) { InfObj = value['InfObj']['value']; } sent.push([uri, title, segnatura, data, InfObj]); }); var myArray = ""; for (var i=0; i'+ sent[i][1] + '';
object_type = "object";
infObject_button += '';
}
if (sent[i][2] != "") {
letter = letter + "
Segnatura: " + sent[i][2];
}
if (sent[i][3] != "") {
letter = letter + "
Data: " + sent[i][3];
}
letter = letter + '
Nessun risultato trovato
"; document.getElementById("object_send").innerHTML = messaggio; } } function handle_cit(json) { console.log(json); const citations = []; var i=0; $.each( json['results']['bindings'], function (index, value) { uri = value['document_uri']['value']; title = value['document_name']['value']; segnatura = value['segnatura']['value']; var data = ""; var InfObj = ""; if (value.hasOwnProperty('time_span')) { data = value['time_span']['value']; } if (value.hasOwnProperty('InfObj')) { InfObj = value['InfObj']['value']; } citations.push([uri, title, segnatura, data, InfObj]); }); var myArray = ""; for (var i=0; i'+ citations[i][1] + '';
object_type = "object";
infObject_button += '';
}
if (citations[i][2] != "") {
letter = letter + "
Segnatura: " + citations[i][2];
}
if (citations[i][3] != "") {
letter = letter + "
Data: " + citations[i][3];
}
letter = letter + "
Nessun risultato trovato
"; document.getElementById("object_cit").innerHTML = messaggio; } } function handle_persons(json) { console.log(json); const people = []; const person_names = []; const person_events = []; var Person = ""; $.each( json['results']['bindings'], function (index, value) { var uri = value['range']['value']; var label = value['label']['value']; var ruolo = value['role']['value'] var count = value['count']['value'] var evento = ruolo + ": " + count person_events.push([uri, label, evento]); if (!person_names.includes(uri)) { person_names.push([uri, label]); } }); for (var k=0; kNessun risultato trovato
"; document.getElementById("object_per").innerHTML = messaggio; } } function handle_count(json) { console.log(json); const toponimi = []; const dataToponimi = []; var max = 0; $.each( json['results']['bindings'], function (index, value) { const topo = []; var toponimo = value['label']['value']; var count = value['Count']['value']; var temp = parseInt(count); toponimi.push(toponimo); dataToponimi.push([toponimo, count]); if (temp>max) { max = temp; } }); // set the dimensions and margins of the graph var margin = {top: 20, right: 30, bottom: 40, left: 90}, width = 460 - margin.left - margin.right, height = 400 - margin.top - margin.bottom; // append the svg object to the body of the page var svg = d3.select("#my_dataviz") .append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // Parse the Data //d3.csv("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/7_OneCatOneNum_header.csv", function(data) { // Add X axis var x = d3.scaleLinear() .domain([0, max]) .range([ 0, width]); svg.append("g") .attr("transform", "translate(0," + height + ")") .call(d3.axisBottom(x)) .selectAll("text") .attr("transform", "translate(-10,0)rotate(-45)") .style("text-anchor", "end"); // Y axis var y = d3.scaleBand() .range([ 0, height ]) .domain(toponimi) .padding(.1); svg.append("g") .call(d3.axisLeft(y)) //Bars svg.selectAll("myRect") .data(dataToponimi) .enter() .append("rect") .attr("x", x(0) ) .attr("y", function(d) { return y(d[0]); }) .attr("width", function(d) { return x(d[1]); }) .attr("height", y.bandwidth() ) .attr("fill", "#69b3a2") /*var texts = svg.selectAll("myRect") .data(dataToponimi) .enter() .append("text"); texts.attr("x", function(d){ return d[1] / 4 - 20}) .attr("y", function(d,i){ return 22.26*i +20}) .attr("text-anchor", "middle") .attr("fill", "#fff") .text(function(d){ return d[1]});*/ } function handle_count2(json) { console.log(json); const toponimi = []; const dataToponimi = []; const values = []; var max = 0; $.each( json['results']['bindings'], function (index, value) { const topo = []; var toponimo = value['label']['value']; var count = value['Count']['value']; var temp = parseInt(count); toponimi.push(toponimo); dataToponimi.push([toponimo, count]); if (temp>max) { max = temp; } }); // set the dimensions and margins of the graph var margin = {top: 20, right: 30, bottom: 40, left: 90}, width = 460 - margin.left - margin.right, height = 400 - margin.top - margin.bottom; // append the svg object to the body of the page var svg = d3.select("#my_dataviz2") .append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // Parse the Data //d3.csv("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/7_OneCatOneNum_header.csv", function(data) { // Add X axis var x = d3.scaleLinear() .domain([0, max]) .range([ 0, width]); svg.append("g") .attr("transform", "translate(0," + height + ")") .call(d3.axisBottom(x)) .selectAll("text") .attr("transform", "translate(-10,0)rotate(-45)") .style("text-anchor", "end"); // Y axis var y = d3.scaleBand() .range([ 0, height ]) .domain(toponimi) .padding(.1); svg.append("g") .call(d3.axisLeft(y)) //Bars svg.selectAll("myRect") .data(dataToponimi) .enter() .append("rect") .attr("x", x(0) ) .attr("y", function(d) { return y(d[0]); }) .attr("width", function(d) { return x(d[1]); }) .attr("height", y.bandwidth() ) .attr("fill", "#69b3a2") svg.selectAll("text2") .data(dataToponimi) .enter().append("text2") .text(function(d) {return d[1]}) .attr("class", "text") } function open_info() { document.getElementById("info_luogo").style.display = "block"; document.getElementById("place_info").style.display = "block"; document.getElementById("topo").style.display = "none"; document.getElementById("rif").style.display = "none"; } function open_toponimi() { document.getElementById("info_luogo").style.display = "block"; document.getElementById("place_info").style.display = "none"; document.getElementById("topo").style.display = "block"; document.getElementById("rif").style.display = "none"; } function open_riferimenti() { document.getElementById("info_luogo").style.display = "block"; document.getElementById("place_info").style.display = "none"; document.getElementById("topo").style.display = "none"; document.getElementById("rif").style.display = "block"; }