Skip to main content

Function: toggleBoundaryGroup()

toggleBoundaryGroup(spec, group, visible): VisualizationSpec

Defined in: spec/boundaryGroup.ts:126

Sets the visible flag on every layer in spec whose id matches any layer ID in group.

When visible is true the property is omitted (default-visible). When visible is false the property is explicitly set to false.

Layers not belonging to the group are left untouched. Returns a new spec object — the original is not mutated.

Parameters​

ParameterTypeDescription
specVisualizationSpecThe spec containing the layers to toggle.
groupBoundaryGroupThe boundary group whose layers should be toggled.
visiblebooleantrue to show (omit visible property), false to hide.

Returns​

VisualizationSpec

A new spec with the updated visibility flags.