8000 Plotly.NET/src/Plotly.NET/ChartAPI/Chart.fs at dev · plotly/Plotly.NET · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
3713 lines (3284 loc) · 227 KB

File metadata and controls

3713 lines (3284 loc) · 227 KB
namespace Plotly.NET
open Plotly.NET.LayoutObjects
open Plotly.NET.TraceObjects
open Plotly.NET.ConfigObjects
open DynamicObj
open System
open System.IO
open Giraffe.ViewEngine
open System.Runtime.InteropServices
/// Provides a set of static methods for creating and styling charts.
type Chart =
//==============================================================================================================
//================================================ Core methods ================================================
//==============================================================================================================
/// <summary>
/// Saves the given Chart as html file at the given path (.html file extension is added if not present).
/// Optionally opens the generated file in the browser.
/// </summary>
/// <param name="path">The path to save the chart html at.</param>
/// <param name="OpenInBrowser">Whether or not to open the generated file in the browser (default: false)</param>
static member saveHtml(path: string, ?OpenInBrowser: bool) =
fun (ch: GenericChart) ->
let show = defaultArg OpenInBrowser false
let html = GenericChart.toEmbeddedHTML ch
let file =
if path.EndsWith(".html") then
path
else
$"{path}.html"
File.WriteAllText(file, html)
if show then
file |> openOsSpecificFile
/// <summary>
/// Saves the given chart as a temporary html file and opens it in the browser.
/// </summary>
/// <param name="ch">The chart to show in the browser</param>
static member show(ch: GenericChart) =
let guid = Guid.NewGuid().ToString()
let tempPath = Path.GetTempPath()
let file = sprintf "%s.html" guid
let path = Path.Combine(tempPath, file)
ch |> Chart.saveHtml (path, true)
// #######################
/// Create a combined chart with the given charts merged
static member combine(gCharts: seq<GenericChart>) = GenericChart.combine gCharts
//==============================================================================================================
//============================================= Unspecific charts ==============================================
//==============================================================================================================
/// <summary>Creates a chart that is completely invisible when rendered. The Chart object however is NOT empty! Combining this chart with other charts will have unforseen consequences (it has for example invisible axes that can override other axes if used in Chart.Combine)</summary>
static member Invisible() =
let hiddenAxis () =
LinearAxis.init (ShowGrid = false, ShowLine = false, ShowTickLabels = false, ZeroLine = false)
let trace = Trace2D.initScatter (id)
trace.RemoveProperty("type") |> ignore
GenericChart.ofTraceObject false trace
|> GenericChart.mapLayout (fun l ->
l
|> Layout.setLinearAxis (StyleParam.SubPlotId.XAxis 1, hiddenAxis ())
|> Layout.setLinearAxis (StyleParam.SubPlotId.YAxis 1, hiddenAxis ()))
//==============================================================================================================
//======================================== General Trace object styling ========================================
//==============================================================================================================
/// <summary>
/// Sets trace information on the given chart.
/// </summary>
/// <param name="Name">Sets the name of the chart's trace(s). When the chart is a multichart (it contains multiple traces), the name is suffixed by '_%i' where %i is the index of the trace.</param>
/// <param name="Visible">Whether or not the chart's traces are visible</param>
/// <param name="ShowLegend">Determines whether or not item(s) corresponding to this chart's trace(s) is/are shown in the legend.</param>
/// <param name="LegendRank">Sets the legend rank for the chart's trace(s). Items and groups with smaller ranks are presented on top/left side while with `"reversed" `legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items.</param>
/// <param name="LegendGroup">Sets the legend group for the chart's trace(s). Traces part of the same legend group hide/show at the same time when toggling legend items.</param>
/// <param name="LegendGroupTitle">Sets the title for the chart's trace legend group </param>
static member withTraceInfo
(
?Name: string,
?Visible: StyleParam.Visible,
?ShowLegend: bool,
?LegendRank: int,
?LegendGroup: string,
?LegendGroupTitle: Title
) =
fun (ch: GenericChart) ->
ch
|> GenericChart.mapiTrace (fun i trace ->
let naming i name =
name |> Option.map (fun v -> if i = 0 then v else sprintf "%s_%i" v i)
trace
|> TraceStyle.TraceInfo(
?Name = (naming i Name),
?Visible = Visible,
?ShowLegend = ShowLegend,
?LegendRank = LegendRank,
?LegendGroup = LegendGroup,
?LegendGroupTitle = LegendGroupTitle
))
/// <summary>
/// Sets the axis anchor ids for the chart's cartesian and/or carpet trace(s).
///
/// If the traces are not of these types, nothing will be set and a warning message will be displayed.
/// </summary>
/// <param name="X">The new x axis anchor id for the chart's cartesian and/or carpet trace(s)</param>
/// <param name="Y">The new x axis anchor id for the chart's cartesian and/or carpet trace(s)</param>
static member withAxisAnchor
(
?X,
?Y
) =
let idx =
X |> Option.map StyleParam.LinearAxisId.X
let idy =
Y |> Option.map StyleParam.LinearAxisId.Y
fun (ch: GenericChart) ->
ch
|> GenericChart.mapTrace (fun trace ->
match trace with
| :? Trace2D as trace -> trace |> Trace2DStyle.SetAxisAnchor(?X = idx, ?Y = idy) :> Trace
| :? TraceCarpet as trace when trace.``type`` = "carpet" ->
trace |> TraceCarpetStyle.SetAxisAnchor(?X = idx, ?Y = idy) :> Trace
| _ ->
printfn "the input was not a 2D cartesian or carpet trace. no axis anchors set."
trace)
/// <summary>
/// Sets the color axis id for the chart's trace(s).
/// </summary>
/// <param name="id">The new color axis id for the chart's trace(s)</param>
static member withColorAxisAnchor(id: int) =
fun (ch: GenericChart) -> ch |> GenericChart.mapTrace (Trace.setColorAxisAnchor id)
/// <summary>
/// Sets the legend id for the chart's trace(s).
/// </summary>
/// <param name="id">The new Legend id for the chart's trace(s)</param>
static member withLegendAnchor(id: int) =
fun (ch: GenericChart) -> ch |> GenericChart.mapTrace (Trace.setLegendAnchor id)
/// <summary>
/// Sets the marker for the chart's trace(s).
/// </summary>
/// <param name="marker">The new marker for the chart's trace(s)</param>
/// <param name="Combine">Whether or not to combine the objects if there is already a marker (default is false)</param>
static member setMarker(marker: Marker, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateMarker marker)
else
ch |> GenericChart.mapTrace (Trace.setMarker marker))
/// <summary>
/// Sets the marker for the chart's trace(s).
///
/// If there is already a marker set, the objects are combined.
/// </summary>
/// <param name="marker">The new marker for the chart's trace(s)</param>
static member withMarker(marker: Marker) =
(fun (ch: GenericChart) -> ch |> Chart.setMarker (marker, true))
/// <summary>
/// Applies the given styles to the marker object(s) of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="Angle">Sets the marker angle in respect to `angleref`.</param>
/// <param name="AngleRef">Sets the reference for marker angle. With "previous", angle 0 points along the line from the previous point to this one. With "up", angle 0 points toward the top of the screen.</param>
/// <param name="AutoColorScale">Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. Has an effect only if in `marker.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.</param>
/// <param name="CAuto">Determines whether or not the color domain is computed with respect to the input data (here in `marker.color`) or the bounds set in `marker.cmin` and `marker.cmax` Has an effect only if in `marker.color`is set to a numerical array. Defaults to `false` when `marker.cmin` and `marker.cmax` are set by the user.</param>
/// <param name="CMax">Sets the upper bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmin` must be set as well.</param>
/// <param name="CMid">Sets the mid-point of the color domain by scaling `marker.cmin` and/or `marker.cmax` to be equidistant to this point. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color`. Has no effect when `marker.cauto` is `false`.</param>
/// <param name="CMin">Sets the lower bound of the color domain. Has an effect only if in `marker.color`is set to a numerical array. Value should have the same units as in `marker.color` and if set, `marker.cmax` must be set as well.</param>
/// <param name="Color">Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `marker.cmin` and `marker.cmax` if set.</param>
/// <param name="Colors">Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors.</param>
/// <param name="ColorAxis">Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.</param>
/// <param name="ColorBar">Sets the marker's color bar.</param>
/// <param name="Colorscale">Sets the colorscale. Has an effect only if colors is set to a numerical array. 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, use `marker.cmin` and `marker.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Blackbody,Bluered,Blues,Cividis,Earth,Electric,Greens,Greys,Hot,Jet,Picnic,Portland,Rainbow,RdBu,Reds,Viridis,YlGnBu,YlOrRd.</param>
/// <param name="CornerRadius">Sets the maximum rounding of corners (in px).</param>
/// <param name="Gradient">Sets the marker's gradient</param>
/// <param name="Outline">Sets the marker's outline.</param>
/// <param name="Opacity">Sets the marker opacity.</param>
/// <param name="MaxDisplayed">Sets a maximum number of points to be drawn on the graph. "0" corresponds to no limit.</param>
/// <param name="MultiOpacity">Sets the individual marker opacity.</param>
/// <param name="Pattern">Sets the pattern within the marker.</param>
/// <param name="ReverseScale">Reverses the color mapping if true. Has an effect only if in `marker.color`is set to a numerical array. If true, `marker.cmin` will correspond to the last color in the array and `marker.cmax` will correspond to the first color.</param>
/// <param name="ShowScale">Determines whether or not a colorbar is displayed for this trace. Has an effect only if in `marker.color`is set to a numerical array.</param>
/// <param name="Size">Sets the marker's size.</param>
/// <param name="MultiSize">Sets the individual marker's size.</param>
/// <param name="SizeMin">Has an effect only if `marker.size` is set to a numerical array. Sets the minimum size (in px) of the rendered marker points.</param>
/// <param name="SizeMode">Has an effect only if `marker.size` is set to a numerical array. Sets the rule for which the data in `size` is converted to pixels.</param>
/// <param name="SizeRef">Has an effect only if `marker.size` is set to a numerical array. Sets the scale factor used to determine the rendered size of marker points. Use with `sizemin` and `sizemode`.</param>
/// <param name="StandOff">Moves the marker away from the data point in the direction of `angle` (in px). This can be useful for example if you have another marker at this location and you want to point an arrowhead marker at it.</param>
/// <param name="MultiStandOff">Moves the marker away from the data point in the direction of `angle` (in px). This can be useful for example if you have another marker at this location and you want to point an arrowhead marker at it.</param>
/// <param name="Symbol">Sets the marker symbol.</param>
/// <param name="MultiSymbol">Sets the individual marker symbols.</param>
/// <param name="Symbol3D">Sets the marker symbol for 3d traces.</param>
/// <param name="MultiSymbol3D">Sets the individual marker symbols for 3d traces.</param>
/// <param name="OutlierColor">Sets the color of the outlier sample points.</param>
/// <param name="OutlierWidth">Sets the width of the outlier sample points.</param>
static member withMarkerStyle
(
?Angle: float,
?AngleRef: StyleParam.AngleRef,
?AutoColorScale: bool,
?CAuto: bool,
?CMax: float,
?CMid: float,
?CMin: float,
?Color: Color,
?Colors: seq<Color>,
?ColorAxis: StyleParam.SubPlotId,
?ColorBar: ColorBar,
?Colorscale: StyleParam.Colorscale,
?CornerRadius: int,
?Gradient: Gradient,
?Outline: Line,
?MaxDisplayed: int,
?Opacity: float,
?MultiOpacity: seq<float>,
?Pattern: Pattern,
?ReverseScale: bool,
?ShowScale: bool,
?Size: int,
?MultiSize: seq<int>,
?SizeMin: int,
?SizeMode: StyleParam.MarkerSizeMode,
?SizeRef: int,
?StandOff: float,
?MultiStandOff: seq<float>,
?Symbol: StyleParam.MarkerSymbol,
?MultiSymbol: seq<StyleParam.MarkerSymbol>,
?Symbol3D: StyleParam.MarkerSymbol3D,
?MultiSymbol3D: seq<StyleParam.MarkerSymbol3D>,
?OutlierColor: Color,
?OutlierWidth: int
) =
fun (ch: GenericChart) ->
ch
|> GenericChart.mapTrace (
TraceStyle.Marker(
?Angle = Angle,
?AngleRef = AngleRef,
?AutoColorScale = AutoColorScale,
?CAuto = CAuto,
?CMax = CMax,
?CMid = CMid,
?CMin = CMin,
?Color = Color,
?Colors = Colors,
?ColorAxis = ColorAxis,
?ColorBar = ColorBar,
?Colorscale = Colorscale,
?CornerRadius = CornerRadius,
?Gradient = Gradient,
?Outline = Outline,
?Size = Size,
?MultiSize = MultiSize,
?Opacity = Opacity,
?Pattern = Pattern,
?MultiOpacity = MultiOpacity,
?Symbol = Symbol,
?MultiSymbol = MultiSymbol,
?Symbol3D = Symbol3D,
?MultiSymbol3D = MultiSymbol3D,
?OutlierColor = OutlierColor,
?OutlierWidth = OutlierWidth,
?MaxDisplayed = MaxDisplayed,
?ReverseScale = ReverseScale,
?ShowScale = ShowScale,
?SizeMin = SizeMin,
?SizeMode = SizeMode,
?SizeRef = SizeRef,
?StandOff = StandOff,
?MultiStandOff = MultiStandOff
)
)
/// <summary>
/// Sets the line for the chart's trace(s).
/// </summary>
/// <param name="line">The new Line for the chart's trace(s)</param>
/// <param name="Combine">Whether or not to combine the objects if there is already a Line (default is false)</param>
static member setLine(line: Line, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateLine line)
else
ch |> GenericChart.mapTrace (Trace.setLine line))
/// <summary>
/// Sets the line for the chart's trace(s).
///
/// If there is already a Line set, the objects are combined.
/// </summary>
/ 537C // <param name="line">The new line for the chart's trace(s)</param>
static member withLine(line: Line) =
(fun (ch: GenericChart) -> ch |> Chart.setLine (line, true))
/// <summary>
/// Applies the given styles to the line object(s) of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="BackOff">Sets the line back off from the end point of the nth line segment (in px). This option is useful e.g. to avoid overlap with arrowhead markers. With "auto" the lines would trim before markers if `marker.angleref` is set to "previous".</param>
/// <param name="AutoColorScale">Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. Has an effect only if in `line.color`is set to a numerical array. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.</param>
/// <param name="CAuto">Determines whether or not the color domain is computed with respect to the input data (here in `line.color`) or the bounds set in `line.cmin` and `line.cmax` Has an effect only if in `line.color`is set to a numerical array. Defaults to `false` when `line.cmin` and `line.cmax` are set by the user.</param>
/// <param name="CMax">Sets the upper bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmin` must be set as well.</param>
/// <param name="CMid">Sets the mid-point of the color domain by scaling `line.cmin` and/or `line.cmax` to be equidistant to this point. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color`. Has no effect when `line.cauto` is `false`.</param>
/// <param name="CMin">Sets the lower bound of the color domain. Has an effect only if in `line.color`is set to a numerical array. Value should have the same units as in `line.color` and if set, `line.cmax` must be set as well.</param>
/// <param name="Color">Sets the line color.</param>
/// <param name="ColorAxis">Sets a reference to a shared color axis. References to these shared color axes are "coloraxis", "coloraxis2", "coloraxis3", etc. Settings for these shared color axes are set in the layout, under `layout.coloraxis`, `layout.coloraxis2`, etc. Note that multiple color scales can be linked to the same color axis.</param>
/// <param name="Colorscale">Sets the line colorscale</param>
/// <param name="ReverseScale">Reverses the color mapping if true.</param>
/// <param name="ShowScale">Whether or not to show the color bar</param>
/// <param name="ColorBar">Sets the colorbar.</param>
/// <param name="Dash">Sets the dash style of lines. Set to a dash type string ("solid", "dot", "dash", "longdash", "dashdot", or "longdashdot") or a dash length list in px (eg "5px,10px,2px,2px").</param>
/// <param name="Shape">Determines the line shape. With "spline" the lines are drawn using spline interpolation. The other available values correspond to step-wise line shapes.</param>
/// <param name="Simplify">Simplifies lines by removing nearly-collinear points. When transitioning lines, it may be desirable to disable this so that the number of points along the resulting SVG path is unaffected.</param>
/// <param name="Smoothing">Has an effect only if `shape` is set to "spline" Sets the amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape).</param>
/// <param name="Width">Sets the line width (in px).</param>
/// <param name="MultiWidth">Sets the individual line width (in px).</param>
/// <param name="OutlierColor">Sets the color of the outline of outliers</param>
/// <param name="OutlierWidth">Sets the width of the outline of outliers</param>
static member withLineStyle
(
?BackOff: StyleParam.BackOff,
?AutoColorScale: bool,
?CAuto: bool,
?CMax: float,
?CMid: float,
?CMin: float,
?Color: Color,
?ColorAxis: StyleParam.SubPlotId,
?Colorscale: StyleParam.Colorscale,
?ReverseScale: bool,
?ShowScale: bool,
?ColorBar: ColorBar,
?Dash: StyleParam.DrawingStyle,
?Shape: StyleParam.Shape,
?Simplify: bool,
?Smoothing: float,
?Width: float,
?MultiWidth: seq<float>,
?OutlierColor: Color,
?OutlierWidth: float
) =
fun (ch: GenericChart) ->
ch
|> GenericChart.mapTrace (
TraceStyle.Line(
?BackOff = BackOff,
?AutoColorScale = AutoColorScale,
?CAuto = CAuto,
?CMax = CMax,
?CMid = CMid,
?CMin = CMin,
?Color = Color,
?ColorAxis = ColorAxis,
?Colorscale = Colorscale,
?ReverseScale = ReverseScale,
?ShowScale = ShowScale,
?ColorBar = ColorBar,
?Dash = Dash,
?Shape = Shape,
?Simplify = Simplify,
?Smoothing = Smoothing,
?Width = Width,
?MultiWidth = MultiWidth,
?OutlierColor = OutlierColor,
?OutlierWidth = OutlierWidth
)
)
/// <summary>
/// Sets the error for the x dimension for the chart's trace(s).
/// </summary>
/// <param name="xError">The new Error in the x dimension for the chart's trace(s)</param>
/// <param name="Combine">Whether or not to combine the objects if there is already an Error object set (default is false)</param>
static member setXError(xError: Error, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateXError xError)
else
ch |> GenericChart.mapTrace (Trace.setXError xError))
/// <summary>
/// Sets the error in the x dimension for the chart's trace(s).
///
/// If there is already an error set, the objects are combined.
/// </summary>
/// <param name="xError">The new error for the chart's trace(s)</param>
static member withXError(xError: Error) =
(fun (ch: GenericChart) -> ch |> Chart.setXError (xError, true))
/// <summary>
/// Applies the given styles to the error object(s) in the x dimension of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name ="Visible">Determines whether or not this set of error bars is visible.</param>
/// <param name ="Type">Determines the rule used to generate the error bars. If "constant`, the bar lengths are of a constant value. Set this constant in `value`. If "percent", the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If "sqrt", the bar lengths correspond to the square of the underlying data. If "data", the bar lengths are set with data set `array`.</param>
/// <param name ="Symmetric">Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.</param>
/// <param name ="Array">Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.</param>
/// <param name ="Arrayminus">Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.</param>
/// <param name ="Value">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars.</param>
/// <param name ="Valueminus">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars</param>
/// <param name ="Traceref"></param>
/// <param name ="Tracerefminus"></param>
/// <param name ="Copy_ystyle"></param>
/// <param name ="Color">Sets the stoke color of the error bars.</param>
/// <param name ="Thickness">Sets the thickness (in px) of the error bars.</param>
/// <param name ="Width">Sets the width (in px) of the cross-bar at both ends of the error bars.</param>
static member withXErrorStyle
(
?Visible: bool,
?Type: StyleParam.ErrorType,
?Symmetric: bool,
?Array: seq<#IConvertible>,
?Arrayminus: seq<#IConvertible>,
?Value: float,
?Valueminus: float,
?Traceref: int,
?Tracerefminus: int,
?Copy_ystyle: bool,
?Color: Color,
?Thickness: float,
?Width: float
) =
fun (ch: GenericChart) ->
ch
|> GenericChart.mapTrace (
TraceStyle.XError(
?Visible = Visible,
?Type = Type,
?Symmetric = Symmetric,
?Array = Array,
?Arrayminus = Arrayminus,
?Value = Value,
?Valueminus = Valueminus,
?Traceref = Traceref,
?Tracerefminus = Tracerefminus,
?Copy_ystyle = Copy_ystyle,
?Color = Color,
?Thickness = Thickness,
?Width = Width
)
)
/// <summary>
/// Sets the error for the y dimension for the chart's trace(s).
/// </summary>
/// <param name="yError">The new Error in the x dimension for the chart's trace(s)</param>
/// <param name="Combine">Whether or not to combine the objects if there is already an Error object set (default is false)</param>
static member setYError(yError: Error, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateYError yError)
else
ch |> GenericChart.mapTrace (Trace.setYError yError))
/// <summary>
/// Sets the error in the y dimension for the chart's trace(s).
///
/// If there is already an error set, the objects are combined.
/// </summary>
/// <param name="yError">The new error for the chart's trace(s)</param>
static member withYError(yError: Error) =
(fun (ch: GenericChart) -> ch |> Chart.setYError (yError, true))
/// <summary>
/// Applies the given styles to the error object(s) in the y dimension of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name ="Visible">Determines whether or not this set of error bars is visible.</param>
/// <param name ="Type">Determines the rule used to generate the error bars. If "constant`, the bar lengths are of a constant value. Set this constant in `value`. If "percent", the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If "sqrt", the bar lengths correspond to the square of the underlying data. If "data", the bar lengths are set with data set `array`.</param>
/// <param name ="Symmetric">Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.</param>
/// <param name ="Array">Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.</param>
/// <param name ="Arrayminus">Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.</param>
/// <param name ="Value">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars.</param>
/// <param name ="Valueminus">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars</param>
/// <param name ="Traceref"></param>
/// <param name ="Tracerefminus"></param>
/// <param name ="Copy_ystyle"></param>
/// <param name ="Color">Sets the stoke color of the error bars.</param>
/// <param name ="Thickness">Sets the thickness (in px) of the error bars.</param>
/// <param name ="Width">Sets the width (in px) of the cross-bar at both ends of the error bars.</param>
static member withYErrorStyle
(
?Visible: bool,
?Type: StyleParam.ErrorType,
?Symmetric: bool,
?Array: seq<#IConvertible>,
?Arrayminus: seq<#IConvertible>,
?Value: float,
?Valueminus: float,
?Traceref: int,
?Tracerefminus: int,
?Copy_ystyle: bool,
?Color: Color,
?Thickness: float,
?Width: float
) =
fun (ch: GenericChart) ->
ch
|> GenericChart.mapTrace (
TraceStyle.YError(
?Visible = Visible,
?Type = Type,
?Symmetric = Symmetric,
?Array = Array,
?Arrayminus = Arrayminus,
?Value = Value,
?Valueminus = Valueminus,
?Traceref = Traceref,
?Tracerefminus = Tracerefminus,
?Copy_ystyle = Copy_ystyle,
?Color = Color,
?Thickness = Thickness,
?Width = Width
)
)
/// <summary>
/// Sets the error for the z dimension for the chart's trace(s).
/// </summary>
/// <param name="zError">The new Error in the x dimension for the chart's trace(s)</param>
/// <param name="Combine">Whether or not to combine the objects if there is already an Error object set (default is false)</param>
static member setZError(zError: Error, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateZError zError)
else
ch |> GenericChart.mapTrace (Trace.setZError zError))
/// <summary>
/// Sets the error in the z dimension for the chart's trace(s).
///
/// If there is already an error set, the objects are combined.
/// </summary>
/// <param name="zError">The new error for the chart's trace(s)</param>
static member withZError(zError: Error) =
(fun (ch: GenericChart) -> ch |> Chart.setZError (zError, true))
/// <summary>
/// Applies the given styles to the error object(s) in the z dimension of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name ="Visible">Determines whether or not this set of error bars is visible.</param>
/// <param name ="Type">Determines the rule used to generate the error bars. If "constant`, the bar lengths are of a constant value. Set this constant in `value`. If "percent", the bar lengths correspond to a percentage of underlying data. Set this percentage in `value`. If "sqrt", the bar lengths correspond to the square of the underlying data. If "data", the bar lengths are set with data set `array`.</param>
/// <param name ="Symmetric">Determines whether or not the error bars have the same length in both direction (top/bottom for vertical bars, left/right for horizontal bars.</param>
/// <param name ="Array">Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.</param>
/// <param name ="Arrayminus">Sets the data corresponding the length of each error bar in the bottom (left) direction for vertical (horizontal) bars Values are plotted relative to the underlying data.</param>
/// <param name ="Value">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars.</param>
/// <param name ="Valueminus">Sets the value of either the percentage (if `type` is set to "percent") or the constant (if `type` is set to "constant") corresponding to the lengths of the error bars in the bottom (left) direction for vertical (horizontal) bars</param>
/// <param name ="Traceref"></param>
/// <param name ="Tracerefminus"></param>
/// <param name ="Copy_ystyle"></param>
/// <param name ="Color">Sets the stoke color of the error bars.</param>
/// <param name ="Thickness">Sets the thickness (in px) of the error bars.</param>
/// <param name ="Width">Sets the width (in px) of the cross-bar at both ends of the error bars.</param>
static member withZErrorStyle
(
?Visible: bool,
?Type: StyleParam.ErrorType,
?Symmetric: bool,
?Array: seq<#IConvertible>,
?Arrayminus: seq<#IConvertible>,
?Value: float,
?Valueminus: float,
?Traceref: int,
?Tracerefminus: int,
?Copy_ystyle: bool,
?Color: Color,
?Thickness: float,
?Width: float
) =
fun (ch: GenericChart) ->
ch
|> GenericChart.mapTrace (
TraceStyle.ZError(
?Visible = Visible,
?Type = Type,
?Symmetric = Symmetric,
?Array = Array,
?Arrayminus = Arrayminus,
?Value = Value,
?Valueminus = Valueminus,
?Traceref = Traceref,
?Tracerefminus = Tracerefminus,
?Copy_ystyle = Copy_ystyle,
?Color = Color,
?Thickness = Thickness,
?Width = Width
)
)
/// <summary>
/// Sets the ColorBar for the chart's trace(s).
/// </summary>
/// <param name="colorBar">The new ColorBar for the chart's trace(s)</param>
/// <param name="Combine">Whether or not to combine the objects if there is already a ColorBar object set (default is false)</param>
static member setColorBar(colorBar: ColorBar, ?Combine: bool) =
let combine = defaultArg Combine false
(fun (ch: GenericChart) ->
if combine then
ch |> GenericChart.mapTrace (Trace.updateColorBar colorBar)
else
ch |> GenericChart.mapTrace (Trace.setColorBar colorBar))
/// <summary>
/// Sets the ColorBar for the chart's trace(s).
///
/// If there is already a ColorBar set, the objects are combined.
/// </summary>
/// <param name="colorbar">The new ColorBar for the chart's trace(s)</param>
static member withColorBar(colorbar: ColorBar) =
(fun (ch: GenericChart) -> ch |> Chart.setColorBar (colorbar, true))
/// <summary>
/// Applies the given styles to the ColorBar object(s) of the chart's trace(s). Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="TitleText">Sets the colorbar's title</param>
/// <param name="TitleFont">Sets the title font.</param>
/// <param name="TitleStandoff">Sets the standoff distance (in px) between the axis labels and the title text The default value is a function of the axis tick labels, the title `font.size` and the axis `linewidth`. Note that the axis title position is always constrained within the margins, so the actual standoff distance is always less than the set or default value. By setting `standoff` and turning on `automargin`, plotly.js will push the margins to fit the axis title at given standoff distance.</param>
/// <param name="Title">Sets the Title object (use this for more finegrained control than the other title-associated arguments)</param>
/// <param name="BGColor">Sets the color of padded area.</param>
/// <param name="BorderColor">Sets the axis line color.</param>
/// <param name="BorderWidth">Sets the width (in px) or the border enclosing this color bar.</param>
/// <param name="DTick">Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to "log" and "date" axes. If the axis `type` is "log", then ticks are set every 10^(n"dtick) where n is the tick number. For example, to set a tick mark at 1, 10, 100, 1000, ... set dtick to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2. To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to log_10(5), or 0.69897000433. "log" has several special values; "L&lt;f&gt;", where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use "D1" (all digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and "D2". If the axis `type` is "date", then you must convert the time to milliseconds. For example, to set the interval between ticks to one day, set `dtick` to 86400000.0. "date" also has special values "M&lt;n&gt;" gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to "2000-01-15" and `dtick` to "M3". To set ticks every 4 years, set `dtick` to "M48"</param>
/// <param name="ExponentFormat">Determines a formatting rule for the tick exponents. For example, consider the number 1,000,000,000. If "none", it appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If "power", 1x10^9 (with 9 in a super script). If "SI", 1G. If "B", 1B.</param>
/// <param name="LabelAlias">Replacement text for specific tick or hover labels. For example using {US: 'USA', CA: 'Canada'} changes US to USA and CA to Canada. The labels we would have shown must match the keys exactly, after adding any tickprefix or ticksuffix. labelalias can be used with any axis type, and both keys (if needed) and values (if desired) can include html-like tags or MathJax.</param>
/// <param name="Len">Sets the length of the color bar This measure excludes the padding of both ends. That is, the color bar length is this length minus the padding on both ends.</param>
/// <param name="LenMode">Determines whether this color bar's length (i.e. the measure in the color variation direction) is set in units of plot "fraction" or in "pixels. Use `len` to set the value.</param>
/// <param name="MinExponent">Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `tickformat` is "SI" or "B".</param>
/// <param name="NTicks">Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to "auto".</param>
/// <param name="Orientation">Sets the orientation of the colorbar.</param>
/// <param name="OutlineColor">Sets the axis line color.</param>
/// <param name="OutlineWidth">Sets the width (in px) of the axis line.</param>
/// <param name="SeparateThousands">If "true", even 4-digit integers are separated</param>
/// <param name="ShowExponent">If "all", all exponents are shown besides their significands. If "first", only the exponent of the first tick is shown. If "last", only the exponent of the last tick is shown. If "none", no exponents appear.</param>
/// <param name="ShowTickLabels">Determines whether or not the tick labels are drawn.</param>
/// <param name="ShowTickPrefix">If "all", all tick labels are displayed with a prefix. If "first", only the first tick is displayed with a prefix. If "last", only the last tick is displayed with a suffix. If "none", tick prefixes are hidden.</param>
/// <param name="ShowTickSuffix">Same as `showtickprefix` but for tick suffixes.</param>
/// <param name="Thickness">Sets the thickness of the color bar This measure excludes the size of the padding, ticks and labels.</param>
/// <param name="ThicknessMode">Determines whether this color bar's thickness (i.e. the measure in the constant color direction) is set in units of plot "fraction" or in "pixels". Use `thickness` to set the value.</param>
/// <param name="Tick0">Sets the placement of the first tick on this axis. Use with `dtick`. If the axis `type` is "log", then you must take the log of your starting tick (e.g. to set the starting tick to 100, set the `tick0` to 2) except when `dtick`="L&gt;f&lt;" (see `dtick` for more info). If the axis `type` is "date", it should be a date string, like date data. If the axis `type` is "category", it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.</param>
/// <param name="TickAngle">Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically.</param>
/// <param name="TickColor">Sets the tick color.</param>
/// <param name="TickFont">Sets the color bar's tick label font</param>
/// <param name="TickFormat">Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: "%h" for half of the year as a decimal number as well as "%{n}f" for fractional seconds with n digits. For example, "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display "09~15~23.46"</param>
/// <param name="TickFormatStops">Set rules for customizing TickFormat on different zoom levels</param>
/// <param name="TickLabelOverflow">Determines how we handle tick labels that would overflow either the graph div or the domain of the axis. The default value for inside tick labels is "hide past domain". In other cases the default is "hide past div".</param>
/// <param name="TickLabelPosition">Determines where tick labels are drawn.</param>
/// <param name="TickLabelStep">Sets the spacing between tick labels as compared to the spacing between ticks. A value of 1 (default) means each tick gets a label. A value of 2 means shows every 2nd label. A larger value n means only every nth tick is labeled. `tick0` determines which labels are shown. Not implemented for axes with `type` "log" or "multicategory", or when `tickmode` is "array".</param> /// <param name="TickLen">Sets the tick length (in px).</param>
/// <param name="TickMode">Sets the tick mode for this axis. If "auto", the number of ticks is set via `nticks`. If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick` ("linear" is the default value if `tick0` and `dtick` are provided). If "array", the placement of the ticks is set via `tickvals` and the tick text is `ticktext`. ("array" is the default value if `tickvals` is provided).</param>
/// <param name="TickPrefix">Sets a tick label prefix.</param>
/// <param name="Ticks">Determines whether ticks are drawn or not. If "", this axis' ticks are not drawn. If "outside" ("inside"), this axis' are drawn outside (inside) the axis lines.</param>
/// <param name="TickSuffix">Sets a tick label suffix.</param>
/// <param name="TickText">Sets the text displayed at the ticks position via `tickvals`. Only has an effect if `tickmode` is set to "array". Used with `tickvals`.</param>
/// <param name="TickVals">Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `ticktext`.</param>
/// <param name="TickWidth">Sets the tick width (in px).</param>
/// <param name="X">Sets the x position of the color bar (in plot fraction).</param>
/// <param name="XAnchor">Sets this color bar's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the color bar.</param>
/// <param name="XPad">Sets the amount of padding (in px) along the x direction.</param>
/// <param name="XRef">Sets the container `x` refers to. "container" spans the entire `width` of the plot. "paper" refers to the width of the plotting area only.</param>
/// <param name="Y">Sets the y position of the color bar (in plot fraction).</param>
/// <param name="YAnchor">Sets this color bar's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the color bar.</param>
/// <param name="YPad">Sets the amount of padding (in px) along the y direction.</param>
/// <param name="YRef">Sets the container `y` refers to. "container" spans the entire `height` of the plot. "paper" refers to the height of the plotting area only.</param>
static member withColorBarStyle
(
?TitleText: string,
?TitleFont: Font,
?TitleStandoff: int,
?Title: Title,
?BGColor: Color,
?BorderColor: Color,
?BorderWidth: float,
?DTick: IConvertible,
?ExponentFormat: StyleParam.ExponentFormat,
?LabelAlias: DynamicObj,
?Len: float,
?LenMode: StyleParam.UnitMode,
?MinExponent: float,
?NTicks: int,
?Orientation: StyleParam.Orientation,
?OutlineColor: Color,
?OutlineWidth: float,
?SeparateThousands: bool,
?ShowExponent: StyleParam.ShowExponent,
?ShowTickLabels: bool,
?ShowTickPrefix: StyleParam.ShowTickOption,
?ShowTickSuffix: StyleParam.ShowTickOption,
?Thickness: float,
?ThicknessMode: StyleParam.UnitMode,
?Tick0: IConvertible,
?TickAngle: int,
?TickColor: Color,
?TickFont: Font,
?TickFormat: string,
?TickFormatStops: seq<TickFormatStop>,
?TickLabelOverflow: StyleParam.TickLabelOverflow,
?TickLabelPosition: StyleParam.TickLabelPosition,
?TickLabelStep: int,
?TickLen: float,
?TickMode: StyleParam.TickMode,
?TickPrefix: string,
?Ticks: StyleParam.TickOptions,
?TickSuffix: string,
?TickText: seq<#IConvertible>,
?TickVals: seq<#IConvertible>,
?TickWidth: float,
?X: float,
?XAnchor: StyleParam.HorizontalAlign,
?XPad: float,
?XRef: string,
?Y: float,
?YAnchor: StyleParam.VerticalAlign,
?YPad: float,
?YRef: string
) =
let title =
Title
|> Option.defaultValue (Plotly.NET.Title())
|> Plotly.NET.Title.style (?Text = TitleText, ?Font = TitleFont, ?Standoff = TitleStandoff)
let colorbar =
ColorBar.init (
Title = title,
?BGColor = BGColor,
?BorderColor = BorderColor,
?BorderWidth = BorderWidth,
?DTick = DTick,
?ExponentFormat = ExponentFormat,
?LabelAlias = LabelAlias,
?Len = Len,
?LenMode = LenMode,
?MinExponent = MinExponent,
?NTicks = NTicks,
?Orientation = Orientation,
?OutlineColor = OutlineColor,
?OutlineWidth = OutlineWidth,
?SeparateThousands = SeparateThousands,
?ShowExponent = ShowExponent,
?ShowTickLabels = ShowTickLabels,
?ShowTickPrefix = ShowTickPrefix,
?ShowTickSuffix = ShowTickSuffix,
?Thickness = Thickness,
?ThicknessMode = ThicknessMode,
?Tick0 = Tick0,
?TickAngle = TickAngle,
?TickColor = TickColor,
?TickFont = TickFont,
?TickFormat = TickFormat,
?TickFormatStops = TickFormatStops,
?TickLabelOverflow = TickLabelOverflow,
?TickLabelPosition = TickLabelPosition,
?TickLabelStep = TickLabelStep,
?TickLen = TickLen,
?TickMode = TickMode,
?TickPrefix = TickPrefix,
?Ticks = Ticks,
?TickSuffix = TickSuffix,
?TickText = TickText,
?TickVals = TickVals,
?TickWidth = TickWidth,
?X = X,
?XAnchor = XAnchor,
?XPad = XPad,
?XRef = XRef,
?Y = Y,
?YAnchor = YAnchor,
?YPad = YPad,
?YRef = YRef
)
Chart.withColorBar (colorbar)
//==============================================================================================================
//======================================= General Layout object styling ========================================
//==============================================================================================================
// <summary>
/// Sets the given layout on the input chart.
///
/// If there is already an layout set, the object is replaced.
/// </summary>
static member setLayout(layout: Layout) =
(fun (ch: GenericChart) -> GenericChart.setLayout layout ch)
/// <summary>
/// Sets the given layout on the input chart.
///
/// If there is already an layout set, the objects are combined.
/// </summary>
static member withLayout(layout: Layout) =
(fun (ch: GenericChart) -> GenericChart.addLayout layout ch)
/// <summary>
/// Applies the given styles to the chart's Layout object. Overwrites attributes with the same name that are already set.
/// </summary>
/// <param name="Title">Sets the title of the layout.</param>
/// <param name="ShowLegend">Determines whether or not a legend is drawn. Default is `true` if there is a trace to show and any of these: a) Two or more traces would by default be shown in the legend. b) One pie trace is shown in the legend. c) One trace is explicitly given with `showlegend: true`.</param>
/// <param name="Margin">Sets the margins around the layout.</param>
/// <param name="AutoSize">Determines whether or not a layout width or height that has been left undefined by the user is initialized on each relayout. Note that, regardless of this attribute, an undefined layout width or height is always initialized on the first call to plot.</param>
/// <param name="Width">Sets the plot's width (in px).</param>
/// <param name="Height">Sets the plot's height (in px).</param>
/// <param name="Font">Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.</param>
/// <param name="UniformText">Determines how the font size for various text elements are uniformed between each trace type.</param>
/// <param name="Separators">Sets the decimal and thousand separators. For example, ". " puts a '.' before decimals and a space between thousands. In English locales, dflt is ".," but other locales may alter this default.</param>
/// <param name="PaperBGColor">Sets the background color of the paper where the graph is drawn.</param>
/// <param name="PlotBGColor">Sets the background color of the plotting area in-between x and y axes.</param>
/// <param name="AutoTypeNumbers">Using "strict" a numeric string in trace data is not converted to a number. Using "convert types" a numeric string in trace data may be treated as a number during automatic axis `type` detection. This is the default value; however it could be overridden for individual axes.</param>
/// <param name="Colorscale">Sets the default colorscales that are used by plots using autocolorscale.</param>
/// <param name="Colorway">Sets the default trace colors.</param>
/// <param name="ModeBar">Sets the modebar of the layout.</param>
/// <param name="HoverMode">Determines the mode of hover interactions. If "closest", a single hoverlabel will appear for the "closest" point within the `hoverdistance`. If "x" (or "y"), multiple hoverlabels will appear for multiple points at the B844 "closest" x- (or y-) coordinate within the `hoverdistance`, with the caveat that no more than one hoverlabel will appear per trace. If "x unified" (or "y unified"), a single hoverlabel will appear multiple points at the closest x- (or y-) coordinate within the `hoverdistance` with the caveat that no more than one hoverlabel will appear per trace. In this mode, spikelines are enabled by default perpendicular to the specified axis. If false, hover interactions are disabled.</param>
/// <param name="ClickMode">Determines the mode of single click interactions. "event" is the default value and emits the `plotly_click` event. In addition this mode emits the `plotly_selected` event in drag modes "lasso" and "select", but with no event data attached (kept for compatibility reasons). The "select" flag enables selecting single data points via click. This mode also supports persistent selections, meaning that pressing Shift while clicking, adds to / subtracts from an existing selection. "select" with `hovermode`: "x" can be confusing, consider explicitly setting `hovermode`: "closest" when using this feature. Selection events are sent accordingly as long as "event" flag is set as well. When the "event" flag is missing, `plotly_click` and `plotly_selected` events are not fired.</param>
/// <param name="DragMode">Determines the mode of drag interactions. "select" and "lasso" apply only to scatter traces with markers or text. "orbit" and "turntable" apply only to 3D scenes.</param>
/// <param name="SelectDirection">When `dragmode` is set to "select", this limits the selection of the drag to horizontal, vertical or diagonal. "h" only allows horizontal selection, "v" only vertical, "d" only diagonal and "any" sets no limit.</param>
/// <param name="ActiveSelection">Sets the styling of the active selection</param>
/// <param name="NewSelection">Controls the behavior of newly drawn selections</param>
/// <param name="HoverDistance">Sets the default distance (in pixels) to look for data to add hover labels (-1 means no cutoff, 0 means no looking for data). This is only a real distance for hovering on point-like objects, like scatter points. For area-like objects (bars, scatter fills, etc) hovering is on inside the area and off outside, but these objects will not supersede hover on point-like objects in case of conflict.</param>
/// <param name="SpikeDistance">Sets the default distance (in pixels) to look for data to draw spikelines to (-1 means no cutoff, 0 means no looking for data). As with hoverdistance, distance does not apply to area-like objects. In addition, some objects can be hovered on but will not generate spikelines, such as scatter fills.</param>
/// <param name="Hoverlabel">Sets the style ov hover labels.</param>
/// <param name="Transition">Sets transition options used during Plotly.react updates.</param>
/// <param name="DataRevision">If provided, a changed value tells `Plotly.react` that one or more data arrays has changed. This way you can modify arrays in-place rather than making a complete new copy for an incremental change. If NOT provided, `Plotly.react` assumes that data arrays are being treated as immutable, thus any data array with a different identity from its predecessor contains new data.</param>
/// <param name="UIRevision">Used to allow user interactions with the plot to persist after `Plotly.react` calls that are unaware of these interactions. If `uirevision` is omitted, or if it is given and it changed from the previous `Plotly.react` call, the exact new figure is used. If `uirevision` is truthy and did NOT change, any attribute that has been affected by user interactions and did not receive a different value in the new figure will keep the interaction value. `layout.uirevision` attribute serves as the default for `uirevision` attributes in various sub-containers. For finer control you can set these sub-attributes directly. For example, if your app separately controls the data on the x and y axes you might set `xaxis.uirevision="time"` and `yaxis.uirevision="cost"`. Then if only the y data is changed, you can update `yaxis.uirevision="quantity"` and the y axis range will reset but the x axis range will retain any user-driven zoom.</param>
/// <param name="EditRevision">Controls persistence of user-driven changes in `editable: true` configuration, other than trace names and axis titles. Defaults to `layout.uirevision`.</param>
/// <param name="SelectRevision">Controls persistence of user-driven changes in `editable: true` configuration, other than trace names and axis titles. Defaults to `layout.uirevision`.</param>
/// <param name="Template">Default attributes to be applied to the plot. Templates can be created from existing plots using `Plotly.makeTemplate`, or created manually. They should be objects with format: `{layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...}` `layoutTemplate` and `traceTemplate` are objects matching the attribute structure of `layout` and a data trace. Trace templates are applied cyclically to traces of each type. Container arrays (eg `annotations`) have special handling: An object ending in `defaults` (eg `annotationdefaults`) is applied to each array item. But if an item has a `templateitemname` key we look in the template array for an item with matching `name` and apply that instead. If no matching `name` is found we mark the item invisible. Any named template item not referenced is appended to the end of the array, so you can use this for a watermark annotation or a logo image, for example. To omit one of these items on the plot, make an item with matching `templateitemname` and `visible: false`.</param>
/// <param name="Meta">Assigns extra meta information that can be used in various `text` attributes. Attributes such as the graph, axis and colorbar `title.text`, annotation `text` `trace.name` in legend items, `rangeselector`, `updatemenus` and `sliders` `label` text all support `meta`. One can access `meta` fields using template strings: `%{meta[i]}` where `i` is the index of the `meta` item in question. `meta` can also be an object for example `{key: value}` which can be accessed %{meta[key]}.</param>
/// <param name="Computed">Placeholder for exporting automargin-impacting values namely `margin.t`, `margin.b`, `margin.l` and `margin.r` in "full-json" mode.</param>
/// <param name="Grid">Sets the layout grid for arranging multiple plots</param>
/// <param name="Calendar">Sets the default calendar system to use for interpreting and displaying dates throughout the plot.</param>
/// <param name="MinReducedHeight">Minimum height of the plot with margin.automargin applied (in px)</param>
/// <param name="MinReducedWidth">Minimum width of the plot with margin.automargin applied (in px)</param>
/// <param name="NewShape">Controls the behavior of newly drawn shapes</param>
/// <param name="ActiveShape">Sets the styling of the active shape</param>
/// <param name="HideSources">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).</param>
/// <param name="ScatterGap">Sets the gap (in plot fraction) between scatter points of adjacent location coordinates. Defaults to `bargap`.</param>
/// <param name="ScatterMode">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.</param>
/// <param name="BarGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="BarGroupGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="BarMode">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.</param>
/// <param name="BarNorm">Sets the normalization for bar traces on the graph. With "fraction", the value of each bar is divided by the sum of all values at that location coordinate. "percent" is the same but multiplied by 100 to show percentages.</param>
/// <param name="ExtendPieColors">If `true`, the pie slice colors (whether given by `piecolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="HiddenLabels">If `true`, the pie slice colors (whether given by `piecolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="PieColorWay">Sets the default pie slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendpiecolors`.</param>
/// <param name="BoxGap">Sets the gap (in plot fraction) between boxes of adjacent location coordinates. Has no effect on traces that have "width" set.</param>
/// <param name="BoxGroupGap">Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="BoxMode">Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="ViolinGap">Sets the gap (in plot fraction) between boxes of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="ViolinGroupGap">Sets the gap (in plot fraction) between violins of the same location coordinate. Has no effect on traces that have "width" set.</param>
/// <param name="ViolinMode">Determines how violins at the same location coordinate are displayed on the graph. If "group", the violins are plotted next to one another centered around the shared location. If "overlay", the violins are plotted over one another, you might need to set "opacity" to see them multiple violins. Has no effect on traces that have "width" set.</param>
/// <param name="WaterfallGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="WaterfallGroupGap">Sets the gap (in plot fraction) between bars of the same location coordinate.</param>
/// <param name="WaterfallMode">Determines how bars at the same location coordinate are displayed on the graph. 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.</param>
/// <param name="FunnelGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="FunnelGroupGap">Sets the gap (in plot fraction) between bars of adjacent location coordinates.</param>
/// <param name="FunnelMode">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 "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.</param>
/// <param name="ExtendFunnelAreaColors">If `true`, the funnelarea slice colors (whether given by `funnelareacolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="FunnelAreaColorWay">Sets the default funnelarea slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendfunnelareacolors`.</param>
/// <param name="ExtendSunBurstColors">If `true`, the sunburst slice colors (whether given by `sunburstcolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="SunBurstColorWay">If `true`, the sunburst slice colors (whether given by `sunburstcolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="ExtendTreeMapColors">If `true`, the treemap slice colors (whether given by `treemapcolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="TreeMapColorWay">Sets the default treemap slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendtreemapcolors`.</param>
/// <param name="ExtendIcicleColors">If `true`, the icicle slice colors (whether given by `iciclecolorway` or inherited from `colorway`) will be extended to three times its original length by first repeating every color 20% lighter then each color 20% darker. This is intended to reduce the likelihood of reusing the same color when you have many slices, but you can set `false` to disable. Colors provided in the trace, using `marker.colors`, are never extended.</param>
/// <param name="IcicleColorWay">Sets the default icicle slice colors. Defaults to the main `colorway` used for trace colors. If you specify a new list here it can still be extended with lighter and darker colors, see `extendiciclecolors`.</param>
/// <param name="Annotations">A collection containing all Annotations of this layout. An annotation is a text element that can be placed anywhere in the plot. It can be positioned with respect to relative coordinates in the plot or with respect to the actual data coordinates of the graph. Annotations can be shown with or without an arrow.</param>
/// <param name="Shapes">A collection containing all Shapes of this layout.</param>
/// <param name="Selections">A collection containing all Selections of this layout.</param>
/// <param name="Images">A collection containing all Images of this layout. </param>
/// <param name="Sliders">A collection containing all Sliders of this layout. </param>
/// <param name="UpdateMenus">A collection containing all UpdateMenus of this layout. </param>
static member withLayoutStyle
(
?Title: Title,
?ShowLegend: bool,
?Margin: Margin,
?AutoSize: bool,
?Width: int,
?Height: int,
?Font: Font,
?UniformText: UniformText,
?Separators: string,
?PaperBGColor: Color,
?PlotBGColor: Color,
?AutoTypeNumbers: StyleParam.AutoTypeNumbers,
?Colorscale: DefaultColorScales,
?Colorway: Color,
?ModeBar: ModeBar,
?HoverMode: StyleParam.HoverMode,
?ClickMode: StyleParam.ClickMode,
?DragMode: StyleParam.DragMode,
?SelectDirection: StyleParam.SelectDirection,
?ActiveSelection: ActiveSelection,
?NewSelection: NewSelection,
?HoverDistance: int,
?SpikeDistance: int,
?Hoverlabel: Hoverlabel,
?Transition: Transition,
?DataRevision: string,
?UIRevision: string,
?EditRevision: string,
?SelectRevision: string,
?Template: DynamicObj,
?Meta: string,
?Computed: string,
?Grid: LayoutGrid,
?Calendar: StyleParam.Calendar,
?MinReducedHeight: int,
?MinReducedWidth: int,
?NewShape: NewShape,
?ActiveShape: ActiveShape,
?HideSources: bool,
?ScatterGap: float,
?ScatterMode: StyleParam.ScatterMode,
?BarGap: float,
?BarGroupGap: float,
?BarMode: StyleParam.BarMode,
?BarNorm: StyleParam.BarNorm,
?ExtendPieColors: bool,
?HiddenLabels: seq<#IConvertible>,
?PieColorWay: Color,
?BoxGap: float,
?BoxGroupGap: float,
?BoxMode: StyleParam.BoxMode,
?ViolinGap: float,
?ViolinGroupGap: float,
?ViolinMode: StyleParam.ViolinMode,
?WaterfallGap: float,
?WaterfallGroupGap: float,
?WaterfallMode: StyleParam.WaterfallMode,
?FunnelGap: float,
?FunnelGroupGap: float,
?FunnelMode: StyleParam.FunnelMode,
?ExtendFunnelAreaColors: bool,
?FunnelAreaColorWay: Color,
?ExtendSunBurstColors: bool,
?SunBurstColorWay: Color,
?ExtendTreeMapColors: bool,
?TreeMapColorWay: Color,
?ExtendIcicleColors: bool,
?IcicleColorWay: Color,
?Annotations: seq<Annotation>,
?Shapes: seq<Shape>,
?Selections: seq<Selection>,
?Images: seq<LayoutImage>,
?Sliders: seq<Slider>,
?UpdateMenus: seq<UpdateMenu>
) =
(fun (ch: GenericChart) ->
let layout' =
Layout.init (
?Title = Title,
?ShowLegend = ShowLegend,
?Margin = Margin,
?AutoSize = AutoSize,
?Width = Width,
?Height = Height,
?Font = Font,
?UniformText = UniformText,
?Separators = Separators,
?PaperBGColor = PaperBGColor,
?PlotBGColor = PlotBGColor,
?AutoTypeNumbers = AutoTypeNumbers,
?Colorscale = Colorscale,
?Colorway = Colorway,
?ModeBar = ModeBar,
?HoverMode = HoverMode,
?ClickMode = ClickMode,
?DragMode = DragMode,
?SelectDirection = SelectDirection,
?NewSelection = NewSelection,
?ActiveSelection = ActiveSelection,
?HoverDistance = HoverDistance,
0