ColorAxis
public final class ColorAxis : Encodable, SubplotAxis
Undocumented
-
Unique identifier of the axis.
Declaration
Swift
public var uid: UInt
-
Determines whether or not the color domain is computed with respect to the input data (here corresponding trace color array(s)) or the bounds set in
cmin
andcmax
Defaults tofalse
whencmin
andcmax
are set by the user.Declaration
Swift
public var cAuto: Bool?
-
Sets the lower bound of the color domain.
Value should have the same units as corresponding trace color array(s) and if set,
cmax
must be set as well.Declaration
Swift
public var cMin: Double?
-
Sets the upper bound of the color domain.
Value should have the same units as corresponding trace color array(s) and if set,
cmin
must be set as well.Declaration
Swift
public var cMax: Double?
-
Sets the mid-point of the color domain by scaling
cmin
and/orcmax
to be equidistant to this point.Value should have the same units as corresponding trace color array(s). Has no effect when
cauto
isfalse
.Declaration
Swift
public var cMiddle: Double?
-
Sets the colorscale.
The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example,
[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]
. To control the bounds of the colorscale in color space, usecmin
andcmax
. Alternatively,colorscale
may be a palette name string of the following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Viridis,Cividis.Declaration
Swift
public var colorScale: ColorScale?
-
Determines whether the colorscale is a default palette (
autocolorscale: true
) or the palette determined bycolorscale
.In case
colorscale
is unspecified orautocolorscale
is true, the default palette will be chosen according to whether numbers in thecolor
array are all positive, all negative or mixed.Declaration
Swift
public var autoColorScale: Bool?
-
Reverses the color mapping if true.
If true,
cmin
will correspond to the last color in the array andcmax
will correspond to the first color.Declaration
Swift
public var reverseScale: Bool?
-
Determines whether or not a colorbar is displayed for this trace.
Declaration
Swift
public var showScale: Bool?
-
Undocumented
Declaration
Swift
public var colorBar: ColorBar?
-
Shared and preset default axis reference used to initialize layout and all traces.
Declaration
Swift
public static let preset: ColorAxis
-
Creates
ColorAxis
object with specified properties.Declaration
Swift
public init(uid: UInt = UInt.random(in: 2...UInt.max), cAuto: Bool? = nil, cMin: Double? = nil, cMax: Double? = nil, cMiddle: Double? = nil, colorScale: ColorScale? = nil, autoColorScale: Bool? = nil, reverseScale: Bool? = nil, showScale: Bool? = nil, colorBar: ColorBar? = nil)
Parameters
uid
Unique identifier of the axis.
cAuto
Determines whether or not the color domain is computed with respect to the input data (here corresponding trace color array(s)) or the bounds set in
cmin
andcmax
Defaults tofalse
whencmin
andcmax
are set by the user.cMin
Sets the lower bound of the color domain.
cMax
Sets the upper bound of the color domain.
cMiddle
Sets the mid-point of the color domain by scaling
cmin
and/orcmax
to be equidistant to this point.colorScale
Sets the colorscale.
autoColorScale
Determines whether the colorscale is a default palette (
autocolorscale: true
) or the palette determined bycolorscale
.reverseScale
Reverses the color mapping if true.
showScale
Determines whether or not a colorbar is displayed for this trace.
colorBar