zambezi / grid

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

Expose grid component array. #39

Closed gabrielmontagne closed 7 years ago

gabrielmontagne commented 7 years ago

Description

From the proposed documentation,

When you use use or usePre, you're just pushing components into an array of components. If you need to manipulate that array wholesale, you can inspect, modify or reassign the whole component list by using the externalComponents or externalComponentsPre getter / setters on the grid.

grid.externalComponents() // => the current components

grid.externalComponents([componentA, componentB]) // => overriding the current components

Motivation and Context

In some contexts (for example, when proxying configuration on higher level components) it becomes tricky to update the component stack. Calling use or usePre becomes fragile -- if done more than once, the components will be incorrectly stacked and will run multiple times.

With this PR, components can safely be reconfigured or rearranged as needed.

How Was This Tested?

On a rig offline. image

Types of changes

Checklist: