diff --git a/crates/apps/gioser-web/pkg/gioser_web.d.ts b/crates/apps/gioser-web/pkg/gioser_web.d.ts index d37c8a2..bc7a32e 100644 --- a/crates/apps/gioser-web/pkg/gioser_web.d.ts +++ b/crates/apps/gioser-web/pkg/gioser_web.d.ts @@ -8,14 +8,14 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl export interface InitOutput { readonly memory: WebAssembly.Memory; readonly boot: () => void; - readonly __wasm_bindgen_func_elem_219: (a: number, b: number, c: number) => void; - readonly __wasm_bindgen_func_elem_1408: (a: number, b: number, c: number, d: number) => void; - readonly __wasm_bindgen_func_elem_218: (a: number, b: number, c: number) => void; - readonly __wasm_bindgen_func_elem_218_3: (a: number, b: number, c: number) => void; - readonly __wasm_bindgen_func_elem_496: (a: number, b: number, c: number) => void; - readonly __wasm_bindgen_func_elem_602: (a: number, b: number, c: number) => void; - readonly __wasm_bindgen_func_elem_289: (a: number, b: number, c: number) => void; - readonly __wasm_bindgen_func_elem_288: (a: number, b: number) => void; + readonly __wasm_bindgen_func_elem_216: (a: number, b: number, c: number) => void; + readonly __wasm_bindgen_func_elem_1404: (a: number, b: number, c: number, d: number) => void; + readonly __wasm_bindgen_func_elem_215: (a: number, b: number, c: number) => void; + readonly __wasm_bindgen_func_elem_215_3: (a: number, b: number, c: number) => void; + readonly __wasm_bindgen_func_elem_492: (a: number, b: number, c: number) => void; + readonly __wasm_bindgen_func_elem_598: (a: number, b: number, c: number) => void; + readonly __wasm_bindgen_func_elem_285: (a: number, b: number, c: number) => void; + readonly __wasm_bindgen_func_elem_284: (a: number, b: number) => void; readonly __wbindgen_export: (a: number, b: number) => number; readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export3: (a: number) => void; diff --git a/crates/apps/gioser-web/pkg/gioser_web.js b/crates/apps/gioser-web/pkg/gioser_web.js index df3c8bd..382f2a9 100644 --- a/crates/apps/gioser-web/pkg/gioser_web.js +++ b/crates/apps/gioser-web/pkg/gioser_web.js @@ -571,42 +571,42 @@ function __wbg_get_imports() { }, __wbindgen_cast_0000000000000001: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 179, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1408); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_1404); return addHeapObject(ret); }, __wbindgen_cast_0000000000000002: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [F64], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_219); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_216); return addHeapObject(ret); }, __wbindgen_cast_0000000000000003: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 6, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_218); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_215); return addHeapObject(ret); }, __wbindgen_cast_0000000000000004: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("KeyboardEvent")], shim_idx: 6, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_218_3); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_215_3); return addHeapObject(ret); }, __wbindgen_cast_0000000000000005: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MouseEvent")], shim_idx: 137, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_496); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_492); return addHeapObject(ret); }, __wbindgen_cast_0000000000000006: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MouseEvent")], shim_idx: 173, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_602); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_598); return addHeapObject(ret); }, __wbindgen_cast_0000000000000007: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("PointerEvent")], shim_idx: 67, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_289); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_285); return addHeapObject(ret); }, __wbindgen_cast_0000000000000008: function(arg0, arg1) { // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 69, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. - const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_288); + const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_284); return addHeapObject(ret); }, __wbindgen_cast_0000000000000009: function(arg0, arg1) { @@ -633,34 +633,34 @@ function __wbg_get_imports() { }; } -function __wasm_bindgen_func_elem_288(arg0, arg1) { - wasm.__wasm_bindgen_func_elem_288(arg0, arg1); +function __wasm_bindgen_func_elem_284(arg0, arg1) { + wasm.__wasm_bindgen_func_elem_284(arg0, arg1); } -function __wasm_bindgen_func_elem_218(arg0, arg1, arg2) { - wasm.__wasm_bindgen_func_elem_218(arg0, arg1, addHeapObject(arg2)); +function __wasm_bindgen_func_elem_215(arg0, arg1, arg2) { + wasm.__wasm_bindgen_func_elem_215(arg0, arg1, addHeapObject(arg2)); } -function __wasm_bindgen_func_elem_218_3(arg0, arg1, arg2) { - wasm.__wasm_bindgen_func_elem_218_3(arg0, arg1, addHeapObject(arg2)); +function __wasm_bindgen_func_elem_215_3(arg0, arg1, arg2) { + wasm.__wasm_bindgen_func_elem_215_3(arg0, arg1, addHeapObject(arg2)); } -function __wasm_bindgen_func_elem_496(arg0, arg1, arg2) { - wasm.__wasm_bindgen_func_elem_496(arg0, arg1, addHeapObject(arg2)); +function __wasm_bindgen_func_elem_492(arg0, arg1, arg2) { + wasm.__wasm_bindgen_func_elem_492(arg0, arg1, addHeapObject(arg2)); } -function __wasm_bindgen_func_elem_602(arg0, arg1, arg2) { - wasm.__wasm_bindgen_func_elem_602(arg0, arg1, addHeapObject(arg2)); +function __wasm_bindgen_func_elem_598(arg0, arg1, arg2) { + wasm.__wasm_bindgen_func_elem_598(arg0, arg1, addHeapObject(arg2)); } -function __wasm_bindgen_func_elem_289(arg0, arg1, arg2) { - wasm.__wasm_bindgen_func_elem_289(arg0, arg1, addHeapObject(arg2)); +function __wasm_bindgen_func_elem_285(arg0, arg1, arg2) { + wasm.__wasm_bindgen_func_elem_285(arg0, arg1, addHeapObject(arg2)); } -function __wasm_bindgen_func_elem_1408(arg0, arg1, arg2) { +function __wasm_bindgen_func_elem_1404(arg0, arg1, arg2) { try { const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.__wasm_bindgen_func_elem_1408(retptr, arg0, arg1, addHeapObject(arg2)); + wasm.__wasm_bindgen_func_elem_1404(retptr, arg0, arg1, addHeapObject(arg2)); var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); if (r1) { @@ -671,8 +671,8 @@ function __wasm_bindgen_func_elem_1408(arg0, arg1, arg2) { } } -function __wasm_bindgen_func_elem_219(arg0, arg1, arg2) { - wasm.__wasm_bindgen_func_elem_219(arg0, arg1, arg2); +function __wasm_bindgen_func_elem_216(arg0, arg1, arg2) { + wasm.__wasm_bindgen_func_elem_216(arg0, arg1, arg2); } function addHeapObject(obj) { diff --git a/crates/apps/gioser-web/pkg/gioser_web_bg.wasm b/crates/apps/gioser-web/pkg/gioser_web_bg.wasm index 310d68e..4dfe114 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/apps/gioser-web/pkg/gioser_web_bg.wasm.d.ts b/crates/apps/gioser-web/pkg/gioser_web_bg.wasm.d.ts index ea09953..592e517 100644 --- a/crates/apps/gioser-web/pkg/gioser_web_bg.wasm.d.ts +++ b/crates/apps/gioser-web/pkg/gioser_web_bg.wasm.d.ts @@ -2,14 +2,14 @@ /* eslint-disable */ export const memory: WebAssembly.Memory; export const boot: () => void; -export const __wasm_bindgen_func_elem_219: (a: number, b: number, c: number) => void; -export const __wasm_bindgen_func_elem_1408: (a: number, b: number, c: number, d: number) => void; -export const __wasm_bindgen_func_elem_218: (a: number, b: number, c: number) => void; -export const __wasm_bindgen_func_elem_218_3: (a: number, b: number, c: number) => void; -export const __wasm_bindgen_func_elem_496: (a: number, b: number, c: number) => void; -export const __wasm_bindgen_func_elem_602: (a: number, b: number, c: number) => void; -export const __wasm_bindgen_func_elem_289: (a: number, b: number, c: number) => void; -export const __wasm_bindgen_func_elem_288: (a: number, b: number) => void; +export const __wasm_bindgen_func_elem_216: (a: number, b: number, c: number) => void; +export const __wasm_bindgen_func_elem_1404: (a: number, b: number, c: number, d: number) => void; +export const __wasm_bindgen_func_elem_215: (a: number, b: number, c: number) => void; +export const __wasm_bindgen_func_elem_215_3: (a: number, b: number, c: number) => void; +export const __wasm_bindgen_func_elem_492: (a: number, b: number, c: number) => void; +export const __wasm_bindgen_func_elem_598: (a: number, b: number, c: number) => void; +export const __wasm_bindgen_func_elem_285: (a: number, b: number, c: number) => void; +export const __wasm_bindgen_func_elem_284: (a: number, b: number) => void; export const __wbindgen_export: (a: number, b: number) => number; export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number; export const __wbindgen_export3: (a: number) => void; diff --git a/crates/apps/gioser-web/styles.css b/crates/apps/gioser-web/styles.css index dd1fb29..43bfe56 100644 --- a/crates/apps/gioser-web/styles.css +++ b/crates/apps/gioser-web/styles.css @@ -231,49 +231,27 @@ body.deck-active-tierra .deck { --deck-glow: rgba(212, 152, 115, 0.24); } inset: 0; pointer-events: none; z-index: 0; + transition: opacity 2s ease; } .deck-page[data-element="aire"] .page-ambience { - background: - radial-gradient(circle at 18% 22%, rgba(208, 219, 255, 0.20), transparent 38%), - radial-gradient(circle at 78% 68%, rgba(208, 219, 255, 0.14), transparent 40%), - radial-gradient(circle at 45% 90%, rgba(180, 200, 255, 0.10), transparent 45%); - animation: aire-drift 45s ease-in-out infinite alternate; + background: radial-gradient(circle at 50% 60%, rgba(208,219,255,0.18), transparent 70%); + animation: page-breathe 8s ease-in-out infinite alternate; } .deck-page[data-element="fuego"] .page-ambience { - background: - radial-gradient(circle at 50% 100%, rgba(245, 144, 86, 0.35), transparent 55%), - radial-gradient(circle at 25% 80%, rgba(255, 90, 40, 0.18), transparent 35%), - radial-gradient(circle at 80% 85%, rgba(255, 140, 60, 0.18), transparent 35%); - animation: fuego-flicker 12s ease-in-out infinite; + background: radial-gradient(circle at 50% 80%, rgba(245,144,86,0.22), transparent 70%); + animation: page-breathe 6s ease-in-out infinite alternate; } .deck-page[data-element="agua"] .page-ambience { - background: - radial-gradient(ellipse at 50% 95%, rgba(60, 160, 230, 0.30), transparent 60%), - radial-gradient(ellipse at 20% 70%, rgba(108, 208, 243, 0.15), transparent 50%), - radial-gradient(ellipse at 80% 75%, rgba(108, 208, 243, 0.12), transparent 50%); - animation: agua-tide 30s ease-in-out infinite alternate; + background: radial-gradient(circle at 50% 80%, rgba(108,208,243,0.18), transparent 70%); + animation: page-breathe 10s ease-in-out infinite alternate; } .deck-page[data-element="tierra"] .page-ambience { - background: - radial-gradient(ellipse at 50% 100%, rgba(120, 80, 40, 0.40), transparent 60%), - radial-gradient(ellipse at 22% 88%, rgba(180, 130, 80, 0.20), transparent 45%), - radial-gradient(ellipse at 78% 88%, rgba(150, 100, 60, 0.22), transparent 45%); + background: radial-gradient(circle at 50% 85%, rgba(140,100,60,0.22), transparent 70%); + animation: page-breathe 7s ease-in-out infinite alternate; } -/* Animaciones sutiles — solo opacidad, sin desplazamiento visible. - El movimiento (transform) del fondo causaba un "respiro" molesto - al abrir el deck. */ -@keyframes aire-drift { - from { opacity: 0.60; } - to { opacity: 0.90; } -} -@keyframes fuego-flicker { - 0%, 100% { opacity: 0.65; } - 35% { opacity: 0.90; } - 60% { opacity: 0.75; } -} -@keyframes agua-tide { - from { opacity: 0.55; } - to { opacity: 0.85; } +@keyframes page-breathe { + from { opacity: 0.35; } + to { opacity: 0.80; } } /* Head + controls */ diff --git a/crates/modules/gioser/gioser-graph-web/src/lib.rs b/crates/modules/gioser/gioser-graph-web/src/lib.rs index aad4d8c..7c0ce4c 100644 --- a/crates/modules/gioser/gioser-graph-web/src/lib.rs +++ b/crates/modules/gioser/gioser-graph-web/src/lib.rs @@ -1,11 +1,11 @@ -//! `gioser-graph-web` — widget de grafo semántico SVG inline. +//! `gioser-graph-web` — grafo semántico SVG inline. //! -//! Layout grid: 3 columnas, filas según la cantidad de nodos. -//! Los nodos son rectángulos redondeados con texto + subtexto (camino). -//! Aristas se dibujan entre todos los pares con líneas semitransparentes: -//! mientras mayor el weight, más opaca y brillante la línea. -//! Animación CSS de respiración suave en el SVG. +//! Layout grid: 3 columnas, filas según cantidad de nodos. +//! Nodos: rectángulos redondeados 170×44px con texto + subtexto (camino). +//! Aristas: opacidad/brillo según weight (más peso = más blanca y opaca). +//! Respiración CSS suave en el SVG (opacity oscila perpetua). //! Hover: glow + opacidad. +//! Las aristas conectan por ID (UUID), no por doc_id. use std::cell::RefCell; use std::rc::Rc; @@ -43,8 +43,6 @@ struct NodeData { name: String, camino: String, doc_id: Option, - chunk: Option, - tags: Option>, #[allow(dead_code)] preview: Option, } @@ -76,8 +74,8 @@ type NavCallback = Rc>>>; const CANVAS_W: f64 = 800.0; const CANVAS_H: f64 = 420.0; -const NODE_W: f64 = 170.0; // más grandes -const NODE_H: f64 = 44.0; // más grandes +const NODE_W: f64 = 170.0; +const NODE_H: f64 = 44.0; const COLS: usize = 3; const CAMINO_COLORS: &[(&str, &str)] = &[ @@ -94,26 +92,6 @@ fn camino_color(camino: &str) -> &str { "#888888" } -fn weight_alpha(w: Option) -> f64 { - // weight 0.5 → 0.40, weight 1.0 → 0.85 - match w { - Some(v) => 0.40 + (v - 0.5).max(0.0) * 0.9, - None => 0.35, - } - .clamp(0.15, 0.95) -} - -fn weight_stroke_color(w: Option, base: &str) -> String { - let alpha = weight_alpha(w); - // Extraer color base, añadir alpha - // Asumimos formato #rrggbb - if base.len() >= 7 && alpha < 1.0 { - format!("{}", base) // se sobreescribe con stroke-opacity - } else { - base.to_string() - } -} - pub struct GraphWidget { container: HtmlElement, api_url: String, @@ -147,7 +125,6 @@ impl GraphWidget { pub async fn load(&mut self) -> Result<(), JsValue> { let url = format!("{}/graph?limit=500", self.api_url); let window = web_sys::window().ok_or_else(|| JsValue::from_str("no window"))?; - let resp_value = JsFuture::from(window.fetch_with_str(&url)).await?; let resp: Response = resp_value.dyn_into()?; if !resp.ok() { @@ -159,17 +136,11 @@ impl GraphWidget { let graph: GraphResponse = serde_json::from_str(&body).map_err(|e| JsValue::from_str(&format!("JSON: {e}")))?; - let nodes: Vec = graph - .nodes - .into_iter() - .map(|n| n.data) - .filter(|n| n.doc_id.is_some()) - .collect(); + let nodes: Vec = graph.nodes.into_iter().map(|n| n.data).collect(); let edges: Vec = graph.edges.into_iter().map(|e| e.data).collect(); self.nodes = nodes; self.edges = edges; - self.render(); Ok(()) } @@ -192,7 +163,6 @@ impl GraphWidget { .unwrap(); svg.set_attribute("viewBox", &format!("0 0 {} {}", CANVAS_W as u32, CANVAS_H as u32)).ok(); svg.set_attribute("width", "100%").ok(); - svg.set_attribute("height", &format!("{}px", CANVAS_H as u32)).ok(); svg.set_attribute("preserveAspectRatio", "xMidYMid meet").ok(); svg.style().set_property("display", "block").ok(); svg.style().set_property("margin", "1.5rem auto 0").ok(); @@ -202,33 +172,20 @@ impl GraphWidget { svg.style().set_property("border-radius", "12px").ok(); svg.style().set_property("border", "1px solid rgba(216,168,93,0.15)").ok(); - // Estilo para animación de respiración en el SVG - // Se añade un