Trace

public protocol Trace : Encodable

Data series that for displaying in a Plotly chart.

  • One of the supported Plotly.js trace types, i.e. “scatter”, “bar”, “pie” and so on.

    Todo

    This should be a static variable always encoded to JSON.

    Declaration

    Swift

    var type: String { get }
  • Switch indicating whether the trace supports animation of its data.

    Declaration

    Swift

    static var animatable: Bool { get }
  • uid

    Unique identifier used to track traces between animation frames.

    Declaration

    Swift

    var uid: String? { get set }
  • Name of the trace. Displayed in legend by default.

    Declaration

    Swift

    var name: String? { get set }
  • Flag indicating whether the trace is hidden.

    Declaration

    Swift

    var visible: Visible? { get set }
  • debugQuickLookObject() Extension method

    Undocumented

    Declaration

    Swift

    func debugQuickLookObject() -> AnyObject
  • show(layout:config:) Extension method

    Shows interactive figure containing the trace in the default browser on your OS.

    This method is useful for quickly previewing a trace. It saves a few line of code because it avoids explicitly constructing the Figure object. Optionally, it also accepts configuration and layout options to fine-tune the appearance.

    Here’s a one-liner that shows a scatter trace:

    try Scatter(x: [1, 2, 3], y: [4, 6, 5]).show()
    

    Declaration

    Swift

    @available(iOS 10.0, *)
    @discardableResult
    func show(layout: Layout = Layout(), config: Config = Config()) throws -> Figure

    Parameters

    layout

    Settings affecting layout of the figure, i.e. subplots, axis, title and more.

    config

    Configuration of the figure, i.e. toolbar, watermark, scrolling, locale and more.