Class: LayoutRegistry

LayoutRegistry()

Helper for working with predefined layouts

This is part of the public interface with LocusZoom and a major way that users interact to configure plots.

Each layout object that is added or retrieved here is a deep copy and totally independent from any other object

Constructor

new LayoutRegistry()

Source:

Extends

  • module:registry/base:RegistryBase

Methods

(static) merge(custom_layout, default_layout) → {object}

A helper method used for merging two objects. If a key is present in both, takes the value from the first object. Values from default_layout will be cleanly copied over, ensuring no references or shared state.

Frequently used for preparing custom layouts. Both objects should be JSON-serializable.

Parameters:
Name Type Description
custom_layout object

An object containing configuration parameters that override or add to defaults

default_layout object

An object containing default settings.

Source:
Returns:

The custom layout is modified in place and also returned from this method.

Type
object

add(type, name, item, override) → {*}

Add a type of layout to the registry

Parameters:
Name Type Default Description
type String

The type of layout to add (plot, panel, data_layer, toolbar, toolbar_widgets, or tooltip)

name String

The name of the layout object to add

item Object

The layout object describing parameters

override boolean false

Whether to replace an existing item by that name

Source:
Returns:
Type
*

list(typeopt) → {Array.<String>|Object}

List all available types of layout (eg toolbar, panel, etc). If a specific type name is provided, list the layouts for that type of element ("just predefined panels").

Parameters:
Name Type Attributes Description
type String <optional>

The type of layout (eg toolbar, panel, etc)

Source:
Returns:
Type
Array.<String> | Object