Skip to content

Conversation

@stephanwlee
Copy link
Contributor

@stephanwlee stephanwlee commented Sep 6, 2018

Chart tooltip (or all popovers) should render at the body level in order
to prevent clipping from a scrollable area. To be more specific, even
position:fixed can get contained inside a region if it is within a
scrollable region. As a remedy, most tools render popover in children of
body.

To achieve this in a component structure, there are two competing goals:

  1. intuitive component structure (tooltip is a subcomponent chart)
  2. DOM-wise, tooltip should not be nested in chart but should be at body
    level.
    Libraries like React allows such pattern via "tunneling". By manually creating
    an element in the body, we emulated the behavior.

In this commit, we:

  • introduced vz-chart-tooltip that knows how to position
  • applied the new tooltip to scalar-card
  • introduced new positioning, "auto"

Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

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

Cool! Thanks for figuring this out and also getting rid of the inner html stuff while you were at it.

Chart tooltip (or all popovers) should render at the body level in order
to prevent clipping from a scrollable area. To be more specific, even
position:fixed can get contained inside a region if it is within a
scrollable region. As a remedy, most tools render popover in children of
body.

To achieve this in a component structure, there are two competing goals:
1. intuitive component structure (tooltip is a subcomponent chart)
2. DOM-wise, tooltip should not be nested in chart but should be at body
   level.
Libraries like React allows such pattern via "tunneling". By manually creating
an element in the body, we emulated the behavior.

In this commit, we:
- introduced vz-chart-tooltip that knows how to position
- applied the new tooltip to scalar-card
- introduced new positioning, "auto"
@stephanwlee stephanwlee merged commit 7277d15 into tensorflow:master Sep 21, 2018
@stephanwlee stephanwlee deleted the explore branch September 21, 2018 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants