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
23pub use {
24    animation::*, backend::*, chart::*, display::*, event::*, geo::*, geom::*, model::*, option::*,
25    paint::*, series::*, text::*,
26};
27
28// The easing of an animation belongs to the engine, and so does the
29// easing a chart's animator takes. It is re-exported here so that an
30// application can name it without reaching for the engine.
31pub use euv_engine::Easing;
32
33// The DOM types the chart crate talks to. They are imported one by one
34// rather than through a blanket `web_sys::*` glob, because the crate
35// defines its own `Transform2D` and `Position`, which would collide with
36// the DOM types of the same name.
37use std::{
38    cell::RefCell,
39    collections::{BTreeMap, HashMap},
40    error::Error,
41    fmt::{Debug, Display},
42    hash::{Hash, Hasher},
43    iter::{Peekable, once},
44    mem::take,
45    rc::Rc,
46    slice::from_ref,
47    str::{Chars, SplitWhitespace},
48};
49
50use {
51    euv_core::Signal,
52    euv_engine::{Tween, TweenState},
53    js_sys::{Array, Float32Array, Function, Object, Uint8Array, Uint32Array},
54    lombok_macros::Data,
55    wasm_bindgen::{JsCast, JsValue},
56    wasm_bindgen_futures::JsFuture,
57    web_sys::{
58        CanvasGradient, CanvasRenderingContext2d, Document, HtmlCanvasElement, HtmlImageElement,
59        Navigator, WebGl2RenderingContext, WebGlBuffer, WebGlContextAttributes, WebGlProgram,
60        WebGlShader, WebGlTexture, WebGlUniformLocation, WebGlVertexArrayObject, Window,
61    },
62};