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
Conversation
ae3c6e0
to
95844f4
Compare
b061053
to
df60ede
Compare
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.
Please simplify the set code but otherwise looks good.
uniqueStyles.add(style); | ||
} | ||
} | ||
const styles = Array.from(uniqueStyles); |
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.
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.
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.
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.
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.
I disagree. The array call makes a copy while creating an iterator is highly optimized.
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.
I guess since we may return an array, it doesn't make a big difference.
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.
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.
…a#7665) Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
fix #7621