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

Update file xg2.js

parent 9f1e9a2c
No related branches found
No related tags found
No related merge requests found
Pipeline #12815 passed
......@@ -165,7 +165,8 @@
.attr("width", d => Math.abs(x(d.xG_diff) - x(0))) // Longitud proporcional a xG_diff
.attr("height", y.bandwidth())
.attr("fill", d => {
const intensity = Math.max(0.2, Math.min(1, Math.abs(d.xG_diff) / 10)); // Escala de intensidad ajustable
const maxValue = d3.max(filteredData, d => Math.abs(d.xG_diff));
const intensity = Math.max(0.4, Math.abs(d.xG_diff) / maxValue); // Usar maxValue para escalar y asegurar un mínimo de 0.4
return d.xG_diff > 0
? d3.interpolateBlues(intensity) // Azul para valores positivos
: d3.interpolateReds(intensity); // Rojo para valores negativos
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment