Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy-Sheppard committed May 6, 2024
1 parent 0093ae4 commit 55c258d
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,21 +535,24 @@ pub struct TooltipPlugins {

#[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq, PartialOrd, Ord)]
pub struct TooltipCallbacks {
#[serde(skip_serializing_if = "FnWithArgs::is_empty")]
#[serde(skip_serializing_if = "FnWithArgs::is_empty", skip_deserializing)]
// FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub label: FnWithArgs,
}

#[derive(Debug, Clone, Deserialize, Serialize, Default, PartialEq, Eq, PartialOrd, Ord)]
pub struct ChartScale {
#[serde(skip_serializing_if = "FnWithArgs::is_empty")]
#[serde(skip_serializing_if = "FnWithArgs::is_empty", skip_deserializing)]
// FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub afterBuildTicks: FnWithArgs,
#[serde(skip_serializing_if = "Option::is_none")]
pub alignToPixels: Option<bool>,
#[serde(skip_serializing_if = "String::is_empty", default)]
pub backgroundColour: String,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub barPercentage: NumberString,
#[serde(skip_serializing_if = "FnWithArgs::is_empty")]
#[serde(skip_serializing_if = "FnWithArgs::is_empty", skip_deserializing)]
// FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub beforeFit: FnWithArgs,
#[serde(skip_serializing_if = "Option::is_none")]
pub beginAtZero: Option<bool>,
Expand Down Expand Up @@ -621,6 +624,7 @@ pub struct Grid {
#[serde(skip_serializing_if = "Option::is_none")]
pub drawOnChartArea: Option<bool>,
#[serde(skip_serializing_if = "String::is_empty", default, skip_deserializing)]
// the skip_deserializing needed because chartjs sets a default with a different type, FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub tickColor: String,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub z: NumberString,
Expand Down Expand Up @@ -710,14 +714,15 @@ pub struct ScaleTicks {
#[serde(
skip_serializing_if = "FnWithArgs::is_empty",
default,
skip_deserializing
skip_deserializing // FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
)]
pub callback: FnWithArgs,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub count: NumberString,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub maxTicksLimit: NumberString,
#[serde(skip_serializing_if = "Option::is_none", skip_deserializing)]
// the skip_deserializing needed because chartjs sets a default with a different type, FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub padding: Option<Padding>,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub precision: NumberString,
Expand Down Expand Up @@ -767,7 +772,8 @@ pub struct LegendLabel {
pub boxHeight: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub boxWidth: Option<usize>,
#[serde(skip_serializing_if = "FnWithArgs::is_empty")]
#[serde(skip_serializing_if = "FnWithArgs::is_empty", skip_deserializing)]
// FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub filter: FnWithArgs,
#[serde(skip_serializing_if = "String::is_empty", default)]
pub pointStyle: String,
Expand Down Expand Up @@ -846,6 +852,7 @@ pub struct DataLabels {
#[serde(skip_serializing_if = "Option::is_none")]
pub font: Option<Font>,
#[serde(skip_serializing_if = "FnWithArgs::is_empty", skip_deserializing)]
// FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
pub formatter: FnWithArgs,
#[serde(skip_serializing_if = "NumberString::is_empty", default)]
pub offset: NumberString,
Expand Down Expand Up @@ -886,13 +893,13 @@ pub struct Segment {
#[serde(
skip_serializing_if = "FnWithArgs::is_empty",
default,
skip_deserializing
skip_deserializing // FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
)]
pub borderColor: FnWithArgs,
#[serde(
skip_serializing_if = "FnWithArgs::is_empty",
default,
skip_deserializing
skip_deserializing // FnWithArgs can't deser right now, might be solved in the future with a fancy serde deserializer
)]
pub borderDash: FnWithArgs,
}

0 comments on commit 55c258d

Please sign in to comment.