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
, annotationtext
rangeselector
,updatemenues
andsliders
label
text all supportmeta
. To access the tracemeta
values in an attribute in the same trace, simply use%{meta[i]}
wherei
is the index or key of themeta
item in question. To access tracemeta
in layout attributes, use%{data[n[.meta[i]}
wherei
is the index or key of themeta
andn
is the trace index. -
Undocumented
Declaration
Swift
public var stream: Stream?
-
Controls persistence of some user-driven changes to the trace:
constraintrange
inparcoords
traces, as well as someeditable: true
modifications such asname
andcolorbar.title
.Defaults to
layout.uirevision
. Note that other user-driven trace attribute changes are controlled bylayout
attributes:trace.visible
is controlled bylayout.legend.uirevision
,selectedpoints
is 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 nouid
is provided. So if your app can add/remove traces before the end of thedata
array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace auid
that stays with it as it moves.Declaration
Swift
public var uiRevision: Anything?
-
An identifier for this carpet, so that
scattercarpet
andcontourcarpet
traces 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
a0
for 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
b0
for 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
x
is 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
Carpet
object 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
name
Sets the trace name.
x
A two dimensional array of x coordinates at each carpet point.
y
A two dimensional array of y coordinates at each carpet point.
a
An array containing values of the first parameter value
b
A 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
Carpet
object 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
visible
Determines whether or not this trace is visible.
opacity
Sets the opacity of the trace.
name
Sets the trace name.
uid
Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.
ids
Assigns id labels to each datum.
customData
Assigns extra data each datum.
meta
Assigns extra meta information associated with this trace that can be used in various text attributes.
stream
uiRevision
Controls persistence of some user-driven changes to the trace:
constraintrange
inparcoords
traces, as well as someeditable: true
modifications such asname
andcolorbar.title
.carpet
An identifier for this carpet, so that
scattercarpet
andcontourcarpet
traces can specify a carpet plot on which they liex
A two dimensional array of x coordinates at each carpet point.
y
A two dimensional array of y coordinates at each carpet point.
a
An array containing values of the first parameter value
a0
Alternate to
a
.da
Sets the a coordinate step.
b
A two dimensional array of y coordinates at each carpet point.
b0
Alternate to
b
.db
Sets the b coordinate step.
cheaterSlope
The shift applied to each successive row of data in creating a cheater plot.
aAxis
bAxis
font
The default font used for axis & tick labels on this carpet
color
Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors.
xAxis
Sets a reference between this trace’s x coordinates and a 2D cartesian x axis.
yAxis
Sets 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