Carpet

public struct Carpet<XData, YData, AData, BData> : Trace, XYSubplot where XData : Plotable, YData : Plotable, AData : Plotable, BData : Plotable

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.

See also

Documentation for Python, JavaScript or R
  • 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?
  • uid

    Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.

    Declaration

    Swift

    public var uid: String?
  • ids

    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 colorbar title.text, annotation text rangeselector, updatemenues and sliders label text all support meta. To access the trace meta values in an attribute in the same trace, simply use %{meta[i]} where i is the index or key of the meta item in question. To access trace meta in layout attributes, use %{data[n[.meta[i]} where i is the index or key of the meta and n is the trace index.

    Declaration

    Swift

    public var meta: Data<Anything>?
  • Undocumented

    Declaration

    Swift

    public var stream: Stream?
  • Controls persistence of some user-driven changes to the trace: constraintrange in parcoords traces, as well as some editable: true modifications such as name and colorbar.title.

    Defaults to layout.uirevision. Note that other user-driven trace attribute changes are controlled by layout attributes: trace.visible is controlled by layout.legend.uirevision, selectedpoints is controlled by layout.selectionrevision, and colorbar.(x|y) (accessible with config: {editable: true}) is controlled by layout.editrevision. Trace changes are tracked by uid, which only falls back on trace index if no uid is provided. So if your app can add/remove traces before the end of the data array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a uid that stays with it as it moves.

    Declaration

    Swift

    public var uiRevision: Anything?
  • An identifier for this carpet, so that scattercarpet and contourcarpet traces can specify a carpet plot on which they lie

    Declaration

    Swift

    public var carpet: String?
  • x

    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?
  • y

    A two dimensional array of y coordinates at each carpet point.

    Declaration

    Swift

    public var y: YData?
  • a

    An array containing values of the first parameter value

    Declaration

    Swift

    public var a: AData?
  • a0

    Alternate to a.

    Builds a linear space of a coordinates. Use with da where a0 is the starting coordinate and da the step.

    Declaration

    Swift

    public var a0: Double?
  • da

    Sets the a coordinate step.

    See a0 for more info.

    Declaration

    Swift

    public var da: Double?
  • b

    A two dimensional array of y coordinates at each carpet point.

    Declaration

    Swift

    public var b: BData?
  • b0

    Alternate to b.

    Builds a linear space of a coordinates. Use with db where b0 is the starting coordinate and db the step.

    Declaration

    Swift

    public var b0: Double?
  • db

    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 more

    Declaration

    Swift

    public struct AAxis : Encodable
  • Undocumented

    Declaration

    Swift

    public var aAxis: AAxis?
  • Undocumented

    See more

    Declaration

    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 to layout.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 to layout.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.

  • 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 in parcoords traces, as well as some editable: true modifications such as name and colorbar.title.

    carpet

    An identifier for this carpet, so that scattercarpet and contourcarpet traces can specify a carpet plot on which they lie

    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

    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