charming

repository·main·Indexed 25 days ago

https://github.com/yuankunzhang/charming

A Rust visualization library version 0.6.0 that leverages Apache ECharts to provide a declarative API for generating high-quality charts. It supports multiple rendering targets including HTML, SVG, and various image formats via HtmlRenderer, ImageRenderer (requires ssr feature), and WasmRenderer (requires wasm feature). The library is compatible with WebAssembly environments and integrates with frameworks such as Dioxus, Leptos, Sycamore, and Yew.

Tokens
9.7K
Snippets
25
Records
58
Agent score
79%

What's inside charming

  1. How Charming renderers work

    main

    Charming provides three types of renderers to output charts in different environments. Note that the ssr and wasm features are mutually exclusive.

    1. HtmlRenderer: Renders a chart into HTML fragments. The actual rendering is offloaded to the user's web browser, making it ideal for interactive client-side web applications.
    2. ImageRenderer: Renders a chart into an image file (SVG, PNG, etc.) using an embedded deno_core engine. This requires the ssr feature flag.
    3. WasmRenderer: Renders a chart within a WebAssembly runtime. This requires the wasm feature flag.
  2. Prerequisites for charming with dioxus-desktop

    main

    Before running the dioxus-desktop-demo, ensure your environment meets the following requirements:

    • Rust: The Rust toolchain must be installed.
    • Dioxus CLI: The dx command-line tool must be installed.
    • Platform Dependencies: You must install the specific system dependencies required for Dioxus desktop applications on your operating system.
  3. Prerequisites for the charming Leptos demo

    main

    Before running the Leptos demo, ensure your environment meets the following requirements:

    • Rust: The Rust programming language must be installed.
    • trunk: The trunk build tool must be installed for managing WebAssembly assets.
    • Wasm Target: You must have the wasm32-unknown-unknown target installed via rustup.
  4. View the Charming chart gallery

    main

    You can explore a wide variety of chart examples including Bar, Boxplot, Candlestick, Funnel, Gauge, Graph, Heatmap, Line, Parallel, Pie, Radar, Sankey, Scatter, Calendar, Sunburst, Theme River, and Tree charts.

    To view the interactive charts on a rendered HTML page, clone the repository and run the gallery binary using Cargo.

    cargo run --bin gallery