Skip to content
Snippets Groups Projects
Commit e060d9e9 authored by ferngon's avatar ferngon
Browse files

Update file xg2.js

parent fc75424a
Branches
No related tags found
No related merge requests found
Pipeline #12817 passed
...@@ -165,10 +165,10 @@ ...@@ -165,10 +165,10 @@
.attr("width", d => Math.abs(x(d.xG_diff) - x(0))) // Longitud proporcional a xG_diff .attr("width", d => Math.abs(x(d.xG_diff) - x(0))) // Longitud proporcional a xG_diff
.attr("height", y.bandwidth()) .attr("height", y.bandwidth())
.attr("fill", d => { .attr("fill", d => {
const logIntensity = Math.log(Math.abs(d.xG_diff) + 1) / Math.log(maxValue + 1); const intensity = Math.min(1, Math.abs(d.xG_diff) / 10); // Escala de intensidad ajustable
return d.xG_diff > 0 return d.xG_diff > 0
? d3.interpolateBlues(logIntensity) // Azul para valores positivos ? d3.interpolateBlues(intensity) // Azul para valores positivos
: d3.interpolateReds(logIntensity); // Rojo para valores negativos : d3.interpolateReds(intensity); // Rojo para valores negativos
}) })
.on("click", function(event, d) { .on("click", function(event, d) {
infoContainer2 infoContainer2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment