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 curves to LineSeriesCanvas #880

Merged
merged 3 commits into from
Aug 13, 2018

Conversation

mcnuttandrew
Copy link
Contributor

Addresses #804

@mcnuttandrew mcnuttandrew requested a review from jckr July 18, 2018 01:53
@mcnuttandrew
Copy link
Contributor Author

Bump for review?

Copy link
Contributor

@benshope benshope left a 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) {
Copy link
Contributor

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]) {
Copy link
Contributor

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) }

Copy link
Contributor Author

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?

@mcnuttandrew mcnuttandrew merged commit 5ebe092 into uber:master Aug 13, 2018
@mcnuttandrew mcnuttandrew deleted the line-series-step-fix branch September 23, 2018 16:15
ayarcohaila pushed a commit to ayarcohaila/react-vis that referenced this pull request Jun 30, 2021
* Add curves to LineSeriesCanvas

* my visual linter got turned off, extreme atom eyeroll

* address comment
ayarcohaila added a commit to ayarcohaila/react-vis that referenced this pull request May 30, 2023
* Add curves to LineSeriesCanvas

* my visual linter got turned off, extreme atom eyeroll

* address comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants