pub struct JsAssets {
pub cytoscape_path: String,
pub dagre_path: String,
pub cytoscape_dagre_path: String,
pub layout_base_path: String,
pub cose_base_path: String,
pub cytoscape_cose_bilkent_path: String,
pub wasm_base64: Option<String>,
pub wasm_js_glue: Option<String>,
}Expand description
JavaScript asset paths for graph visualization.
The report uses Cytoscape.js with layout plugins for interactive dependency graph visualization. You can provide paths to:
- CDN URLs (e.g., unpkg.com)
- Local bundled files (for offline use)
- Empty strings (graph will show placeholder)
§Example
use report_leptos::JsAssets;
// CDN paths (with Cytoscape fallback, no WASM)
let assets = JsAssets {
cytoscape_path: "https://unpkg.com/cytoscape@3/dist/cytoscape.min.js".into(),
dagre_path: "https://unpkg.com/dagre@0.8/dist/dagre.min.js".into(),
cytoscape_dagre_path: "https://unpkg.com/cytoscape-dagre@2/cytoscape-dagre.js".into(),
layout_base_path: "https://unpkg.com/layout-base@2/layout-base.js".into(),
cose_base_path: "https://unpkg.com/cose-base@2/cose-base.js".into(),
cytoscape_cose_bilkent_path: "https://unpkg.com/cytoscape-cose-bilkent@4/cytoscape-cose-bilkent.js".into(),
..Default::default() // wasm_base64, wasm_js_glue = None
};
// Or use defaults (empty paths - graph shows placeholder)
let assets = JsAssets::default();Fields§
§cytoscape_path: StringPath to cytoscape.min.js
dagre_path: StringPath to dagre.min.js (for hierarchical layouts)
cytoscape_dagre_path: StringPath to cytoscape-dagre.js plugin
layout_base_path: StringPath to layout-base.js (required by cose-base)
cose_base_path: StringPath to cose-base.js (required by cytoscape-cose-bilkent)
cytoscape_cose_bilkent_path: StringPath to cytoscape-cose-bilkent.js plugin (for force-directed layouts)
wasm_base64: Option<String>Inline WASM module (base64 encoded) for native graph rendering
wasm_js_glue: Option<String>Inline JS glue code for WASM module
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsAssets
impl RefUnwindSafe for JsAssets
impl Send for JsAssets
impl Sync for JsAssets
impl Unpin for JsAssets
impl UnwindSafe for JsAssets
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.