This is an extension and not part of the main GoJS library. Note that the API for this class may change at any time. If you intend to use an extension in production, you should copy the code to your own source directory. See the Extensions intro page for more information.
Override this method to customize the computation of the starting index in the colors Array given the fraction computed by normalizeTemperature. The default behavior is a simple linear interpolation. The value must be a valid index into the colors Array.
a number between zero and one, inclusive
an index into colors
Override this method to customize getting the value for how "hot" the given Part is. Typically this is overridden to return some numeric property of the Part.data. By default it returns one, the maximum, assuming the normalizeTemperature method does not scale the value.
a number indicating the Part's temperature, where smaller values are cooler.
Override this method to shift and scale the given temperature to get a fraction between zero and one, inclusive. A value of zero indicates that the given Part not participate in the heat map. Values between zero and one select the starting color from the colors Array -- higher values get more colors. By default it just returns the given value, making sure the value is between zero and one.
a fraction between zero and one, inclusive
Return an ImageData of the given SIZE in pixels for the given AREA in document coordinates.
a Rect in document coordinates
a Size in device-independent-pixel/viewport coordinates
ImageData or null
Update the heatMapPart's raster image for the viewport.
A class for drawing a heat map based on the "temperatures" of Parts.
This class adds a heat map image in the "ViewportForeground" Layer that is dynamically computed as the user scrolls or zooms or when a transaction/undo/redo is finished.
It also has a method, renderImageData, that renders a heat map for a given area of the document, not just for the viewport, returning an ImageData.