From 6ddc43b6f42ed1bfd44c24bf54e65840d3f220e9 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Thu, 18 Jan 2024 16:18:20 +0100 Subject: [PATCH 01/29] =?UTF-8?q?Adapte=20la=20police=20et=20la=20hauteur?= =?UTF-8?q?=20des=20carr=C3=A9s=20=C3=A0=20l'espace=20entre=20les=20feuill?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/displaytree.ejs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 79cdcc5..dc4a3e8 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -172,6 +172,7 @@ var cladeRoot; var layout = d3.layout.cladogram(); // Fonction D3 qui transforme les donnees en cladograme var nodeWidth = 80; // Largeur var nodeHeight = 30; // Hauteur +var hLetter = 15; // var x0Align = 350; // Cordonee horizonatle de l'alignement var stringWidth; // Largeur affichage arbre var tagSimpleGene = false; // True si arbre de gene de type PhyloXML, False si arbre de gene de type RecPhyloXML @@ -1388,12 +1389,14 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { seqTextAA.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe + .style("font", hLetter+"px courrier") .attr('x', function(d) {return 1;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.aa;}); seqTextNuc.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe + .style("font", hLetter+"px courrier") .attr('x', function(d) {return 1;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.dna;}); @@ -1420,7 +1423,7 @@ seqTextAA.append('text') .merge(aablock) .append("rect") .attr('width', function(d) { return hStep; }) - .attr('height', function(d) { return 15 }) + .attr('height', function(d) { return hLetter }) .style("fill", function(d){ return (d.col)}) .style("opacity", function(d){ if (displaySeqType != "AA") { @@ -1485,7 +1488,7 @@ seqTextAA.append('text') .merge(dnablock) .append("rect") .attr('width', function(d) { return hStep; }) - .attr('height', function(d) { return 10 }) + .attr('height', function(d) { return hLetter }) .style("fill", function(d){ return (d.col)}) .style("opacity", function(d){ if (displaySeqType != "Nuc") { @@ -2282,12 +2285,21 @@ $('#loga').on('click', function(event, dropdownData) { }); $('#moreHeigth').on('click', function(event, dropdownData) { nodeHeight += modStepY; + hLetter = nodeHeight ; + if (nodeHeight >= 15) { + hLetter = 15 ; + } + console.log("node = "+nodeHeight+"; letter = "+hLetter); updateLayout(cladeRoot); }); $('#lessHeigth').on('click', function(event, dropdownData) { - if (nodeHeight - modStepY >= 30 ) { + if (nodeHeight - modStepY >= 0 ) { // if (true) { nodeHeight -= modStepY; + if (nodeHeight < 15) { + hLetter = nodeHeight ; + } + console.log("node = "+nodeHeight+"; letter = "+hLetter); updateLayout(cladeRoot); } }); From 8927488803a3bde29b8d493cce7a89e351415f7e Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Thu, 18 Jan 2024 16:26:09 +0100 Subject: [PATCH 02/29] Supprime la modif de police --- views/displaytree.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index dc4a3e8..69ec602 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -1389,14 +1389,14 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { seqTextAA.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe - .style("font", hLetter+"px courrier") +/* .style("font", hLetter+"px courrier")*/ .attr('x', function(d) {return 1;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.aa;}); seqTextNuc.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe - .style("font", hLetter+"px courrier") +/* .style("font", hLetter+"px courrier")*/ .attr('x', function(d) {return 1;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.dna;}); From 249b74a77acbfb1f8030e0395e1b940eff5853db Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Fri, 19 Jan 2024 10:37:12 +0100 Subject: [PATCH 03/29] Utilise la variable fitPoliceSize --- views/displaytree.ejs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 69ec602..7a08d71 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -173,6 +173,7 @@ var layout = d3.layout.cladogram(); // Fonction D3 qui transforme les donnees var nodeWidth = 80; // Largeur var nodeHeight = 30; // Hauteur var hLetter = 15; +var fitPoliceSize = 16.667; // Taille de la police des aa et dna // var x0Align = 350; // Cordonee horizonatle de l'alignement var stringWidth; // Largeur affichage arbre var tagSimpleGene = false; // True si arbre de gene de type PhyloXML, False si arbre de gene de type RecPhyloXML @@ -1389,7 +1390,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { seqTextAA.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe -/* .style("font", hLetter+"px courrier")*/ + .style("font-size",fitPoliceSize+"px") .attr('x', function(d) {return 1;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.aa;}); @@ -1765,7 +1766,7 @@ function saveSVGAlignment(){ }); $('.seqblock g text').css({ 'letter-spacing':(alignmentLetterSpacing)+'px', - 'font-size': '16.667px', + 'font-size': fitPoliceSize+'px', }); var style = "\n"; var img = new Image(); @@ -2324,7 +2325,7 @@ $('#export').on('click', function(event, dropdownData) { }); $('.seqblock g text').css({ 'letter-spacing': (alignmentLetterSpacing)+'px', - 'font-size': '16.667px', + 'font-size': fitPoliceSize+'px', }); break; default: From f0466f4453b8b7ca705dd58f7b96321bf28c7199 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Fri, 19 Jan 2024 13:45:13 +0100 Subject: [PATCH 04/29] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20nodeWidth=20?= =?UTF-8?q?=20lorsque=20le=20bouton=20'logarithmic'=20est=20utilis=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/displaytree.ejs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 7a08d71..6634285 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -562,9 +562,12 @@ function updateLayout(cRoot,firstLoad=0) { if (tagSimpleGene) { if (firstLoad == 1) { var max_tree_length = getmaxlength(treeRoot,0); + console.log("MAX TREE LENGTH SIMPLE "+max_tree_length); + console.log("MAX TREE nodeWidth 1 "+nodeWidth); if (max_tree_length > 0) { nodeWidth = Math.floor(nodeWidth / max_tree_length) * 3.0; } + console.log("MAX TREE nodeWidth 2"+nodeWidth); }; phylogeny(treeRoot,nodeWidth); } else { @@ -2279,8 +2282,21 @@ $('#lessWidth').on('click', function(event, dropdownData) { $('#loga').on('click', function(event, dropdownData) { if (logBranchLength) { logBranchLength = false; + var max_tree_length = getmaxlength(treeRoot,0); + console.log("MAX TREE LENGTH "+max_tree_length) + if (max_tree_length > 0) { + nodeWidth = Math.floor(80 / max_tree_length) * 3.0; + } + console.log("MAX TREE nodeWidth "+nodeWidth); }else { logBranchLength = true; + var max_tree_length = getmaxlength(treeRoot,0); + console.log("MAX TREE LENGTH LOG "+max_tree_length) + if (max_tree_length > 0) { + nodeWidth = Math.floor(80 / max_tree_length) * 3.0; + } + console.log("MAX TREE nodeWidth "+nodeWidth); + } updateLayout(cladeRoot); }); From 4c7145757d6a319eaf29d9727bf52e364c541e9e Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Fri, 19 Jan 2024 13:53:05 +0100 Subject: [PATCH 05/29] Nettoyage --- views/displaytree.ejs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 6634285..51ac914 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -1391,7 +1391,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { console.log("aa_dataset and dna_dataset OK"); -seqTextAA.append('text') + seqTextAA.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe .style("font-size",fitPoliceSize+"px") .attr('x', function(d) {return 1;}) @@ -1405,12 +1405,13 @@ seqTextAA.append('text') .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.dna;}); - var aaDiv = d3.select('#svg2') + console.log("sequences OK"); + + var aaDiv = d3.select('#svg2') .append('g') .attr('id', 'aa-container') .attr("transform", "translate(" + (margin.right - minX - 300) + "," + (margin.top - minY + 50 + psGraphHeight + decalageY) + ")") - var aablock = aaDiv.selectAll(".aa_block") .data(aa_dataset); @@ -1528,7 +1529,7 @@ seqTextAA.append('text') return d.opac } }); - + console.log("sequence blocs OK"); // ============================================================== // Fin modif : blocs de séquences From 3d20019996f2427c71c3424ae149d4de689082cf Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Fri, 19 Jan 2024 14:39:57 +0100 Subject: [PATCH 06/29] Remplace les fonctions par des valeurs --- views/displaytree.ejs | 66 +++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 40 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 51ac914..5b355d5 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -1175,7 +1175,8 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { } updateNodeColors(); }; - + + console.log("mise en place des graphes"); // ====================================================== // | Début : graphe des résultats de sélection positive | // ====================================================== @@ -1260,7 +1261,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .style('stroke-dasharray', ('4, 4')); psGraph.append('br'); - + console.log("graphes OK"); // ==================================================== // | Fin : graphe des résultats de sélection positive | // ==================================================== @@ -1350,6 +1351,17 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { console.log("Genere aa_dataset and dna_dataset"); aa_dataset = []; dna_dataset = []; + var opacityAA = 0; + var opacityNuc = 0; + + if (displaySeqType == 'AA') { + opacityAA = 0.5; + opacityNuc = 0.0; + } + else { + opacityAA = 0.0; + opacityNuc = 0.5; + } /* d3.selectAll(".aa_block").remove(); // on vire tout d3.selectAll(".dna_block").remove();*/ @@ -1427,17 +1439,10 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { aablockEnter .merge(aablock) .append("rect") - .attr('width', function(d) { return hStep; }) - .attr('height', function(d) { return hLetter }) + .attr('width', hStep) + .attr('height', hLetter ) .style("fill", function(d){ return (d.col)}) - .style("opacity", function(d){ - if (displaySeqType != "AA") { - return 0 - } else { -/* return d.opac*/ - return 0.5 - } - }); + .style("opacity",opacityAA); //ENTER + updatesATE @@ -1457,19 +1462,12 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .append("rect") .attr("class","aa_rect") .attr("transform","translate(0,15)" ) - .attr('width', function(d) { return hStep; }) - .attr('height', function(d) { return 2 }) + .attr('width', hStep) + .attr('height', 2) .attr("stroke","black") .attr("stroke-opacity", 1) .style("fill", "black") - .style("opacity", function(d){ - if (displaySeqType != "AA") { - return 0 - } else { - return d.opac - - } - }); + .style("opacity",opacityAA); var dnaDiv = d3.select('#svg2') .append('g') @@ -1492,16 +1490,10 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { dnablockEnter .merge(dnablock) .append("rect") - .attr('width', function(d) { return hStep; }) - .attr('height', function(d) { return hLetter }) + .attr('width', hStep) + .attr('height', hLetter ) .style("fill", function(d){ return (d.col)}) - .style("opacity", function(d){ - if (displaySeqType != "Nuc") { - return 0 - } else { - return 0.5 - } - }); + .style("opacity", opacityNuc); // Rectangles qui soulignent les position sel pos //ENTER + updates dnablockEnter @@ -1517,18 +1509,12 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .append("rect") .attr("class","dna_rect") .attr("transform","translate(0,15)" ) - .attr('width', function(d) { return hStep; }) - .attr('height', function(d) { return 4 }) + .attr('width', hStep) + .attr('height', 4 ) .attr("stroke","black") .attr("stroke-opacity", 1) .style("fill", "black") - .style("opacity", function(d){ - if (displaySeqType != "Nuc") { - return 0 - } else { - return d.opac - } - }); + .style("opacity", opacityNuc); console.log("sequence blocs OK"); // ============================================================== From f00609c1ada47dfa7502bfd061dc938aa616bda7 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Fri, 19 Jan 2024 15:40:11 +0100 Subject: [PATCH 07/29] Generation des svg sous la condition du type de sequence --- views/displaytree.ejs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 5b355d5..502fcaa 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -1384,7 +1384,9 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { col:aa, opac:opac, }; - aa_dataset.push(locnode); + if (displaySeqType == 'AA') { + aa_dataset.push(locnode); + } }) var dnas = dico_dna[seqname]; dnas.forEach (function (dna,j) { @@ -1397,7 +1399,9 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { col:dna, opac:opac, }; - dna_dataset.push(locnode); + if (displaySeqType == 'Nuc') { + dna_dataset.push(locnode); + } }) }); @@ -1419,6 +1423,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { console.log("sequences OK"); + if (displaySeqType == 'AA') { var aaDiv = d3.select('#svg2') .append('g') .attr('id', 'aa-container') @@ -1468,7 +1473,8 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .attr("stroke-opacity", 1) .style("fill", "black") .style("opacity",opacityAA); - + } + if (displaySeqType == 'Nuc') { var dnaDiv = d3.select('#svg2') .append('g') .attr('id', 'dna-container') @@ -1515,6 +1521,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .attr("stroke-opacity", 1) .style("fill", "black") .style("opacity", opacityNuc); + } console.log("sequence blocs OK"); // ============================================================== From 78a765a9f3a02167e9b10e3f4292573760583d04 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 09:24:07 +0100 Subject: [PATCH 08/29] =?UTF-8?q?Fixe=20la=20position=20en=20x=20du=20text?= =?UTF-8?q?e=20=C3=A0=200=20au=20lieu=20de=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/displaytree.ejs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 502fcaa..c9c5e93 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -174,6 +174,8 @@ var nodeWidth = 80; // Largeur var nodeHeight = 30; // Hauteur var hLetter = 15; var fitPoliceSize = 16.667; // Taille de la police des aa et dna +// var fitPoliceSize = 10.003; // Taille de la police des aa et dna + // var x0Align = 350; // Cordonee horizonatle de l'alignement var stringWidth; // Largeur affichage arbre var tagSimpleGene = false; // True si arbre de gene de type PhyloXML, False si arbre de gene de type RecPhyloXML @@ -195,8 +197,10 @@ var div; var myStorage = window.localStorage; // utilisation de localStorage pour consrever les preferences var displaySeqType = 'AA'; var hStepBase = 12; +// var hStepBase = 6; var hStep; var alignmentLetterSpacing = hStepBase - 10; +// var alignmentLetterSpacing = 0; var psThresholdHigh = parseFloat($('#ps-threshold-high').val()) || parseFloat(1.0); var psThresholdLow = parseFloat($('#ps-threshold-low').val()) || parseFloat(0.9); var psThresholdHighBgColor = "#FF0000"; @@ -1410,14 +1414,14 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { seqTextAA.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe .style("font-size",fitPoliceSize+"px") - .attr('x', function(d) {return 1;}) + .attr('x', function(d) {return 0;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.aa;}); seqTextNuc.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe /* .style("font", hLetter+"px courrier")*/ - .attr('x', function(d) {return 1;}) + .attr('x', function(d) {return 0;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.dna;}); From 87642c09e7c2d7b13d5d74e155cf151995e02fd5 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 10:42:15 +0100 Subject: [PATCH 09/29] Correction surlignage, correction taille de police pour les dna, adaptation de la taille de la police --- views/displaytree.ejs | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index c9c5e93..f63bafb 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -173,8 +173,9 @@ var layout = d3.layout.cladogram(); // Fonction D3 qui transforme les donnees var nodeWidth = 80; // Largeur var nodeHeight = 30; // Hauteur var hLetter = 15; -var fitPoliceSize = 16.667; // Taille de la police des aa et dna -// var fitPoliceSize = 10.003; // Taille de la police des aa et dna +var fitNormalPoliceSize = 16.667; // Taille de la police des aa et dna +var fitSmallPoliceSize = 10.003; // Taille de la police des aa et dna +var fitPoliceSize = fitNormalPoliceSize; // Taille de la police des aa et dna // var x0Align = 350; // Cordonee horizonatle de l'alignement var stringWidth; // Largeur affichage arbre @@ -196,11 +197,13 @@ var patterns= []; var div; var myStorage = window.localStorage; // utilisation de localStorage pour consrever les preferences var displaySeqType = 'AA'; -var hStepBase = 12; -// var hStepBase = 6; +var hStepNormal = 12; +var hStepSmall = 6; +var hStepBase = hStepNormal; var hStep; -var alignmentLetterSpacing = hStepBase - 10; -// var alignmentLetterSpacing = 0; +var alignmentLetterNormalSpacing = hStepBase - 10; +var alignmentLetterSmallSpacing = 0; +var alignmentLetterSpacing = alignmentLetterNormalSpacing; var psThresholdHigh = parseFloat($('#ps-threshold-high').val()) || parseFloat(1.0); var psThresholdLow = parseFloat($('#ps-threshold-low').val()) || parseFloat(0.9); var psThresholdHighBgColor = "#FF0000"; @@ -1010,8 +1013,8 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { // } }) .style("font-family","sans-serif") - .style("font-size","12px") - .style("font-weight","bold") + .style("font-size",12+"px") + // .style("font-weight","bold") .style("text-decoration",function (d) { if (d.data.lastEvent) { var pa = d.data.lastEvent.pattern; @@ -1420,7 +1423,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { seqTextNuc.append('text') .style('letter-spacing', (alignmentLetterSpacing)+'px') // Espacement des lettres pour correpondre au graphe -/* .style("font", hLetter+"px courrier")*/ + .style("font-size",fitPoliceSize+"px") .attr('x', function(d) {return 0;}) .attr('y', function(d) {return Math.floor(hStepBase/3);}) .text(function(d) {return d.dna;}); @@ -1476,7 +1479,13 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .attr("stroke","black") .attr("stroke-opacity", 1) .style("fill", "black") - .style("opacity",opacityAA); + .style("opacity",function(d){ + if (displaySeqType != "AA") { + return 0 + } else { + return d.opac + } + }); } if (displaySeqType == 'Nuc') { var dnaDiv = d3.select('#svg2') @@ -1524,7 +1533,13 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .attr("stroke","black") .attr("stroke-opacity", 1) .style("fill", "black") - .style("opacity", opacityNuc); + .style("opacity", function(d){ + if (displaySeqType != "Nuc") { + return 0 + } else { + return d.opac + } + }); } console.log("sequence blocs OK"); @@ -2303,6 +2318,9 @@ $('#moreHeigth').on('click', function(event, dropdownData) { hLetter = nodeHeight ; if (nodeHeight >= 15) { hLetter = 15 ; + hStepBase = hStepNormal; + fitPoliceSize = fitNormalPoliceSize; + alignmentLetterSpacing = alignmentLetterNormalSpacing; } console.log("node = "+nodeHeight+"; letter = "+hLetter); updateLayout(cladeRoot); @@ -2313,6 +2331,9 @@ $('#lessHeigth').on('click', function(event, dropdownData) { nodeHeight -= modStepY; if (nodeHeight < 15) { hLetter = nodeHeight ; + hStepBase = hStepSmall; + alignmentLetterSpacing = alignmentLetterSmallSpacing; + fitPoliceSize = fitSmallPoliceSize; } console.log("node = "+nodeHeight+"; letter = "+hLetter); updateLayout(cladeRoot); From 86bdf2b92927ee1d57ca1c6b28a0b5c820c2fb4f Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 11:12:07 +0100 Subject: [PATCH 10/29] Reduit la hauteur du soulignage pour les dna --- views/displaytree.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index f63bafb..86983fe 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -1529,7 +1529,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { .attr("class","dna_rect") .attr("transform","translate(0,15)" ) .attr('width', hStep) - .attr('height', 4 ) + .attr('height', 2 ) .attr("stroke","black") .attr("stroke-opacity", 1) .style("fill", "black") From 0457f82722c75c2dc56695f644a5cae42d4b31fa Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 11:26:56 +0100 Subject: [PATCH 11/29] Adapte la position verticale du soulignage --- views/displaytree.ejs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 86983fe..0bd549f 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -173,6 +173,7 @@ var layout = d3.layout.cladogram(); // Fonction D3 qui transforme les donnees var nodeWidth = 80; // Largeur var nodeHeight = 30; // Hauteur var hLetter = 15; +var hUnderline = 15; var fitNormalPoliceSize = 16.667; // Taille de la police des aa et dna var fitSmallPoliceSize = 10.003; // Taille de la police des aa et dna var fitPoliceSize = fitNormalPoliceSize; // Taille de la police des aa et dna @@ -1473,7 +1474,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { }) .append("rect") .attr("class","aa_rect") - .attr("transform","translate(0,15)" ) + .attr("transform","translate(0,"+hUnderline+")" ) .attr('width', hStep) .attr('height', 2) .attr("stroke","black") @@ -1527,7 +1528,7 @@ function updateSvg(treeRoot,firstLoad ,config = {}) { }) .append("rect") .attr("class","dna_rect") - .attr("transform","translate(0,15)" ) + .attr("transform","translate(0,"+hUnderline+")" ) .attr('width', hStep) .attr('height', 2 ) .attr("stroke","black") @@ -2318,6 +2319,7 @@ $('#moreHeigth').on('click', function(event, dropdownData) { hLetter = nodeHeight ; if (nodeHeight >= 15) { hLetter = 15 ; + hUnderline = 15 ; hStepBase = hStepNormal; fitPoliceSize = fitNormalPoliceSize; alignmentLetterSpacing = alignmentLetterNormalSpacing; @@ -2331,6 +2333,7 @@ $('#lessHeigth').on('click', function(event, dropdownData) { nodeHeight -= modStepY; if (nodeHeight < 15) { hLetter = nodeHeight ; + hUnderline = 10 ; hStepBase = hStepSmall; alignmentLetterSpacing = alignmentLetterSmallSpacing; fitPoliceSize = fitSmallPoliceSize; From a0eeb67cd59962424cf8999d0967a590a38a438d Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 14:24:15 +0100 Subject: [PATCH 12/29] Ameliore la position verticale du soulignage --- views/displaytree.ejs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index 0bd549f..dc3da3d 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -2316,8 +2316,8 @@ $('#loga').on('click', function(event, dropdownData) { }); $('#moreHeigth').on('click', function(event, dropdownData) { nodeHeight += modStepY; - hLetter = nodeHeight ; - if (nodeHeight >= 15) { + hLetter = nodeHeight - 2 ; + if (nodeHeight > 15) { hLetter = 15 ; hUnderline = 15 ; hStepBase = hStepNormal; @@ -2328,12 +2328,15 @@ $('#moreHeigth').on('click', function(event, dropdownData) { updateLayout(cladeRoot); }); $('#lessHeigth').on('click', function(event, dropdownData) { - if (nodeHeight - modStepY >= 0 ) { + if (nodeHeight - modStepY >= 10 ) { // if (true) { nodeHeight -= modStepY; - if (nodeHeight < 15) { - hLetter = nodeHeight ; - hUnderline = 10 ; + if (nodeHeight <= 15) { + hLetter = nodeHeight - 2 ; + hUnderline = 12 ; + if (nodeHeight <= 10) { + hUnderline = 9 ; + } hStepBase = hStepSmall; alignmentLetterSpacing = alignmentLetterSmallSpacing; fitPoliceSize = fitSmallPoliceSize; From eea16d765f167aea2fe485311199fcee15afd2c0 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 14:57:56 +0100 Subject: [PATCH 13/29] Modif de la pos. verticale lors de l'action moreHeight --- views/displaytree.ejs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index dc3da3d..a7e9c4a 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -2317,6 +2317,9 @@ $('#loga').on('click', function(event, dropdownData) { $('#moreHeigth').on('click', function(event, dropdownData) { nodeHeight += modStepY; hLetter = nodeHeight - 2 ; + if (nodeHeight > 10) { + hUnderline = 12 ; + } if (nodeHeight > 15) { hLetter = 15 ; hUnderline = 15 ; From 98f13256f6ef837dddb6ab1cb0fc4ae41840e28b Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 15:15:09 +0100 Subject: [PATCH 14/29] Le pointeur de lessHeight devient not-allowed lorsque la hauteur minimum est atteinte --- views/displaytree.ejs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index a7e9c4a..b532aea 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -2315,6 +2315,7 @@ $('#loga').on('click', function(event, dropdownData) { updateLayout(cladeRoot); }); $('#moreHeigth').on('click', function(event, dropdownData) { + $('#lessHeigth').css('cursor','pointer') nodeHeight += modStepY; hLetter = nodeHeight - 2 ; if (nodeHeight > 10) { @@ -2339,6 +2340,7 @@ $('#lessHeigth').on('click', function(event, dropdownData) { hUnderline = 12 ; if (nodeHeight <= 10) { hUnderline = 9 ; + $('#lessHeigth').css('cursor','not-allowed') } hStepBase = hStepSmall; alignmentLetterSpacing = alignmentLetterSmallSpacing; From 95d0758064141f349d5cf0f35acc3a14f76b85b0 Mon Sep 17 00:00:00 2001 From: Simon Penel Date: Mon, 22 Jan 2024 16:46:43 +0100 Subject: [PATCH 15/29] Nettoyage --- views/displaytree.ejs | 159 +++++++++--------------------------------- 1 file changed, 33 insertions(+), 126 deletions(-) diff --git a/views/displaytree.ejs b/views/displaytree.ejs index b532aea..ff67372 100644 --- a/views/displaytree.ejs +++ b/views/displaytree.ejs @@ -18,7 +18,6 @@ Modified by Grégoire ALIZADEH NOIRET, 15 March 2023