-
Notifications
You must be signed in to change notification settings - Fork 122
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
refactor: cleanup wordcloud config, types and theming #1358
Conversation
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.
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
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
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.
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
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.
Changes look good to me
e377859
to
3eb5bd7
Compare
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`.
Summary
Refactor
wordcloud
spec to cleanup duplicate or unused config and types.BREAKING CHANGES
The
WorkcloudSpec.config
prop is removed as it was not used other than assigningmargins
even with erroneous properties. All wordcloud properties are now driven from theWorkcloudSpec
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 ofTheme.chartMargins
.WorkcloudConfigs
is removed in favor of singularWordcloudViewModel
type which is extended to formWordcloudSpec
.Details
Other Changes:
Word
types are refined to reflect the mutating nature ofd3TagCloud
function.d3-cloud
Checklist
:xy
,:partition
):interactions
,:axis
):theme
label has been added and the@elastic/eui-design
team has been pinged when there areTheme
API changescloses #123
,fixes #123
)packages/charts/src/index.ts
dark
,light
,eui-dark
&eui-light