-
Notifications
You must be signed in to change notification settings - Fork 77
feat(plugin-chart-word-cloud): convert word cloud to use encodable #258
Conversation
Deploy preview for superset-ui-plugins ready! Built with commit 06b2e61 |
Codecov Report
@@ Coverage Diff @@
## master #258 +/- ##
=========================================
- Coverage 37.99% 36.9% -1.09%
=========================================
Files 12 12
Lines 229 233 +4
Branches 21 24 +3
=========================================
- Hits 87 86 -1
- Misses 132 135 +3
- Partials 10 12 +2
Continue to review full report at Codecov.
|
export const ROTATION = { | ||
flat: () => 0, | ||
/* eslint-disable-next-line no-magic-numbers */ | ||
random: () => Math.floor(Math.random() * 6 - 3) * 30, |
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.
Maybe leave a comment to explain that this calculates a random rotation between -90 and 90 degrees. I'm assuming the unit is degrees since square is * 90
, but it would be helpful to read it explicitly when skimming the code.
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've only taken a look at Encoder.ts and Wordcloud.tsx, but those two LGTM. Have a non-blocking comment about adding a comment for the rotation function.
…pache-superset#258) * feat: convert word cloud to use encodable * fix: minor bugs * feat: bump dependencies * feat: use field * fix: defaultProps * fix: unit test * docs: update storybook * refactor: move files * docs: update storybook * fix: unit test * fix: address comments
🏆 Enhancements
encodable
.Basic
encodes color by word length
encodes font family by first letter