You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a project, I need to get the data index of a selected point in leptos. Echarts supports this Echarts Event and Action, but I am not familiar enough with wasm to implement this myself.
Using wasm_bindgen it should be possible to allow this functionality.
If someone could provide me with a minimal working PR, I would be able to extend the functionality.
// The function to call on clicklet closure = Closure::wrap(Box::new(|_| {info!("clicked");})asBox<dynFnMut(JsValue)>);let js_function:&js_sys::Function = closure.as_ref().unchecked_ref();// The chartlet chart = renderer.render("chart", ...).unwrap();let js_value:JsValue = chart.into();// The `on` methodlet on = js_sys::Reflect::get(&js_value,&"on".into()).expect("Object should have 'on' method").dyn_into::<js_sys::Function>().expect("'on' should be a function");// The call
on.call2(&js_value,&"click".into(), js_function).expect("Failed to call 'on' method");
Would be nice to have access to the on method on the bindings though. :)
For a project, I need to get the data index of a selected point in leptos. Echarts supports this Echarts Event and Action, but I am not familiar enough with wasm to implement this myself.
Using
wasm_bindgen
it should be possible to allow this functionality.If someone could provide me with a minimal working PR, I would be able to extend the functionality.
Code that would generate something like this, just hardcoded in the wasm_renderer.rs file, would be great.
Later on, we would need to figure out how we can support both html and wasm.
@yuankunzhang would you be able to tackle this?
The text was updated successfully, but these errors were encountered: