zambezi / grid

D3 component for drawing grids
MIT License
4 stars 2 forks source link

Skip redraw when hidden #15

Closed gabrielmontagne closed 8 years ago

gabrielmontagne commented 8 years ago

Description

This PR installs the skip when hidden D3 util on the grid to prevent attempts at redrawing when the grid is on a display: none node.

Motivation and Context

The grid cannot render properly if it's detached -- currently it will fail with an Illegal Size error. But it is not uncommon for clients to try to render the grid onto hidden divs; the most usual case begin a grid on an inactive "tab".

With this PR the grid will just not try to render if it determines that it's not visible./

How Was This Tested?

On a local rig on a "tabbing" application.

Types of changes