workflow_d3/
script.rs

1use workflow_dom::inject::*;
2use workflow_dom::result::Result;
3
4static mut D3_LOADED: bool = false;
5
6pub async fn load() -> Result<()> {
7    if unsafe { D3_LOADED } {
8        return Ok(());
9    }
10
11    let d3_js = include_bytes!("../extern/resources/d3.v7.min.js");
12    inject_blob(Content::Script(None, d3_js)).await?;
13
14    unsafe { D3_LOADED = true };
15
16    Ok(())
17}