Class pv.Image
Extends pv.Bar.
Represents an image. Images share the same layout and style properties as bars, in conjunction with an external image such as PNG or JPEG. The image is specified via the #url property. The fill, if specified, appears beneath the image, while the optional stroke appears above the image.
TODO Restore support for dynamic images (such as heatmaps). These were supported in the canvas implementation using the pixel buffer API; although SVG does not support pixel manipulation, it is possible to embed a canvas element in SVG using foreign objects.
TODO Allow different modes of image placement: "scale" -- scale and preserve aspect ratio, "tile" -- repeat the image, "center" -- center the image, "fill" -- scale without preserving aspect ratio.
See pv.Bar for details on positioning properties.
Defined in: Image.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pv.Image()
Constructs a new dot mark with default properties.
|
Field Attributes | Field Name and Description |
---|---|
Default properties for images.
|
|
The URL of the image to display.
|
- Fields borrowed from class pv.Bar:
- fillStyle, height, lineWidth, strokeStyle, width
- Fields borrowed from class pv.Mark:
- bottom, childIndex, cursor, data, index, left, parent, proto, reverse, right, root, scene, title, top, type, visible
- Methods borrowed from class pv.Bar:
- anchor
- Methods borrowed from class pv.Mark:
- add, anchorTarget, cousin, def, event, extend, first, last, mouse, render, sibling
Constructs a new dot mark with default properties. Images are not typically constructed directly, but by adding to a panel or an existing mark via pv.Mark#add.
Default properties for images. By default, there is no stroke or fill style.
The URL of the image to display. The set of supported image types is browser-dependent; PNG and JPEG are recommended.