refactor: cleanup wordcloud config, types and theming#1358
Merged
nickofthyme merged 4 commits intoelastic:alphafrom Sep 12, 2021
Merged
refactor: cleanup wordcloud config, types and theming#1358nickofthyme merged 4 commits intoelastic:alphafrom
nickofthyme merged 4 commits intoelastic:alphafrom
Conversation
Contributor
markov00
reviewed
Sep 6, 2021
Collaborator
markov00
left a comment
There was a problem hiding this comment.
The name WordcloudViewModel looks more like an internal detail/api more than a public part of the API.
What if we rename it back to WordcloudConfig
packages/charts/src/chart_types/wordcloud/layout/types/viewmodel_types.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/wordcloud/renderer/svg/connected_component.tsx
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/wordcloud/renderer/svg/connected_component.tsx
Outdated
Show resolved
Hide resolved
monfera
reviewed
Sep 8, 2021
monfera
approved these changes
Sep 8, 2021
Contributor
monfera
left a comment
There was a problem hiding this comment.
Beautiful reduction of code noise, lots of lines gone 😍 Also, great to have added the new image prints. Good to go once CI is in green
markov00
approved these changes
Sep 9, 2021
Collaborator
markov00
left a comment
There was a problem hiding this comment.
Changes look good to me
markov00
reviewed
Sep 9, 2021
e377859 to
3eb5bd7
Compare
nickofthyme
added a commit
to nickofthyme/elastic-charts
that referenced
this pull request
Sep 23, 2021
BREAKING CHANGES: The `WorkcloudSpec.config` prop is removed as it was not used other than assigning `margins` even with erroneous properties. All wordcloud properties are now driven from the `WorkcloudSpec` directly. Since the wordcloud is unique in that it's styles are driven by the data I think keeping them on the spec is more favorable than moving them to the theme as they would be overridden more frequently. This does not provide a themed instance of the chart type but this could possibly come from `.brightening` the provided colors of the text elements. Changes include - `WorkcloudSpec.margin` deleted in favor of `Theme.chartMargins`. - `WorkcloudConfigs` is removed in favor of singular `WordcloudViewModel` type which is extended to form `WordcloudSpec`.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Refactor
wordcloudspec to cleanup duplicate or unused config and types.BREAKING CHANGES
The
WorkcloudSpec.configprop is removed as it was not used other than assigningmarginseven with erroneous properties. All wordcloud properties are now driven from theWorkcloudSpecdirectly. Since the wordcloud is unique in that it's styles are driven by the data I think keeping them on the spec is more favorable than moving them to the theme as they would be overridden more frequently. This does not provide a themed instance of the chart type but this could possibly come from.brighteningthe provided colors of the text elements.Changes include
WorkcloudSpec.margindeleted in favor ofTheme.chartMargins.WorkcloudConfigsis removed in favor of singularWordcloudViewModeltype which is extended to formWordcloudSpec.Details
Other Changes:
Wordtypes are refined to reflect the mutating nature ofd3TagCloudfunction.d3-cloudChecklist
:xy,:partition):interactions,:axis):themelabel has been added and the@elastic/eui-designteam has been pinged when there areThemeAPI changescloses #123,fixes #123)packages/charts/src/index.tsdark,light,eui-dark&eui-light