refactoring
This commit is contained in:
parent
01a0c9244d
commit
0dfa95713b
|
@ -7,8 +7,8 @@ import commarc from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdi
|
|||
//import {Runtime, Library, Inspector} from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/runtime.js";
|
||||
//import commarc from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/index.js";
|
||||
|
||||
const synttypes=["princ", "subord I","subord II","subord III","coord", "coord I", "coord II","subord IV","subord V","parent",
|
||||
"coord III", "pcoord", "coord 0", "subord VI", "coord IV", "coord V", "pcoord I","subord VII"]
|
||||
//const synttypes=["princ", "subord I","subord II","subord III","coord", "coord I", "coord II","subord IV","subord V","parent",
|
||||
// "coord III", "pcoord", "coord 0", "subord VI", "coord IV", "coord V", "pcoord I","subord VII"]
|
||||
|
||||
//var clausecolors=d3.scaleOrdinal(d3.schemeSet1).domain(synttypes)
|
||||
|
||||
|
@ -18,16 +18,18 @@ const synttypes=["princ", "subord I","subord II","subord III","coord", "coord I"
|
|||
"CoV": "coord V", "ParentheticalCoI": "pcoord I", "SubVII": "subord VII"}
|
||||
*/
|
||||
//const structpalette=d3.quantize(d3.interpolateHcl("#4d4193", "#60c96e"), 18)
|
||||
const maptypestopalette={"Ma": 0, "SubI": 1, "SubII": 3, "SubIII": 4, "Co": 5,
|
||||
|
||||
/*const maptypestopalette={"Ma": 0, "SubI": 1, "SubII": 3, "SubIII": 4, "Co": 5,
|
||||
"CoI": 9, "CoII": 10, "SubIV": 5, "SubV": 6, "ParentethicalClause": 17,
|
||||
"CoIII": 11, "ParentheticalCo":14, "PseudoCo": 16, "SubVI": 7 , "CoIV": 12,
|
||||
"CoV": 13, "ParentheticalCoI": 15, "SubVII": 8}
|
||||
|
||||
var colorssp = d3.scaleQuantize()
|
||||
.domain([0,17])
|
||||
.range(["#3288bd", "#66c2a5", "#e41a1c", "#4daf4a", "#984ea3", "#d53e4f", "#f46d43", "#ABDDA4",
|
||||
"#E6F598", "#FFFFBF", "#FEE08B", "#FDAE61", "#F46D43",
|
||||
"#D53E4F", "#9E0142", "#e377c2", "#7f7f7f", "#bcbd22"]);
|
||||
|
||||
*/
|
||||
const runtime1 = new Runtime(new Library(name => {
|
||||
console.log('name' +name)
|
||||
switch (name) {
|
||||
|
@ -70,7 +72,7 @@ document.addEventListener("dblclick", function(e){
|
|||
if (name === "sentenceStructArcs")
|
||||
return new Inspector(document.querySelector("#displayinfo"));
|
||||
});
|
||||
main.redefine('width', 580);
|
||||
main.redefine('width', 648);
|
||||
main.redefine('height', 500);
|
||||
|
||||
//main.redefine("links", d3.csv("https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/files/parsint_mod_completo_pre_new_4.csv", d3.autoType));
|
||||
|
@ -84,11 +86,16 @@ document.addEventListener("dblclick", function(e){
|
|||
collection[i].classList.add('font-italic');
|
||||
//collection[i].classList.add('text-info');
|
||||
//console.log(collection[i].className)
|
||||
var synttp=collection[i].className.split(" ")[1]
|
||||
|
||||
|
||||
//console.log(maptypes[synttp]+' '+maptypestopalette[synttp]+', '+colorssp(maptypestopalette[synttp]))
|
||||
//collection[i].style.background = colorssp(maptypestopalette[synttp]);
|
||||
collection[i].style.color = colorssp(maptypestopalette[synttp]);
|
||||
if (selectedVista!='frasi'){
|
||||
var synttp=collection[i].className.split(" ")[1]
|
||||
collection[i].style.color = colorssp(mapsynttypestopalette[synttp]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//collection[i].style.removeProperty('color');
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ WHERE {
|
|||
var colorssp = d3.scaleQuantize()
|
||||
.domain([0, 17])
|
||||
.range(["#3288bd", "#66c2a5", "#e41a1c", "#4daf4a", "#984ea3", "#d53e4f", "#f46d43", "#ABDDA4",
|
||||
"#E6F598", "#FFFFBF", "#FEE08B", "#FDAE61", "#F46D43",
|
||||
"#E6F598", "ci", "#FEE08B", "#FDAE61", "#F46D43",
|
||||
"#D53E4F", "#9E0142", "#e377c2", "#7f7f7f", "#bcbd22"]);
|
||||
|
||||
const mapsynttypestopalette = {
|
||||
|
|
Loading…
Reference in New Issue