Dimension

public struct Dimension : Encodable

The dimensions (variables) of the parallel categories diagram.

  • The shown name of the dimension.

    Declaration

    Swift

    public var label: String?
  • Specifies the ordering logic for the categories in the dimension.

    By default, plotly uses trace, which specifies the order that is present in the data supplied. Set categoryorder to category ascending or category descending if order should be determined by the alphanumerical order of the category names. Set categoryorder to array to derive the ordering from the attribute categoryarray. If a category is not found in the categoryarray array, the sorting behavior for that attribute will be identical to the trace mode. The unspecified categories will follow the categories in categoryarray.

    Declaration

    Swift

    public var categoryOrder: CarpetCategoryOrder?
  • Sets the order in which categories in this dimension appear.

    Only has an effect if categoryorder is set to array. Used with categoryorder.

    Declaration

    Swift

    public var categoryArray: [Double]?
  • Sets alternative tick labels for the categories in this dimension.

    Only has an effect if categoryorder is set to array. Should be an array the same length as categoryarray Used with categoryorder.

    Declaration

    Swift

    public var tickText: [Double]?
  • Dimension values.

    values[n] represents the category value of the nth point in the dataset, therefore the values vector for all dimensions must be the same (longer vectors will be truncated).

    Declaration

    Swift

    public var values: [Double]?
  • The display index of dimension, from left to right, zero indexed, defaults to dimension index.

    Declaration

    Swift

    public var displayIndex: Int?
  • Shows the dimension when set to true (the default).

    Hides the dimension for false.

    Declaration

    Swift

    public var visible: Bool?
  • Creates Dimension object with specified properties.

    Declaration

    Swift

    public init(label: String? = nil, categoryOrder: CarpetCategoryOrder? = nil, categoryArray:
            [Double]? = nil, tickText: [Double]? = nil, values: [Double]? = nil, displayIndex: Int? = nil,
            visible: Bool? = nil)

    Parameters

    label

    The shown name of the dimension.

    categoryOrder

    Specifies the ordering logic for the categories in the dimension.

    categoryArray

    Sets the order in which categories in this dimension appear.

    tickText

    Sets alternative tick labels for the categories in this dimension.

    values

    Dimension values.

    displayIndex

    The display index of dimension, from left to right, zero indexed, defaults to dimension index.

    visible

    Shows the dimension when set to true (the default).