From 67378a3fd8c007cddb2c1e11b545f57e9874fc2d Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Mon, 13 Feb 2023 08:15:12 +0100 Subject: [PATCH] plotlyjs v2.17: Introduce group attributes for scatter trace i.e. alignmentgroup, offsetgroup, scattermode and scattergap (https://github.com/plotly/plotly.js/pull/6381) --- src/Plotly.NET/ChartAPI/Chart.fs | 6 ++ src/Plotly.NET/ChartAPI/Chart2D.fs | 92 +++++++++++++++++-- .../CommonAbstractions/StyleParams.fs | 14 +++ src/Plotly.NET/Layout/Layout.fs | 12 +++ src/Plotly.NET/Traces/Trace2D.fs | 6 ++ 5 files changed, 122 insertions(+), 8 deletions(-) diff --git a/src/Plotly.NET/ChartAPI/Chart.fs b/src/Plotly.NET/ChartAPI/Chart.fs index 9dec96a15..9212e2955 100644 --- a/src/Plotly.NET/ChartAPI/Chart.fs +++ b/src/Plotly.NET/ChartAPI/Chart.fs @@ -776,6 +776,8 @@ type Chart = /// Controls the behavior of newly drawn shapes /// Sets the styling of the active shape /// Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise). + /// Sets the gap (in plot fraction) between scatter points of adjacent location coordinates. Defaults to `bargap`. + /// Determines how scatter points at the same location coordinate are displayed on the graph. With "group", the scatter points are plotted next to one another centered around the shared location. With "overlay", the scatter points are plotted over one another, you might need to reduce "opacity" to see multiple scatter points. /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. /// Determines how bars at the same location coordinate are displayed on the graph. With "stack", the bars are stacked on top of one another With "relative", the bars are stacked on top of one another, with negative values below the axis, positive values above With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars. @@ -852,6 +854,8 @@ type Chart = [] ?NewShape: NewShape, [] ?ActiveShape: ActiveShape, [] ?HideSources: bool, + [] ?ScatterGap: float, + [] ?ScatterMode: StyleParam.ScatterMode, [] ?BarGap: float, [] ?BarGroupGap: float, [] ?BarMode: StyleParam.BarMode, @@ -930,6 +934,8 @@ type Chart = ?MinReducedWidth = MinReducedWidth, ?ActiveShape = ActiveShape, ?HideSources = HideSources, + ?ScatterGap = ScatterGap, + ?ScatterMode = ScatterMode, ?BarGap = BarGap, ?BarGroupGap = BarGroupGap, ?BarMode = BarMode, diff --git a/src/Plotly.NET/ChartAPI/Chart2D.fs b/src/Plotly.NET/ChartAPI/Chart2D.fs index 9bcb1aa9c..bf334d81a 100644 --- a/src/Plotly.NET/ChartAPI/Chart2D.fs +++ b/src/Plotly.NET/ChartAPI/Chart2D.fs @@ -56,6 +56,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -89,6 +91,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -138,6 +142,8 @@ module Chart2D = ?MultiText = MultiText, ?TextPosition = TextPosition, ?MultiTextPosition = MultiTextPosition, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -175,6 +181,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -207,6 +215,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -242,6 +252,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -271,6 +283,8 @@ module Chart2D = /// Sets the marker symbol for each datum /// Sets the marker symbol for each individual datum /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -295,6 +309,8 @@ module Chart2D = [] ?MarkerSymbol: StyleParam.MarkerSymbol, [] ?MultiMarkerSymbol: seq, [] ?Marker: Marker, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -302,14 +318,10 @@ module Chart2D = [] ?UseDefaults: bool ) = - let useDefaults = - defaultArg UseDefaults true // if text position or font is set, then show labels (not only when hovering) let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome) - let useWebGL = defaultArg UseWebGL false - Chart.Scatter( x, y, @@ -328,12 +340,13 @@ module Chart2D = ?MarkerSymbol = MarkerSymbol, ?MultiMarkerSymbol = MultiMarkerSymbol, ?Marker = Marker, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, ?UseWebGL = UseWebGL, ?UseDefaults = UseDefaults - ) @@ -353,6 +366,8 @@ module Chart2D = /// Sets the marker symbol for each datum /// Sets the marker symbol for each individual datum /// Sets the marker (use this for more finegrained control than the other marker-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -376,6 +391,8 @@ module Chart2D = [] ?MarkerSymbol: StyleParam.MarkerSymbol, [] ?MultiMarkerSymbol: seq, [] ?Marker: Marker, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -401,6 +418,8 @@ module Chart2D = ?MarkerSymbol = MarkerSymbol, ?MultiMarkerSymbol = MultiMarkerSymbol, ?Marker = Marker, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -432,6 +451,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -465,6 +486,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -475,9 +498,6 @@ module Chart2D = [] ?UseDefaults: bool ) = - let useDefaults = - defaultArg UseDefaults true - // if text position or font is set than show labels (not only when hovering) let changeMode = let isShowMarker = @@ -511,6 +531,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -546,6 +568,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -578,6 +602,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -612,6 +638,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -648,6 +676,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -682,6 +712,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -744,6 +776,8 @@ module Chart2D = ?MultiText = MultiText, ?TextPosition = TextPosition, ?MultiTextPosition = MultiTextPosition, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -783,6 +817,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -816,6 +852,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -851,6 +889,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -886,6 +926,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -916,6 +958,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -967,6 +1011,8 @@ module Chart2D = ?MultiText = MultiText, ?TextPosition = TextPosition, ?MultiTextPosition = MultiTextPosition, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm @@ -997,6 +1043,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -1025,6 +1073,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -1056,6 +1106,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -1408,6 +1460,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -1441,6 +1495,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -1480,6 +1536,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -1513,6 +1571,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -1545,6 +1605,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -1580,6 +1642,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -1615,6 +1679,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -1649,6 +1715,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -1689,6 +1757,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, @@ -1722,6 +1792,8 @@ module Chart2D = /// Sets the width of the line /// sets the drawing style of the line /// Sets the line (use this for more finegrained control than the other line-associated arguments) + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `Orientation` is Horizontal). Stacking also turns `fill` on by default and sets the default `mode` to "lines" irrespective of point count. ou can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. /// Sets the normalization for the sum of this `stackgroup. Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used @@ -1754,6 +1826,8 @@ module Chart2D = [] ?LineWidth: float, [] ?LineDash: StyleParam.DrawingStyle, [] ?Line: Line, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, @@ -1790,6 +1864,8 @@ module Chart2D = ?LineWidth = LineWidth, ?LineDash = LineDash, ?Line = Line, + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup, ?StackGroup = StackGroup, ?Orientation = Orientation, ?GroupNorm = GroupNorm, diff --git a/src/Plotly.NET/CommonAbstractions/StyleParams.fs b/src/Plotly.NET/CommonAbstractions/StyleParams.fs index 3466d4bd0..01642bb04 100644 --- a/src/Plotly.NET/CommonAbstractions/StyleParams.fs +++ b/src/Plotly.NET/CommonAbstractions/StyleParams.fs @@ -2486,6 +2486,20 @@ module StyleParam = // #S# //-------------------------- + [] + type ScatterMode = + | Group + | Overlay + + static member toString = + function + | Group -> "group" + | Overlay -> "overlay" + + static member convert = ScatterMode.toString >> box + override this.ToString() = this |> ScatterMode.toString + member this.Convert() = this |> ScatterMode.convert + [] type ShapeSizeMode = | Scaled diff --git a/src/Plotly.NET/Layout/Layout.fs b/src/Plotly.NET/Layout/Layout.fs index 60e08393b..d06b73313 100644 --- a/src/Plotly.NET/Layout/Layout.fs +++ b/src/Plotly.NET/Layout/Layout.fs @@ -52,6 +52,8 @@ type Layout() = /// Controls the behavior of newly drawn shapes /// Sets the styling of the active shape /// Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise). + /// Sets the gap (in plot fraction) between scatter points of adjacent location coordinates. Defaults to `bargap`. + /// Determines how scatter points at the same location coordinate are displayed on the graph. With "group", the scatter points are plotted next to one another centered around the shared location. With "overlay", the scatter points are plotted over one another, you might need to reduce "opacity" to see multiple scatter points. /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. /// Determines how bars at the same location coordinate are displayed on the graph. With "stack", the bars are stacked on top of one another With "relative", the bars are stacked on top of one another, with negative values below the axis, positive values above With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars. @@ -127,6 +129,8 @@ type Layout() = [] ?NewShape: NewShape, [] ?ActiveShape: ActiveShape, [] ?HideSources: bool, + [] ?ScatterGap: float, + [] ?ScatterMode: StyleParam.ScatterMode, [] ?BarGap: float, [] ?BarGroupGap: float, [] ?BarMode: StyleParam.BarMode, @@ -203,6 +207,8 @@ type Layout() = ?MinReducedWidth = MinReducedWidth, ?ActiveShape = ActiveShape, ?HideSources = HideSources, + ?ScatterGap = ScatterGap, + ?ScatterMode = ScatterMode, ?BarGap = BarGap, ?BarGroupGap = BarGroupGap, ?BarMode = BarMode, @@ -281,6 +287,8 @@ type Layout() = /// Controls the behavior of newly drawn shapes /// Sets the styling of the active shape /// Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise). + /// Sets the gap (in plot fraction) between scatter points of adjacent location coordinates. Defaults to `bargap`. + /// Determines how scatter points at the same location coordinate are displayed on the graph. With "group", the scatter points are plotted next to one another centered around the shared location. With "overlay", the scatter points are plotted over one another, you might need to reduce "opacity" to see multiple scatter points. /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. /// Determines how bars at the same location coordinate are displayed on the graph. With "stack", the bars are stacked on top of one another With "relative", the bars are stacked on top of one another, with negative values below the axis, positive values above With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars. @@ -356,6 +364,8 @@ type Layout() = [] ?NewShape: NewShape, [] ?ActiveShape: ActiveShape, [] ?HideSources: bool, + [] ?ScatterGap: float, + [] ?ScatterMode: StyleParam.ScatterMode, [] ?BarGap: float, [] ?BarGroupGap: float, [] ?BarMode: StyleParam.BarMode, @@ -432,6 +442,8 @@ type Layout() = NewShape |> DynObj.setValueOpt layout "newshape" ActiveShape |> DynObj.setValueOpt layout "activeshape" HideSources |> DynObj.setValueOpt layout "hidesources" + ScatterGap |> DynObj.setValueOpt layout "scattergap" + ScatterMode |> DynObj.setValueOptBy layout "scattermode" StyleParam.ScatterMode.convert BarGap |> DynObj.setValueOpt layout "bargap" BarGroupGap |> DynObj.setValueOpt layout "bargroupgap" BarMode |> DynObj.setValueOptBy layout "barmode" StyleParam.BarMode.convert diff --git a/src/Plotly.NET/Traces/Trace2D.fs b/src/Plotly.NET/Traces/Trace2D.fs index b52b999c2..8f0acda53 100644 --- a/src/Plotly.NET/Traces/Trace2D.fs +++ b/src/Plotly.NET/Traces/Trace2D.fs @@ -147,6 +147,8 @@ type Trace2DStyle() = /// 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. /// Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the stacking direction. With "v" ("h"), the y (x) values of subsequent traces are added. Also affects the default value of `fill`. /// Only relevant when `stackgroup` is used, and only the first `groupnorm` found in the `stackgroup` will be used - including if `visible` is "legendonly" but not if it is `false`. Sets the normalization for the sum of this `stackgroup`. With "fraction", the value of each trace at each location is divided by the sum of all trace values at that location. "percent" is the same but multiplied by 100 to show percentages. If there are multiple subplots, or multiple `stackgroup`s on one subplot, each will be normalized within its own set. + /// Set several traces linked to the same position axis or matching axes to the same alignmentgroup. This controls whether bars compute their positional range dependently or independently. + /// Set several traces linked to the same position axis or matching axes to the same offsetgroup where bars of the same position coordinate will line up. /// Set several scatter traces (on the same subplot) to the same stackgroup in order to add their y values (or their x values if `orientation` is "h"). If blank or omitted this trace will not be stacked. Stacking also turns `fill` on by default, using "tonexty" ("tonextx") if `orientation` is "h" ("v") and sets the default `mode` to "lines" irrespective of point count. You can only stack on a numeric (linear or log) axis. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order. /// Only relevant when the axis `type` is "date". Sets the period positioning in milliseconds or "M<n>" on the x axis. Special values in the form of "M<n>" could be used to declare the number of months. In this case `n` must be a positive integer. /// Only relevant when the axis `type` is "date". Sets the alignment of data points on the x axis. @@ -209,6 +211,8 @@ type Trace2DStyle() = [] ?YAxis: StyleParam.LinearAxisId, [] ?Orientation: StyleParam.Orientation, [] ?GroupNorm: StyleParam.GroupNorm, + [] ?AlignmentGroup: string, + [] ?OffsetGroup: string, [] ?StackGroup: string, [] ?XPeriod: #IConvertible, [] ?XPeriodAlignment: StyleParam.PeriodAlignment, @@ -270,6 +274,8 @@ type Trace2DStyle() = YAxis |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.convert Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert GroupNorm |> DynObj.setValueOptBy trace "groupnorm" StyleParam.GroupNorm.convert + AlignmentGroup |> DynObj.setValueOpt trace "alignmentgroup" + OffsetGroup |> DynObj.setValueOpt trace "offsetgroup" StackGroup |> DynObj.setValueOpt trace "stackgroup" XPeriod |> DynObj.setValueOpt trace "xperiod" XPeriodAlignment |> DynObj.setValueOptBy trace "xperiodalignment" StyleParam.PeriodAlignment.convert