Skip to content
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

Implement tagcloud renderer #77910

Merged
merged 15 commits into from
Sep 28, 2020
Merged

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Sep 18, 2020

Summary

Part of #46801

  • Implement own renderer for Tag Cloud visualization.
  • lazy load the visualization component
  • Implement toExpressionAst function for building pipeline.
  • add unit tests

Fixes extra scrollbar at visualization:

image

Checklist

For maintainers

@sulemanof sulemanof mentioned this pull request Sep 22, 2020
13 tasks
@sulemanof sulemanof added Feature:Tagcloud Tag cloud visualization feature Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.11.0 v8.0.0 labels Sep 22, 2020
@sulemanof sulemanof marked this pull request as ready for review September 23, 2020 09:59
@sulemanof sulemanof requested a review from a team September 23, 2020 09:59
@sulemanof sulemanof requested review from a team as code owners September 23, 2020 09:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

code LGTM for changes related to renderers and toAST. didn't check changes to actual tag cloud implementation apart from emitting events.

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

A couple things I noticed.

1. When resizing so small that it can't render all the items, increasing the size again makes the tags overlap.

This could easily happen in a Dashboard when resizing the window.
Screen Recording 2020-09-23 at 04 19 08 PM

2. We really need to get rid of Open Sans.

By just removing the font-family declaration from the <text> elements, they'll properly inherit our UI font family Inter.

Screen Shot 2020-09-23 at 16 20 15 PM

@sulemanof
Copy link
Contributor Author

A couple things I noticed.

1. When resizing so small that it can't render all the items, increasing the size again makes the tags overlap.

This could easily happen in a Dashboard when resizing the window.
Screen Recording 2020-09-23 at 04 19 08 PM

2. We really need to get rid of Open Sans.

By just removing the font-family declaration from the <text> elements, they'll properly inherit our UI font family Inter.

Screen Shot 2020-09-23 at 16 20 15 PM

It seems that the first issue is a result of changing the font-family in tag cloud config (as far as I see the font was changed).
I can't reproduce the same issue without the change.
Also it seems it's not so simple to get rid of setting font-family explicitly, because the d3 tagcloud should be built laying on it. possible explanation
At least, it needs more investigation.
Since it's not a regression caused by this PR, let's create a separate issue for replacing the font-family.

@sulemanof
Copy link
Contributor Author

@elasticmachine merge upstream

@cchaos
Copy link
Contributor

cchaos commented Sep 24, 2020

The problem with leaving "Open Sans" in is that Kibana no longer ships with the "Open Sans" font. It hasn't since 7.0. So for most users it is going to fallback to system fonts which is most likely going to still mess with rendering. So I think it's really important to change this.

@sulemanof
Copy link
Contributor Author

The problem with leaving "Open Sans" in is that Kibana no longer ships with the "Open Sans" font. It hasn't since 7.0. So for most users it is going to fallback to system fonts which is most likely going to still mess with rendering. So I think it's really important to change this.

ok, I see.. so it def need to be fixed, but anyway I think that's not in scope of this PR.
I opened an issue #78407 to track this.
If it has high priority, we'll try to resolve this ASAP. @stratoula @timroes what are your thoughts?

@stratoula
Copy link
Contributor

@sulemanof agree! Let's push it on 7.11

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Purely from the SASS files, looks fine

@sulemanof
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@stratoula stratoula 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 it locally on Chrome ❤️

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id value diff baseline
visTypeTagcloud 29 +3 26

async chunks size

id value diff baseline
visTypeTagcloud 295.4KB ⚠️ +295.4KB 0.0B

page load bundle size

id value diff baseline
visTypeTagcloud 22.1KB -285.7KB 307.8KB
visualizations 272.6KB -765.0B 273.4KB
total -286.4KB

distributable file count

id value diff baseline
default 45649 +6 45643
oss 26391 +6 26385

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@sulemanof sulemanof merged commit 53d4938 into elastic:master Sep 28, 2020
@sulemanof sulemanof deleted the feat/tagcloud_renderer branch September 28, 2020 13:14
@sulemanof sulemanof added v7.10.0 and removed v7.11.0 labels Sep 28, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 28, 2020
* master: (226 commits)
  [Enterprise Search] Added Logic for the Credentials View (elastic#77626)
  [CSM] Js errors (elastic#77919)
  Add the @kbn/apm-config-loader package (elastic#77855)
  [Security Solution] Refactor useSelector (elastic#75297)
  Implement tagcloud renderer (elastic#77910)
  [APM] Alerting: Add global option to create all alert types (elastic#78151)
  [Ingest pipelines] Upload indexed document to test a pipeline (elastic#77939)
  TypeScript cleanup in visualizations plugin (elastic#78428)
  Lazy load metric & mardown visualizations (elastic#78391)
  [Detections][EQL] EQL rule execution in detection engine (elastic#77419)
  Update tutorial-full-experience.asciidoc (elastic#75836)
  Update tutorial-define-index.asciidoc (elastic#75754)
  Add support for runtime field types to mappings editor. (elastic#77420)
  [Monitoring] Usage collection (elastic#75878)
  [Docs][Actions] Add docs for Jira and IBM Resilient (elastic#78316)
  [Security Solution][Resolver] Update @timestamp formatting (elastic#78166)
  [Security Solution] Fix app layout (elastic#76668)
  [Security Solution][Resolver] 2 new functions to DAL (elastic#78477)
  Adds new elasticsearch client to telemetry plugin (elastic#78046)
  skip flaky suite (elastic#78512) (elastic#78511) (elastic#78510) (elastic#78509) (elastic#78508) (elastic#78507) (elastic#78506) (elastic#78505) (elastic#78504) (elastic#78503) (elastic#78502) (elastic#78501) (elastic#78500)
  ...
@sulemanof sulemanof mentioned this pull request Sep 28, 2020
7 tasks
timroes pushed a commit to timroes/kibana that referenced this pull request Sep 28, 2020
* Implement toExpressionAst for tagcloud

* Implement tagcloud vis renderer

* Use resize observer

* Use common no data message

* Update build_pipeline.test

* Update tag cloud tests

* Revert "Use common no data message"

This reverts commit fddf019.

* Update interpreter functional tests

* Add tests for toExpressionAst fn

* Use throttled chart update

* Update renderer

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Sep 29, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@sulemanof sulemanof added backported and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Sep 29, 2020
timroes pushed a commit that referenced this pull request Sep 29, 2020
…t tagcloud renderer (#77910) | Fix types (#78619) (#78666)

* TypeScript cleanup in visualizations plugin (#78428)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Implement tagcloud renderer (#77910)

* Implement toExpressionAst for tagcloud

* Implement tagcloud vis renderer

* Use resize observer

* Use common no data message

* Update build_pipeline.test

* Update tag cloud tests

* Revert "Use common no data message"

This reverts commit fddf019.

* Update interpreter functional tests

* Add tests for toExpressionAst fn

* Use throttled chart update

* Update renderer

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Fix types (#78619)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Daniil Suleiman <31325372+sulemanof@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Tagcloud Tag cloud visualization feature Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants