Carpet
The data describing carpet axis layout is set in y and (optionally) also x.
If only y is present, x the plot is interpreted as a cheater plot and is filled in using the
y values. x and y may either be 2D arrays matching with each dimension matching that of
a and b, or they may be 1D arrays with total length equal to that of a and b.
-
Corresponding Plotly trace type.
Declaration
Swift
public let type: String -
Switch indicating whether the trace supports animation of its data.
Declaration
Swift
public static var animatable: Bool { get } -
Determines whether or not this trace is visible.
If legendonly, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).
Declaration
Swift
public var visible: Visible? -
Sets the opacity of the trace.
Declaration
Swift
public var opacity: Double? -
Sets the trace name.
The trace name appear as the legend item and on hover.
Declaration
Swift
public var name: String? -
Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
Declaration
Swift
public var uid: String? -
Assigns id labels to each datum.
These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.
Declaration
Swift
public var ids: [String]? -
Assigns extra data each datum.
This may be useful when listening to hover, click and selection events. Note that, scatter traces also appends customdata items in the markers DOM elements
Declaration
Swift
public var customData: [String]? -
Assigns extra meta information associated with this trace that can be used in various text attributes.
Attributes such as trace
name, graph, axis and colorbartitle.text, annotationtextrangeselector,updatemenuesandsliderslabeltext all supportmeta. To access the tracemetavalues in an attribute in the same trace, simply use%{meta[i]}whereiis the index or key of themetaitem in question. To access tracemetain layout attributes, use%{data[n[.meta[i]}whereiis the index or key of themetaandnis the trace index. -
Undocumented
Declaration
Swift
public var stream: Stream? -
Controls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title.Defaults to
layout.uirevision. Note that other user-driven trace attribute changes are controlled bylayoutattributes:trace.visibleis controlled bylayout.legend.uirevision,selectedpointsis controlled bylayout.selectionrevision, andcolorbar.(x|y)(accessible withconfig: {editable: true}) is controlled bylayout.editrevision. Trace changes are tracked byuid, which only falls back on trace index if nouidis provided. So if your app can add/remove traces before the end of thedataarray, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auidthat stays with it as it moves.Declaration
Swift
public var uiRevision: Anything? -
An identifier for this carpet, so that
scattercarpetandcontourcarpettraces can specify a carpet plot on which they lieDeclaration
Swift
public var carpet: String? -
A two dimensional array of x coordinates at each carpet point.
If omitted, the plot is a cheater plot and the xaxis is hidden by default.
Declaration
Swift
public var x: XData? -
A two dimensional array of y coordinates at each carpet point.
Declaration
Swift
public var y: YData? -
An array containing values of the first parameter value
Declaration
Swift
public var a: AData? -
Sets the a coordinate step.
See
a0for more info.Declaration
Swift
public var da: Double? -
A two dimensional array of y coordinates at each carpet point.
Declaration
Swift
public var b: BData? -
Sets the b coordinate step.
See
b0for more info.Declaration
Swift
public var db: Double? -
The shift applied to each successive row of data in creating a cheater plot.
Only used if
xis been omitted.Declaration
Swift
public var cheaterSlope: Double? -
Undocumented
See moreDeclaration
Swift
public struct AAxis : Encodable -
Undocumented
Declaration
Swift
public var aAxis: AAxis? -
Undocumented
See moreDeclaration
Swift
public struct BAxis : Encodable -
Undocumented
Declaration
Swift
public var bAxis: BAxis? -
The default font used for axis & tick labels on this carpet
Declaration
Swift
public var font: Font? -
Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors.
Grid color is lightened by blending this with the plot background Individual pieces can override this.
Declaration
Swift
public var color: Color? -
Sets a reference between this trace’s x coordinates and a 2D cartesian x axis.
If x (the default value), the x coordinates refer to
layout.xaxis. If x2, the x coordinates refer tolayout.xaxis2, and so on.Declaration
Swift
public var xAxis: XAxis -
Sets a reference between this trace’s y coordinates and a 2D cartesian y axis.
If y (the default value), the y coordinates refer to
layout.yaxis. If y2, the y coordinates refer tolayout.yaxis2, and so on.Declaration
Swift
public var yAxis: YAxis -
Creates
Carpetobject from the most frequently used properties.Declaration
Swift
public init(name: String? = nil, x: XData? = nil, y: YData? = nil, a: AData? = nil, b: BData? = nil)Parameters
nameSets the trace name.
xA two dimensional array of x coordinates at each carpet point.
yA two dimensional array of y coordinates at each carpet point.
aAn array containing values of the first parameter value
bA two dimensional array of y coordinates at each carpet point.
-
init(visible:opacity: name: uid: ids: customData: meta: stream: uiRevision: carpet: x: y: a: a0: da: b: b0: db: cheaterSlope: aAxis: bAxis: font: color: xAxis: yAxis: ) Creates
Carpetobject with specified properties.Declaration
Swift
public init(visible: Visible? = nil, opacity: Double? = nil, name: String? = nil, uid: String? = nil, ids: [String]? = nil, customData: [String]? = nil, meta: Data<Anything>? = nil, stream: Stream? = nil, uiRevision: Anything? = nil, carpet: String? = nil, x: XData? = nil, y: YData? = nil, a: AData? = nil, a0: Double? = nil, da: Double? = nil, b: BData? = nil, b0: Double? = nil, db: Double? = nil, cheaterSlope: Double? = nil, aAxis: AAxis? = nil, bAxis: BAxis? = nil, font: Font? = nil, color: Color? = nil, xAxis: XAxis = .preset, yAxis: YAxis = .preset)Parameters
visibleDetermines whether or not this trace is visible.
opacitySets the opacity of the trace.
nameSets the trace name.
uidAssign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
idsAssigns id labels to each datum.
customDataAssigns extra data each datum.
metaAssigns extra meta information associated with this trace that can be used in various text attributes.
streamuiRevisionControls persistence of some user-driven changes to the trace:
constraintrangeinparcoordstraces, as well as someeditable: truemodifications such asnameandcolorbar.title.carpetAn identifier for this carpet, so that
scattercarpetandcontourcarpettraces can specify a carpet plot on which they liexA two dimensional array of x coordinates at each carpet point.
yA two dimensional array of y coordinates at each carpet point.
aAn array containing values of the first parameter value
a0Alternate to
a.daSets the a coordinate step.
bA two dimensional array of y coordinates at each carpet point.
b0Alternate to
b.dbSets the b coordinate step.
cheaterSlopeThe shift applied to each successive row of data in creating a cheater plot.
aAxisbAxisfontThe default font used for axis & tick labels on this carpet
colorSets default for all colors associated with this axis all at once: line, font, tick, and grid colors.
xAxisSets a reference between this trace’s x coordinates and a 2D cartesian x axis.
yAxisSets a reference between this trace’s y coordinates and a 2D cartesian y axis.
-
Encodes the object in a format compatible with Plotly.
Declaration
Swift
public func encode(to encoder: Encoder) throws
View on GitHub
Install in Dash
Carpet Structure Reference