Skip to content

feat(wordcloud): click and over events on text#1180

Merged
markov00 merged 5 commits intoelastic:masterfrom
markov00:2021_05_28-wc_click
Jun 3, 2021
Merged

feat(wordcloud): click and over events on text#1180
markov00 merged 5 commits intoelastic:masterfrom
markov00:2021_05_28-wc_click

Conversation

@markov00
Copy link
Copy Markdown
Collaborator

@markov00 markov00 commented May 31, 2021

Summary

The <Worldcloud> chart now fully support the onElementClick, onElementOver and onElementOut events, returning the original datum the callback.

Details

The following fixes/improvements are applied:

  • fix the wordcloud API to use the correct Config type (previously the PartitionConfig was listed)
  • removed the event callers from the wordcloud state (no more required as we can call the actions directly from the SVG text element)
  • the input datum is added to the dataset passed to the d3-cloud function. This because the dataset is mutated by d3-cloud causing the WordModel prop weight to be overwritten by the fontWeight value.

Connected issues

This closes the support request for the wordcloud migration in Kibana #1156

Checklist

  • Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • Proper documentation or storybook story was added for features that require explanation or tutorials

@markov00 markov00 requested a review from monfera May 31, 2021 13:52
@markov00 markov00 added :wordcloud Wordcloud related issues enhancement New feature or request :interactions Interactions related issue labels Jun 1, 2021
Copy link
Copy Markdown
Contributor

@rshen91 rshen91 left a comment

Choose a reason for hiding this comment

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

LGTM tested locally

Copy link
Copy Markdown
Contributor

@monfera monfera left a comment

Choose a reason for hiding this comment

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

Looks good, tested all three event types on all the sample configs, and the code improvements are good too!

Copy link
Copy Markdown
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Great work! Changes look good to me, left one code change. Tested locally and functions as expected.

@markov00 markov00 mentioned this pull request Jun 3, 2021
@markov00 markov00 merged commit 196fb6a into elastic:master Jun 3, 2021
@markov00 markov00 deleted the 2021_05_28-wc_click branch June 3, 2021 16:22
nickofthyme pushed a commit that referenced this pull request Jun 4, 2021
# [30.0.0](v29.2.0...v30.0.0) (2021-06-04)

### Bug Fixes

* **domain:** custom domain should not filter data ([#1181](#1181)) ([76e8dca](76e8dca)), closes [#1129](#1129)
* **value_labels:** zero as a valid value for textBorder and borderWidth ([#1182](#1182)) ([a64f333](a64f333))
* annotation tooltip display when remounting specs ([#1167](#1167)) ([8408600](8408600))
* render nodeLabel formatted text into the nodes ([#1173](#1173)) ([b44bdff](b44bdff))

### Features

* **axis:** allow pixel domain padding for y axes  ([#1145](#1145)) ([7c1fa8e](7c1fa8e))
* apply value formatter to the default legend item label ([#1190](#1190)) ([71474a5](71474a5))
* **tooltip:** stickTo vertical middle of the cursor ([#1163](#1163)) ([380363b](380363b)), closes [#1108](#1108)
* **wordcloud:** click and over events on text ([#1180](#1180)) ([196fb6a](196fb6a)), closes [#1156](#1156)

### BREAKING CHANGES

* **value_labels:** the `textBorder` of `ValueFillDefinition` is now optional or a number only
@nickofthyme
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 30.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Jun 4, 2021
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
# [30.0.0](elastic/elastic-charts@v29.2.0...v30.0.0) (2021-06-04)

### Bug Fixes

* **domain:** custom domain should not filter data ([opensearch-project#1181](elastic/elastic-charts#1181)) ([92ba84c](elastic/elastic-charts@92ba84c)), closes [opensearch-project#1129](elastic/elastic-charts#1129)
* **value_labels:** zero as a valid value for textBorder and borderWidth ([#1182](elastic/elastic-charts#1182)) ([880fbf1](elastic/elastic-charts@880fbf1))
* annotation tooltip display when remounting specs ([opensearch-project#1167](elastic/elastic-charts#1167)) ([7163951](elastic/elastic-charts@7163951))
* render nodeLabel formatted text into the nodes ([opensearch-project#1173](elastic/elastic-charts#1173)) ([0de9688](elastic/elastic-charts@0de9688))

### Features

* **axis:** allow pixel domain padding for y axes  ([#1145](elastic/elastic-charts#1145)) ([6787728](elastic/elastic-charts@6787728))
* apply value formatter to the default legend item label ([opensearch-project#1190](elastic/elastic-charts#1190)) ([20108bb](elastic/elastic-charts@20108bb))
* **tooltip:** stickTo vertical middle of the cursor ([#1163](elastic/elastic-charts#1163)) ([b858fb3](elastic/elastic-charts@b858fb3)), closes [opensearch-project#1108](elastic/elastic-charts#1108)
* **wordcloud:** click and over events on text ([opensearch-project#1180](elastic/elastic-charts#1180)) ([adbf341](elastic/elastic-charts@adbf341)), closes [opensearch-project#1156](elastic/elastic-charts#1156)

### BREAKING CHANGES

* **value_labels:** the `textBorder` of `ValueFillDefinition` is now optional or a number only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request :interactions Interactions related issue released Issue released publicly :wordcloud Wordcloud related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants