diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index 31000a2..8d45e55 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -2,21 +2,33 @@ name: Rust
on:
push:
- branches: [ "main" ]
+ branches: ["main"]
pull_request:
- branches: [ "main" ]
+ branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
-
runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Build
+ run: cargo build --verbose
+ - name: Run tests
+ run: cargo test --verbose
+ linting:
+ name: Linting and formatting
+ runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - name: Build
- run: cargo build --verbose
- - name: Run tests
- run: cargo test --verbose
+ - uses: actions/checkout@v4
+ - uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ components: rustfmt
+ - name: Rustfmt Check
+ uses: actions-rust-lang/rustfmt@v1
+ - uses: actions/checkout@v4
+ - name: Run Clippy
+ run: cargo clippy --all-targets --all-features
diff --git a/Cargo.toml b/Cargo.toml
index 2da7951..3af0630 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,4 +1,5 @@
[workspace]
+resolver = "2"
members = [
"charming",
"gallery",
diff --git a/README.md b/README.md
index 6e4fa1e..d4708f9 100644
--- a/README.md
+++ b/README.md
@@ -22,9 +22,9 @@ Highlights:
Vintage |
- Vintage |
+ Westeros |
Essos |
- Essos |
+ Wonderland |
Walden |
diff --git a/charming/src/component/angle_axis.rs b/charming/src/component/angle_axis.rs
index 71d8f2e..ae29f68 100644
--- a/charming/src/component/angle_axis.rs
+++ b/charming/src/component/angle_axis.rs
@@ -99,6 +99,12 @@ pub struct AngleAxis {
data: Vec,
}
+impl Default for AngleAxis {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AngleAxis {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/aria.rs b/charming/src/component/aria.rs
index 8e1d158..67ab4f9 100644
--- a/charming/src/component/aria.rs
+++ b/charming/src/component/aria.rs
@@ -56,6 +56,12 @@ pub struct DecalItem {
max_tile_height: Option,
}
+impl Default for DecalItem {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl DecalItem {
pub fn new() -> DecalItem {
DecalItem {
@@ -141,6 +147,12 @@ pub struct Decal {
decals: Vec,
}
+impl Default for Decal {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Decal {
pub fn new() -> Decal {
Decal {
@@ -210,6 +222,12 @@ pub struct Aria {
decal: Option,
}
+impl Default for Aria {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Aria {
pub fn new() -> Aria {
Aria {
diff --git a/charming/src/component/axis.rs b/charming/src/component/axis.rs
index 7604878..7894529 100644
--- a/charming/src/component/axis.rs
+++ b/charming/src/component/axis.rs
@@ -126,6 +126,12 @@ pub struct Axis {
data: Vec,
}
+impl Default for Axis {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Axis {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/axis3d.rs b/charming/src/component/axis3d.rs
index c3e8423..4a20cd8 100644
--- a/charming/src/component/axis3d.rs
+++ b/charming/src/component/axis3d.rs
@@ -9,6 +9,12 @@ pub struct Axis3D {
type_: Option,
}
+impl Default for Axis3D {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Axis3D {
pub fn new() -> Self {
Self { type_: None }
diff --git a/charming/src/component/data_zoom.rs b/charming/src/component/data_zoom.rs
index 22577fa..ece1d00 100644
--- a/charming/src/component/data_zoom.rs
+++ b/charming/src/component/data_zoom.rs
@@ -137,6 +137,12 @@ pub struct DataZoom {
brush_select: Option,
}
+impl Default for DataZoom {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl DataZoom {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/geo.rs b/charming/src/component/geo.rs
index e15fb9e..9dd5d72 100644
--- a/charming/src/component/geo.rs
+++ b/charming/src/component/geo.rs
@@ -86,6 +86,12 @@ pub struct Geo {
silent: Option,
}
+impl Default for Geo {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Geo {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/geo_map.rs b/charming/src/component/geo_map.rs
index f0d6640..3c409fe 100644
--- a/charming/src/component/geo_map.rs
+++ b/charming/src/component/geo_map.rs
@@ -30,6 +30,12 @@ pub struct GeoMap {
opt: Option,
}
+impl Default for GeoMap {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl GeoMap {
pub fn new() -> Self {
GeoMap {
diff --git a/charming/src/component/grid.rs b/charming/src/component/grid.rs
index e24bfca..4f4d551 100644
--- a/charming/src/component/grid.rs
+++ b/charming/src/component/grid.rs
@@ -54,6 +54,12 @@ pub struct GridTooltip {
extra_css_text: Option,
}
+impl Default for GridTooltip {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl GridTooltip {
pub fn new() -> Self {
Self {
@@ -207,6 +213,12 @@ pub struct Grid {
tooltip: Option,
}
+impl Default for Grid {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Grid {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/grid3d.rs b/charming/src/component/grid3d.rs
index bb0e50b..eb6ed04 100644
--- a/charming/src/component/grid3d.rs
+++ b/charming/src/component/grid3d.rs
@@ -4,6 +4,12 @@ use serde::Serialize;
#[serde(rename_all = "camelCase")]
pub struct Grid3D {}
+impl Default for Grid3D {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Grid3D {
pub fn new() -> Self {
Self {}
diff --git a/charming/src/component/legend.rs b/charming/src/component/legend.rs
index ae41371..5ab8788 100644
--- a/charming/src/component/legend.rs
+++ b/charming/src/component/legend.rs
@@ -171,6 +171,12 @@ pub struct Legend {
data: Vec,
}
+impl Default for Legend {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Legend {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/mod.rs b/charming/src/component/mod.rs
index 90e4aa6..5e664aa 100644
--- a/charming/src/component/mod.rs
+++ b/charming/src/component/mod.rs
@@ -26,12 +26,9 @@ pub use angle_axis::*;
pub use aria::*;
pub use axis::*;
pub use axis3d::*;
-pub use brush::*;
-pub use calendar::*;
pub use data_zoom::*;
pub use geo::*;
pub use geo_map::*;
-pub use graphic::*;
pub use grid::*;
pub use grid3d::*;
pub use legend::*;
@@ -41,7 +38,6 @@ pub use polar_coordinate::*;
pub use radar_coordinate::*;
pub use radius_axis::*;
pub use single_axis::*;
-pub use timeline::*;
pub use title::*;
pub use toolbox::*;
pub use visual_map::*;
diff --git a/charming/src/component/parallel_axis.rs b/charming/src/component/parallel_axis.rs
index 6ee6ec9..f43f1f9 100644
--- a/charming/src/component/parallel_axis.rs
+++ b/charming/src/component/parallel_axis.rs
@@ -40,6 +40,12 @@ pub struct ParallelAxis {
data: Vec,
}
+impl Default for ParallelAxis {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl ParallelAxis {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/parallel_coordinate.rs b/charming/src/component/parallel_coordinate.rs
index fe7b472..e1408e7 100644
--- a/charming/src/component/parallel_coordinate.rs
+++ b/charming/src/component/parallel_coordinate.rs
@@ -82,6 +82,12 @@ pub struct ParallelAxisDefault {
data: Vec,
}
+impl Default for ParallelAxisDefault {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl ParallelAxisDefault {
pub fn new() -> Self {
Self {
@@ -264,6 +270,12 @@ pub struct ParallelCoordinate {
parallel_axis_default: Option,
}
+impl Default for ParallelCoordinate {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl ParallelCoordinate {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/polar_coordinate.rs b/charming/src/component/polar_coordinate.rs
index 737fe35..af91677 100644
--- a/charming/src/component/polar_coordinate.rs
+++ b/charming/src/component/polar_coordinate.rs
@@ -24,6 +24,12 @@ pub struct PolarCoordinate {
radius: Option,
}
+impl Default for PolarCoordinate {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl PolarCoordinate {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/radar_coordinate.rs b/charming/src/component/radar_coordinate.rs
index b16d25a..f1a911b 100644
--- a/charming/src/component/radar_coordinate.rs
+++ b/charming/src/component/radar_coordinate.rs
@@ -104,6 +104,12 @@ pub struct RadarAxisName {
overflow: Option,
}
+impl Default for RadarAxisName {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl RadarAxisName {
pub fn new() -> Self {
Self {
@@ -307,6 +313,12 @@ pub struct RadarIndicator {
color: Option,
}
+impl Default for RadarIndicator {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl RadarIndicator {
pub fn new() -> Self {
Self {
@@ -417,6 +429,12 @@ pub struct RadarCoordinate {
indicator: Vec,
}
+impl Default for RadarCoordinate {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl RadarCoordinate {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/radius_axis.rs b/charming/src/component/radius_axis.rs
index 6846fd1..8469e84 100644
--- a/charming/src/component/radius_axis.rs
+++ b/charming/src/component/radius_axis.rs
@@ -70,6 +70,12 @@ pub struct RadiusAxis {
data: Vec,
}
+impl Default for RadiusAxis {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl RadiusAxis {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/single_axis.rs b/charming/src/component/single_axis.rs
index cd4e4c6..d4be86d 100644
--- a/charming/src/component/single_axis.rs
+++ b/charming/src/component/single_axis.rs
@@ -52,6 +52,12 @@ pub struct SingleAxis {
max: Option,
}
+impl Default for SingleAxis {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl SingleAxis {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/title.rs b/charming/src/component/title.rs
index 1177a35..9ab3a1d 100644
--- a/charming/src/component/title.rs
+++ b/charming/src/component/title.rs
@@ -122,6 +122,12 @@ pub struct Title {
shadow_offset_y: Option,
}
+impl Default for Title {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Title {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/toolbox.rs b/charming/src/component/toolbox.rs
index ff8d7c8..6010e40 100644
--- a/charming/src/component/toolbox.rs
+++ b/charming/src/component/toolbox.rs
@@ -27,6 +27,12 @@ pub struct SaveAsImage {
background_color: Option,
}
+impl Default for SaveAsImage {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl SaveAsImage {
pub fn new() -> Self {
Self {
@@ -68,6 +74,12 @@ pub struct Restore {
title: Option,
}
+impl Default for Restore {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Restore {
pub fn new() -> Self {
Self {
@@ -100,6 +112,12 @@ pub struct DataView {
read_only: Option,
}
+impl Default for DataView {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl DataView {
pub fn new() -> Self {
Self {
@@ -157,6 +175,12 @@ pub struct MagicType {
title: Option,
}
+impl Default for MagicType {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl MagicType {
pub fn new() -> Self {
Self {
@@ -194,6 +218,12 @@ pub struct Brush {
type_: Vec,
}
+impl Default for Brush {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Brush {
pub fn new() -> Self {
Self { type_: vec![] }
@@ -212,6 +242,12 @@ pub struct ToolboxDataZoom {
y_axis_index: Option,
}
+impl Default for ToolboxDataZoom {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl ToolboxDataZoom {
pub fn new() -> Self {
Self { y_axis_index: None }
@@ -245,6 +281,12 @@ pub struct Feature {
brush: Option,
}
+impl Default for Feature {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Feature {
pub fn new() -> Self {
Self {
@@ -313,6 +355,12 @@ pub struct Toolbox {
bottom: Option,
}
+impl Default for Toolbox {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Toolbox {
pub fn new() -> Self {
Self {
diff --git a/charming/src/component/visual_map.rs b/charming/src/component/visual_map.rs
index 9e3b8f6..5a78481 100644
--- a/charming/src/component/visual_map.rs
+++ b/charming/src/component/visual_map.rs
@@ -40,6 +40,12 @@ pub struct VisualMapPiece {
color: Option,
}
+impl Default for VisualMapPiece {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl VisualMapPiece {
pub fn new() -> Self {
Self {
@@ -126,6 +132,12 @@ pub struct VisualMapChannel {
color: Vec,
}
+impl Default for VisualMapChannel {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl VisualMapChannel {
pub fn new() -> Self {
Self { color: vec![] }
@@ -214,6 +226,12 @@ pub struct VisualMap {
pieces: Option>,
}
+impl Default for VisualMap {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl VisualMap {
pub fn new() -> Self {
Self {
diff --git a/charming/src/datatype/dataset.rs b/charming/src/datatype/dataset.rs
index f32c5c8..7bc2637 100644
--- a/charming/src/datatype/dataset.rs
+++ b/charming/src/datatype/dataset.rs
@@ -81,6 +81,12 @@ pub struct Transform {
from_transform_result: Option,
}
+impl Default for Transform {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Transform {
pub fn new() -> Self {
Self {
@@ -142,6 +148,12 @@ impl Serialize for Dataset {
}
}
+impl Default for Dataset {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Dataset {
pub fn new() -> Self {
Self {
diff --git a/charming/src/datatype/dimension.rs b/charming/src/datatype/dimension.rs
index e5af878..a4ef3fd 100644
--- a/charming/src/datatype/dimension.rs
+++ b/charming/src/datatype/dimension.rs
@@ -37,6 +37,12 @@ pub struct Dimension {
display_name: Option,
}
+impl Default for Dimension {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Dimension {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/anchor.rs b/charming/src/element/anchor.rs
index fccb902..ce3e06f 100644
--- a/charming/src/element/anchor.rs
+++ b/charming/src/element/anchor.rs
@@ -27,6 +27,12 @@ pub struct Anchor {
item_style: Option,
}
+impl Default for Anchor {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Anchor {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/area_style.rs b/charming/src/element/area_style.rs
index 79472d1..2fedab0 100644
--- a/charming/src/element/area_style.rs
+++ b/charming/src/element/area_style.rs
@@ -23,6 +23,12 @@ pub struct AreaStyle {
opacity: Option,
}
+impl Default for AreaStyle {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AreaStyle {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/axis_label.rs b/charming/src/element/axis_label.rs
index b7ce01b..9d2c4ba 100644
--- a/charming/src/element/axis_label.rs
+++ b/charming/src/element/axis_label.rs
@@ -27,6 +27,12 @@ pub struct AxisLabel {
interval: Option,
}
+impl Default for AxisLabel {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AxisLabel {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/axis_line.rs b/charming/src/element/axis_line.rs
index d6d3657..138f2a4 100644
--- a/charming/src/element/axis_line.rs
+++ b/charming/src/element/axis_line.rs
@@ -49,6 +49,12 @@ pub struct AxisLineStyle {
opacity: Option,
}
+impl Default for AxisLineStyle {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AxisLineStyle {
pub fn new() -> Self {
Self {
@@ -126,6 +132,12 @@ pub struct AxisLine {
line_style: Option,
}
+impl Default for AxisLine {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AxisLine {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/axis_pointer.rs b/charming/src/element/axis_pointer.rs
index 1f6f535..b4607a4 100644
--- a/charming/src/element/axis_pointer.rs
+++ b/charming/src/element/axis_pointer.rs
@@ -39,6 +39,12 @@ pub struct AxisPointerLink {
y_axis_name: Option,
}
+impl Default for AxisPointerLink {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AxisPointerLink {
pub fn new() -> Self {
Self {
@@ -113,6 +119,12 @@ pub struct AxisPointer {
link: Vec,
}
+impl Default for AxisPointer {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AxisPointer {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/axis_tick.rs b/charming/src/element/axis_tick.rs
index d7f276a..c7309b7 100644
--- a/charming/src/element/axis_tick.rs
+++ b/charming/src/element/axis_tick.rs
@@ -21,6 +21,12 @@ pub struct AxisTick {
line_style: Option,
}
+impl Default for AxisTick {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl AxisTick {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/background.rs b/charming/src/element/background.rs
index 679aeec..213acac 100644
--- a/charming/src/element/background.rs
+++ b/charming/src/element/background.rs
@@ -24,6 +24,12 @@ pub struct BackgroundStyle {
opacity: Option,
}
+impl Default for BackgroundStyle {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl BackgroundStyle {
pub fn new() -> Self {
Self {
@@ -77,6 +83,12 @@ pub struct DataBackground {
area_style: Option,
}
+impl Default for DataBackground {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl DataBackground {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/blur.rs b/charming/src/element/blur.rs
index 9a6e5de..b56a9b1 100644
--- a/charming/src/element/blur.rs
+++ b/charming/src/element/blur.rs
@@ -12,6 +12,12 @@ pub struct Blur {
item_style: Option,
}
+impl Default for Blur {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Blur {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/coordinate_tooltip.rs b/charming/src/element/coordinate_tooltip.rs
index d3553de..f5058ed 100644
--- a/charming/src/element/coordinate_tooltip.rs
+++ b/charming/src/element/coordinate_tooltip.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
use serde::Serialize;
use crate::datatype::CompositeValue;
diff --git a/charming/src/element/dimension_encode.rs b/charming/src/element/dimension_encode.rs
index faf273d..62fd370 100644
--- a/charming/src/element/dimension_encode.rs
+++ b/charming/src/element/dimension_encode.rs
@@ -21,6 +21,12 @@ pub struct DimensionEncode {
tooltip: Vec,
}
+impl Default for DimensionEncode {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl DimensionEncode {
pub fn new() -> Self {
Self {
diff --git a/charming/src/element/emphasis.rs b/charming/src/element/emphasis.rs
index 429b9d8..05292e5 100644
--- a/charming/src/element/emphasis.rs
+++ b/charming/src/element/emphasis.rs
@@ -31,6 +31,12 @@ pub struct Emphasis {
label: Option