4.5.0 • Published 3 days ago

@nightingale-elements/nightingale-heatmap v4.5.0

Weekly downloads
-
License
-
Repository
github
Last release
3 days ago

nightingale-heatmap

Published on NPM

Nightingale Heatmap component is used to generate a heatmap visualisation.

Usage

The below example is using residues contacts data based on the distance.

<nightingale-heatmap
  id="heatmap"
  width="400"
  height="400"
  bottom-color="black"
  top-color="white"
  margin-left="50"
  margin-bottom="50"
  symmetric
></nightingale-heatmap>

API Reference

Properties

symmetric: boolean (default: false)

It supports symmetric matrix.

top-color: string (default: 'yellow')

The heatmap can interpolate colors from the bottom value (0.0) to its top (1.0). This attribute defines the color to paint the top (1.0) value.

It follows the web standard defined in https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

bottom-color: string (default: "darkblue")

The heatmap can interpolate colors from the bottom value (0.0) to its top (1.0). This attribute defines the color to paint the bottom (0.0) value.

It follows the web standard defined in https://developer.mozilla.org/en-US/docs/Web/CSS/color_value

x-label: string (default: "Residue")

Label to the legend in the X axix

y-label: string (default: "Residue")

Label to the legend in the X axix

Properties

data: Array

The data array is of the HeatmapData structure.

type HeatmapData = Array<
  [
    number, //   X coordinate starting on 1
    number, //   Y coordinate starting on 1
    number, //    Value in that position. Between 0 and 1
  ]
>;

For instance:

[
  [1, 1, 0.2],
  [1, 2, 0.8],
  [2, 2, 0.5],
];

Events

change

Is dispatched when hovering over a point in the heatmap.

The detail of the event is a HeatmapPoint:

type HeatmapPoint = {
  xPoint: number;
  yPoint: number;
  value: number | null;
};

Usage example:

heatmapElement.addEventListener("change", (evt) => {
  console.log(evt.detail);
});
4.5.1-alpha.1

3 days ago

4.5.1-alpha.5

3 days ago

4.4.0-alpha.0

10 months ago

4.5.0-alpha.0

10 months ago

4.4.1-alpha.0

10 months ago

4.5.0

9 months ago

4.2.1-alpha.0

11 months ago

4.2.2-alpha.0

11 months ago

4.0.0

1 year ago

4.2.1

1 year ago

4.0.3

1 year ago

4.0.24-alpha.0

1 year ago

4.0.21-alpha.0

1 year ago

4.0.19-alpha.0

1 year ago

4.0.18-alpha.0

1 year ago

4.0.15-alpha.0

1 year ago

4.0.14-alpha.0

1 year ago