Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a first integration test #97

Merged
merged 3 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 183 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions charming/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ serde = { version = "1.0", features = ["derive"] }
serde-wasm-bindgen = {version = "0.6", optional = true }
serde_json = "1.0"
serde_v8 = { version = "0.220", optional = true }
serde_with = "3.11.0"
wasm-bindgen = { version = "0.2", optional = true }

[dev-dependencies]
assert-json-diff = "2.0.2"

[dependencies.web-sys]
version = "0.3.64"
optional = true
Expand Down
5 changes: 4 additions & 1 deletion charming/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ use component::{
use datatype::Dataset;
use element::{process_raw_strings, AxisPointer, Color, MarkLine, Tooltip};
use serde::Serialize;
use serde_with::{formats::PreferOne, serde_as, OneOrMany};
use series::Series;

/**
The chart representation.

Expand Down Expand Up @@ -236,6 +236,7 @@ mouse pointer.
[`Toolbox`] is a feature toolbox that includes data view, save as image, data
zoom, restore, and reset.
*/
#[serde_as]
#[derive(Serialize, Debug, PartialEq, Clone)]
#[serde(rename_all = "camelCase")]
pub struct Chart {
Expand All @@ -258,13 +259,15 @@ pub struct Chart {
#[serde(rename = "grid3D")]
grid3d: Vec<Grid3D>,

#[serde_as(as = "OneOrMany<_, PreferOne>")]
#[serde(skip_serializing_if = "Vec::is_empty")]
x_axis: Vec<Axis>,

#[serde(skip_serializing_if = "Vec::is_empty")]
#[serde(rename = "xAxis3D")]
x_axis3d: Vec<Axis3D>,

#[serde_as(as = "OneOrMany<_, PreferOne>")]
#[serde(skip_serializing_if = "Vec::is_empty")]
y_axis: Vec<Axis>,

Expand Down
Loading
Loading