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

Refactor tooltip formatter from function to class #14224

Closed
nreese opened this issue Sep 29, 2017 · 1 comment
Closed

Refactor tooltip formatter from function to class #14224

nreese opened this issue Sep 29, 2017 · 1 comment
Labels
chore Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@nreese
Copy link
Contributor

nreese commented Sep 29, 2017

The current tooltip formatter implementation contains a lot of nested functions that return functions. Ultimately, the last returned function is used as the formatter to format the event into an html string. [PR embed visualization in tooltip] (#14102) adds a cleanUp function to the tooltipFormatter.

@thomasneirynck suggested the following updates that were deemed to large for the scope of PR 14102 but still valuable.

  • It would be nice to refactor tooltipFormatProvider's to return a class instead of a function.
    something like:
class TooltipFormatter {
   constructor(parentVis) {
   }
  
   formatTooltipContents(event) {
   }
  
   cleanUp(){
  }
   
}
  • Have the formatter return a dom element instead of an html string.
@nreese nreese added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) chore labels Sep 29, 2017
@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 16, 2018
@nreese
Copy link
Contributor Author

nreese commented Feb 15, 2019

There has been a lot of refactoring and tooltipFormatProvider no longer exists and this suggestion is no longer useful

@nreese nreese closed this as completed Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants