Published
Edited
Oct 2, 2020
Fork of Anotações
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
destaca = function(e, d){
let me = d3.select(this); // O elemento SVG onde o evento aconteceu

// apaga todos
d3.selectAll("#cg circle")
.attr("opacity", .25);
// enfatiza o selecionado
me
.attr("opacity", "1")
.attr("stroke-width", 2);

// escreve um tooltip
d3.select("g#annotation")
.insert("text")
.attr("id", "label")
.attr("x", me.attr("cx"))
.attr("y", me.attr("cy"))
.attr("dy", radius(d.chuva) + 14)
.attr("text-anchor", "middle")
.attr("font-family", "sans-serif")
.attr("font-size", "12")
.text(formatDate(d.semana) + ", " + formatNum(d.tmedia) + "C e " + formatNum(d.chuva) + "mm");
let div = d3.select("body").append("div")
.attr("id", "details")
.attr("class", "tooltip");
}
Insert cell
voltaDestaque = function(e, d){
d3.select(this)
.attr("fill", fill(d.cidade))
.attr("opacity", .6)
.attr("stroke-width", 1);
d3.selectAll("#cg circle")
.attr("opacity", .6);

d3.select("g#annotation")
.select("text")
.remove();
}
Insert cell
formatDate = d3.utcFormat("%b %-d %Y")
Insert cell
formatNum = d3.format(".1f")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more