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

FIX: line-chart is rendered properly (no-shrink) #1403

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

stephanwlee
Copy link
Contributor

@stephanwlee stephanwlee commented Sep 4, 2018

When using paginated to scroll through charts quickly, you will trigger
the chart creation (which is debounced for 350ms). The chart creation,
even if it is no longer in foreground ("display:none"d), it will draw and result
in a shrunken line-chart. There is a bad draw detection logic to remedy the
problem, but it did not account for the debounce logic in the line-chart.

To mitigate the problem, we now listen to on Plottable.Component#onAnchor
event to known when a chart is mounted on DOM and know when a drawn
happened while it was in the background.

Alternatively, we can cancel the chart creation debounce by either creating
a new state in chart, active, or a method cancelMakeChart.

When using paginated to scroll through charts quickly, you will trigger
the chart creation (which is debounced for 350ms). The chart creation,
even if it is no longer in foreground and is "display:none"d, it will
resume drawing and result in very shrunken line-chart. There has been
some detector of such bad draw but it did not account for the debounce
logic in the line-chart.

To mitigate the problem, we now listen to on Component#onAnchor event to
listen to DOM mounting to detect whether we have a bad draw: drawn in the
background.

Alternatively, we can cancel debounce when tf component detects the
backgroundness by either creating a new state in chart, `active`, or
a method `cancelMakeChart`.
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.

Thanks for the fix!

@stephanwlee stephanwlee merged commit 199cf2c into tensorflow:master Sep 5, 2018
@stephanwlee stephanwlee deleted the opt2 branch September 5, 2018 02:04
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