tawasuyu

tawasuyu/brahman

Rust 492TOML 194Markdown 53JSON 176939 Definitions

gioser-graph: min-max normalize weights, subtle transparency

- All edge weights are 0.83-0.93 (tight cluster). Now:
  min-max scale: (w - 0.80) / 0.15 → 0.0-1.0
  then quadratic curve: norm² to exaggerate differences
- Stroke width: 0.8 + expanded*3.0 (subtle, not chunky)
- Opacity: 12-42% (transparent and subtle)
- Brightness: moderate, maps to expanded value

1fdbd358c8cd914fb767cbee1483d79935aa1fec · by Sergio · (5 months ago) · parent ac894390f · browse the tree at this commit

Semantic delta · 1

crates/modules/gioser/gioser-graph-web/src/lib.rs

2 files · +14 −8

diff --git a/crates/apps/gioser-web/pkg/gioser_web_bg.wasm b/crates/apps/gioser-web/pkg/gioser_web_bg.wasm
index 939c2e4..2a36079 100644
Binary files a/crates/apps/gioser-web/pkg/gioser_web_bg.wasm and b/crates/apps/gioser-web/pkg/gioser_web_bg.wasm differ
diff --git a/crates/modules/gioser/gioser-graph-web/src/lib.rs b/crates/modules/gioser/gioser-graph-web/src/lib.rs
index bd5e3fd..946a449 100644
--- a/crates/modules/gioser/gioser-graph-web/src/lib.rs
+++ b/crates/modules/gioser/gioser-graph-web/src/lib.rs
@@ -253,21 +253,27 @@ impl GraphWidget {
             let c2 = color_map.get(edge.target.as_str()).copied().unwrap_or("#888");
 
             let w = edge.weight.unwrap_or(0.7);
-            // EXAGERADO: grosor 1 a 10px, máximo contraste
-            // weight 0.50 → 3px, weight 0.95 → 9px
-            let thick = 1.5 + w * 8.0;
 
-            // Color más saturado: mezcla sin gris, cada canal al extremo
+            // Min-max scaling: expandir el rango real (0.83-0.93) a 0.0-1.0
+            // Con un mínimo global de 0.80 para capturar todo
+            let norm = ((w - 0.80) / 0.15).clamp(0.0, 1.0);
+            // Curva cuadrática para exagerar diferencias: norm²
+            let expanded = norm * norm;
+
+            // Grosor sutil: 0.5px a 3.5px (no grueso, diferenciado)
+            let thick = 0.8 + expanded * 3.0;
+
+            // Color mezclado
             let blended = blend_colors(c1, c2, 0.5);
             let (br, bg, bb) = parse_hex(&blended);
-            // Brillo exagerado: peso bajo = color puro; peso alto → blanco
-            let bright_factor = w * 0.7;
+            // Brillo: sin expander, normal 0-1, sútil
+            let bright_factor = norm * 0.5;
             let r = (br as f64 + (255.0 - br as f64) * bright_factor).min(255.0) as u32;
             let g = (bg as f64 + (255.0 - bg as f64) * bright_factor).min(255.0) as u32;
             let b = (bb as f64 + (255.0 - bb as f64) * bright_factor).min(255.0) as u32;
 
-            // Opacidad: peso bajo = 40%, peso alto = 95%
-            let alpha = 0.40 + w * 0.55;
+            // Opacidad baja y sutil: 15% a 40%
+            let alpha = 0.12 + expanded * 0.30;
 
             let line: SvgLineElement = self
                 .document