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

Double rendering of charts on initial load #690

Closed
monfera opened this issue May 31, 2020 · 1 comment · Fixed by #693 or elastic/kibana#69126
Closed

Double rendering of charts on initial load #690

monfera opened this issue May 31, 2020 · 1 comment · Fixed by #693 or elastic/kibana#69126
Assignees
Labels
bug Something isn't working released Issue released publicly

Comments

@monfera
Copy link
Contributor

monfera commented May 31, 2020

Describe the bug
Double rendering of charts, reproducible in Storybook and Playground

To Reproduce
Steps to reproduce the behavior:

  1. Put in a console.log in a render function, and/or randomize some data in the view model or render function
  2. Reload the page
  3. See dual console logging for rendering, or points/lines/etc. moving with the randomization approach

Expected behaviour
Single rendering

Additional context
Looks like the code that gets invoked is
https://github.com/elastic/elastic-charts/blob/master/src/components/chart_resizer.tsx#L86-L93

  private handleResize = (entries: ResizeObserverEntry[]) => {
    // return; // <= this line isn't here
    if (this.initialResizeComplete) {
      this.onResizeDebounced(entries);
    } else {
      this.initialResizeComplete = true;
      this.onResize(entries);
    }
  };

If the return is uncommented, the double rendering goes away, but then of course, it'll not respond to a resizing

@monfera monfera added the bug Something isn't working label May 31, 2020
@markov00 markov00 self-assigned this Jun 1, 2020
markov00 added a commit to markov00/elastic-charts that referenced this issue Jun 1, 2020
Use only the ResizeObseerver to handle chart sizing at the initialization.

fix elastic#690
markov00 added a commit that referenced this issue Jun 11, 2020
Fix the double rendering caused by ignoring the fact that the container size > 0 needs to be part of the required flags to initialize the rendering process.

fix #690
markov00 pushed a commit that referenced this issue Jun 15, 2020
# [19.5.0](v19.4.1...v19.5.0) (2020-06-15)

### Bug Fixes

* **tooltip:** show true opaque colors in tooltips ([#629](#629)) ([23290be](23290be)), closes [#628](#628)
* path of stacked area series with missing values ([#703](#703)) ([2541180](2541180))
* remove double rendering ([#693](#693)) ([ebf2748](ebf2748)), closes [#690](#690)

### Features

* **partition:** add 4.5 contrast for text in partition slices ([#608](#608)) ([eded2ac](eded2ac)), closes [#606](#606)
* add screenshot functions to partition/goal ([#697](#697)) ([5581c3c](5581c3c))
@markov00
Copy link
Member

🎉 This issue has been resolved in version 19.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Jun 15, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
# [19.5.0](elastic/elastic-charts@v19.4.1...v19.5.0) (2020-06-15)

### Bug Fixes

* **tooltip:** show true opaque colors in tooltips ([opensearch-project#629](elastic/elastic-charts#629)) ([323b325](elastic/elastic-charts@323b325)), closes [opensearch-project#628](elastic/elastic-charts#628)
* path of stacked area series with missing values ([opensearch-project#703](elastic/elastic-charts#703)) ([93f063f](elastic/elastic-charts@93f063f))
* remove double rendering ([#693](elastic/elastic-charts#693)) ([1a9bbb9](elastic/elastic-charts@1a9bbb9)), closes [#690](elastic/elastic-charts#690)

### Features

* **partition:** add 4.5 contrast for text in partition slices ([opensearch-project#608](elastic/elastic-charts#608)) ([59d6d49](elastic/elastic-charts@59d6d49)), closes [opensearch-project#606](elastic/elastic-charts#606)
* add screenshot functions to partition/goal ([opensearch-project#697](elastic/elastic-charts#697)) ([6d2ff64](elastic/elastic-charts@6d2ff64))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Issue released publicly
Projects
None yet
2 participants