-
Notifications
You must be signed in to change notification settings - Fork 835
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 curves to LineSeriesCanvas #880
Conversation
Bump for review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
let line = d3Shape.line() | ||
.x(row => x(row) + marginLeft) | ||
.y(row => y(row) + marginTop); | ||
if (curve !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could probably skip this outer check because of the inner ones
.x(row => x(row) + marginLeft) | ||
.y(row => y(row) + marginTop); | ||
if (curve !== null) { | ||
if (typeof curve === 'string' && d3Shape[curve]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice that you're allowing string and function to be passed! could potentially skip all the if
checks and reassignment to write this like d3Shape.line().x(row => x(row) + marginLeft).y(row => y(row) + marginTop).curve(d3Shape[curve] || curve || whateverTheDefaultValue) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form of this is mostly just copying a similar function in the regular lineseries, i guess a future PR could clean this up by combining them into some sort of decorator?
* Add curves to LineSeriesCanvas * my visual linter got turned off, extreme atom eyeroll * address comment
* Add curves to LineSeriesCanvas * my visual linter got turned off, extreme atom eyeroll * address comment
Addresses #804