format = function(){
const ch1 = d3.select("input#pageViews").property("checked"),
ch2 = d3.select("input#pageLength").property("checked"),
ch3 = d3.select("input#totalEdits").property("checked"),
ch4 = d3.select("input#yearsWait").property("checked"),
ch5 = d3.select("input#articleAge").property("checked"),
ch6 = d3.select("input#numWatcher").property("checked");
d3.selectAll("text#para")
.each(function(d){
let currentObj = d3.select(this);
currentObj.text("");
for (let i = 0; i < 150; i++){
let bold = (i < width2char(textBold(d.Page_Views)) && ch1)
let color = (i < width2char(textColor(d.Page_Length)) && ch2)
let uLine = (i < width2char(textUnderline(d.Total_Edits)) && ch3)
let ital = (i < width2char(textItalic(d.Days_Wait)) && ch4)
let serif = (i < width2char(textSerif(d.Article_Age)) || !ch5)
currentObj.append("tspan")
.attr("class", "init")
.attr("font-weight", bold? "bold":"normal")
.attr("fill", color? "#2166ac":"#b2182b")
.attr("text-decoration", uLine? "underline":"none")
.style("font-variation-settings", function(){
return `"slnt" ${ital? -30:0},
"wght" ${bold? 800:400},
"CASL" ${serif? 0:1},
"CRSV" ${serif? 0:1},
"MONO" 1`})
.text(d.First_Para_Clean.substring(i, i+1))
currentObj.append("title")
.text(tooltip)
}
})
d3.selectAll("rect#highlight")
.each(function(d){
d3.select(this)
.transition()
.duration(200)
.attr("opacity", ch6? 1:0)
})
}