visualizzazione struttura, in progress

This commit is contained in:
cesare 2023-02-03 15:42:34 +01:00
parent c8a9003976
commit fa21842778
4 changed files with 1257 additions and 1317 deletions

View File

@ -115,7 +115,7 @@ Minimap
padding: 0px 0px; padding: 0px 0px;
color:#1E90FF; color:#1E90FF;
font-size: 12px; font-size: 12px;
z-index: 1; z-index: 100;
/*float: top;*/ /*float: top;*/
} }

View File

@ -5,18 +5,15 @@
var resetResult; var resetResult;
var lsid; var lsid;
var lsentid;
var getDimDiv; var getDimDiv;
const formaClass='frm'
$(document).ready(function() { $(document).ready(function() {
lsid=''; lsid='';
removeGraph=false; removeGraph=false;
const posyntstruct=`<div >
<div id="sentenceStructArcs2"></div>
</div>
`
const cantobadgeclass = 'badge badge-outline-info badge-pill' const cantobadgeclass = 'badge badge-outline-info badge-pill'
@ -34,8 +31,6 @@ $(document).ready(function() {
var displayId = 'displaycanto' var displayId = 'displaycanto'
var cantiche=["Inferno", "Purgatorio","Paradiso"] var cantiche=["Inferno", "Purgatorio","Paradiso"]
var loadedCanti=new Set(); var loadedCanti=new Set();
var purgatorioLoaded = false;
var paradisoLoaded = false;
//used in minimap //used in minimap
// //
@ -67,7 +62,8 @@ $(document).ready(function() {
$(" .Ma, .Co, .Su, .Pa").each(function(idx, element) { //$(" .Ma, .Co, .Su, .Pa").each(function(idx, element) {
$(" ."+formaClass).each(function(idx, element) {
// We cycle through the elements using each() so that we can choose the element specifically that we wish to clean up afterward // We cycle through the elements using each() so that we can choose the element specifically that we wish to clean up afterward
var ele = $(element); var ele = $(element);
ele.tooltip({ ele.tooltip({
@ -82,10 +78,11 @@ $(" .Ma, .Co, .Su, .Pa").each(function(idx, element) {
}); });
$( " .Ma, .Co, .Su, .Pa " ).dblclick(function() { //$( " .Ma, .Co, .Su, .Pa " ).dblclick(function() {
$( " ."+formaClass ).dblclick(function() {
sentenceId=$(this).attr('class').split(' ')[0].replace('$','') sentenceId=$(this).attr('class').split(' ')[0].replace('$','')
console.log(lisid) console.log('dblclick '+lisid)
if (shownSentenceList.has(sentenceId)){ if (shownSentenceList.has(sentenceId)){
resetSentenceStructure(sentenceId) resetSentenceStructure(sentenceId)
shownSentenceList.delete(sentenceId) shownSentenceList.delete(sentenceId)
@ -94,17 +91,19 @@ $( " .Ma, .Co, .Su, .Pa " ).dblclick(function() {
} }
else{ else{
showSentenceStructure (sentenceId) //showSentenceStructure (sentenceId)
shownSentenceList.add(sentenceId) shownSentenceList.add(sentenceId)
} }
}); });
$(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) { //$(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) {
$(" ."+formaClass).hover(function(idx, element) {
sentenceId=$(this).attr('class').split(' ')[0].split('_') sentenceId=$(this).attr('class').split(' ')[0].split('_')
var tmplisid=sentenceId[0]+'_'+sentenceId[1]+'_'+sentenceId[3] var tmplisid=sentenceId[0]+'_'+sentenceId[1]+'_'+sentenceId[3]
lsentid=$(this).attr('class').split(' ')[0]
lisid=tmplisid lisid=tmplisid
}); });
@ -122,14 +121,12 @@ $(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) {
shownSentenceList.delete(sentenceId) shownSentenceList.delete(sentenceId)
} }
else{ else{
showSentenceStructure (sentenceId) //showSentenceStructure (sentenceId)
shownSentenceList.add(sentenceId) shownSentenceList.add(sentenceId)
} }
}); });
//var mmih = 0
//var mmiw = 0
$("#" + displayId).scroll(function() { $("#" + displayId).scroll(function() {
@ -167,7 +164,7 @@ $(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) {
//$("#" + $(this).attr('name').replace(" ", "_")).css("display", "block"); //$("#" + $(this).attr('name').replace(" ", "_")).css("display", "block");
$("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;') $("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;')
manageMiniMap(this); manageMiniMap(this);
$(" .Ma, .Co, .Su, .Pa").each(function(idx, element) { $(" ."+formaClass).each(function(idx, element) {
var ele = $(element); var ele = $(element);
ele.tooltip({ ele.tooltip({
content: (function() {return formatTTContent(ele.attr('title'));}), content: (function() {return formatTTContent(ele.attr('title'));}),
@ -182,6 +179,7 @@ $(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) {
sentenceId=$(this).attr('class').split(' ')[0].split('_') sentenceId=$(this).attr('class').split(' ')[0].split('_')
var tmplisid=sentenceId[0]+'_'+sentenceId[1]+'_'+sentenceId[3] var tmplisid=sentenceId[0]+'_'+sentenceId[1]+'_'+sentenceId[3]
lsentid=$(this).attr('class').split(' ')[0]
lisid=tmplisid lisid=tmplisid
}); });
@ -541,50 +539,14 @@ $(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) {
} }
} }
/*
function showCantica(cantica) {
//var listaCanti = new Set()
var setVersi = new Set()
var containerForme = formeprima
var idcantica=1;
if (cantica == 'Paradiso'){
containerForme = formeterza
idcantica=3
}
if (cantica == 'Purgatorio'){
containerForme = formeseconda
idcantica=2
}
const endlc = performance.now();
console.log(`Load `+cantica+` time: ${endlc - start} ms`);
var elverso, formaItem
for (var cmpItem of containerForme) {
formaItem = cmpItem.split("_")
var sentenceid=idcantica+"_"+formaItem[1]+"_s_"+formaItem[5]
//createDivVerso(cantica, num, canto, forma, catgram, pos)
if (! setVersi.has(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])){
elverso=createDivVerso(cantica, formaItem[3], 'Canto_' + formaItem[1], formaItem[0], formaItem[4], formaItem[2], sentenceid,formaItem[6])
setVersi.add(cantica+ "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])
}
else{
createSpanFormeNew(formaItem[0], formaItem[4], formaItem[2], sentenceid,formaItem[6],elverso)
}
}
return
}
*/
function createSpanFormeNew(forma, catgramm, pos, sentenceid, clausefunct, elementoverso) { function createSpanFormeNew(forma, catgramm, pos, sentenceid, clausefunct, elementoverso) {
var spanoccorrenza = $('<span />') var spanoccorrenza = $('<span />')
spanoccorrenza.attr('id', pos) spanoccorrenza.attr('id', pos)
//spanoccorrenza.attr('data-cg', catgramm) //spanoccorrenza.attr('data-cg', catgramm)
spanoccorrenza.attr('title', catgramm) spanoccorrenza.attr('title', catgramm)
spanoccorrenza.attr('class', sentenceid+" "+clausefunct) spanoccorrenza.attr('class', sentenceid+" "+clausefunct+' '+formaClass)
spanoccorrenza.append(forma+" ") spanoccorrenza.append(forma+" ")
spanoccorrenza.appendTo(elementoverso) spanoccorrenza.appendTo(elementoverso)
@ -608,33 +570,7 @@ $(" .Ma, .Co, .Su, .Pa").hover(function(idx, element) {
return elementoverso return elementoverso
} }
/*
function createDivVerso(cantica, num, canto, forma, catgram, pos, sentenceid, clausefunct) {
var elementoverso = $('<p />')
elementoverso.append(num + ". ")
elementoverso.attr("style", "line-height: 0.5em")
elementoverso.attr('class', 'f6 text-secondary text-nowrap font-weight-lighter '+cantica+' '+canto)
elementoverso.attr('id', cantica + "_" + canto + "_" + num)
var spanoccorrenza = $('<span />')
spanoccorrenza.attr('id', pos)
//spanoccorrenza.attr('data-cg', catgram)
spanoccorrenza.attr('title', catgram)
spanoccorrenza.attr('class', sentenceid+" "+clausefunct)
spanoccorrenza.append(forma+" ")
spanoccorrenza.appendTo(elementoverso)
elementoverso.appendTo('#' + cantica + canto)
return elementoverso
}
*/
function createAllDivCanti() { function createAllDivCanti() {
var cantiche=["Inferno", "Purgatorio","Paradiso"] var cantiche=["Inferno", "Purgatorio","Paradiso"]

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,4 @@
tqvpvs=` tqvpvs=`
PREFIX ecrm: <http://erlangen-crm.org/current/> PREFIX ecrm: <http://erlangen-crm.org/current/>
PREFIX orl: <https://dantenetwork.it/ontology/orl/current/> PREFIX orl: <https://dantenetwork.it/ontology/orl/current/>
@ -243,14 +240,15 @@ orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
syntitprefix='https://dantenetwork.it/ontology/syntit/current/' syntitprefix='https://dantenetwork.it/ontology/syntit/current/'
var stringInSparql= false; //var stringInSparql= false;
function writesparqlquery(query) { function writesparqlquery(query) {
return (query); return (query);
} }
//restituisce la query per ottenere tutti i versi di una cantica
//restituisce la query per ottenere tutti i versi di una cantica: NON USATA: RIMUOVERE
function versiCantica(cantica) { function versiCantica(cantica) {
var SparqlParser = sparqljs.Parser; var SparqlParser = sparqljs.Parser;