GroupBy

public struct GroupBy : Transform

Specification of groupby operation on trace data.

See also

Documentation for Python, JavaScript or R
  • Determines whether this group-by transform is enabled or disabled.

    Declaration

    Swift

    public var enabled: Bool?
  • Sets the groups in which the trace data will be split.

    For example, with x set to [1, 2, 3, 4] and groups set to [‘a’, ‘b’, ‘a’, ‘b’], the groupby transform with split in one trace with x [1, 3] and one trace with x [2, 4].

    Declaration

    Swift

    public var groups: [Double]?
  • Pattern by which grouped traces are named.

    If only one trace is present, defaults to the group name ("%{group}"), otherwise defaults to the group name with trace name ("%{group} (%{trace})"). Available escape sequences are %{group}, which inserts the group name, and %{trace}, which inserts the trace name. If grouping GDP data by country when more than one trace is present, for example, the default “%{group} (%{trace})” would return “Monaco (GDP per capita)”.

    Declaration

    Swift

    public var nameFormat: String?
  • Undocumented

    See more

    Declaration

    Swift

    public struct Style : Encodable
  • Undocumented

    Declaration

    Swift

    public var styles: [Style]?
  • Creates GroupBy object with specified properties.

    Declaration

    Swift

    public init(enabled: Bool? = nil, groups: [Double]? = nil, nameFormat: String? = nil, styles:
            [Style]? = nil)

    Parameters

    enabled

    Determines whether this group-by transform is enabled or disabled.

    groups

    Sets the groups in which the trace data will be split.

    nameFormat

    Pattern by which grouped traces are named.

    styles