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

Fix rendering fail due to Undefined, and spelling mistake #19

Merged
merged 2 commits into from
Feb 11, 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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ It is important then, that you know which variables are being parsed to the func
segment: Segment {
borderColor:
FnWithArgs::new() // Create the Function
.arg("ctx") // Add a named arguement using a builder pattern
.arg("ctx") // Add a named argument using a builder pattern
.body("ctx.p0.parsed.y > ctx.p1.parsed.y ? 'red' : 'green'") // Add the function body, in this case make the line red if the slope is negative
}
}
]
}
}
```
```
6 changes: 6 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ impl Chart {

let dash = Reflect::get(&segment, &"borderDash".into());
if let Ok(dash) = dash {
if dash == JsValue::UNDEFINED {
return;
}
Reflect::set(
&segment,
&"borderDash".into(),
Expand All @@ -66,6 +69,9 @@ impl Chart {

let color = Reflect::get(&segment, &"borderColor".into());
if let Ok(color) = color {
if color == JsValue::UNDEFINED {
return;
}
Reflect::set(
&segment,
&"borderColor".into(),
Expand Down
Loading