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: don't include view stroke by default for non-cartesian plot #7665

Merged
merged 4 commits into from Aug 28, 2021

Conversation

kanitw
Copy link
Member

@kanitw kanitw commented Aug 28, 2021

fix #7621

@kanitw kanitw requested a review from domoritz August 28, 2021 05:41
@kanitw kanitw changed the title fix: non-cartesian plot shouldn't include view stroke by default fix: don't include view stroke by default for non-cartesian plot Aug 28, 2021
@kanitw kanitw force-pushed the kw/7621-default-view-stroke branch 2 times, most recently from ae3c6e0 to 95844f4 Compare August 28, 2021 06:18
@kanitw kanitw force-pushed the kw/7621-default-view-stroke branch from b061053 to df60ede Compare August 28, 2021 11:59
Copy link
Member

@domoritz domoritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please simplify the set code but otherwise looks good.

uniqueStyles.add(style);
}
}
const styles = Array.from(uniqueStyles);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can check the length of the set and return the first item of the set instead. No need to make it an array.

Copy link
Member Author

@kanitw kanitw Aug 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To get the first item you need to get the iterator and call next, which seems equally expensive as this but result in a more complicated code. So I think this is actually better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. The array call makes a copy while creating an iterator is highly optimized.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess since we may return an array, it doesn't make a big difference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the time N=1 or a few. Maybe iterator is marginally better, but produces way longer code that doesn't justify the benefit.

@kanitw kanitw merged commit 907518c into master Aug 28, 2021
@kanitw kanitw deleted the kw/7621-default-view-stroke branch August 28, 2021 16:45
BradyJ27 pushed a commit to BradyJ27/vega-lite that referenced this pull request Oct 19, 2023
…a#7665)

Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
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.

Non-cartesian plots shouldn't include view stroke by default
2 participants