1 /**
  2  * Constructs a new dot mark with default properties. Images are not typically
  3  * constructed directly, but by adding to a panel or an existing mark via
  4  * {@link pv.Mark#add}.
  5  *
  6  * @class Represents an image. Images share the same layout and style properties as
  7  * bars, in conjunction with an external image such as PNG or JPEG. The image is
  8  * specified via the {@link #url} property. The fill, if specified, appears
  9  * beneath the image, while the optional stroke appears above the image.
 10  *
 11  * <p>TODO Restore support for dynamic images (such as heatmaps). These were
 12  * supported in the canvas implementation using the pixel buffer API; although
 13  * SVG does not support pixel manipulation, it is possible to embed a canvas
 14  * element in SVG using foreign objects.
 15  *
 16  * <p>TODO Allow different modes of image placement: "scale" -- scale and
 17  * preserve aspect ratio, "tile" -- repeat the image, "center" -- center the
 18  * image, "fill" -- scale without preserving aspect ratio.
 19  *
 20  * <p>See {@link pv.Bar} for details on positioning properties.
 21  *
 22  * @extends pv.Bar
 23  */
 24 pv.Image = function() {
 25   pv.Bar.call(this);
 26 };
 27 
 28 pv.Image.prototype = pv.extend(pv.Bar)
 29     .property("url");
 30 
 31 pv.Image.prototype.type = "image";
 32 
 33 /**
 34  * The URL of the image to display. The set of supported image types is
 35  * browser-dependent; PNG and JPEG are recommended.
 36  *
 37  * @type string
 38  * @name pv.Image.prototype.url
 39  */
 40 
 41 /**
 42  * Default properties for images. By default, there is no stroke or fill style.
 43  *
 44  * @type pv.Image
 45  */
 46 pv.Image.prototype.defaults = new pv.Image()
 47     .extend(pv.Bar.prototype.defaults)
 48     .fillStyle(null);
 49