# Class: highlight_regions

## LocusZoom_DataLayers~highlight_regions()

"Highlight regions with rectangle" data layer. Creates one (or more) continuous 2D rectangles that mark an entire interval, to the full height of the panel.

Each individual rectangle can be shown in full, or overlapping ones can be merged (eg, based on same category). The rectangles are generally drawn with partial transparency, and do not respond to mouse events: they are a useful highlight tool to draw attention to intervals that contain interesting variants.

This layer has several useful modes:

1. Draw one or more specified rectangles as provided from: A. Hard-coded layout (layout.regions) B. Data fetched from a source (like intervals with start and end coordinates)- as specified in layout.fields
2. Fetch data from an external source, and only render the intervals that match criteria

## Constructor

#### new highlight_regions()

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`layout.color` | String | Array.<module:LocusZoom_DataLayers~ScalableParameter> | <optional> | '#CCCCCC' | The fill color for each rectangle
`layout.fill_opacity` | String | Array.<module:LocusZoom_DataLayers~ScalableParameter> | <optional> | 0.5 | The opacity (0-1). We recommend partial transparency so that rectangles do not hide or interfere with adjacent elements.
`layout.filters` | Array.<Object> | <optional> |  | An array of filter entries specifying which intervals to draw annotations for.
`layout.regions` | Array.<Object> | <optional> |  | A hard-coded list of regions. If provided, takes precedence over data fetched from an external source.
`layout.start_field` | String | <optional> | 'start' | The field to use for rectangle start x coordinate
`layout.end_field` | String | <optional> | 'end' | The field to use for rectangle end x coordinate
`layout.merge_field` | String | <optional> |  | If two intervals overlap, they can be "merged" based on a field that identifies the category (eg, only rectangles of the same category will be merged). This field must be present in order to trigger merge behavior. This is applied after filters.

Source:
  - components/data_layer/highlight_regions.js, line 40
See:
  - module:LocusZoom_DataLayers~BaseDataLayer for additional layout options

### Members

#### (static, constant) default_layout

Source:
  - components/data_layer/highlight_regions.js, line 9