Image
public struct Image : Encodable
Undocumented
-
Determines whether or not this image is visible.
Declaration
Swift
public var visible: Bool? -
Specifies the URL of the image to be used.
The URL must be accessible from the domain where the plot code is run, and can be either relative or absolute.
Declaration
Swift
public var source: String? -
Specifies whether images are drawn below or above traces.
When
xrefandyrefare both set topaper, image is drawn below the entire plot area.Declaration
Swift
public var layer: ShapeLayer? -
Sets the image container size horizontally.
The image will be sized based on the
positionvalue. Whenxrefis set topaper, units are sized relative to the plot width. Whenxrefends withdomain, units are sized relative to the axis width.Declaration
Swift
public var xSize: Double? -
Sets the image container size vertically.
The image will be sized based on the
positionvalue. Whenyrefis set topaper, units are sized relative to the plot height. Whenyrefends withdomain, units are sized relative to the axis height.Declaration
Swift
public var ySize: Double? -
Specifies which dimension of the image to constrain.
See moreDeclaration
Swift
public enum Sizing : String, Encodable -
Specifies which dimension of the image to constrain.
Declaration
Swift
public var sizing: Sizing? -
Sets the opacity of the image.
Declaration
Swift
public var opacity: Double? -
Sets the image’s x position.
When
xrefis set topaper, units are sized relative to the plot height. Seexreffor more infoDeclaration
Swift
public var x: Anything? -
Sets the image’s y position.
When
yrefis set topaper, units are sized relative to the plot height. Seeyreffor more infoDeclaration
Swift
public var y: Anything? -
Sets the anchor for the x position
Declaration
Swift
public var xAnchor: XAnchor? -
Sets the anchor for the y position.
Declaration
Swift
public var yAnchor: YAnchor? -
Sets the images’s x coordinate axis.
If set to a x axis id (e.g. x or x2), the
xposition refers to a x coordinate. If set to paper, thexposition refers to the distance from the left of the plotting area in normalized coordinates where 0 (1) corresponds to the left (right). If set to a x axis ID followed by domain (separated by a space), the position behaves like for paper, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., x2 domain refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis.Declaration
Swift
public var xReference: XAxisReference? -
Sets the images’s y coordinate axis.
If set to a y axis id (e.g. y or y2), the
yposition refers to a y coordinate. If set to paper, theyposition refers to the distance from the bottom of the plotting area in normalized coordinates where 0 (1) corresponds to the bottom (top). If set to a y axis ID followed by domain (separated by a space), the position behaves like for paper, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., y2 domain refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis.Declaration
Swift
public var yReference: YAxisReference? -
When used in a template, named items are created in the output figure in addition to any items the figure already has in this array.
You can modify these items in the output figure by making your own item with
templateitemnamematching thisnamealongside your modifications (includingvisible: falseorenabled: falseto hide it). Has no effect outside of a template.Declaration
Swift
public var name: String? -
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a matching item in the input figure, but you can modify one by making an item with
templateitemnamematching itsname, alongside your modifications (includingvisible: falseorenabled: falseto hide it). If there is no template or no matching item, this item will be hidden unless you explicitly show it withvisible: true.Declaration
Swift
public var templateItemName: String? -
init(visible:source: layer: xSize: ySize: sizing: opacity: x: y: xAnchor: yAnchor: xReference: yReference: name: templateItemName: ) Creates
Imageobject with specified properties.Declaration
Swift
public init(visible: Bool? = nil, source: String? = nil, layer: ShapeLayer? = nil, xSize: Double? = nil, ySize: Double? = nil, sizing: Sizing? = nil, opacity: Double? = nil, x: Anything? = nil, y: Anything? = nil, xAnchor: XAnchor? = nil, yAnchor: YAnchor? = nil, xReference: XAxisReference? = nil, yReference: YAxisReference? = nil, name: String? = nil, templateItemName: String? = nil)Parameters
visibleDetermines whether or not this image is visible.
sourceSpecifies the URL of the image to be used.
layerSpecifies whether images are drawn below or above traces.
xSizeSets the image container size horizontally.
ySizeSets the image container size vertically.
sizingSpecifies which dimension of the image to constrain.
opacitySets the opacity of the image.
xSets the image’s x position.
ySets the image’s y position.
xAnchorSets the anchor for the x position
yAnchorSets the anchor for the y position.
xReferenceSets the images’s x coordinate axis.
yReferenceSets the images’s y coordinate axis.
nameWhen used in a template, named items are created in the output figure in addition to any items the figure already has in this array.
templateItemNameUsed to refer to a named item in this array in the template.
View on GitHub
Install in Dash
Image Structure Reference