Skip to main content

euv_chart/
lib.rs

1//! euv-chart
2//!
3//! A high-performance charting library for the euv framework.
4//!
5//! The crate offers an ECharts-compatible option model, renders through
6//! WebGPU, WebGL2, or Canvas2D — whichever the host browser supports —
7//! and exposes one API for all three, so a developer never has to know
8//! which backend is in use.
9
10mod animation;
11mod backend;
12mod chart;
13mod display;
14mod event;
15mod geo;
16mod geom;
17mod model;
18mod option;
19mod paint;
20mod series;
21mod text;
22
23#[cfg(test)]
24#[path = "../tests/mod.rs"]
25mod tests;
26
27pub use {
28    animation::*, backend::*, chart::*, display::*, event::*, geo::*, geom::*, model::*, option::*,
29    paint::*, series::*, text::*,
30};
31
32// The easing of an animation belongs to the engine, and so does the
33// easing a chart's animator takes. It is re-exported here so that an
34// application can name it without reaching for the engine.
35pub use euv_engine::Easing;
36
37// The DOM types the chart crate talks to. They are imported one by one
38// rather than through a blanket `web_sys::*` glob, because the crate
39// defines its own `Transform2D` and `Position`, which would collide with
40// the DOM types of the same name.
41use std::{
42    cell::RefCell,
43    collections::{BTreeMap, HashMap},
44    error::Error,
45    fmt::{Debug, Display},
46    hash::{Hash, Hasher},
47    iter::{Peekable, once},
48    mem::take,
49    rc::Rc,
50    slice::from_ref,
51    str::{Chars, SplitWhitespace},
52};
53
54use {
55    euv_core::Signal,
56    euv_engine::{Tween, TweenState},
57    js_sys::{Array, Float32Array, Function, Object, Uint8Array, Uint32Array},
58    lombok_macros::Data,
59    wasm_bindgen::{JsCast, JsValue},
60    wasm_bindgen_futures::JsFuture,
61    web_sys::{
62        CanvasGradient, CanvasRenderingContext2d, Document, HtmlCanvasElement, HtmlImageElement,
63        Navigator, WebGl2RenderingContext, WebGlBuffer, WebGlContextAttributes, WebGlProgram,
64        WebGlShader, WebGlTexture, WebGlUniformLocation, WebGlVertexArrayObject, Window,
65    },
66};