diff --git a/Plotly.NET.sln b/Plotly.NET.sln index e65c1d305..4c91c96fc 100644 --- a/Plotly.NET.sln +++ b/Plotly.NET.sln @@ -119,6 +119,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{EAE25A1F src\Plotly.NET\Playground.fsx = src\Plotly.NET\Playground.fsx EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plotly.NET.Tests.CSharp", "tests\Plotly.NET.Tests.CSharp\Plotly.NET.Tests.CSharp.csproj", "{C3CEE309-4C3F-4927-B012-220DB37750F6}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Plotly.NET.Tests.FSharpConsole", "tests\Plotly.NET.Tests.FSharpConsole\Plotly.NET.Tests.FSharpConsole.fsproj", "{60114ACE-77E6-4A19-9A2F-CB64084174AF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -150,6 +154,18 @@ Global {6CFC629E-1A0C-4EF3-8495-BA00A356A381}.Dotnet|Any CPU.Build.0 = Debug|Any CPU {6CFC629E-1A0C-4EF3-8495-BA00A356A381}.Release|Any CPU.ActiveCfg = Release|Any CPU {6CFC629E-1A0C-4EF3-8495-BA00A356A381}.Release|Any CPU.Build.0 = Release|Any CPU + {C3CEE309-4C3F-4927-B012-220DB37750F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3CEE309-4C3F-4927-B012-220DB37750F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3CEE309-4C3F-4927-B012-220DB37750F6}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU + {C3CEE309-4C3F-4927-B012-220DB37750F6}.Dotnet|Any CPU.Build.0 = Debug|Any CPU + {C3CEE309-4C3F-4927-B012-220DB37750F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3CEE309-4C3F-4927-B012-220DB37750F6}.Release|Any CPU.Build.0 = Release|Any CPU + {60114ACE-77E6-4A19-9A2F-CB64084174AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60114ACE-77E6-4A19-9A2F-CB64084174AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60114ACE-77E6-4A19-9A2F-CB64084174AF}.Dotnet|Any CPU.ActiveCfg = Debug|Any CPU + {60114ACE-77E6-4A19-9A2F-CB64084174AF}.Dotnet|Any CPU.Build.0 = Debug|Any CPU + {60114ACE-77E6-4A19-9A2F-CB64084174AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60114ACE-77E6-4A19-9A2F-CB64084174AF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -162,6 +178,8 @@ Global {60FB82C0-F472-494E-BCF7-7B3C54212406} = {7B09CC0A-F1E1-4094-9DE4-B047581E01F0} {CDB973F2-0F60-4ADB-84A8-924AFA8B6D49} = {7B09CC0A-F1E1-4094-9DE4-B047581E01F0} {6CFC629E-1A0C-4EF3-8495-BA00A356A381} = {0E87E47E-9EDC-4525-AF72-F0E139D54236} + {C3CEE309-4C3F-4927-B012-220DB37750F6} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8} + {60114ACE-77E6-4A19-9A2F-CB64084174AF} = {EAE25A1F-86FC-426B-803F-1006D1AD06A8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7177F1E1-341C-48AB-9864-6B525FFF7633} diff --git a/docs/1_0_axis-styling.fsx b/docs/1_0_axis-styling.fsx index 7e317c37f..adfda4208 100644 --- a/docs/1_0_axis-styling.fsx +++ b/docs/1_0_axis-styling.fsx @@ -63,8 +63,10 @@ for even more fine-grained control, initialize a new axis and replace the old on The following example creates two mirrored axes with inside ticks, one of them with a log scale: *) +open Plotly.NET.LayoutObjects // this namespace contains all object abstractions for layout styling + let mirroredXAxis = - Axis.LinearAxis.init( + LinearAxis.init( Title = Title.init(Text="Mirrored axis"), ShowLine = true, Mirror = StyleParam.Mirror.AllTicks, @@ -73,7 +75,7 @@ let mirroredXAxis = ) let mirroredLogYAxis = - Axis.LinearAxis.init( + LinearAxis.init( Title = Title.init(Text="Log axis"), AxisType = StyleParam.AxisType.Log, ShowLine = true, diff --git a/docs/1_3_shapes.fsx b/docs/1_3_shapes.fsx index 93098134e..735038745 100644 --- a/docs/1_3_shapes.fsx +++ b/docs/1_3_shapes.fsx @@ -45,6 +45,8 @@ multiple shapes at once. **Attention**: Adding a shape after you added a previous one currently removes the old one. This is a bug and will be fixed *) +open Plotly.NET.LayoutObjects + let s1 = Shape.init (StyleParam.ShapeType.Rectangle,2.,4.,3.,4.,Opacity=0.3,Fillcolor="#d3d3d3") let s2 = Shape.init (StyleParam.ShapeType.Rectangle,5.,7.,3.,4.,Opacity=0.3,Fillcolor="#d3d3d3") diff --git a/docs/1_4_annotations.fsx b/docs/1_4_annotations.fsx index fb16f4991..e1b580b3c 100644 --- a/docs/1_4_annotations.fsx +++ b/docs/1_4_annotations.fsx @@ -46,6 +46,8 @@ multiple annotations at once. **Attention**: Adding an annotation after you added a previous one currently removes the old one. This is a bug and will be fixed *) +open Plotly.NET.LayoutObjects + let a1 = Annotation.init (X=2.,Y=4.,Text = "Hi there!") let a2 = Annotation.init (X=5.,Y=7.,Text="I am another annotation!",BGColor="white",BorderColor="black") diff --git a/docs/3_1_3d-surface-plots.fsx b/docs/3_1_3d-surface-plots.fsx index 3caac124e..f7a324116 100644 --- a/docs/3_1_3d-surface-plots.fsx +++ b/docs/3_1_3d-surface-plots.fsx @@ -73,6 +73,8 @@ let z' = [ [1.;2.;]; ] // column (length y) +open Plotly.NET.TraceObjects + let surface2 = Chart.Surface(z',x',y',Opacity=0.5,Contours=Contours.initXyz(Show=true)) diff --git a/docs/3_2_3d-mesh-plots.fsx b/docs/3_2_3d-mesh-plots.fsx index d45684b84..fe2db8f95 100644 --- a/docs/3_2_3d-mesh-plots.fsx +++ b/docs/3_2_3d-mesh-plots.fsx @@ -62,9 +62,10 @@ let a = Array.init 50 (fun _ -> rnd.NextDouble()) let b = Array.init 50 (fun _ -> rnd.NextDouble()) let c = Array.init 50 (fun _ -> rnd.NextDouble()) +open Plotly.NET.TraceObjects let mesh3d = - Trace3d.initMesh3d + Trace3D.initMesh3d (fun mesh3d -> mesh3d?x <- a mesh3d?y <- b diff --git a/docs/3_4_3d-streamtube-plots.fsx b/docs/3_4_3d-streamtube-plots.fsx index ac01ef418..24ab555da 100644 --- a/docs/3_4_3d-streamtube-plots.fsx +++ b/docs/3_4_3d-streamtube-plots.fsx @@ -38,6 +38,7 @@ open Deedle open FSharp.Data open System open Plotly.NET +open Plotly.NET.TraceObjects let tubeData = Http.RequestString @"https://raw.githubusercontent.com/plotly/datasets/master/streamtube-wind.csv" diff --git a/docs/3_5_3d-volume-plots.fsx b/docs/3_5_3d-volume-plots.fsx index 1a1df3ba8..7f47e5462 100644 --- a/docs/3_5_3d-volume-plots.fsx +++ b/docs/3_5_3d-volume-plots.fsx @@ -62,6 +62,8 @@ let values = sin(x*y*z) / (x*y*z) ) x y z +open Plotly.NET.TraceObjects + let volume = Chart.Volume( x, y, z, values, diff --git a/docs/3_6_3d-isosurface-plots .fsx b/docs/3_6_3d-isosurface-plots .fsx index bc5d98e01..75014a7a1 100644 --- a/docs/3_6_3d-isosurface-plots .fsx +++ b/docs/3_6_3d-isosurface-plots .fsx @@ -62,6 +62,8 @@ let valueIso = x * x * 0.5 + y * y + z * z * 2. ) xIso yIso zIso +open Plotly.NET.TraceObjects + let isoSurface = Chart.IsoSurface( xIso,yIso,zIso,valueIso, diff --git a/docs/4_2_violin-plots.fsx b/docs/4_2_violin-plots.fsx index 63dc52b29..72499f7e9 100644 --- a/docs/4_2_violin-plots.fsx +++ b/docs/4_2_violin-plots.fsx @@ -62,6 +62,8 @@ violin1 |> GenericChart.toChartHTML (** By swapping x and y plus using `StyleParam.Orientation.Horizontal` we can flip the chart horizontaly. *) +open Plotly.NET.TraceObjects + let violin2 = Chart.Violin( y,x, diff --git a/docs/5_0_geo-vs-mapbox.fsx b/docs/5_0_geo-vs-mapbox.fsx index c5a9c6938..371110514 100644 --- a/docs/5_0_geo-vs-mapbox.fsx +++ b/docs/5_0_geo-vs-mapbox.fsx @@ -66,6 +66,7 @@ baseMapOnly |> GenericChart.toChartHTML To control the features of the map, a `Geo` object is used that can be associtaed with a given chart using the `Chart.WithGeo` function. Here is a map with all physical features enabled and styled, at a larger-scale 1:50m resolution: *) +open Plotly.NET.LayoutObjects let myGeo = Geo.init( diff --git a/docs/5_1_geo-plots.fsx b/docs/5_1_geo-plots.fsx index 71086dba7..cbf6e5a10 100644 --- a/docs/5_1_geo-plots.fsx +++ b/docs/5_1_geo-plots.fsx @@ -52,6 +52,8 @@ The simplest type of geo plot is plotting the (lon,lat) pairs of a location via Here is an example using the location of Canadian cities: *) +open Plotly.NET.LayoutObjects + let pointGeo = Chart.PointGeo( lon, diff --git a/docs/5_2_choropleth-map.fsx b/docs/5_2_choropleth-map.fsx index e5057251b..e260e9d62 100644 --- a/docs/5_2_choropleth-map.fsx +++ b/docs/5_2_choropleth-map.fsx @@ -112,6 +112,9 @@ choroplethMap1 |> GenericChart.toChartHTML you can access various map styles via `Chart.withGeoStyle`, such as the projection type, lake/ocean color, and so on. *) + +open Plotly.NET.LayoutObjects + let choroplethMap2 = Chart.ChoroplethMap( locations,z, diff --git a/docs/6_0_geo-vs-mapbox.fsx b/docs/6_0_geo-vs-mapbox.fsx index 58ffefca8..89321d98f 100644 --- a/docs/6_0_geo-vs-mapbox.fsx +++ b/docs/6_0_geo-vs-mapbox.fsx @@ -50,6 +50,7 @@ Mapbox tile maps are composed of various layers, of three different types: a `Mapbox` object where these properties can be set can be initialized via `Mapbox.init`. To use it in a chart, use the `Chart.withMapbox` function: *) open Plotly.NET +open Plotly.NET.LayoutObjects // a simple Mapbox with a OpenStreetMap base layer. let mb = diff --git a/docs/6_1_mapbox-plots.fsx b/docs/6_1_mapbox-plots.fsx index 7ce825b70..2eea6656f 100644 --- a/docs/6_1_mapbox-plots.fsx +++ b/docs/6_1_mapbox-plots.fsx @@ -51,6 +51,7 @@ let lat = [ The simplest type of geographic plot using Mapbox is plotting the (lon,lat) pairs of a location via `Chart.PointMapbox`. Here is an example using the location of Canadian cities: *) +open Plotly.NET.LayoutObjects let pointMapbox = Chart.PointMapbox( diff --git a/docs/6_2_choropleth-mapbox.fsx b/docs/6_2_choropleth-mapbox.fsx index c40bf3f52..e32ad1fa0 100644 --- a/docs/6_2_choropleth-mapbox.fsx +++ b/docs/6_2_choropleth-mapbox.fsx @@ -124,6 +124,7 @@ And finally put together the chart using GeoJSON: *) open Plotly.NET +open Plotly.NET.LayoutObjects let choroplethMapbox = Chart.ChoroplethMapbox( diff --git a/docs/6_3_density-mapbox.fsx b/docs/6_3_density-mapbox.fsx index 6825ad79f..4d7f6e31d 100644 --- a/docs/6_3_density-mapbox.fsx +++ b/docs/6_3_density-mapbox.fsx @@ -50,6 +50,7 @@ let lat= dataDensityMapbox.["Latitude"] |> Series.values let magnitudes = dataDensityMapbox.["Magnitude"] |> Series.values open Plotly.NET +open Plotly.NET.LayoutObjects let densityMapbox = Chart.DensityMapbox( diff --git a/docs/7_0_candlestick.fsx b/docs/7_0_candlestick.fsx index f83c940fb..2e4797b6e 100644 --- a/docs/7_0_candlestick.fsx +++ b/docs/7_0_candlestick.fsx @@ -33,6 +33,8 @@ let's first create some data for the purpose of creating example charts: *) open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects let candles = [|("2020-01-17T13:40:00", 0.68888, 0.68888, 0.68879, 0.6888); diff --git a/docs/7_1_funnel.fsx b/docs/7_1_funnel.fsx index 6b09bc46c..09f3cf997 100644 --- a/docs/7_1_funnel.fsx +++ b/docs/7_1_funnel.fsx @@ -42,6 +42,7 @@ it traversed. See also the [FunnelArea]({{root}}/6_2_funnel_area.html) chart for *) open Plotly.NET +open Plotly.NET.TraceObjects // Customize the connector lines used to connect the funnel bars let connectorLine = Line.init (Color="royalblue", Dash=StyleParam.DrawingStyle.Dot, Width=3.) diff --git a/docs/8_1_polar_bar_charts.fsx b/docs/8_1_polar_bar_charts.fsx index 8c8e49a99..dfc321113 100644 --- a/docs/8_1_polar_bar_charts.fsx +++ b/docs/8_1_polar_bar_charts.fsx @@ -50,7 +50,8 @@ A common use case is the **windrose chart**. A wind rose is a graphic tool used by meteorologists to give a succinct view of how wind speed and direction are typically distributed at a particular location. *) - +open Plotly.NET.LayoutObjects + let windrose1 = [ Chart.BarPolar (r , t, Name="11-14 m/s") @@ -60,7 +61,7 @@ let windrose1 = ] |> Chart.combine |> Chart.withAngularAxis( - Axis.AngularAxis.init( + AngularAxis.init( CategoryOrder = StyleParam.CategoryOrder.Array, CategoryArray = (["East"; "N-E"; "North"; "N-W"; "West"; "S-W"; "South"; "S-E";]) // set the order of the categorical axis ) diff --git a/docs/8_2_styling_polar_layouts.fsx b/docs/8_2_styling_polar_layouts.fsx index f7b69136c..2f455f588 100644 --- a/docs/8_2_styling_polar_layouts.fsx +++ b/docs/8_2_styling_polar_layouts.fsx @@ -66,6 +66,7 @@ combinedPolar |> GenericChart.toChartHTML Use the `Chart.withPolar` function and initialize a Polar layout with the desired looks *) +open Plotly.NET.LayoutObjects let styledPolar = combinedPolar @@ -95,12 +96,12 @@ You could pass these axes to `Chart.withPolar`, but for the case where you want let styledPolar2 = styledPolar |> Chart.withAngularAxis( - Axis.AngularAxis.init( + AngularAxis.init( Color="darkblue" ) ) |> Chart.withRadialAxis( - Axis.RadialAxis.init( + RadialAxis.init( Title = Title.init("Hi, i am the radial axis"), Color="darkblue", SeparateThousands = true diff --git a/docs/9_0_parallel-categories.fsx b/docs/9_0_parallel-categories.fsx index 24d05c47b..e30decad0 100644 --- a/docs/9_0_parallel-categories.fsx +++ b/docs/9_0_parallel-categories.fsx @@ -34,6 +34,7 @@ The parallel categories diagram (also known as parallel sets or alluvial diagram Combinations of category rectangles across dimensions are connected by ribbons, where the height of the ribbon corresponds to the relative frequency of occurrence of the combination of categories in the data set. *) open Plotly.NET +open Plotly.NET.TraceObjects let dims = [ diff --git a/docs/9_1_parallel-coords.fsx b/docs/9_1_parallel-coords.fsx index 41695e1a1..d5b70d83c 100644 --- a/docs/9_1_parallel-coords.fsx +++ b/docs/9_1_parallel-coords.fsx @@ -64,6 +64,8 @@ parcoords1 parcoords1 |> GenericChart.toChartHTML (***include-it-raw***) +open Plotly.NET.TraceObjects + // Dynamic object version let parcoords = let v = [| diff --git a/docs/index.fsx b/docs/index.fsx index 8b2b03fac..94c35fa4f 100644 --- a/docs/index.fsx +++ b/docs/index.fsx @@ -235,15 +235,17 @@ static void Main(string[] args) ### Declarative style in F# using the underlying `DynamicObj`: *) +open Plotly.NET.LayoutObjects + let xAxis = - let tmp = Axis.LinearAxis() + let tmp = LinearAxis() tmp?title <- "xAxis" tmp?showgrid <- false tmp?showline <- true tmp let yAxis = - let tmp = Axis.LinearAxis() + let tmp = LinearAxis() tmp?title <- "yAxis" tmp?showgrid <- false tmp?showline <- true diff --git a/src/Plotly.NET/Axis.fs b/src/Plotly.NET/Axis.fs deleted file mode 100644 index 91848b25a..000000000 --- a/src/Plotly.NET/Axis.fs +++ /dev/null @@ -1,1372 +0,0 @@ -namespace Plotly.NET - -open DynamicObj -open System - -/// Various axes that can be used to add scales to your plots. -module Axis = - - /// Linear axes can be used as x and y scales on 2D plots, and as x,y, and z scales on 3D plots. - type LinearAxis () = - inherit DynamicObj () - - /// - /// Initialize a LinearAxis object that can be used as a positional scale for Y, X or Z coordinates. - /// - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Sets the axis title. - /// Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question. - /// 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. Defaults to layout.autotypenumbers. - /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". - /// If "normal", the range is computed in relation to the extrema of the input data. If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. Applies only to linear axes. - /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. - /// Determines whether or not this axis is zoom-able. If true, then zoom is disabled. - /// If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: "x"}, xaxis2: {scaleanchor: "y"}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: "x"}, xaxis: {scaleanchor: "y"}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. - /// If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal. - /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the "range", or by decreasing the "domain". Default is "domain" for axes containing image traces, "range" otherwise. - /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are "left", "center" (default), and "right" for x axes, and "top", "middle" (default), and "bottom" for y axes. - /// If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`. - /// Sets breaks in the axis range - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Determines where ticks and grid lines are drawn with respect to their corresponding tick labels. Only has an effect for axes of `type` "category" or "multicategory". When set to "boundaries", ticks and grid lines are drawn half a category to the left/bottom of labels. - /// Determines where tick labels are drawn with respect to their corresponding ticks and grid lines. Only has an effect for axes of `type` "date" When set to "period", tick labels are drawn in the middle of the period between ticks. - /// Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when `ticklabelmode` is set to "period". Similarly left or right has no effect on y axes or when `ticklabelmode` is set to "period". Has no effect on "multicategory" axes or when `tickson` is set to "boundaries". When used on axes linked by `matches` or `scaleanchor`, no extra padding for inside labels would be added by autorange, so that the scales could match. - /// 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". Otherwise on "category" and "multicategory" axes the default is "allow". In other cases the default is "hide past div". - /// Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored. If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// Determines whether long tick labels automatically grow the figure margins. - /// Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest - /// Sets the spike color. If undefined, will use the series color - /// Sets the width (in px) of the zero line. - /// Sets the dash style of lines - /// Determines the drawing mode for the spike line If "toaxis", the line is drawn from the data point to the axis the series is plotted on. If "across", the line is drawn across the entire plot area, and supercedes "toaxis". If "marker", then a marker dot is drawn on the axis the series is plotted on - /// Determines whether spikelines are stuck to the cursor or to the closest datapoints. - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines. - /// Sets the line color of the zero line. - /// Sets the width (in px) of the zero line. - /// Determines whether or not a dividers are drawn between the category levels of this axis. Only has an effect on "multicategory" axes. - /// Sets the color of the dividers Only has an effect on "multicategory" axes. - /// Sets the width (in px) of the dividers Only has an effect on "multicategory" axes. - /// If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`. - /// Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area. - /// If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible. - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - /// Sets the domain of this axis (in plot fraction). - /// Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free". - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Controls persistence of user-driven changes in axis `range`, `autorange`, and `title` if in `editable: true` configuration. Defaults to `layout.uirevision`. - /// Sets a range slider for this axis - /// Sets a range selector for this axis. This object contains toggable presets for the rangeslider. - /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` - static member init - ( - ?Visible : bool, - ?Color : string, - ?Title : Title, - ?AxisType : StyleParam.AxisType, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?AutoRange : StyleParam.AutoRange, - ?RangeMode : StyleParam.RangeMode, - ?Range : StyleParam.Range, - ?FixedRange : bool, - ?ScaleAnchor : StyleParam.LinearAxisId, - ?ScaleRatio : float, - ?Constrain : StyleParam.AxisConstraint, - ?ConstrainToward : StyleParam.AxisConstraintDirection, - ?Matches : StyleParam.LinearAxisId, - ?Rangebreaks : seq, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TicksOn : StyleParam.CategoryTickAnchor, - ?TickLabelMode : StyleParam.TickLabelMode, - ?TickLabelPosition : StyleParam.TickLabelPosition, - ?TickLabelOverflow : StyleParam.TickLabelOverflow, - ?Mirror : StyleParam.Mirror, - ?TickLen : float, - ?TickWidth : float, - ?TickColor : string, - ?ShowTickLabels : bool, - ?AutoMargin : bool, - ?ShowSpikes : bool, - ?SpikeColor : string, - ?SpikeThickness : int, - ?SpikeDash : StyleParam.DrawingStyle, - ?SpikeMode : StyleParam.SpikeMode, - ?SpikeSnap : StyleParam.SpikeSnap, - ?TickFont : Font, - ?TickAngle : int, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFormat : string, - ?TickFormatStops : seq, - ?HoverFormat : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : float, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : float, - ?ZeroLine : bool, - ?ZeroLineColor : string, - ?ZeroLineWidth : float, - ?ShowDividers : bool, - ?DividerColor : string, - ?DividerWidth : int, - ?Anchor : StyleParam.LinearAxisId, - ?Side : StyleParam.Side, - ?Overlaying : StyleParam.LinearAxisId, - ?Layer : StyleParam.Layer, - ?Domain : StyleParam.Range, - ?Position : float, - ?CategoryOrder : StyleParam.CategoryOrder, - ?CategoryArray : seq<#IConvertible>, - ?UIRevision : #IConvertible, - ?RangeSlider : RangeSlider, - ?RangeSelector : RangeSelector, - ?Calendar : StyleParam.Calendar - - ) = - LinearAxis() - |> LinearAxis.style - ( - ?Visible = Visible , - ?Color = Color , - ?Title = Title , - ?AxisType = AxisType , - ?AutoTypeNumbers = AutoTypeNumbers , - ?AutoRange = AutoRange , - ?RangeMode = RangeMode , - ?Range = Range , - ?FixedRange = FixedRange , - ?ScaleAnchor = ScaleAnchor , - ?ScaleRatio = ScaleRatio , - ?Constrain = Constrain , - ?ConstrainToward = ConstrainToward , - ?Matches = Matches , - ?Rangebreaks = Rangebreaks , - ?TickMode = TickMode , - ?NTicks = NTicks , - ?Tick0 = Tick0 , - ?DTick = DTick , - ?TickVals = TickVals , - ?TickText = TickText , - ?Ticks = Ticks , - ?TicksOn = TicksOn , - ?TickLabelMode = TickLabelMode , - ?TickLabelPosition = TickLabelPosition , - ?TickLabelOverflow = TickLabelOverflow , - ?Mirror = Mirror , - ?TickLen = TickLen , - ?TickWidth = TickWidth , - ?TickColor = TickColor , - ?ShowTickLabels = ShowTickLabels , - ?AutoMargin = AutoMargin , - ?ShowSpikes = ShowSpikes , - ?SpikeColor = SpikeColor , - ?SpikeThickness = SpikeThickness , - ?SpikeDash = SpikeDash , - ?SpikeMode = SpikeMode , - ?SpikeSnap = SpikeSnap , - ?TickFont = TickFont , - ?TickAngle = TickAngle , - ?ShowTickPrefix = ShowTickPrefix , - ?TickPrefix = TickPrefix , - ?ShowTickSuffix = ShowTickSuffix , - ?TickSuffix = TickSuffix , - ?ShowExponent = ShowExponent , - ?ExponentFormat = ExponentFormat , - ?MinExponent = MinExponent , - ?SeparateThousands = SeparateThousands , - ?TickFormat = TickFormat , - ?TickFormatStops = TickFormatStops , - ?HoverFormat = HoverFormat , - ?ShowLine = ShowLine , - ?LineColor = LineColor , - ?LineWidth = LineWidth , - ?ShowGrid = ShowGrid , - ?GridColor = GridColor , - ?GridWidth = GridWidth , - ?ZeroLine = ZeroLine , - ?ZeroLineColor = ZeroLineColor , - ?ZeroLineWidth = ZeroLineWidth , - ?ShowDividers = ShowDividers , - ?DividerColor = DividerColor , - ?DividerWidth = DividerWidth , - ?Anchor = Anchor , - ?Side = Side , - ?Overlaying = Overlaying , - ?Layer = Layer , - ?Domain = Domain , - ?Position = Position , - ?CategoryOrder = CategoryOrder , - ?CategoryArray = CategoryArray , - ?UIRevision = UIRevision , - ?RangeSlider = RangeSlider , - ?RangeSelector = RangeSelector , - ?Calendar = Calendar - ) - - /// - /// Initialize a categorical LinearAxis object that can be used as a positional scale for Y, X or Z coordinates. - /// - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Sets the axis title. - /// 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. Defaults to layout.autotypenumbers. - /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". - /// If "normal", the range is computed in relation to the extrema of the input data. If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. Applies only to linear axes. - /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. - /// Determines whether or not this axis is zoom-able. If true, then zoom is disabled. - /// If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: "x"}, xaxis2: {scaleanchor: "y"}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: "x"}, xaxis: {scaleanchor: "y"}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. - /// If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal. - /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the "range", or by decreasing the "domain". Default is "domain" for axes containing image traces, "range" otherwise. - /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are "left", "center" (default), and "right" for x axes, and "top", "middle" (default), and "bottom" for y axes. - /// If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`. - /// Sets breaks in the axis range - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Determines where ticks and grid lines are drawn with respect to their corresponding tick labels. Only has an effect for axes of `type` "category" or "multicategory". When set to "boundaries", ticks and grid lines are drawn half a category to the left/bottom of labels. - /// Determines where tick labels are drawn with respect to their corresponding ticks and grid lines. Only has an effect for axes of `type` "date" When set to "period", tick labels are drawn in the middle of the period between ticks. - /// Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when `ticklabelmode` is set to "period". Similarly left or right has no effect on y axes or when `ticklabelmode` is set to "period". Has no effect on "multicategory" axes or when `tickson` is set to "boundaries". When used on axes linked by `matches` or `scaleanchor`, no extra padding for inside labels would be added by autorange, so that the scales could match. - /// 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". Otherwise on "category" and "multicategory" axes the default is "allow". In other cases the default is "hide past div". - /// Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored. If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// Determines whether long tick labels automatically grow the figure margins. - /// Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest - /// Sets the spike color. If undefined, will use the series color - /// Sets the width (in px) of the zero line. - /// Sets the dash style of lines - /// Determines the drawing mode for the spike line If "toaxis", the line is drawn from the data point to the axis the series is plotted on. If "across", the line is drawn across the entire plot area, and supercedes "toaxis". If "marker", then a marker dot is drawn on the axis the series is plotted on - /// Determines whether spikelines are stuck to the cursor or to the closest datapoints. - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines. - /// Sets the line color of the zero line. - /// Sets the width (in px) of the zero line. - /// Determines whether or not a dividers are drawn between the category levels of this axis. Only has an effect on "multicategory" axes. - /// Sets the color of the dividers Only has an effect on "multicategory" axes. - /// Sets the width (in px) of the dividers Only has an effect on "multicategory" axes. - /// If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`. - /// Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area. - /// If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible. - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - /// Sets the domain of this axis (in plot fraction). - /// Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free". - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Controls persistence of user-driven changes in axis `range`, `autorange`, and `title` if in `editable: true` configuration. Defaults to `layout.uirevision`. - /// Sets a range slider for this axis - /// Sets a range selector for this axis. This object contains toggable presets for the rangeslider. - /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` - static member initCategorical - ( - categoryOrder : StyleParam.CategoryOrder, - ?Visible : bool, - ?Color : string, - ?Title : Title, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?AutoRange : StyleParam.AutoRange, - ?RangeMode : StyleParam.RangeMode, - ?Range : StyleParam.Range, - ?FixedRange : bool, - ?ScaleAnchor : StyleParam.LinearAxisId, - ?ScaleRatio : float, - ?Constrain : StyleParam.AxisConstraint, - ?ConstrainToward : StyleParam.AxisConstraintDirection, - ?Matches : StyleParam.LinearAxisId, - ?Rangebreaks : seq, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TicksOn : StyleParam.CategoryTickAnchor, - ?TickLabelMode : StyleParam.TickLabelMode, - ?TickLabelPosition : StyleParam.TickLabelPosition, - ?TickLabelOverflow : StyleParam.TickLabelOverflow, - ?Mirror : StyleParam.Mirror, - ?TickLen : float, - ?TickWidth : float, - ?TickColor : string, - ?ShowTickLabels : bool, - ?AutoMargin : bool, - ?ShowSpikes : bool, - ?SpikeColor : string, - ?SpikeThickness : int, - ?SpikeDash : StyleParam.DrawingStyle, - ?SpikeMode : StyleParam.SpikeMode, - ?SpikeSnap : StyleParam.SpikeSnap, - ?TickFont : Font, - ?TickAngle : int, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFormat : string, - ?TickFormatStops : seq, - ?HoverFormat : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : float, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : float, - ?ZeroLine : bool, - ?ZeroLineColor : string, - ?ZeroLineWidth : float, - ?ShowDividers : bool, - ?DividerColor : string, - ?DividerWidth : int, - ?Anchor : StyleParam.LinearAxisId, - ?Side : StyleParam.Side, - ?Overlaying : StyleParam.LinearAxisId, - ?Layer : StyleParam.Layer, - ?Domain : StyleParam.Range, - ?Position : float, - ?CategoryArray : seq<#IConvertible>, - ?UIRevision : #IConvertible, - ?RangeSlider : RangeSlider, - ?RangeSelector : RangeSelector, - ?Calendar : StyleParam.Calendar - ) = - LinearAxis() - |> LinearAxis.style - ( - CategoryOrder = categoryOrder, - AxisType = StyleParam.AxisType.Category, - ?Visible = Visible , - ?Color = Color , - ?Title = Title , - ?AutoTypeNumbers = AutoTypeNumbers , - ?AutoRange = AutoRange , - ?RangeMode = RangeMode , - ?Range = Range , - ?FixedRange = FixedRange , - ?ScaleAnchor = ScaleAnchor , - ?ScaleRatio = ScaleRatio , - ?Constrain = Constrain , - ?ConstrainToward = ConstrainToward , - ?Matches = Matches , - ?Rangebreaks = Rangebreaks , - ?TickMode = TickMode , - ?NTicks = NTicks , - ?Tick0 = Tick0 , - ?DTick = DTick , - ?TickVals = TickVals , - ?TickText = TickText , - ?Ticks = Ticks , - ?TicksOn = TicksOn , - ?TickLabelMode = TickLabelMode , - ?TickLabelPosition = TickLabelPosition , - ?TickLabelOverflow = TickLabelOverflow , - ?Mirror = Mirror , - ?TickLen = TickLen , - ?TickWidth = TickWidth , - ?TickColor = TickColor , - ?ShowTickLabels = ShowTickLabels , - ?AutoMargin = AutoMargin , - ?ShowSpikes = ShowSpikes , - ?SpikeColor = SpikeColor , - ?SpikeThickness = SpikeThickness , - ?SpikeDash = SpikeDash , - ?SpikeMode = SpikeMode , - ?SpikeSnap = SpikeSnap , - ?TickFont = TickFont , - ?TickAngle = TickAngle , - ?ShowTickPrefix = ShowTickPrefix , - ?TickPrefix = TickPrefix , - ?ShowTickSuffix = ShowTickSuffix , - ?TickSuffix = TickSuffix , - ?ShowExponent = ShowExponent , - ?ExponentFormat = ExponentFormat , - ?MinExponent = MinExponent , - ?SeparateThousands = SeparateThousands , - ?TickFormat = TickFormat , - ?TickFormatStops = TickFormatStops , - ?HoverFormat = HoverFormat , - ?ShowLine = ShowLine , - ?LineColor = LineColor , - ?LineWidth = LineWidth , - ?ShowGrid = ShowGrid , - ?GridColor = GridColor , - ?GridWidth = GridWidth , - ?ZeroLine = ZeroLine , - ?ZeroLineColor = ZeroLineColor , - ?ZeroLineWidth = ZeroLineWidth , - ?ShowDividers = ShowDividers , - ?DividerColor = DividerColor , - ?DividerWidth = DividerWidth , - ?Anchor = Anchor , - ?Side = Side , - ?Overlaying = Overlaying , - ?Layer = Layer , - ?Domain = Domain , - ?Position = Position , - ?CategoryArray = CategoryArray , - ?UIRevision = UIRevision , - ?RangeSlider = RangeSlider , - ?RangeSelector = RangeSelector , - ?Calendar = Calendar - ) - - /// - /// Create a function that applies the given style parameters to a LinearAxis object - /// - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Sets the axis title. - /// Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question. - /// 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. Defaults to layout.autotypenumbers. - /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". - /// If "normal", the range is computed in relation to the extrema of the input data. If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. Applies only to linear axes. - /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. - /// Determines whether or not this axis is zoom-able. If true, then zoom is disabled. - /// If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: "x"}, xaxis2: {scaleanchor: "y"}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: "x"}, xaxis: {scaleanchor: "y"}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. - /// If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal. - /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the "range", or by decreasing the "domain". Default is "domain" for axes containing image traces, "range" otherwise. - /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are "left", "center" (default), and "right" for x axes, and "top", "middle" (default), and "bottom" for y axes. - /// If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`. - /// Sets breaks in the axis range - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Determines where ticks and grid lines are drawn with respect to their corresponding tick labels. Only has an effect for axes of `type` "category" or "multicategory". When set to "boundaries", ticks and grid lines are drawn half a category to the left/bottom of labels. - /// Determines where tick labels are drawn with respect to their corresponding ticks and grid lines. Only has an effect for axes of `type` "date" When set to "period", tick labels are drawn in the middle of the period between ticks. - /// Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when `ticklabelmode` is set to "period". Similarly left or right has no effect on y axes or when `ticklabelmode` is set to "period". Has no effect on "multicategory" axes or when `tickson` is set to "boundaries". When used on axes linked by `matches` or `scaleanchor`, no extra padding for inside labels would be added by autorange, so that the scales could match. - /// 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". Otherwise on "category" and "multicategory" axes the default is "allow". In other cases the default is "hide past div". - /// Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored. If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// Determines whether long tick labels automatically grow the figure margins. - /// Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest - /// Sets the spike color. If undefined, will use the series color - /// Sets the width (in px) of the zero line. - /// Sets the dash style of lines - /// Determines the drawing mode for the spike line If "toaxis", the line is drawn from the data point to the axis the series is plotted on. If "across", the line is drawn across the entire plot area, and supercedes "toaxis". If "marker", then a marker dot is drawn on the axis the series is plotted on - /// Determines whether spikelines are stuck to the cursor or to the closest datapoints. - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines. - /// Sets the line color of the zero line. - /// Sets the width (in px) of the zero line. - /// Determines whether or not a dividers are drawn between the category levels of this axis. Only has an effect on "multicategory" axes. - /// Sets the color of the dividers Only has an effect on "multicategory" axes. - /// Sets the width (in px) of the dividers Only has an effect on "multicategory" axes. - /// If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`. - /// Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area. - /// If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible. - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - /// Sets the domain of this axis (in plot fraction). - /// Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free". - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Controls persistence of user-driven changes in axis `range`, `autorange`, and `title` if in `editable: true` configuration. Defaults to `layout.uirevision`. - /// Sets a range slider for this axis - /// Sets a range selector for this axis. This object contains toggable presets for the rangeslider. - /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` - static member style - ( - ?Visible : bool, - ?Color : string, - ?Title : Title, - ?AxisType : StyleParam.AxisType, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?AutoRange : StyleParam.AutoRange, - ?RangeMode : StyleParam.RangeMode, - ?Range : StyleParam.Range, - ?FixedRange : bool, - ?ScaleAnchor : StyleParam.LinearAxisId, - ?ScaleRatio : float, - ?Constrain : StyleParam.AxisConstraint, - ?ConstrainToward : StyleParam.AxisConstraintDirection, - ?Matches : StyleParam.LinearAxisId, - ?Rangebreaks : seq, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TicksOn : StyleParam.CategoryTickAnchor, - ?TickLabelMode : StyleParam.TickLabelMode, - ?TickLabelPosition : StyleParam.TickLabelPosition, - ?TickLabelOverflow : StyleParam.TickLabelOverflow, - ?Mirror : StyleParam.Mirror, - ?TickLen : float, - ?TickWidth : float, - ?TickColor : string, - ?ShowTickLabels : bool, - ?AutoMargin : bool, - ?ShowSpikes : bool, - ?SpikeColor : string, - ?SpikeThickness : int, - ?SpikeDash : StyleParam.DrawingStyle, - ?SpikeMode : StyleParam.SpikeMode, - ?SpikeSnap : StyleParam.SpikeSnap, - ?TickFont : Font, - ?TickAngle : int, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFormat : string, - ?TickFormatStops : seq, - ?HoverFormat : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : float, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : float, - ?ZeroLine : bool, - ?ZeroLineColor : string, - ?ZeroLineWidth : float, - ?ShowDividers : bool, - ?DividerColor : string, - ?DividerWidth : int, - ?Anchor : StyleParam.LinearAxisId, - ?Side : StyleParam.Side, - ?Overlaying : StyleParam.LinearAxisId, - ?Layer : StyleParam.Layer, - ?Domain : StyleParam.Range, - ?Position : float, - ?CategoryOrder : StyleParam.CategoryOrder, - ?CategoryArray : seq<#IConvertible>, - ?UIRevision : #IConvertible, - ?RangeSlider : RangeSlider, - ?RangeSelector : RangeSelector, - ?Calendar : StyleParam.Calendar - ) = - (fun (axis:LinearAxis) -> - - Visible |> DynObj.setValueOpt axis "visible" - Color |> DynObj.setValueOpt axis "color" - Title |> DynObj.setValueOpt axis "title" - AxisType |> DynObj.setValueOptBy axis "axistype" StyleParam.AxisType.convert - AutoTypeNumbers |> DynObj.setValueOptBy axis "autotypenumbers" StyleParam.AutoTypeNumbers.convert - AutoRange |> DynObj.setValueOptBy axis "autorange" StyleParam.AutoRange.convert - RangeMode |> DynObj.setValueOptBy axis "rangemode" StyleParam.RangeMode.convert - Range |> DynObj.setValueOptBy axis "range" StyleParam.Range.convert - FixedRange |> DynObj.setValueOpt axis "fixedrange" - ScaleAnchor |> DynObj.setValueOptBy axis "scaleanchor" StyleParam.LinearAxisId.convert - ScaleRatio |> DynObj.setValueOpt axis "scaleratio" - Constrain |> DynObj.setValueOptBy axis "constrain" StyleParam.AxisConstraint.convert - ConstrainToward |> DynObj.setValueOptBy axis "constraitoward" StyleParam.AxisConstraintDirection.convert - Matches |> DynObj.setValueOptBy axis "matches" StyleParam.LinearAxisId.convert - Rangebreaks |> DynObj.setValueOpt axis "rangebreaks" - TickMode |> DynObj.setValueOptBy axis "tickmode" StyleParam.TickMode.convert - NTicks |> DynObj.setValueOpt axis "nticks" - Tick0 |> DynObj.setValueOpt axis "tick0" - DTick |> DynObj.setValueOpt axis "dtick" - TickVals |> DynObj.setValueOpt axis "tickvals" - TickText |> DynObj.setValueOpt axis "ticktext" - Ticks |> DynObj.setValueOptBy axis "ticks" StyleParam.TickOptions.convert - TicksOn |> DynObj.setValueOptBy axis "tickson" StyleParam.CategoryTickAnchor.convert - TickLabelMode |> DynObj.setValueOptBy axis "ticklabelmode" StyleParam.TickLabelMode.convert - TickLabelPosition |> DynObj.setValueOptBy axis "ticklabelposition" StyleParam.TickLabelPosition.convert - TickLabelOverflow |> DynObj.setValueOptBy axis "ticklabeloverflow" StyleParam.TickLabelOverflow.convert - Mirror |> DynObj.setValueOptBy axis "mirror" StyleParam.Mirror.convert - TickLen |> DynObj.setValueOpt axis "ticklen" - TickWidth |> DynObj.setValueOpt axis "tickwidth" - TickColor |> DynObj.setValueOpt axis "tickcolor" - ShowTickLabels |> DynObj.setValueOpt axis "showticklabels" - AutoMargin |> DynObj.setValueOpt axis "automargin" - ShowSpikes |> DynObj.setValueOpt axis "showspikes" - SpikeColor |> DynObj.setValueOpt axis "spikecolor" - SpikeThickness |> DynObj.setValueOpt axis "spikethickness" - SpikeDash |> DynObj.setValueOptBy axis "spikedash" StyleParam.DrawingStyle.convert - SpikeMode |> DynObj.setValueOptBy axis "spikemode" StyleParam.SpikeMode.convert - SpikeSnap |> DynObj.setValueOptBy axis "spikesnap" StyleParam.SpikeSnap.convert - TickFont |> DynObj.setValueOpt axis "tickfont" - TickAngle |> DynObj.setValueOpt axis "tickangle" - ShowTickPrefix |> DynObj.setValueOptBy axis "showtickprefix" StyleParam.ShowTickOption.convert - TickPrefix |> DynObj.setValueOpt axis "tickprefix" - ShowTickSuffix |> DynObj.setValueOptBy axis "showticksuffix" StyleParam.ShowTickOption.convert - TickSuffix |> DynObj.setValueOpt axis "ticksuffix" - ShowExponent |> DynObj.setValueOptBy axis "showexponent" StyleParam.ShowExponent.convert - ExponentFormat |> DynObj.setValueOptBy axis "exponentformat" StyleParam.ExponentFormat.convert - MinExponent |> DynObj.setValueOpt axis "minexponent" - SeparateThousands |> DynObj.setValueOpt axis "separatethousands" - TickFormat |> DynObj.setValueOpt axis "tickformat" - TickFormatStops |> DynObj.setValueOpt axis "tickformatstops" - HoverFormat |> DynObj.setValueOpt axis "hoverformat" - ShowLine |> DynObj.setValueOpt axis "showline" - LineColor |> DynObj.setValueOpt axis "linecolor" - LineWidth |> DynObj.setValueOpt axis "linewidth" - ShowGrid |> DynObj.setValueOpt axis "showgrid" - GridColor |> DynObj.setValueOpt axis "gridcolor" - GridWidth |> DynObj.setValueOpt axis "gridwidth" - ZeroLine |> DynObj.setValueOpt axis "zeroline" - ZeroLineColor |> DynObj.setValueOpt axis "zerolinecolor" - ZeroLineWidth |> DynObj.setValueOpt axis "zerolinewidth" - ShowDividers |> DynObj.setValueOpt axis "showdividers" - DividerColor |> DynObj.setValueOpt axis "dividercolor" - DividerWidth |> DynObj.setValueOpt axis "dividerwidth" - Anchor |> DynObj.setValueOptBy axis "anchor" StyleParam.LinearAxisId.convert - Side |> DynObj.setValueOptBy axis "side" StyleParam.Side.convert - Overlaying |> DynObj.setValueOptBy axis "overlaying" StyleParam.LinearAxisId.convert - Layer |> DynObj.setValueOptBy axis "layer" StyleParam.Layer.convert - Domain |> DynObj.setValueOptBy axis "domain" StyleParam.Range.convert - Position |> DynObj.setValueOpt axis "position" - CategoryOrder |> DynObj.setValueOptBy axis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt axis "categoryarray" - UIRevision |> DynObj.setValueOpt axis "uirevision" - RangeSlider |> DynObj.setValueOpt axis "rangeslider" - RangeSelector |> DynObj.setValueOpt axis "rangeselector" - Calendar |> DynObj.setValueOptBy axis "calendar" StyleParam.Calendar.convert - - axis - ) - - /// Radial axes can be used as a scale for the radial coordinates in polar plots. - type RadialAxis () = - inherit DynamicObj () - - /// - /// Initialize an AngularAxis object that can be used as a angular scale for polar coordinates. - /// - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. - /// 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. Defaults to layout.autotypenumbers. - /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". - /// If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. If "normal", the range is computed in relation to the extrema of the input data (same behavior as for cartesian axes). - /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Sets the angle (in degrees) from which the radial axis is drawn. Note that by default, radial axis line on the theta=0 line corresponds to a line pointing right (like what mathematicians prefer). Defaults to the first `polar.sector` angle. - /// Determines on which side of radial axis line the tick and tick labels appear. - /// Sets the title of the Radial Axis. - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` - static member init - ( - ?Visible : bool, - ?AxisType : StyleParam.AxisType, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?AutoRange : StyleParam.AutoRange, - ?RangeMode : StyleParam.RangeMode, - ?Range : StyleParam.Range, - ?CategoryOrder : StyleParam.CategoryOrder, - ?CategoryArray : seq<#IConvertible>, - ?Angle : float, - ?Side : StyleParam.Direction, - ?Title : Title, - ?HoverFormat : string, - ?UIRevision : #IConvertible, - ?Color : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : int, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : int, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TickLen : int, - ?TickWidth : int, - ?TickColor : string, - ?ShowTickLabels : bool, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFont : Font, - ?TickAngle : int, - ?TickFormat : string, - ?TickFormatStops : seq, - ?Layer : StyleParam.Layer, - ?Calendar : StyleParam.Calendar - ) = - RadialAxis() - |> RadialAxis.style - ( - ?Visible = Visible , - ?AxisType = AxisType , - ?AutoTypeNumbers = AutoTypeNumbers , - ?AutoRange = AutoRange , - ?RangeMode = RangeMode , - ?Range = Range , - ?CategoryOrder = CategoryOrder , - ?CategoryArray = CategoryArray , - ?Angle = Angle , - ?Side = Side , - ?Title = Title , - ?HoverFormat = HoverFormat , - ?UIRevision = UIRevision , - ?Color = Color , - ?ShowLine = ShowLine , - ?LineColor = LineColor , - ?LineWidth = LineWidth , - ?ShowGrid = ShowGrid , - ?GridColor = GridColor , - ?GridWidth = GridWidth , - ?TickMode = TickMode , - ?NTicks = NTicks , - ?Tick0 = Tick0 , - ?DTick = DTick , - ?TickVals = TickVals , - ?TickText = TickText , - ?Ticks = Ticks , - ?TickLen = TickLen , - ?TickWidth = TickWidth , - ?TickColor = TickColor , - ?ShowTickLabels = ShowTickLabels , - ?ShowTickPrefix = ShowTickPrefix , - ?TickPrefix = TickPrefix , - ?ShowTickSuffix = ShowTickSuffix , - ?TickSuffix = TickSuffix , - ?ShowExponent = ShowExponent , - ?ExponentFormat = ExponentFormat , - ?MinExponent = MinExponent , - ?SeparateThousands = SeparateThousands , - ?TickFont = TickFont , - ?TickAngle = TickAngle , - ?TickFormat = TickFormat , - ?TickFormatStops = TickFormatStops , - ?Layer = Layer , - ?Calendar = Calendar - ) - - /// - /// Creates a function that applies the given style parameters to a RadialAxis object - /// - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. - /// 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. Defaults to layout.autotypenumbers. - /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". - /// If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. If "normal", the range is computed in relation to the extrema of the input data (same behavior as for cartesian axes). - /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Sets the angle (in degrees) from which the radial axis is drawn. Note that by default, radial axis line on the theta=0 line corresponds to a line pointing right (like what mathematicians prefer). Defaults to the first `polar.sector` angle. - /// Determines on which side of radial axis line the tick and tick labels appear. - /// Sets the title of the Radial Axis. - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` - static member style - ( - ?Visible : bool, - ?AxisType : StyleParam.AxisType, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?AutoRange : StyleParam.AutoRange, - ?RangeMode : StyleParam.RangeMode, - ?Range : StyleParam.Range, - ?CategoryOrder : StyleParam.CategoryOrder, - ?CategoryArray : seq<#IConvertible>, - ?Angle : float, - ?Side : StyleParam.Direction, - ?Title : Title, - ?HoverFormat : string, - ?UIRevision : #IConvertible, - ?Color : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : int, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : int, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TickLen : int, - ?TickWidth : int, - ?TickColor : string, - ?ShowTickLabels : bool, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFont : Font, - ?TickAngle : int, - ?TickFormat : string, - ?TickFormatStops : seq, - ?Layer : StyleParam.Layer, - ?Calendar : StyleParam.Calendar - ) = - fun (radialAxis:RadialAxis) -> - - Visible |> DynObj.setValueOpt radialAxis "visible" - AxisType |> DynObj.setValueOptBy radialAxis "type" StyleParam.AxisType.convert - AutoTypeNumbers |> DynObj.setValueOptBy radialAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert - AutoRange |> DynObj.setValueOptBy radialAxis "autorange" StyleParam.AutoRange.convert - RangeMode |> DynObj.setValueOptBy radialAxis "rangemode" StyleParam.RangeMode.convert - Range |> DynObj.setValueOptBy radialAxis "range" StyleParam.Range.convert - CategoryOrder |> DynObj.setValueOptBy radialAxis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt radialAxis "categoryarray" - Angle |> DynObj.setValueOpt radialAxis "angle" - Side |> DynObj.setValueOptBy radialAxis "side" StyleParam.Direction.convert - Title |> DynObj.setValueOpt radialAxis "title" - HoverFormat |> DynObj.setValueOpt radialAxis "hoverformat" - UIRevision |> DynObj.setValueOpt radialAxis "uirevision" - Color |> DynObj.setValueOpt radialAxis "color" - ShowLine |> DynObj.setValueOpt radialAxis "showline" - LineColor |> DynObj.setValueOpt radialAxis "linecolor" - LineWidth |> DynObj.setValueOpt radialAxis "linewidth" - ShowGrid |> DynObj.setValueOpt radialAxis "showgrid" - GridColor |> DynObj.setValueOpt radialAxis "gridcolor" - GridWidth |> DynObj.setValueOpt radialAxis "gridwidth" - TickMode |> DynObj.setValueOptBy radialAxis "tickmode" StyleParam.TickMode.convert - NTicks |> DynObj.setValueOpt radialAxis "nticks" - Tick0 |> DynObj.setValueOpt radialAxis "tick0" - DTick |> DynObj.setValueOpt radialAxis "dtick" - TickVals |> DynObj.setValueOpt radialAxis "TickVals" - TickText |> DynObj.setValueOpt radialAxis "TickText" - Ticks |> DynObj.setValueOptBy radialAxis "ticks" StyleParam.TickOptions.convert - TickLen |> DynObj.setValueOpt radialAxis "ticklen" - TickWidth |> DynObj.setValueOpt radialAxis "tickwidth" - TickColor |> DynObj.setValueOpt radialAxis "tickcolor" - ShowTickLabels |> DynObj.setValueOpt radialAxis "showticklabels" - ShowTickPrefix |> DynObj.setValueOptBy radialAxis "showtickprefix" StyleParam.ShowTickOption.convert - TickPrefix |> DynObj.setValueOpt radialAxis "tickprefix" - ShowTickSuffix |> DynObj.setValueOptBy radialAxis "showticksuffix" StyleParam.ShowTickOption.convert - TickSuffix |> DynObj.setValueOpt radialAxis "ticksuffix" - ShowExponent |> DynObj.setValueOptBy radialAxis "showexponent" StyleParam.ShowExponent.convert - ExponentFormat |> DynObj.setValueOptBy radialAxis "exponentformat" StyleParam.ExponentFormat.convert - MinExponent |> DynObj.setValueOpt radialAxis "minexponent" - SeparateThousands |> DynObj.setValueOpt radialAxis "separatethousands" - TickFont |> DynObj.setValueOpt radialAxis "tickfont" - TickAngle |> DynObj.setValueOpt radialAxis "tickangle" - TickFormat |> DynObj.setValueOpt radialAxis "TickFormat" - TickFormatStops |> DynObj.setValueOpt radialAxis "tickformatstops" - Layer |> DynObj.setValueOptBy radialAxis "layer" StyleParam.Layer.convert - Calendar |> DynObj.setValueOptBy radialAxis "calendar" StyleParam.Calendar.convert - - radialAxis - - /// Angular axes can be used as a scale for the angular coordinates in polar plots. - type AngularAxis () = - inherit DynamicObj () - - /// - /// Initialize an AngularAxis object that can be used as a angular scale for polar coordinates. - /// - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. - /// 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. Defaults to layout.autotypenumbers. - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Sets the format unit of the formatted "theta" values. Has an effect only when `angularaxis.type` is "linear". - /// Set the angular period. Has an effect only when `angularaxis.type` is "category". - /// Sets the direction corresponding to positive angles. - /// Sets that start position (in degrees) of the angular axis By default, polar subplots with `direction` set to "counterclockwise" get a `rotation` of "0" which corresponds to due East (like what mathematicians prefer). In turn, polar with `direction` set to "clockwise" get a rotation of "90" which corresponds to due North (like on a compass), - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - static member init - ( - ?Visible : bool, - ?AxisType : StyleParam.AxisType, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?CategoryOrder : StyleParam.CategoryOrder, - ?CategoryArray : seq<#IConvertible>, - ?ThetaUnit : StyleParam.AngularUnit, - ?Period : float, - ?Direction : StyleParam.Direction, - ?Rotation : int, - ?HoverFormat : string, - ?UIRevision : #IConvertible, - ?Color : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : int, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : int, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TickLen : int, - ?TickWidth : int, - ?TickColor : string, - ?ShowTickLabels : bool, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFont : Font, - ?TickAngle : int, - ?TickFormat : string, - ?TickFormatStops : seq, - ?Layer : StyleParam.Layer - ) = - AngularAxis() - |> AngularAxis.style - ( - ?Visible = Visible , - ?AxisType = AxisType , - ?AutoTypeNumbers = AutoTypeNumbers , - ?CategoryOrder = CategoryOrder , - ?CategoryArray = CategoryArray , - ?ThetaUnit = ThetaUnit , - ?Period = Period , - ?Direction = Direction , - ?Rotation = Rotation , - ?HoverFormat = HoverFormat , - ?UIRevision = UIRevision , - ?Color = Color , - ?ShowLine = ShowLine , - ?LineColor = LineColor , - ?LineWidth = LineWidth , - ?ShowGrid = ShowGrid , - ?GridColor = GridColor , - ?GridWidth = GridWidth , - ?TickMode = TickMode , - ?NTicks = NTicks , - ?Tick0 = Tick0 , - ?DTick = DTick , - ?TickVals = TickVals , - ?TickText = TickText , - ?Ticks = Ticks , - ?TickLen = TickLen , - ?TickWidth = TickWidth , - ?TickColor = TickColor , - ?ShowTickLabels = ShowTickLabels , - ?ShowTickPrefix = ShowTickPrefix , - ?TickPrefix = TickPrefix , - ?ShowTickSuffix = ShowTickSuffix , - ?TickSuffix = TickSuffix , - ?ShowExponent = ShowExponent , - ?ExponentFormat = ExponentFormat , - ?MinExponent = MinExponent , - ?SeparateThousands = SeparateThousands, - ?TickFont = TickFont , - ?TickAngle = TickAngle , - ?TickFormat = TickFormat , - ?TickFormatStops = TickFormatStops , - ?Layer = Layer - ) - - /// - /// Creates a function that applies the given style parameters to a AngularAxis object - /// - /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false - /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. - /// 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. Defaults to layout.autotypenumbers. - /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. - /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. - /// Sets the format unit of the formatted "theta" values. Has an effect only when `angularaxis.type` is "linear". - /// Set the angular period. Has an effect only when `angularaxis.type` is "category". - /// Sets the direction corresponding to positive angles. - /// Sets that start position (in degrees) of the angular axis By default, polar subplots with `direction` set to "counterclockwise" get a `rotation` of "0" which corresponds to due East (like what mathematicians prefer). In turn, polar with `direction` set to "clockwise" get a rotation of "90" which corresponds to due North (like on a compass), - /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. - /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. - /// Determines whether or not a line bounding this axis is drawn. - /// Sets the axis line color. - /// Sets the width (in px) of the axis line. - /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. - /// Sets the color of the grid lines. - /// Sets the width (in px) of the grid lines. - /// 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). - /// 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". - /// 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<f>" (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. - /// 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<f>", 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<n>" 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" - /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. - /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. - /// 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. - /// Sets the tick length (in px). - /// Sets the tick width (in px). - /// Sets the tick color. - /// Determines whether or not the tick labels are drawn. - /// 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. - /// Sets a tick label prefix. - /// Same as `showtickprefix` but for tick suffixes. - /// Sets a tick label suffix. - /// 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. - /// 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. - /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". - /// If "true", even 4-digit integers are separated - /// Sets the tick font. - /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. - /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" - /// Set rules for customizing TickFormat on different zoom levels - /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. - static member style - ( - ?Visible : bool, - ?AxisType : StyleParam.AxisType, - ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, - ?CategoryOrder : StyleParam.CategoryOrder, - ?CategoryArray : seq<#IConvertible>, - ?ThetaUnit : StyleParam.AngularUnit, - ?Period : float, - ?Direction : StyleParam.Direction, - ?Rotation : int, - ?HoverFormat : string, - ?UIRevision : #IConvertible, - ?Color : string, - ?ShowLine : bool, - ?LineColor : string, - ?LineWidth : int, - ?ShowGrid : bool, - ?GridColor : string, - ?GridWidth : int, - ?TickMode : StyleParam.TickMode, - ?NTicks : int, - ?Tick0 : #IConvertible, - ?DTick : #IConvertible, - ?TickVals : seq<#IConvertible>, - ?TickText : seq<#IConvertible>, - ?Ticks : StyleParam.TickOptions, - ?TickLen : int, - ?TickWidth : int, - ?TickColor : string, - ?ShowTickLabels : bool, - ?ShowTickPrefix : StyleParam.ShowTickOption, - ?TickPrefix : string, - ?ShowTickSuffix : StyleParam.ShowTickOption, - ?TickSuffix : string, - ?ShowExponent : StyleParam.ShowExponent, - ?ExponentFormat : StyleParam.ExponentFormat, - ?MinExponent : float, - ?SeparateThousands : bool, - ?TickFont : Font, - ?TickAngle : int, - ?TickFormat : string, - ?TickFormatStops : seq, - ?Layer : StyleParam.Layer - ) = - fun (angularAxis: AngularAxis) -> - - Visible |> DynObj.setValueOpt angularAxis "visible" - AxisType |> DynObj.setValueOptBy angularAxis "type" StyleParam.AxisType.convert - AutoTypeNumbers |> DynObj.setValueOptBy angularAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert - CategoryOrder |> DynObj.setValueOptBy angularAxis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt angularAxis "categoryarray" - ThetaUnit |> DynObj.setValueOpt angularAxis "thetaunit" - Period |> DynObj.setValueOpt angularAxis "Period" - Direction |> DynObj.setValueOpt angularAxis "Direction" - Rotation |> DynObj.setValueOpt angularAxis "Rotation" - HoverFormat |> DynObj.setValueOpt angularAxis "hoverformat" - UIRevision |> DynObj.setValueOpt angularAxis "uirevision" - Color |> DynObj.setValueOpt angularAxis "color" - ShowLine |> DynObj.setValueOpt angularAxis "showline" - LineColor |> DynObj.setValueOpt angularAxis "linecolor" - LineWidth |> DynObj.setValueOpt angularAxis "linewidth" - ShowGrid |> DynObj.setValueOpt angularAxis "showgrid" - GridColor |> DynObj.setValueOpt angularAxis "gridcolor" - GridWidth |> DynObj.setValueOpt angularAxis "gridwidth" - TickMode |> DynObj.setValueOptBy angularAxis "tickmode" StyleParam.TickMode.convert - NTicks |> DynObj.setValueOpt angularAxis "nticks" - Tick0 |> DynObj.setValueOpt angularAxis "tick0" - DTick |> DynObj.setValueOpt angularAxis "dtick" - TickVals |> DynObj.setValueOpt angularAxis "TickVals" - TickText |> DynObj.setValueOpt angularAxis "TickText" - Ticks |> DynObj.setValueOptBy angularAxis "ticks" StyleParam.TickOptions.convert - TickLen |> DynObj.setValueOpt angularAxis "ticklen" - TickWidth |> DynObj.setValueOpt angularAxis "tickwidth" - TickColor |> DynObj.setValueOpt angularAxis "tickcolor" - ShowTickLabels |> DynObj.setValueOpt angularAxis "showticklabels" - ShowTickPrefix |> DynObj.setValueOptBy angularAxis "showtickprefix" StyleParam.ShowTickOption.convert - TickPrefix |> DynObj.setValueOpt angularAxis "tickprefix" - ShowTickSuffix |> DynObj.setValueOptBy angularAxis "showticksuffix" StyleParam.ShowTickOption.convert - TickSuffix |> DynObj.setValueOpt angularAxis "ticksuffix" - ShowExponent |> DynObj.setValueOptBy angularAxis "showexponent" StyleParam.ShowExponent.convert - ExponentFormat |> DynObj.setValueOptBy angularAxis "exponentformat" StyleParam.ExponentFormat.convert - MinExponent |> DynObj.setValueOpt angularAxis "minexponent" - SeparateThousands |> DynObj.setValueOpt angularAxis "separatethousands" - TickFont |> DynObj.setValueOpt angularAxis "tickfont" - TickAngle |> DynObj.setValueOpt angularAxis "tickangle" - TickFormat |> DynObj.setValueOpt angularAxis "TickFormat" - TickFormatStops |> DynObj.setValueOpt angularAxis "tickformatstops" - Layer |> DynObj.setValueOptBy angularAxis "layer" StyleParam.Layer.convert - - angularAxis - - type ColorAxis() = - inherit DynamicObj() - - /// - /// Initializes a ColorAxis object - /// - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Determines whether or not the color domain is computed with respect to the input data (here corresponding trace color array(s)) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as corresponding trace color array(s). Has no effect when `cauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmin` must be set as well. - /// Sets the colorbar associated with this color axis. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not a colorbar is displayed for this trace. - static member init - ( - ?AutoColorScale : bool, - ?CAuto : float, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?ColorBar : ColorBar, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool - ) = - - ColorAxis() - |> ColorAxis.style - ( - ?AutoColorScale = AutoColorScale, - ?CAuto = CAuto , - ?CMin = CMin , - ?CMid = CMid , - ?CMax = CMax , - ?ColorBar = ColorBar , - ?ColorScale = ColorScale , - ?ShowScale = ShowScale , - ?ReverseScale = ReverseScale - ) - /// - /// Creates a function that applies the given style parameters to a ColorAxis object - /// - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Determines whether or not the color domain is computed with respect to the input data (here corresponding trace color array(s)) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as corresponding trace color array(s). Has no effect when `cauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmin` must be set as well. - /// Sets the colorbar associated with this color axis. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not a colorbar is displayed for this trace. - static member style - ( - ?AutoColorScale : bool, - ?CAuto : float, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?ColorBar : ColorBar, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool - ) = - fun (ca:ColorAxis) -> - - AutoColorScale |> DynObj.setValueOpt ca "autocolorscale" - CAuto |> DynObj.setValueOpt ca "cauto" - CMin |> DynObj.setValueOpt ca "cmin" - CMid |> DynObj.setValueOpt ca "cmid" - CMax |> DynObj.setValueOpt ca "cmax" - ColorBar |> DynObj.setValueOpt ca "colorbar" - ColorScale |> DynObj.setValueOpt ca "colorscale" - ShowScale |> DynObj.setValueOpt ca "showscale" - ReverseScale |> DynObj.setValueOpt ca "reversescale" - - ca \ No newline at end of file diff --git a/src/Plotly.NET/GenericChartExtensions.fs b/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs similarity index 93% rename from src/Plotly.NET/GenericChartExtensions.fs rename to src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs index 690250235..227d19391 100644 --- a/src/Plotly.NET/GenericChartExtensions.fs +++ b/src/Plotly.NET/CSharpLayer/GenericChartExtensions.fs @@ -1,5 +1,7 @@ namespace Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open System open System.IO @@ -39,7 +41,7 @@ module GenericChartExtensions = [] [] member this.WithMarker(marker:Marker) = - this |> mapTrace (Trace.TraceStyle.SetMarker(marker)) + this |> Chart.withMarker marker /// Apply styling to the Marker(s) of the chart. [] @@ -51,17 +53,19 @@ module GenericChartExtensions = [] ?Symbol, [] ?Opacity ) = - let marker = - Marker.init ( - ?Size=Size,?Color=Color,?Symbol=Symbol,?Opacity=Opacity - ) - this |> Chart.withMarker(marker) + this + |> Chart.withMarkerStyle( + ?Size=Size, + ?Color=Color, + ?Symbol=Symbol, + ?Opacity=Opacity + ) /// Apply styling to the Line(s) of the chart as Object. [] [] member this.WithLine(line:Line) = - this |> mapTrace (Trace.TraceStyle.SetLine(line)) + this |> Chart.withLine line /// Apply styling to the Line(s) of the chart. [] @@ -75,17 +79,21 @@ module GenericChartExtensions = [] ?Smoothing, [] ?Colorscale ) = - let line = - Line.init ( - ?Width=Width,?Color=Color,?Shape=Shape,?Dash=Dash,?Smoothing=Smoothing,?Colorscale=Colorscale) - - this |> Chart.withLine(line) + this + |> Chart.withLineStyle( + ?Width=Width, + ?Color=Color, + ?Shape=Shape, + ?Dash=Dash, + ?Smoothing=Smoothing, + ?Colorscale=Colorscale + ) /// Apply styling to the xError(s) of the chart as Object [] [] member this.WithXError(xError:Error) = - this |> mapTrace (Trace.TraceStyle.SetErrorX(xError)) + this |> Chart.withXError xError /// Apply styling to the xError(s) of the chart as Object [] @@ -106,7 +114,7 @@ module GenericChartExtensions = [] [] member this.WithYError(yError:Error) = - this |> mapTrace (Trace.TraceStyle.SetErrorY(yError)) + this |> mapTrace (TraceStyle.SetErrorY(yError)) /// Apply styling to the yError(s) of the chart as Object [] @@ -127,7 +135,7 @@ module GenericChartExtensions = [] [] member this.WithZError(zError:Error) = - this |> mapTrace (Trace.TraceStyle.SetErrorZ(zError)) + this |> mapTrace (TraceStyle.SetErrorZ(zError)) /// Apply styling to the zError(s) of the chart as Object @@ -152,7 +160,7 @@ module GenericChartExtensions = // Sets x-Axis of 2d and 3d- Charts [] [] - member this.WithXAxis(xAxis:Axis.LinearAxis,[] ?Id: StyleParam.SubPlotId) = + member this.WithXAxis(xAxis:LinearAxis,[] ?Id: StyleParam.SubPlotId) = this |> Chart.withXAxis(xAxis, ?Id = Id) // Sets x-Axis of 2d and 3d- Charts @@ -171,7 +179,7 @@ module GenericChartExtensions = [] ?Anchor) = let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None - let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, + let xaxis = LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) this |> Chart.withXAxis(xaxis,?Id=Id) @@ -180,13 +188,13 @@ module GenericChartExtensions = [] member this.WithXAxisRangeSlider(rangeSlider:RangeSlider, [] ?Id) = - let xaxis = Axis.LinearAxis.init(RangeSlider = rangeSlider) + let xaxis = LinearAxis.init(RangeSlider = rangeSlider) this |> Chart.withXAxis(xaxis,?Id=Id) // Sets y-Axis of 2d and 3d- Charts [] [] - member this.WithYAxis(yAxis:Axis.LinearAxis,[] ?Id: StyleParam.SubPlotId) = + member this.WithYAxis(yAxis:LinearAxis,[] ?Id: StyleParam.SubPlotId) = this |> Chart.withYAxis(yAxis, ?Id = Id) // Sets y-Axis of 3d- Charts @@ -205,7 +213,7 @@ module GenericChartExtensions = [] ?Anchor) = let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None - let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid, + let yaxis = LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid, ?ShowLine=ShowLine,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) this |> Chart.withYAxis(yaxis,?Id=Id) @@ -213,7 +221,7 @@ module GenericChartExtensions = // Sets z-Axis of 3d- Charts [] [] - member this.WithZAxis(zAxis:Axis.LinearAxis, [] ?Id: StyleParam.SubPlotId) = + member this.WithZAxis(zAxis:LinearAxis, [] ?Id: StyleParam.SubPlotId) = this |> Chart.withZAxis(zAxis, ?Id=Id) @@ -229,7 +237,7 @@ module GenericChartExtensions = [] ?Anchor) = let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None - let zaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine,?Anchor=Anchor,?Domain=domain) + let zaxis = LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine,?Anchor=Anchor,?Domain=domain) this |> Chart.withZAxis(zaxis) [] @@ -384,8 +392,8 @@ module GenericChartExtensions = []?FrameColor, []?FrameWidth : float, []?BgColor, - []?LatAxis : Axis.LinearAxis, - []?LonAxis : Axis.LinearAxis + []?LatAxis : LinearAxis, + []?LonAxis : LinearAxis ) = this |> Chart.withGeoStyle( @@ -513,7 +521,7 @@ module GenericChartExtensions = member this.WithLegend(showlegend) = let layout = Layout() - |> Layout.style(Showlegend=showlegend) + |> Layout.style(ShowLegend=showlegend) GenericChart.addLayout layout this // Set the size of a Chart @@ -633,17 +641,17 @@ module GenericChartExtensions = /// Sets the angular axis of the polar object with the given id on the chart layout [] - member this.WithAngularAxis(angularAxis:Axis.AngularAxis, [] ?Id) = + member this.WithAngularAxis(angularAxis:AngularAxis, [] ?Id) = this |> Chart.withAngularAxis(angularAxis,?Id=Id) /// Sets the radial axis of the polar object with the given id on the chart layout [] - member this.WithRadialAxis(radialAxis:Axis.RadialAxis, [] ?Id) = + member this.WithRadialAxis(radialAxis:RadialAxis, [] ?Id) = this |> Chart.withRadialAxis(radialAxis,?Id=Id) /// Sets the color axis of the color axis with the given id on the chart layout [] - member this.WithColorAxis(colorAxis:Axis.ColorAxis, [] ?Id) = + member this.WithColorAxis(colorAxis:ColorAxis, [] ?Id) = this |> Chart.withColorAxis(colorAxis,?Id=Id) /// Sets the scene object with the given id on the chart layout diff --git a/src/Plotly.NET/CandelstickExtension.fs b/src/Plotly.NET/CandelstickExtension.fs deleted file mode 100644 index 0d2f85843..000000000 --- a/src/Plotly.NET/CandelstickExtension.fs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Plotly.NET - -open DynamicObj -open Trace -open System -open System.Runtime.InteropServices - -[] -type Candle = - { - High : float - Low : float - Close : float - Open : float - } - with - static member Create(o,h,l,c) = - { - High = h - Low = l - Close = c - Open = o - } - -[] -module CandelstickExtension = - - type Chart with - [] - [] - static member Candelstick - ( - data : (#IConvertible*Candle) seq, - [] ?increasing : Line, - [] ?decreasing : Line, - [] ?line : Line - ) = - Trace.initCandlestick( - TraceStyle.Candlestick( - ``open`` = (data |> Seq.map (snd >> (fun x -> x.Open))) , - high = (data |> Seq.map (snd >> (fun x -> x.High))) , - low = (data |> Seq.map (snd >> (fun x -> x.Low))) , - close = (data |> Seq.map (snd >> (fun x -> x.Close))) , - x = (data |> Seq.map fst) , - ?Increasing = increasing , - ?Decreasing = decreasing , - ?Line = line - ) - ) - |> GenericChart.ofTraceObject diff --git a/src/Plotly.NET/Chart.fs b/src/Plotly.NET/Chart.fs deleted file mode 100644 index 18d7f697f..000000000 --- a/src/Plotly.NET/Chart.fs +++ /dev/null @@ -1,4070 +0,0 @@ -namespace Plotly.NET - -open DynamicObj -open System -open System.IO -//open FSharp.Care.Collections - -open GenericChart -open Trace -open Trace3d -open StyleParam -open System.Runtime.InteropServices - -// ########### -// Copied from FSharp.Care.Collections to remove dependancies -[] -module Seq = - - /// Splits a sequence of pairs into two sequences - let unzip (input:seq<_>) = - let (lstA, lstB) = - Seq.foldBack (fun (a,b) (accA, accB) -> - a::accA, b::accB) input ([],[]) - (Seq.ofList lstA, Seq.ofList lstB) - - /// Splits a sequence of triples into three sequences - let unzip3 (input:seq<_>) = - let (lstA, lstB, lstC) = - Seq.foldBack (fun (a,b,c) (accA, accB, accC) -> - a::accA, b::accB, c::accC) input ([],[],[]) - (Seq.ofList lstA, Seq.ofList lstB, Seq.ofList lstC) - - -/// Provides a set of static methods for creating charts. -type Chart = - - static member private renderScatterTrace (useWebGL:bool) (style: Trace -> Trace) = - if useWebGL then - Trace.initScatterGL style - |> GenericChart.ofTraceObject - else - Trace.initScatter style - |> GenericChart.ofTraceObject - - static member private renderScatterPolarTrace (useWebGL:bool) (style: Trace -> Trace) = - if useWebGL then - Trace.initScatterPolarGL style - |> GenericChart.ofTraceObject - else - Trace.initScatterPolar style - |> GenericChart.ofTraceObject - - /// 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) - static member Invisible () = - let hiddenAxis() = - Axis.LinearAxis.init( - ShowGrid = false, - ShowLine = false, - ShowTickLabels = false, - ZeroLine = false - ) - - let trace = Trace("scatter") - trace.Remove("type") |> ignore - GenericChart.ofTraceObject trace - |> GenericChart.mapLayout ( fun l -> - l - |> Layout.AddLinearAxis(StyleParam.SubPlotId.XAxis 1,hiddenAxis()) - |> Layout.AddLinearAxis(StyleParam.SubPlotId.YAxis 1,hiddenAxis()) - ) - - - /// Creates a Scatter chart. Scatter charts are the basis of Point, Line, and Bubble Charts in Plotly, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Determines the drawing mode for this scatter trace. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// Sets the Line Dash style - /// Sets the Line width - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Scatter(x, y, mode, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - - let style = - TraceStyle.Scatter( - X = x , - Y = y , - Mode = mode , - ?StackGroup = StackGroup , - ?Orientation= Orientation , - ?GroupNorm = GroupNorm - ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterTrace useWebGL style - - - /// Creates a Scatter chart. Scatter charts are the basis of Point, Line, and Bubble Charts in Plotly, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble - /// Sets the x,y coordinates of the plotted data. - /// Determines the drawing mode for this scatter trace. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// Sets the Line Dash style - /// Sets the Line width - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Scatter(xy,mode, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width , - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool) = - let x,y = Seq.unzip xy - Chart.Scatter(x, y, mode, - ?Name = Name , - ?Showlegend = Showlegend , - ?MarkerSymbol = MarkerSymbol , - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition = TextPosition , - ?TextFont = TextFont , - ?Dash = Dash , - ?Width = Width , - ?StackGroup = StackGroup , - ?Orientation = Orientation , - ?GroupNorm = GroupNorm , - ?UseWebGL = UseWebGL - ) - - - - /// Creates a Point chart, which uses Points in a 2D space to visualize data. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Point(x, y, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - // if text position or font is set, then show labels (not only when hovering) - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - let useWebGL = defaultArg UseWebGL false - - let style = - TraceStyle.Scatter( - X = x, - Y = y, - Mode = changeMode StyleParam.Mode.Markers, - ?StackGroup = StackGroup, - ?Orientation= Orientation, - ?GroupNorm = GroupNorm) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - Chart.renderScatterTrace useWebGL style - - /// Creates a Point chart, which uses Points in a 2D space to visualize data. - /// Sets the x,y coordinates of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Point(xy, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - let x,y = Seq.unzip xy - Chart.Point(x, y, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?StackGroup = StackGroup, - ?Orientation = Orientation, - ?GroupNorm = GroupNorm, - ?UseWebGL = UseWebGL - ) - - - /// Creates a Line chart, which uses a Line plotted between the given datums in a 2D space to visualize typically an evolution of Y depending on X. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// Sets the Line Dash style - /// Sets the Line width - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Line(x, y, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - // if text position or font is set than show labels (not only when hovering) - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - - let style = - TraceStyle.Scatter( - X = x, - Y = y, - Mode = changeMode StyleParam.Mode.Lines, - ?StackGroup = StackGroup, - ?Orientation= Orientation, - ?GroupNorm = GroupNorm) - >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterTrace useWebGL style - - - /// Creates a Line chart, which uses a Line plotted between the given datums in a 2D space to visualize typically an evolution of Y depending on X. - /// Sets the x,y coordinates of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// Sets the Line Dash style - /// Sets the Line width - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Line(xy, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - let x,y = Seq.unzip xy - Chart.Line( - x, y, - ?Name = Name, - ?ShowMarkers = ShowMarkers, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Dash = Dash, - ?Width = Width, - ?StackGroup = StackGroup, - ?Orientation = Orientation, - ?GroupNorm = GroupNorm, - ?UseWebGL = UseWebGL - ) - - - /// Creates a Spline chart. A spline chart is a line chart in which data points are connected by smoothed curves: this modification is aimed to improve the design of a chart. - /// Very similar to Line Plots, spline charts are typically used to visualize an evolution of Y depending on X. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// Sets the Line Dash style - /// Sets the Line width - /// 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 amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Spline(x, y, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?Smoothing: float, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - let style = - TraceStyle.Scatter( - X = x, - Y = y, - Mode=changeMode StyleParam.Mode.Lines, - ?StackGroup = StackGroup, - ?Orientation= Orientation, - ?GroupNorm = GroupNorm) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - Chart.renderScatterTrace useWebGL style - - - /// Creates a Spline chart. A spline chart is a line chart in which data points are connected by smoothed curves: this modification is aimed to improve the design of a chart. - /// Very similar to Line Plots, spline charts are typically used to visualize an evolution of Y depending on X. - /// Sets the x,y coordinates of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Wether to show markers for the individual data points - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// Sets the Line Dash style - /// Sets the Line width - /// 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 amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Spline(xy, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?Smoothing, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - let x,y = Seq.unzip xy - Chart.Spline(x, y, - ?Name = Name, - ?ShowMarkers = ShowMarkers, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Dash = Dash, - ?Width = Width, - ?Smoothing = Smoothing, - ?StackGroup = StackGroup, - ?Orientation = Orientation, - ?GroupNorm = GroupNorm, - ?UseWebGL = UseWebGL - ) - - - /// Creates a bubble chart. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes. - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets the bubble size of the plotted data - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Bubble(x, y,sizes:seq<#IConvertible>, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - // if text position or font is set than show labels (not only when hovering) - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - let style = - TraceStyle.Scatter( - X = x, - Y = y, - Mode=changeMode StyleParam.Mode.Markers, - ?StackGroup = StackGroup, - ?Orientation= Orientation, - ?GroupNorm = GroupNorm) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol, MultiSizes=sizes) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - Chart.renderScatterTrace useWebGL style - - /// Creates a bubble chart. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes. - /// Sets the x coordinates, y coordinates, and bubble sizes of the plotted data. - /// Sets the trace name. The trace name appear as the legend item and on hover - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the type of symbol that datums are displayed as - /// Sets Line/Marker Color - /// Sets the Opacity of the trace - /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the text font of this trace - /// 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 - /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. - static member Bubble(xysizes,[] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?StackGroup , - [] ?Orientation , - [] ?GroupNorm , - []?UseWebGL : bool - ) = - let x,y,sizes = Seq.unzip3 xysizes - Chart.Bubble( - x, y,sizes, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?StackGroup = StackGroup, - ?Orientation = Orientation, - ?GroupNorm = GroupNorm, - ?UseWebGL = UseWebGL - ) - - - /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line - [] - static member Range(x, y, upper, lower,?Name,?ShowMarkers,?Showlegend,?Color,?RangeColor,?Labels,?TextPosition,?TextFont) = - // if text position or font is set than show labels (not only when hovering) - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - - let trace = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Markers, ?Fillcolor=Color) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend) - |> TraceStyle.Line(?Color=Color) - |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let lower = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = lower, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor) ) - |> TraceStyle.TraceInfo(Showlegend=false) - |> TraceStyle.Line(Width=0.) - |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,,0.5)") - - let upper = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = upper, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor, Fill=StyleParam.Fill.ToNext_y) ) - |> TraceStyle.TraceInfo(Showlegend=false) - |> TraceStyle.Line(Width=0.) - |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,,0.5)") - - GenericChart.MultiChart ([lower;upper;trace],Layout(),Config(), DisplayOptions()) - - [] - /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line - static member Range(xy, upper, lower,?Name,?ShowMarkers,?Showlegend,?Color,?RangeColor,?Labels,?TextPosition,?TextFont) = - let x,y = Seq.unzip xy - Chart.Range(x, y, upper, lower, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?Color=Color,?RangeColor=RangeColor,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont) - - - /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line - static member Range(x, y, upper, lower,mode, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?Color, - [] ?RangeColor, - [] ?Labels, - [] ?UpperLabels, - [] ?LowerLabels, - [] ?TextPosition, - [] ?TextFont, - [] ?LowerName: string, - [] ?UpperName: string) = - - let upperName = defaultArg UpperName "upper" - let lowerName = defaultArg LowerName "lower" - - // if text position or font is set than show labels (not only when hovering) - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - let trace = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = y, Mode=mode, ?Fillcolor=Color) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend) - |> TraceStyle.Line(?Color=Color) - |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let lower = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = lower, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor) ) - |> TraceStyle.TraceInfo(?Name = Some lowerName, Showlegend=false) - |> TraceStyle.Line(Width=0.) - |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,0,0.5)") - |> TraceStyle.TextLabel(?Text=LowerLabels,?Textposition=TextPosition,?Textfont=TextFont) - - let upper = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = upper, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor, Fill=StyleParam.Fill.ToNext_y) ) - |> TraceStyle.TraceInfo(?Name = Some upperName, Showlegend=false) - |> TraceStyle.Line(Width=0.) - |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,0,0.5)") - |> TraceStyle.TextLabel(?Text=UpperLabels,?Textposition=TextPosition,?Textfont=TextFont) - - GenericChart.MultiChart ([lower;upper;trace],Layout(),Config(), DisplayOptions()) - - - /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line - static member Range(xy, upper, lower, mode, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?Color, - [] ?RangeColor, - [] ?Labels, - [] ?UpperLabels, - [] ?LowerLabels, - [] ?TextPosition, - [] ?TextFont, - [] ?LowerName, - [] ?UpperName) = - let x,y = Seq.unzip xy - Chart.Range(x, y, upper, lower, mode, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?Color=Color,?RangeColor=RangeColor,?Labels=Labels,?UpperLabels=UpperLabels,?LowerLabels=LowerLabels,?TextPosition=TextPosition,?TextFont=TextFont,?LowerName=LowerName,?UpperName=UpperName) - - - /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. - static member Area(x, y, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width) = - // if text position or font is set than show labels (not only when hovering) - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Lines,Fill=StyleParam.Fill.ToZero_y) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. - static member Area(xy, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width) = - let x,y = Seq.unzip xy - Chart.Area(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) - - - /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. - static member SplineArea(x, y, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?Smoothing) = - // if text position or font is set than show labels (not only when hovering) - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Lines,Fill=StyleParam.Fill.ToZero_y) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. - static member SplineArea(xy, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?Smoothing) = - let x,y = Seq.unzip xy - Chart.SplineArea(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width,?Smoothing=Smoothing) - - /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. - static member StackedArea(x, y, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width) = - Trace.initScatter ( - TraceStyle.Scatter(X = x,Y = y, Mode=StyleParam.Mode.Lines) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> TraceStyle.SetStackGroup "static" - |> GenericChart.ofTraceObject - - /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. - static member StackedArea(xy, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width) = - let x,y = Seq.unzip xy - Chart.StackedArea(x, y, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) - - /// Illustrates comparisons among individual items - static member Column(keys, values, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let marker = - match Marker with - | Some marker -> marker |> Plotly.NET.Marker.style(?Color=Color) - | Option.None -> Plotly.NET.Marker.init (?Color=Color) - - Trace.initBar (TraceStyle.Bar(X = keys,Y = values,Marker=marker)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Illustrates comparisons among individual items - static member Column(keysvalues, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let keys,values = Seq.unzip keysvalues - Chart.Column(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) - - - /// Displays series of column chart type as stacked columns. - static member StackedColumn(keys, values, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let marker = - match Marker with - | Some marker -> marker |> Plotly.NET.Marker.style(?Color=Color) - | Option.None -> Plotly.NET.Marker.init (?Color=Color) - - Trace.initBar (TraceStyle.Bar(X = keys,Y = values,Marker=marker)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - //|> GenericChart.setLayout (Layout.init (Layout.style(Barmode=StyleParam.Barmode.Stack))) - |> GenericChart.setLayout (Layout.init (Barmode=StyleParam.Barmode.Stack)) - - - /// Displays series of column chart type as stacked columns. - static member StackedColumn(keysvalues, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let keys,values = Seq.unzip keysvalues - Chart.StackedColumn(keys, values,?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) - - - /// Illustrates comparisons among individual items - static member Bar(keys, values, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let marker = - match Marker with - | Some marker -> marker |> Plotly.NET.Marker.style(?Color=Color) - | Option.None -> Plotly.NET.Marker.init (?Color=Color) - Trace.initBar (TraceStyle.Bar(X = values,Y = keys,Marker=marker,Orientation = StyleParam.Orientation.Horizontal)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Illustrates comparisons among individual items - static member Bar(keysvalues, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let keys,values = Seq.unzip keysvalues - Chart.Bar(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) - - - /// Displays series of tcolumn chart type as stacked bars. - static member StackedBar(keys, values, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let marker = - match Marker with - | Some marker -> marker |> Plotly.NET.Marker.style(?Color=Color) - | Option.None -> Plotly.NET.Marker.init (?Color=Color) - Trace.initBar (TraceStyle.Bar(X = values,Y = keys,Marker=marker,Orientation = StyleParam.Orientation.Horizontal)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - //|> GenericChart.setLayout (Layout.init (Layout.style(Barmode=StyleParam.Barmode.Stack))) - |> GenericChart.setLayout (Layout.init (Barmode=StyleParam.Barmode.Stack)) - - - /// Displays series of tcolumn chart type as stacked bars. - static member StackedBar(keysvalues, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Marker) = - let keys,values = Seq.unzip keysvalues - Chart.StackedBar(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) - - - /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. - static member BoxPlot - ( - [] ?x, - [] ?y, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Fillcolor, - [] ?Opacity, - [] ?Whiskerwidth, - [] ?Boxpoints, - [] ?Boxmean, - [] ?Jitter, - [] ?Pointpos, - [] ?Orientation, - [] ?Marker, - [] ?Line, - [] ?Alignmentgroup, - [] ?Offsetgroup, - [] ?Notched, - [] ?NotchWidth, - [] ?QuartileMethod - ) = - Trace.initBoxPlot (TraceStyle.BoxPlot(?X=x, ?Y = y, - ?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints, - ?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation,?Fillcolor=Fillcolor, - ?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Notched=Notched,?NotchWidth=NotchWidth,?QuartileMethod=QuartileMethod - ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color) - |> GenericChart.ofTraceObject - - - /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. - static member BoxPlot(xy, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Fillcolor, - [] ?Opacity, - [] ?Whiskerwidth, - [] ?Boxpoints, - [] ?Boxmean, - [] ?Jitter, - [] ?Pointpos, - [] ?Orientation, - [] ?Marker, - [] ?Line, - [] ?Alignmentgroup, - [] ?Offsetgroup, - [] ?Notched, - [] ?NotchWidth, - [] ?QuartileMethod - ) = - let x,y = Seq.unzip xy - Chart.BoxPlot(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, - ?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Notched=Notched,?NotchWidth=NotchWidth,?QuartileMethod=QuartileMethod) - - - /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. - static member Violin - ( - [] ?x, - [] ?y, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Fillcolor, - [] ?Opacity, - [] ?Points, - [] ?Jitter, - [] ?Pointpos, - [] ?Orientation, - [] ?Width, - [] ?Marker, - [] ?Line, - [] ?Alignmentgroup, - [] ?Offsetgroup, - [] ?Box, - [] ?Bandwidth, - [] ?Meanline, - [] ?Scalegroup, - [] ?Scalemode, - [] ?Side, - [] ?Span, - [] ?SpanMode, - [] ?Uirevision - ) = - Trace.initViolin (TraceStyle.Violin(?X=x, ?Y = y,?Points=Points, - ?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation,?Fillcolor=Fillcolor, - ?Width=Width,?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Box=Box,?Bandwidth=Bandwidth,?Meanline=Meanline, - ?Scalegroup=Scalegroup,?Scalemode=Scalemode,?Side=Side,?Span=Span,?SpanMode=SpanMode,?Uirevision=Uirevision - ) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color) - |> GenericChart.ofTraceObject - - - /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. - static member Violin(xy, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Fillcolor, - [] ?Opacity, - [] ?Points, - [] ?Jitter, - [] ?Pointpos, - [] ?Orientation, - [] ?Width, - [] ?Marker, - [] ?Line, - [] ?Alignmentgroup, - [] ?Offsetgroup, - [] ?Box, - [] ?Bandwidth, - [] ?Meanline, - [] ?Scalegroup, - [] ?Scalemode, - [] ?Side, - [] ?Span, - [] ?SpanMode, - [] ?Uirevision - ) = - let x,y = Seq.unzip xy - Chart.Violin(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Points=Points,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, - ?Width=Width,?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Box=Box,?Bandwidth=Bandwidth,?Meanline=Meanline, - ?Scalegroup=Scalegroup,?Scalemode=Scalemode,?Side=Side,?Span=Span,?SpanMode=SpanMode,?Uirevision=Uirevision - ) - - static member private renderHeatmapTrace (useWebGL:bool) (style: Trace -> Trace) = - if useWebGL then - Trace.initHeatmapGL style - |> GenericChart.ofTraceObject - else - Trace.initHeatmap style - |> GenericChart.ofTraceObject - - /// Shows a graphical representation of a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. - /// That is, given a value for z, lines are drawn for connecting the (x,y) coordinates where that z value occurs. - static member Heatmap(data:seq<#seq<#IConvertible>>, - [] ?ColNames, - [] ?RowNames, - [] ?Name, - [] ?Showlegend, - [] ?Opacity, - [] ?Colorscale, - [] ?Showscale, - [] ?Xgap, - [] ?Ygap, - [] ?zSmooth, - [] ?ColorBar, - []?UseWebGL : bool) - = - let style = - TraceStyle.Heatmap(Z=data,?X=ColNames, ?Y=RowNames, - ?Xgap=Xgap,?Ygap=Ygap,?Colorscale=Colorscale,?Showscale=Showscale,?zSmooth=zSmooth,?ColorBar=ColorBar) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderHeatmapTrace useWebGL style - - - /// Shows a graphical representation of data where the individual values contained in a matrix are represented as colors. - static member Contour(data:seq<#seq<#IConvertible>>, - [] ?X, - [] ?Y, - [] ?Name, - [] ?Showlegend, - [] ?Opacity, - [] ?Colorscale, - [] ?Showscale, - [] ?zSmooth, - [] ?ColorBar) = - Trace.initContour (TraceStyle.Contour(Z=data,?X=X, ?Y=Y, - ?Colorscale=Colorscale,?Showscale=Showscale,?zSmooth=zSmooth,?ColorBar=ColorBar) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - - /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data. - static member Pie(values, - [] ?Labels:seq<'IConvertible>, - [] ?Name, - [] ?Showlegend, - [] ?Colors, - [] ?TextPosition, - [] ?TextFont, - [] ?Hoverinfo, - [] ?Textinfo, - [] ?Opacity) = - Trace.initPie (TraceStyle.Pie(Values=values,?Labels=Labels,?Textinfo=Textinfo)) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity,?Hoverinfo=Hoverinfo) - |> TraceStyle.Marker(?Colors=Colors) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data. - static member Pie(data:seq<#IConvertible*#IConvertible>, - [] ?Name, - [] ?Showlegend, - [] ?Colors, - [] ?TextPosition, - [] ?TextFont, - [] ?Hoverinfo, - [] ?Textinfo, - [] ?Opacity) = - let values,labels = Seq.unzip data - Chart.Pie(values,Labels=labels,?Name=Name,?Showlegend=Showlegend,?Colors=Colors,?TextPosition=TextPosition,?TextFont=TextFont,?Hoverinfo=Hoverinfo,?Textinfo=Textinfo,?Opacity=Opacity) - - - /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole. - static member Doughnut(values, - [] ?Labels, - [] ?Name, - [] ?Showlegend, - [] ?Colors, - [] ?Hole, - [] ?TextPosition, - [] ?TextFont, - [] ?Hoverinfo, - [] ?Textinfo, - [] ?Opacity) = - let hole' = if Hole.IsSome then Hole.Value else 0.4 - Trace.initPie (TraceStyle.Pie(Values=values,?Labels=Labels,?Textinfo=Textinfo,Hole=hole')) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity,?Hoverinfo=Hoverinfo) - |> TraceStyle.Marker(?Colors=Colors) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole. - static member Doughnut(data:seq<#IConvertible*#IConvertible>, - [] ?Name, - [] ?Showlegend, - [] ?Colors, - [] ?Hole, - [] ?TextPosition, - [] ?TextFont, - [] ?Hoverinfo, - [] ?Textinfo, - [] ?Opacity) = - let values,labels = Seq.unzip data - Chart.Doughnut(values,Labels=labels,?Name=Name,?Showlegend=Showlegend,?Colors=Colors,?Hole=Hole,?TextPosition=TextPosition,?TextFont=TextFont,?Hoverinfo=Hoverinfo,?Textinfo=Textinfo,?Opacity=Opacity) - - - /// Uses points, line or both depending on the mode to represent data points in a polar chart - static member ScatterPolar - ( - r, theta, mode, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?UseWebGL - ) = - - let style = - TraceStyle.ScatterPolar( - R = r, - Theta = theta, - Mode = mode - ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterPolarTrace useWebGL style - - /// Uses points, line or both depending on the mode to represent data points in a polar chart - static member ScatterPolar - ( - rtheta, mode, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?UseWebGL - ) = - - let r,t = Seq.unzip rtheta - - Chart.ScatterPolar( - r, t, mode, - ?Name=Name, - ?Showlegend=Showlegend, - ?MarkerSymbol=MarkerSymbol, - ?Color=Color, - ?Opacity=Opacity, - ?Labels=Labels, - ?TextPosition=TextPosition, - ?TextFont=TextFont, - ?Dash=Dash, - ?Width=Width, - ?UseWebGL = UseWebGL - ) - - /// - static member PointPolar - ( - r, theta, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?UseWebGL - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - let style = - TraceStyle.ScatterPolar( - R = r, - Theta = theta, - Mode = changeMode StyleParam.Mode.Markers - ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterPolarTrace useWebGL style - - /// - static member PointPolar - ( - rTheta, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?UseWebGL - ) = - let r,t = Seq.unzip rTheta - - Chart.PointPolar( - r, t, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?UseWebGL = UseWebGL - ) - - /// - static member LinePolar - ( - r, theta, - [] ?Name, - [] ?Showlegend, - [] ?ShowMarkers, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?UseWebGL - ) = - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - let style = - TraceStyle.ScatterPolar( - R = r, - Theta = theta, - Mode = changeMode StyleParam.Mode.Lines - ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterPolarTrace useWebGL style - - /// - static member LinePolar - ( - rTheta, - [] ?Name, - [] ?Showlegend, - [] ?ShowMarkers, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width, - [] ?UseWebGL - ) = - let r,t = Seq.unzip rTheta - - Chart.LinePolar( - r, t, - ?Name = Name, - ?Showlegend = Showlegend, - ?ShowMarkers = ShowMarkers, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Dash = Dash, - ?Width = Width, - ?UseWebGL = UseWebGL - ) - - /// - static member SplinePolar - ( - r, theta, - [] ?Name, - [] ?Showlegend, - [] ?ShowMarkers, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Smoothing, - [] ?Dash, - [] ?Width, - [] ?UseWebGL - ) = - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - let style = - TraceStyle.ScatterPolar( - R = r, - Theta = theta, - Mode = changeMode StyleParam.Mode.Lines - ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterPolarTrace useWebGL style - /// - static member SplinePolar - ( - rTheta, - [] ?Name, - [] ?Showlegend, - [] ?ShowMarkers, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Smoothing, - [] ?Dash, - [] ?Width, - [] ?UseWebGL - ) = - let r,t = Seq.unzip rTheta - - Chart.SplinePolar( - r, t, - ?Name = Name, - ?Showlegend = Showlegend, - ?ShowMarkers = ShowMarkers, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?Smoothing = Smoothing, - ?Dash = Dash, - ?Width = Width, - ?UseWebGL = UseWebGL - ) - - /// - static member BubblePolar - ( - r, theta, sizes:seq<#IConvertible>, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?UseWebGL - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - let style = - TraceStyle.ScatterPolar( - R = r, - Theta = theta, - Mode = changeMode StyleParam.Mode.Markers - ) - >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol,MultiSizes=sizes) - >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - - let useWebGL = defaultArg UseWebGL false - - Chart.renderScatterPolarTrace useWebGL style - - /// - static member BubblePolar - ( - rThetaSizes:seq<#IConvertible*#IConvertible*#IConvertible>, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?UseWebGL - ) = - let r,t,sizes = Seq.unzip3 rThetaSizes - - Chart.BubblePolar( - r, t, sizes, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont, - ?UseWebGL = UseWebGL - ) - - /// - static member BarPolar - ( - r, theta, - [] ?Name, - [] ?Showlegend, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?LineWidth - ) = - Trace.initBarPolar( - TraceStyle.BarPolar( - R = r, Theta = theta - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=LineWidth) - |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Computes a histogram with auto-determined the bin size. - static member Histogram(data, - [] ?Orientation, - [] ?Name, - [] ?Showlegend, - [] ?Opacity, - [] ?Color, - [] ?HistNorm, - [] ?HistFunc, - [] ?nBinsx, - [] ?nBinsy, - [] ?Xbins, - [] ?Ybins, - // TODO - [] ?xError, - [] ?yError) = - Trace.initHistogram ( - TraceStyle.Histogram (X=data,?Orientation=Orientation,?HistNorm=HistNorm,?HistFunc=HistFunc, - ?nBinsx=nBinsx,?nBinsy=nBinsy,?xBins=Xbins,?yBins=Ybins) - ) - |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - - |> GenericChart.ofTraceObject - - /// Computes the bi-dimensional histogram of two data samples and auto-determines the bin size. - static member Histogram2d(x,y, - [] ?Z, - [] ?Name, - [] ?Showlegend, - [] ?Opacity, - [] ?Colorscale, - [] ?Showscale, - [] ?zSmooth, - [] ?ColorBar, - [] ?zAuto, - [] ?zMin, - [] ?zMax, - [] ?nBinsx, - [] ?nBinsy, - [] ?xBins, - [] ?yBins, - [] ?HistNorm, - [] ?HistFunc) = - Trace.initHistogram2d ( - TraceStyle.Histogram2d ( - X=x, - Y=y, - ?Z=Z, - ?Colorscale=Colorscale, - ?Showscale=Showscale, - ?zSmooth=zSmooth, - ?ColorBar=ColorBar, - ?zAuto=zAuto, - ?zMin=zMin, - ?zMax=zMax, - ?nBinsx=nBinsx, - ?nBinsy=nBinsy, - ?xBins=xBins, - ?yBins=yBins, - ?HistNorm=HistNorm, - ?HistFunc=HistFunc ) ) - - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - -// // /// Computes the bi-dimensional histogram of two data samples and auto-determines the bin size. -// // static member Histogram2d(xy,?Name,?HistNorm,?HistFunc,?Colorscale,?Showscale,?zSmooth,?ColorBar,?zAuto,?zMin,?zMax,?nBinsx,?nBinsy,?Xbins,?Ybins) = -// // let x,y = Seq.unzip xy -// // Chart.Histogram2d(x,y,?Name=Name,?HistNorm=HistNorm,?HistFunc=HistFunc,?Colorscale=Colorscale, -// // ?Showscale=Showscale,?ColorBar=ColorBar,?zSmooth=zSmooth,?zAuto=zAuto,?zMin=zMin,?zMax=zMax, -// // ?nBinsx=nBinsx,?nBinsy=nBinsy,?Xbins=Xbins,?Ybins=Ybins -// // ) - - /// Computes the bi-dimensional histogram of two data samples and auto-determines the bin size. - static member Histogram2dContour(x,y, - [] ?Z, - [] ?Name, - [] ?Colorscale, - [] ?Showscale, - [] ?Line, - [] ?zSmooth, - [] ?ColorBar, - [] ?zAuto, - [] ?zMin, - [] ?zMax, - [] ?nBinsx, - [] ?nBinsy, - [] ?xBins, - [] ?yBins, - [] ?HistNorm, - [] ?HistFunc) = - Trace.initHistogram2dContour ( - TraceStyle.Histogram2dContour (X=x, Y=y,? Z=Z,?Line=Line, - ?Colorscale=Colorscale, - ?Showscale=Showscale, - ?zSmooth=zSmooth, - ?ColorBar=ColorBar, - ?zAuto=zAuto, - ?zMin=zMin, - ?zMax=zMax, - ?nBinsx=nBinsx, - ?nBinsy=nBinsy, - ?xBins=xBins, - ?yBins=yBins, - ?HistNorm=HistNorm, - ?HistFunc=HistFunc - ) ) - //|> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - - /// Computes the parallel coordinates plot - static member ParallelCoord(dims:seq<'key*#seq<'values>>, - [] ?Range, - [] ?Constraintrange, - [] ?Color, - [] ?Colorscale, - [] ?Width, - [] ?Dash, - [] ?Domain, - [] ?Labelfont, - [] ?Tickfont, - [] ?Rangefont) = - let dims' = - dims |> Seq.map (fun (k,vals) -> - Dimensions.init(vals) - |> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k) - ) - Trace.initParallelCoord ( - TraceStyle.ParallelCoord (Dimensions=dims',?Domain=Domain,?Labelfont=Labelfont,?Tickfont=Tickfont,?Rangefont=Rangefont) - ) - |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) - |> GenericChart.ofTraceObject - - - /// Computes the parallel coordinates plot - static member ParallelCoord(dims:seq, - [] ?Color, - [] ?Colorscale, - [] ?Width, - [] ?Dash, - [] ?Domain, - [] ?Labelfont, - [] ?Tickfont, - [] ?Rangefont) = - Trace.initParallelCoord ( - TraceStyle.ParallelCoord (Dimensions=dims,?Domain=Domain,?Labelfont=Labelfont,?Tickfont=Tickfont,?Rangefont=Rangefont) - ) - |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) - |> GenericChart.ofTraceObject - - ///Parallel categories diagram for multidimensional categorical data. - static member ParallelCategories(dims:seq<'key*#seq<'values>>, - [] ?Range, - [] ?Constraintrange, - [] ?Color, - [] ?Colorscale, - [] ?Width, - [] ?Dash, - [] ?Domain, - [] ?Labelfont, - [] ?Tickfont, - [] ?Rangefont) = - let dims' = - dims |> Seq.map (fun (k,vals) -> - Dimensions.init(vals) - |> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k) - ) - Trace.initParallelCategories ( - TraceStyle.ParallelCategories(Dimensions=dims',?Domain=Domain,?Labelfont=Labelfont,?Tickfont=Tickfont,?Rangefont=Rangefont) - ) - |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) - |> GenericChart.ofTraceObject - - /// - static member ParallelCategories(dims:seq, - [] ?Color, - [] ?Colorscale, - [] ?Width, - [] ?Dash, - [] ?Domain, - [] ?Labelfont, - [] ?Tickfont, - [] ?Rangefont) = - Trace.initParallelCategories ( - TraceStyle.ParallelCategories (Dimensions=dims,?Domain=Domain,?Color=Color,?Labelfont=Labelfont,?Tickfont=Tickfont,?Rangefont=Rangefont) - ) - |> TraceStyle.Line(?Width=Width,?Dash=Dash,?Colorscale=Colorscale) - |> GenericChart.ofTraceObject - - /// Computes the choropleth map plot - static member ChoroplethMap(locations,z, - [] ?Text, - [] ?Locationmode, - [] ?Autocolorscale, - [] ?Colorscale, - [] ?ColorBar, - [] ?Marker, - [] ?GeoJson, - [] ?FeatureIdKey: string, - [] ?Zmin, - [] ?Zmax) = - Trace.initChoroplethMap ( - TraceStyle.ChoroplethMap (Locations=locations,Z=z,?Text=Text,?Locationmode=Locationmode,?Autocolorscale=Autocolorscale, - ?Colorscale=Colorscale,?ColorBar=ColorBar,?Marker=Marker,?Zmin=Zmin,?Zmax=Zmax,?GeoJson=GeoJson,?FeatureIdKey=FeatureIdKey) - ) - |> GenericChart.ofTraceObject - - /// Computes the parallel coordinates plot - static member Splom(dims:seq<'key*#seq<'values>>, - [] ?Range, - [] ?Constraintrange, - [] ?Color, - [] ?Colorscale, - [] ?Width, - [] ?Dash, - ?Domain,?Labelfont,?Tickfont,?Rangefont) = - let dims' = - dims |> Seq.map (fun (k,vals) -> - Dimensions.init(vals) - |> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k) - ) - Trace.initSplom ( - TraceStyle.Splom (Dimensions=dims') - ) - |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) - |> GenericChart.ofTraceObject - - - /// Computes the Splom plot - static member Splom(dims:seq, - [] ?Color, - [] ?Colorscale, - [] ?Width, - [] ?Dash, - [] ?Domain, - [] ?Labelfont, - [] ?Tickfont, - [] ?Rangefont) = - Trace.initSplom ( - TraceStyle.Splom (Dimensions=dims) - ) - |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) - |> GenericChart.ofTraceObject - - // --------------------------------------------------------------------------------------------------------------------------------------------------- - // 3d - Chart ---> - - /// Uses points, line or both depending on the mode to represent 3d-data points - static member Scatter3d(x, y, z, mode, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width) = - Trace3d.initScatter3d (Trace3dStyle.Scatter3d(X = x,Y = y,Z=z, Mode=mode) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Uses points, line or both depending on the mode to represent 3d-data points - static member Scatter3d(xyz, mode, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width) = - let x,y,z = Seq.unzip3 xyz - Chart.Scatter3d(x, y, z, mode, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) - - /// - static member Point3d - ( - x, y, z, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont - ) = - // if text position or font is set, then show labels (not only when hovering) - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - Chart.Scatter3d( - x = x, - y = y, - z = z, - mode = changeMode StyleParam.Mode.Markers, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont - ) - - /// - static member Point3d - ( - xyz, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont - ) = - let x, y, z = Seq.unzip3 xyz - - Chart.Point3d( - x, y, z, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont - ) - - - /// Uses points, line or both depending on the mode to represent 3d-data points - static member Line3d - ( - x, y, z, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width - ) = - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - Chart.Scatter3d( - x = x, - y = y, - z = z, - mode = changeMode StyleParam.Mode.Lines, - ?Name = Name , - ?Showlegend = Showlegend , - ?MarkerSymbol = MarkerSymbol, - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition = TextPosition, - ?TextFont = TextFont , - ?Dash = Dash , - ?Width = Width - ) - - /// Uses points, line or both depending on the mode to represent 3d-data points - static member Line3d - ( - xyz, - [] ?Name, - [] ?ShowMarkers, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont, - [] ?Dash, - [] ?Width - ) = - let x, y, z = Seq.unzip3 xyz - - Chart.Line3d( - x, y, z, - ?Name = Name , - ?ShowMarkers = ShowMarkers , - ?Showlegend = Showlegend , - ?MarkerSymbol = MarkerSymbol, - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition = TextPosition, - ?TextFont = TextFont , - ?Dash = Dash , - ?Width = Width - ) - - /// - static member Bubble3d - ( - x, y, z, sizes, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont - ) = - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - Trace3d.initScatter3d ( - Trace3dStyle.Scatter3d( - X = x, - Y = y, - Z = z, - Mode=changeMode StyleParam.Mode.Markers - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol, MultiSizes=sizes) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// - static member Bubble3d - ( - xyz, sizes, - [] ?Name, - [] ?Showlegend, - [] ?MarkerSymbol, - [] ?Color, - [] ?Opacity, - [] ?Labels, - [] ?TextPosition, - [] ?TextFont - ) = - let x, y, z = Seq.unzip3 xyz - - Chart.Bubble3d( - x, y, z, sizes, - ?Name = Name, - ?Showlegend = Showlegend, - ?MarkerSymbol = MarkerSymbol, - ?Color = Color, - ?Opacity = Opacity, - ?Labels = Labels, - ?TextPosition = TextPosition, - ?TextFont = TextFont - ) - - - /// Uses points, line or both depending on the mode to represent 3d-data points - static member Surface - ( - zData, - [] ?X, - [] ?Y, - [] ?Name, - [] ?Showlegend, - [] ?Opacity, - [] ?Contours, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar - ) = - Trace3d.initSurface ( - Trace3dStyle.Surface( - ?X=X, - ?Y=Y, - Z=zData, - ?Contours=Contours, - ?ColorScale=ColorScale, - ?ShowScale=ShowScale, - ?ColorBar=ColorBar - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - - /// Uses points, line or both depending on the mode to represent 3d-data points - static member Mesh3d - ( - x, y, z, - [] ?I, - [] ?J, - [] ?K, - [] ?Name, - [] ?Showlegend, - [] ?Opacity, - [] ?Contours, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar - ) = - Trace3d.initMesh3d ( - Trace3dStyle.Mesh3d( - X = x, - Y = y, - Z = z, - ?I = I, - ?J = J, - ?K = K - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - static member Cone - ( - x, y, z, u, v, w, - [] ?Name, - [] ?ShowLegend, - [] ?Opacity, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar - ) = - - Trace3d.initCone( - Trace3dStyle.Cone( - X = x, - Y = y, - Z = z, - U = u, - V = v, - W = w, - ?Name = Name, - ?ShowLegend = ShowLegend, - ?Opacity = Opacity, - ?ColorScale = ColorScale, - ?ShowScale = ShowScale, - ?ColorBar = ColorBar - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - static member Cone - ( - coneXYZ, coneUVW, - [] ?Name, - [] ?ShowLegend, - [] ?Opacity, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar - ) = - let x, y, z = Seq.unzip3 coneXYZ - let u, v, w = Seq.unzip3 coneUVW - - Chart.Cone( - x, y, z, u, v, w, - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Opacity = Opacity , - ?ColorScale = ColorScale , - ?ShowScale = ShowScale , - ?ColorBar = ColorBar - ) - - - static member StreamTube - ( - x, y, z, u, v, w, - [] ?Name, - [] ?ShowLegend, - [] ?Opacity, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar, - [] ?MaxDisplayed: int, - [] ?Starts: StreamTubeStarts - - ) = - - Trace3d.initStreamTube( - Trace3dStyle.StreamTube( - X = x, - Y = y, - Z = z, - U = u, - V = v, - W = w, - ?Name = Name, - ?ShowLegend = ShowLegend, - ?Opacity = Opacity, - ?ColorScale = ColorScale, - ?ShowScale = ShowScale, - ?ColorBar = ColorBar, - ?MaxDisplayed = MaxDisplayed, - ?Starts = Starts - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - static member StreamTube - ( - streamTubeXYZ, streamTubeUVW, - [] ?Name, - [] ?ShowLegend, - [] ?Opacity, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar, - [] ?MaxDisplayed: int, - [] ?Starts: StreamTubeStarts - ) = - let x, y, z = Seq.unzip3 streamTubeXYZ - let u, v, w = Seq.unzip3 streamTubeUVW - - Chart.StreamTube( - x, y, z, u, v, w, - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Opacity = Opacity , - ?ColorScale = ColorScale , - ?ShowScale = ShowScale , - ?ColorBar = ColorBar , - ?MaxDisplayed = MaxDisplayed , - ?Starts = Starts - ) - - static member Volume - ( - x,y,z,value, - [] ?Name, - [] ?ShowLegend, - [] ?Opacity, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar, - [] ?IsoMin, - [] ?IsoMax, - [] ?Caps : Caps, - [] ?Slices : Slices, - [] ?Surface : Surface - ) = - Trace3d.initVolume( - Trace3dStyle.Volume( - X = x, - Y = y, - Z = z, - Value = value, - ?Name = Name, - ?ShowLegend = ShowLegend, - ?Opacity = Opacity, - ?ColorScale = ColorScale, - ?ShowScale = ShowScale, - ?ColorBar = ColorBar, - ?IsoMin = IsoMin, - ?IsoMax = IsoMax, - ?Caps = Caps, - ?Slices = Slices, - ?Surface = Surface - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - - static member IsoSurface - ( - x,y,z,value, - [] ?Name, - [] ?ShowLegend, - [] ?Opacity, - [] ?ColorScale, - [] ?ShowScale, - [] ?ColorBar, - [] ?IsoMin, - [] ?IsoMax, - [] ?Caps : Caps, - [] ?Slices : Slices, - [] ?Surface : Surface - ) = - Trace3d.initIsoSurface( - Trace3dStyle.IsoSurface( - X = x, - Y = y, - Z = z, - Value = value, - ?Name = Name, - ?ShowLegend = ShowLegend, - ?Opacity = Opacity, - ?ColorScale = ColorScale, - ?ShowScale = ShowScale, - ?ColorBar = ColorBar, - ?IsoMin = IsoMin, - ?IsoMax = IsoMax, - ?Caps = Caps, - ?Slices = Slices, - ?Surface = Surface - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) - |> GenericChart.ofTraceObject - - - - /// creates table out of header sequence and row sequences - static member Table(headerValues, cellValues, - [] ?AlignHeader, - [] ?AlignCells, - [] ?ColumnWidth, - [] ?ColumnOrder, - [] ?ColorHeader, - [] ?ColorCells, - [] ?FontHeader, - [] ?FontCells, - [] ?HeightHeader, - [] ?HeightCells, - [] ?LineHeader, - [] ?LineCells) = - Trace.initTable ( - - let CellFilling = - match ColorCells with - | Some color -> Some (CellColor.init (?Color=ColorCells)) - | Option.None -> Option.None - - let HeaderFilling = - match ColorHeader with - | Some color -> Some (CellColor.init (?Color=ColorHeader)) - | Option.None -> Option.None - - TraceStyle.Table ( - header = TableHeader.init (headerValues|> Seq.map seq, ?Align=AlignHeader, ?Fill=HeaderFilling, ?Font=FontHeader, ?Height=HeightHeader, ?Line=LineHeader), - cells = TableCells.init(cellValues |> Seq.transpose, ?Align=AlignCells, ?Fill=CellFilling, ?Font=FontCells, ?Height=HeightCells, ?Line=LineCells), - ?ColumnWidth = ColumnWidth, - ?ColumnOrder = ColumnOrder - ) - ) - |> GenericChart.ofTraceObject - - /// Creates a sunburst chart. Visualize hierarchical data spanning outward radially from root to leaves. - /// Applies the styles of sundburst plot to TraceObjects - /// - /// Parameters: - /// - /// labels: Sets the labels of each of the sectors. - /// - /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// - /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// - /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. - /// - /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// - /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// - /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - /// - /// ColorBar: Sets the ColorBar for the chart - /// - ///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors. - static member Sunburst(labels,parents, - []?Ids, - []?Values , - []?Text , - []?Branchvalues , - []?Level , - []?Maxdepth , - []?Colors: seq, - []?ColorBar:ColorBar - ) = - Trace.initSunburst( - TraceStyle.Sunburst( - labels = labels, - parents = parents, - ?Ids = Ids, - ?Values = Values, - ?Text = Text, - ?Branchvalues = Branchvalues, - ?Level = Level, - ?Maxdepth = Maxdepth - ) - ) - |> TraceStyle.Marker(?Colors=Colors,?ColorBar=ColorBar) - |> GenericChart.ofTraceObject - - - /// Creates a treemap chart. Treemap charts visualize hierarchical data using nested rectangles. Same as Sunburst the hierarchy is defined by labels and parents attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well. - /// - /// Parameters: - /// - /// labels: Sets the labels of each of the sectors. - /// - /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// - /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// - /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. - /// - /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// - /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// - /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - /// - /// ColorBar: Sets the ColorBar for the chart - /// - ///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors. - static member Treemap(labels,parents, - []?Ids, - []?Values , - []?Text , - []?Branchvalues , - []?Tiling , - []?PathBar , - []?Level , - []?Maxdepth , - []?Colors: seq, - []?ColorBar:ColorBar - ) = - Trace.initTreemap( - TraceStyle.Treemap( - labels = labels, - parents = parents, - ?Ids = Ids, - ?Values = Values, - ?Text = Text, - ?Branchvalues = Branchvalues, - ?Tiling = Tiling, - ?PathBar = PathBar, - ?Level = Level, - ?Maxdepth = Maxdepth - ) - ) - |> TraceStyle.Marker(?Colors=Colors,?ColorBar=ColorBar) - |> GenericChart.ofTraceObject - - /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. - /// - /// ``open`` : Sets the open values. - /// - /// high : Sets the high values. - /// - /// low : Sets the low values. - /// - /// close : Sets the close values. - /// - /// x : Sets the x coordinates. If absent, linear coordinate will be generated. - /// - /// ?Increasing : Sets the Line style of the Increasing part of the chart - /// - /// ?Decreasing : Sets the Line style of the Decreasing part of the chart - /// - /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart - /// - /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. - /// - /// ?XCalendar : Sets the calendar system to use with `x` date data. - static member OHLC - ( - ``open`` : #IConvertible seq, - high : #IConvertible seq, - low : #IConvertible seq, - close : #IConvertible seq, - x : #IConvertible seq, - []?Increasing : Line, - []?Decreasing : Line, - []?Tickwidth : float, - []?Line : Line, - []?XCalendar : StyleParam.Calendar - ) = - Trace.initOHLC( - TraceStyle.OHLC( - ``open`` = ``open`` , - high = high , - low = low , - close = close , - x = x , - ?Increasing = Increasing , - ?Decreasing = Decreasing , - ?Tickwidth = Tickwidth , - ?Line = Line , - ?XCalendar = XCalendar - ) - ) - |> GenericChart.ofTraceObject - - /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. - /// - /// stockTimeSeries : tuple list of time * stock (OHLC) data - /// - /// ?Increasing : Sets the Line style of the Increasing part of the chart - /// - /// ?Decreasing : Sets the Line style of the Decreasing part of the chart - /// - /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart - /// - /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. - /// - /// ?XCalendar : Sets the calendar system to use with `x` date data. - static member OHLC - ( - stockTimeSeries: seq, - []?Increasing : Line, - []?Decreasing : Line, - []?Tickwidth : float, - []?Line : Line, - []?XCalendar : StyleParam.Calendar - ) = - Trace.initOHLC( - TraceStyle.OHLC( - ``open`` = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Open))) , - high = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.High))) , - low = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Low))) , - close = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Close))) , - x = (stockTimeSeries |> Seq.map fst) , - ?Increasing = Increasing , - ?Decreasing = Decreasing , - ?Tickwidth = Tickwidth , - ?Line = Line , - ?XCalendar = XCalendar - ) - ) - |> GenericChart.ofTraceObject - - /// Creates a candlestick chart. A candlestick cart is a style of financial chart used to describe price movements of a - /// security, derivative, or currency. Each "candlestick" typically shows one day, thus a one-month chart may show the 20 - /// trading days as 20 candlesticks. Candlestick charts can also be built using intervals shorter or longer than one day. - /// - /// ``open`` : Sets the open values. - /// - /// high : Sets the high values. - /// - /// low : Sets the low values. - /// - /// close : Sets the close values. - /// - /// x : Sets the x coordinates. If absent, linear coordinate will be generated. - /// - /// ?Increasing : Sets the Line style of the Increasing part of the chart - /// - /// ?Decreasing : Sets the Line style of the Decreasing part of the chart - /// - /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart - /// - /// ?WhiskerWidth : Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). - /// - /// ?XCalendar : Sets the calendar system to use with `x` date data. - static member Candlestick - ( - ``open`` : #IConvertible seq, - high : #IConvertible seq, - low : #IConvertible seq, - close : #IConvertible seq, - x : #IConvertible seq, - []?Increasing : Line, - []?Decreasing : Line, - []?WhiskerWidth : float, - []?Line : Line, - []?XCalendar : StyleParam.Calendar - ) = - Trace.initCandlestick( - TraceStyle.Candlestick( - ``open`` = ``open`` , - high = high , - low = low , - close = close , - x = x , - ?Increasing = Increasing , - ?Decreasing = Decreasing , - ?WhiskerWidth = WhiskerWidth, - ?Line = Line , - ?XCalendar = XCalendar - ) - ) - |> GenericChart.ofTraceObject - - /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. - /// - /// stockTimeSeries : tuple list of time * stock (OHLC) data - /// - /// ?Increasing : Sets the Line style of the Increasing part of the chart - /// - /// ?Decreasing : Sets the Line style of the Decreasing part of the chart - /// - /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart - /// - /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. - /// - /// ?XCalendar : Sets the calendar system to use with `x` date data. - static member Candlestick - ( - stockTimeSeries: seq, - []?Increasing : Line, - []?Decreasing : Line, - []?WhiskerWidth : float, - []?Line : Line, - []?XCalendar : StyleParam.Calendar - ) = - Trace.initCandlestick( - TraceStyle.Candlestick( - ``open`` = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Open))) , - high = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.High))) , - low = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Low))) , - close = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Close))) , - x = (stockTimeSeries |> Seq.map fst) , - ?Increasing = Increasing , - ?Decreasing = Decreasing , - ?WhiskerWidth = WhiskerWidth, - ?Line = Line , - ?XCalendar = XCalendar - ) - ) - |> GenericChart.ofTraceObject - - - /// Creates a waterfall chart. Waterfall charts are special bar charts that help visualizing the cumulative effect of sequentially introduced positive or negative values - /// - /// Parameters: - /// - /// x : Sets the x coordinates. - /// - /// y : Sets the y coordinates. - /// - /// Base : Sets where the bar base is drawn (in position axis units). - /// - /// Width : Sets the bar width (in position axis units). - /// - /// Measure : An array containing types of values. By default the values are considered as 'relative'. However; it is possible to use 'total' to compute the sums. Also 'absolute' could be applied to reset the computed total or to declare an initial value where needed. - /// - /// Orientation : Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). - /// - /// Connector : Sets the styling of the connector lines - /// - /// AlignmentGroup : 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. - /// - /// OffsetGroup : 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. - /// - /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. - static member Waterfall - ( - x : #IConvertible seq, - y : #IConvertible seq, - []?Base : IConvertible , - []?Width : float , - []?Measure : StyleParam.WaterfallMeasure seq, - []?Orientation : StyleParam.Orientation, - []?Connector : WaterfallConnector , - []?AlignmentGroup : string, - []?OffsetGroup : string, - []?Offset - ) = - Trace.initWaterfall( - TraceStyle.Waterfall(x,y, - ?Base = Base , - ?Width = Width , - ?Measure = Measure , - ?Orientation = Orientation , - ?Connector = Connector , - ?AlignmentGroup = AlignmentGroup, - ?OffsetGroup = OffsetGroup , - ?Offset = Offset - ) - ) - |> GenericChart.ofTraceObject - - - /// Creates a waterfall chart. Waterfall charts are special bar charts that help visualizing the cumulative effect of sequentially introduced positive or negative values - /// - /// Parameters: - /// - /// xyMeasures : triple sequence containing x coordinates, y coordinates, and the type of measure used for each bar. - /// - /// Base : Sets where the bar base is drawn (in position axis units). - /// - /// Width : Sets the bar width (in position axis units). - /// - /// Orientation : Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). - /// - /// Connector : Sets the styling of the connector lines - /// - /// AlignmentGroup : 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. - /// - /// OffsetGroup : 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. - /// - /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. - static member Waterfall - ( - xyMeasure: (#IConvertible*#IConvertible*StyleParam.WaterfallMeasure) seq, - []?Base : IConvertible , - []?Width : float , - []?Orientation : StyleParam.Orientation, - []?Connector : WaterfallConnector , - []?AlignmentGroup : string, - []?OffsetGroup : string, - []?Offset - ) = - let x,y,measure = Seq.unzip3 xyMeasure - Trace.initWaterfall( - TraceStyle.Waterfall(x,y, - ?Base = Base , - ?Width = Width , - ?Measure = Some measure , - ?Orientation = Orientation , - ?Connector = Connector , - ?AlignmentGroup = AlignmentGroup, - ?OffsetGroup = OffsetGroup , - ?Offset = Offset - ) - ) - |> GenericChart.ofTraceObject - - /// Creates a Funnel chart. - /// Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage it traversed. See also the "funnelarea" trace type for a different approach to visualizing funnel data. - /// - /// Parameters: - /// - /// x : Sets the x coordinates. - /// - /// y : Sets the y coordinates. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition : Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Color : Sets Marker Color - /// - /// Line : Line type - /// - /// x0 : Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step. - /// - /// dX : Sets the x coordinate step. See `x0` for more info. - /// - /// y0 : Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step. - /// - /// dY : Sets the y coordinate step. See `y0` for more info. - /// - /// Width : Sets the bar width (in position axis units). - /// - /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. - /// - /// Orientation : Sets the orientation of the funnels. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). By default funnels are tend to be oriented horizontally; unless only "y" array is presented or orientation is set to "v". Also regarding graphs including only 'horizontal' funnels, "autorange" on the "y-axis" are set to "reversed". - /// - /// Alignmentgroup : 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. - /// - /// Offsetgroup : 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. - /// - /// Cliponaxis : Determines whether the text nodes are clipped about the subplot axes. To show the text nodes above axis lines and tick labels, make sure to set `xaxis.layer` and `yaxis.layer` to "below traces". - /// - /// Connector : Connector type - /// - /// Insidetextfont : Sets the font used for `text` lying inside the bar. - /// - /// Outsidetextfont: Sets the font used for `text` lying outside the bar. - static member Funnel (x, y, - [] ?Name , - [] ?Showlegend , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Color , - [] ?Line , - [] ?x0 , - [] ?dX , - [] ?y0 , - [] ?dY , - [] ?Width , - [] ?Offset , - [] ?Orientation , - [] ?Alignmentgroup , - [] ?Offsetgroup , - [] ?Cliponaxis , - [] ?Connector , - [] ?Insidetextfont , - [] ?Outsidetextfont - ) = - - Trace.initFunnel( - TraceStyle.Funnel( - x = x , - y = y , - ?x0 = x0 , - ?dX = dX , - ?y0 = y0 , - ?dY = dY , - ?Width = Width , - ?Offset = Offset , - ?Orientation = Orientation , - ?Alignmentgroup = Alignmentgroup , - ?Offsetgroup = Offsetgroup , - ?Cliponaxis = Cliponaxis , - ?Connector = Connector , - ?Insidetextfont = Insidetextfont , - ?Outsidetextfont = Outsidetextfont - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Line=Line) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a FunnelArea chart. - /// FunnelArea charts visualize stages in a process using area-encoded trapezoids. This trace can be used to show data in a part-to-whole representation similar to a "pie" trace, wherein each item appears in a single stage. See also the "funnel" trace type for a different approach to visualizing funnel data. - /// - /// Parameters: - /// - /// Values : Sets the values of the sectors. If omitted, we count occurrences of each label. - /// - /// Labels : Sets the sector labels. If `labels` entries are duplicated, we sum associated `values` or simply count occurrences if `values` is not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label. - /// - /// dLabel : Sets the label step. See `label0` for more info. - /// - /// Label0 : Alternate to `labels`. Builds a numeric set of labels. Use with `dlabel` where `label0` is the starting label and `dlabel` the step. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover. - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// Opacity : Sets the opacity of the trace. - /// - /// Color : Sets Marker Color - /// - /// Line : Line type - /// - /// Text : Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition : Specifies the location of the `textinfo`. - /// - /// X : Sets the horizontal domain of this funnelarea trace (in plot fraction). - /// - /// Y : Sets the vertical domain of this funnelarea trace (in plot fraction). - /// - /// Row : If there is a layout grid, use the domain for this row in the grid for this funnelarea trace . - /// - /// Column : If there is a layout grid, use the domain for this column in the grid for this funnelarea trace . - /// - /// Aspectratio : Sets the ratio between height and width - /// - /// Baseratio : Sets the ratio between bottom length and maximum top length. - /// - /// Insidetextfont: Sets the font used for `textinfo` lying inside the sector. - /// - /// Scalegroup : If there are multiple funnelareas that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group. - static member FunnelArea - ( - [] ?Values , - [] ?Labels , - [] ?dLabel , - [] ?Label0 , - [] ?Name , - [] ?Showlegend , - [] ?Opacity , - [] ?Color , - [] ?Line , - [] ?Text , - [] ?TextPosition , - [] ?X , - [] ?Y , - [] ?Row , - [] ?Column , - [] ?Aspectratio , - [] ?Baseratio , - [] ?Insidetextfont, - [] ?Scalegroup - ) = - - Trace.initFunnelArea( - TraceStyle.FunnelArea( - ?Values = Values , - ?Labels = Labels , - ?dLabel = dLabel , - ?Label0 = Label0 , - ?Aspectratio = Aspectratio , - ?Baseratio = Baseratio , - ?Insidetextfont = Insidetextfont, - ?Scalegroup = Scalegroup - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Line=Line) - |> TraceStyle.Domain(?X=X,?Y=Y,?Row=Row,?Column=Column) - |> TraceStyle.TextLabel(?Text=Text,?Textposition=TextPosition) - |> GenericChart.ofTraceObject - - /// Creates a ScatterGeo chart, where data is visualized on a geographic map. - /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble - /// - /// Parameters: - /// - /// longitudes : Sets the longitude coordinates (in degrees East). - /// - /// latitudes : Sets the latitude coordinates (in degrees North). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member ScatterGeo(longitudes, latitudes, mode, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = mode , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - - /// Creates a ScatterGeo chart, where data is visualized on a geographic map. - /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble - /// - /// Parameters: - /// - /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// - /// mode : Determines the drawing mode for this scatter trace. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member ScatterGeo(lonlat, mode, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - let longitudes, latitudes = Seq.unzip lonlat - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = mode , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a ScatterGeo chart, where data is visualized on a geographic map. - /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble - /// - /// Parameters: - /// - /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// - /// mode : Determines the drawing mode for this scatter trace. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member ScatterGeo(locations, mode, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Dash , - [] ?Width : float , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = mode , - ?Locations = locations , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a PointGeo chart, where data is visualized as points on a geographic map. - /// - /// Parameters: - /// - /// longitudes : Sets the longitude coordinates (in degrees East). - /// - /// latitudes : Sets the latitude coordinates (in degrees North). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member PointGeo(longitudes, latitudes, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = changeMode StyleParam.Mode.Markers , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a PointGeo chart, where data is visualized as points on a geographic map. - /// - /// Parameters: - /// - /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member PointGeo(lonlat, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - let longitudes, latitudes = Seq.unzip lonlat - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = changeMode StyleParam.Mode.Markers , - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a PointGeo chart, where data is visualized as points on a geographic map. - /// - /// Parameters: - /// - /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member PointGeo(locations, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = changeMode StyleParam.Mode.Markers , - ?Locations = locations , - ?GeoJson = GeoJson , - ?Connectgaps= Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. - /// - /// Parameters: - /// - /// longitudes : Sets the longitude coordinates (in degrees East). - /// - /// latitudes : Sets the latitude coordinates (in degrees North). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowMarkers : Determines wether or not markers will be rendered for each datum. - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// Dash : Sets the Line Dash style - /// - /// Width : Sets the Line width - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member LineGeo(longitudes, latitudes, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = changeMode StyleParam.Mode.Lines, - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. - /// - /// Parameters: - /// - /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowMarkers : Determines wether or not markers will be rendered for each datum. - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member LineGeo(lonlat, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - let longitudes, latitudes = Seq.unzip lonlat - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = changeMode StyleParam.Mode.Lines, - Longitudes = longitudes , - Latitudes = latitudes , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. - /// - /// Parameters: - /// - /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. - /// - /// Name : Sets the trace name. The trace name appear as the legend item and on hover - /// - /// ShowMarkers : Determines wether or not markers will be rendered for each datum. - /// - /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. - /// - /// MarkerSymbol: Sets the type of symbol that datums are displayed as - /// - /// Color : Sets Line/Marker Color - /// - /// Opacity : Sets the Opacity of the trace - /// - /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. - /// - /// TextFont : Sets the text font of this trace - /// - /// TextFont : Sets the text font of this trace - /// - /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// - /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// - /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// - /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - - static member LineGeo(locations, - [] ?Name , - [] ?Showlegend , - [] ?MarkerSymbol , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?GeoJson , - [] ?FeatureIdKey: string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - Trace.initScatterGeo( - TraceStyle.ScatterGeo( - mode = changeMode StyleParam.Mode.Lines, - Locations = locations , - ?GeoJson = GeoJson , - ?FeatureIdKey = FeatureIdKey , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// - /// Creates a ScatterMapbox chart, where data is visualized by (longitude,latitude) pairs on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// ScatterGeo charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// 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. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member ScatterMapbox(longitudes, latitudes, mode, - [] ?Name , - [] ?ShowLegend , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Width : float , - [] ?Below : string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - Trace.initScatterMapbox( - TraceStyle.ScatterMapbox( - mode = mode , - Longitudes = longitudes , - Latitudes = latitudes , - ?Below = Below , - ?Connectgaps = Connectgaps , - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Width=Width) - |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject - - /// - /// Creates a ScatterMapbox chart, where data is visualized by (longitude,latitude) pairs on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// ScatterGeo charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox - /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// 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. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member ScatterMapbox(lonlat, mode, - [] ?Name , - [] ?ShowLegend , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Width : float , - [] ?Below : string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let longitudes, latitudes = Seq.unzip lonlat - - Chart.ScatterMapbox( - longitudes, - latitudes, - mode, - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition= TextPosition, - ?TextFont = TextFont , - ?Width = Width , - ?Below = Below , - ?Connectgaps = Connectgaps, - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - - /// - /// Creates a PointMapbox chart, where data is visualized by (longitude,latitude) pairs as Points on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// 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. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member PointMapbox(longitudes,latitudes, - [] ?Name , - [] ?ShowLegend , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Width : float , - [] ?Below : string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - - Chart.ScatterMapbox( - longitudes, - latitudes, - mode = changeMode StyleParam.Mode.Markers , - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition= TextPosition, - ?TextFont = TextFont , - ?Width = Width , - ?Below = Below , - ?Connectgaps = Connectgaps, - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - - /// - /// Creates a PointMapbox chart, where data is visualized by (longitude,latitude) pairs as Points on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// 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. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member PointMapbox(lonlat, - [] ?Name , - [] ?ShowLegend , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Width : float , - [] ?Below : string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - let longitudes, latitudes = Seq.unzip lonlat - - Chart.ScatterMapbox( - longitudes, - latitudes, - mode = changeMode StyleParam.Mode.Markers , - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition= TextPosition, - ?TextFont = TextFont , - ?Width = Width , - ?Below = Below , - ?Connectgaps = Connectgaps, - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - /// - /// Creates a LineMapbox chart, where data is visualized by (longitude,latitude) pairs connected by a line on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Determines whether or not To show markers for the individual datums. - /// 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. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member LineMapbox(longitudes,latitudes, - [] ?Name , - [] ?ShowLegend , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Width : float , - [] ?Below : string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - - Chart.ScatterMapbox( - longitudes, - latitudes, - mode = changeMode StyleParam.Mode.Lines , - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition= TextPosition, - ?TextFont = TextFont , - ?Width = Width , - ?Below = Below , - ?Connectgaps = Connectgaps, - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - - /// - /// Creates a LineMapbox chart, where data is visualized by (longitude,latitude) pairs connected by a line on a geographic map using mapbox. - /// - /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. - /// - /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. - /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Determines whether or not To show markers for the individual datums. - /// 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. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". - /// Sets the line width (in px). - /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. - /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. - static member LineMapbox(lonlat, - [] ?Name , - [] ?ShowLegend , - [] ?ShowMarkers , - [] ?Color , - [] ?Opacity , - [] ?Labels , - [] ?TextPosition , - [] ?TextFont , - [] ?Width : float , - [] ?Below : string , - [] ?Connectgaps : bool , - [] ?Fill : StyleParam.Fill , - [] ?Fillcolor - ) = - - let changeMode = - let isShowMarker = - match ShowMarkers with - | Some isShow -> isShow - | Option.None -> false - StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) - >> StyleParam.ModeUtils.showMarker (isShowMarker) - let longitudes, latitudes = Seq.unzip lonlat - - Chart.ScatterMapbox( - longitudes, - latitudes, - mode = changeMode StyleParam.Mode.Lines , - ?Name = Name , - ?ShowLegend = ShowLegend , - ?Color = Color , - ?Opacity = Opacity , - ?Labels = Labels , - ?TextPosition= TextPosition, - ?TextFont = TextFont , - ?Width = Width , - ?Below = Below , - ?Connectgaps = Connectgaps, - ?Fill = Fill , - ?Fillcolor = Fillcolor - ) - - /// - /// Creates a ChoroplethMapbox Chart. - /// - /// Choropleth Maps display divided geographical areas or regions that are coloured, shaded or patterned in relation to - /// a data variable. This provides a way to visualise values over a geographical area, which can show variation or - /// patterns across the displayed location. - /// - /// GeoJSON features to be filled are set in `geojson` The data that describes the choropleth value-to-color mapping is set in `locations` and `z`. - /// - /// Sets which features found in "geojson" to plot using their feature `id` field. - /// Sets the color values. - /// Sets the GeoJSON data associated with this trace. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". - /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Support nested property, for example "properties.name". - /// Sets the text elements associated with each location. - /// Determines if the choropleth polygons will be inserted before the layer with the specified ID. By default, choroplethmapbox traces are placed above the water layers. If set to '', the layer will be inserted above every existing layer. - /// Sets the colorscale. - /// Sets the ColorBar object asociated with this trace - /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. - static member ChoroplethMapbox(locations,z,geoJson, - [] ?FeatureIdKey, - [] ?Text, - [] ?Below, - [] ?Colorscale, - [] ?ColorBar, - [] ?ZAuto, - [] ?ZMin, - [] ?ZMid, - [] ?ZMax - ) = - - Trace.initChoroplethMapbox ( - TraceStyle.ChoroplethMapbox ( - Z = z, - Locations = locations, - GeoJson = geoJson, - ?FeatureIdKey = FeatureIdKey, - ?Text = Text, - ?Below = Below, - ?Colorscale = Colorscale, - ?ColorBar = ColorBar, - ?ZAuto = ZAuto, - ?ZMin = ZMin, - ?ZMid = ZMid, - ?ZMax = ZMax - ) - ) - |> GenericChart.ofTraceObject - - /// - /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. - /// - /// Sets the longitude coordinates (in degrees East). - /// Sets the latitude coordinates (in degrees North). - /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot - /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to '', the layer will be inserted above every existing layer. - /// Sets the colorscale. - /// Sets the ColorBar object asociated with this trace - /// Determines whether or not a colorbar is displayed for this trace. - /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. - static member DensityMapbox (lon,lat, - [] ?Z, - [] ?Radius, - [] ?Opacity, - [] ?Text, - [] ?Below, - [] ?Colorscale, - [] ?ColorBar, - [] ?Showscale , - [] ?ZAuto, - [] ?ZMin, - [] ?ZMid, - [] ?ZMax - ) = - Trace.initDensityMapbox( - TraceStyle.DensityMapbox( - Longitudes = lon, - Latitudes = lat, - ?Z = Z, - ?Radius = Radius, - ?Opacity = Opacity, - ?Text = Text, - ?Below = Below, - ?Colorscale = Colorscale, - ?ColorBar = ColorBar, - ?Showscale = Showscale, - ?ZAuto = ZAuto, - ?ZMin = ZMin, - ?ZMid = ZMid, - ?ZMax = ZMax - ) - ) - |> GenericChart.ofTraceObject - - /// - /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. - /// - /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). - /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot - /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. - /// Sets the opacity of the trace. - /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to '', the layer will be inserted above every existing layer. - /// Sets the colorscale. - /// Sets the ColorBar object asociated with this trace - /// Determines whether or not a colorbar is displayed for this trace. - /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. - static member DensityMapbox (lonlat, - [] ?Z, - [] ?Radius, - [] ?Opacity, - [] ?Text, - [] ?Below, - [] ?Colorscale, - [] ?ColorBar, - [] ?Showscale , - [] ?ZAuto, - [] ?ZMin, - [] ?ZMid, - [] ?ZMax - ) = - - let longitudes, latitudes = Seq.unzip lonlat - - Chart.DensityMapbox( - longitudes, - latitudes, - ?Z = Z, - ?Radius = Radius, - ?Opacity = Opacity, - ?Text = Text, - ?Below = Below, - ?Colorscale = Colorscale, - ?ColorBar = ColorBar, - ?Showscale = Showscale, - ?ZAuto = ZAuto, - ?ZMin = ZMin, - ?ZMid = ZMid, - ?ZMax = ZMax - ) \ No newline at end of file diff --git a/src/Plotly.NET/ChartAPI/Chart.fs b/src/Plotly.NET/ChartAPI/Chart.fs new file mode 100644 index 000000000..3cdde5d69 --- /dev/null +++ b/src/Plotly.NET/ChartAPI/Chart.fs @@ -0,0 +1,1395 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO + +open GenericChart +open System.Runtime.InteropServices + +// ########### +// Copied from FSharp.Care.Collections to remove dependancies +[] +module Seq = + + /// Splits a sequence of pairs into two sequences + let unzip (input:seq<_>) = + let (lstA, lstB) = + Seq.foldBack (fun (a,b) (accA, accB) -> + a::accA, b::accB) input ([],[]) + (Seq.ofList lstA, Seq.ofList lstB) + + /// Splits a sequence of triples into three sequences + let unzip3 (input:seq<_>) = + let (lstA, lstB, lstC) = + Seq.foldBack (fun (a,b,c) (accA, accB, accC) -> + a::accA, b::accB, c::accC) input ([],[],[]) + (Seq.ofList lstA, Seq.ofList lstB, Seq.ofList lstC) + +[] +module internal ChartIO = + + ///Choose process to open plots with depending on OS. Thanks to @zyzhu for hinting at a solution (https://github.com/plotly/Plotly.NET/issues/31) + let openOsSpecificFile path = + if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then + let psi = new System.Diagnostics.ProcessStartInfo(FileName = path, UseShellExecute = true) + System.Diagnostics.Process.Start(psi) |> ignore + elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then + System.Diagnostics.Process.Start("xdg-open", path) |> ignore + elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then + System.Diagnostics.Process.Start("open", path) |> ignore + else + invalidOp "Not supported OS platform" + +/// Provides a set of static methods for creating charts. +type Chart = + + /// 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) + static member Invisible () = + let hiddenAxis() = + LinearAxis.init( + ShowGrid = false, + ShowLine = false, + ShowTickLabels = false, + ZeroLine = false + ) + + let trace = Trace2D.initScatter(id) + trace.Remove("type") |> ignore + GenericChart.ofTraceObject trace + |> GenericChart.mapLayout ( fun l -> + l + |> Layout.AddLinearAxis(StyleParam.SubPlotId.XAxis 1,hiddenAxis()) + |> Layout.AddLinearAxis(StyleParam.SubPlotId.YAxis 1,hiddenAxis()) + ) + + + /// Set the name related properties of a trace + [] + static member withTraceName + ( + [] ?Name, + [] ?Showlegend, + [] ?Legendgroup, + [] ?Visible + ) = + fun (ch:GenericChart) -> + ch |> 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),?Showlegend=Showlegend,?Legendgroup=Legendgroup,?Visible=Visible) + ) + + /// Set the axis anchor id the trace is belonging to + [] + 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 |> mapTrace (fun trace -> + trace + |> TraceStyle.SetAxisAnchor(?X=idx,?Y=idy) + ) + [] + static member withAxisAnchor + ( + (ch:GenericChart), + [] ?X, + [] ?Y + ) = + ch |> Chart.withAxisAnchor(?X=X,?Y=Y) + + /// Apply styling to the Marker(s) of the chart as Object. + [] + static member withMarker(marker:Marker) = + (fun (ch:GenericChart) -> + ch |> mapTrace (TraceStyle.SetMarker(marker)) + ) + + /// Apply styling to the Marker(s) of the chart. + [] + static member withMarkerStyle + ( + [] ?Size, + [] ?Color, + [] ?Symbol, + [] ?Opacity + ) = + let marker = + Marker.init ( + ?Size=Size,?Color=Color,?Symbol=Symbol,?Opacity=Opacity + ) + Chart.withMarker(marker) + + /// Apply styling to the Line(s) of the chart as Object. + [] + static member withLine(line:Line) = + (fun (ch:GenericChart) -> + ch |> mapTrace (TraceStyle.SetLine(line)) + ) + + /// Apply styling to the Line(s) of the chart. + [] + static member withLineStyle + ( + [] ?Width, + [] ?Color, + [] ?Shape, + [] ?Dash, + [] ?Smoothing, + [] ?Colorscale + ) = + let line = + Line.init ( + ?Width=Width,?Color=Color,?Shape=Shape,?Dash=Dash,?Smoothing=Smoothing,?Colorscale=Colorscale) + + Chart.withLine(line) + + /// Apply styling to the xError(s) of the chart as Object + [] + static member withXError(xError:Error) = + (fun (ch:GenericChart) -> + ch |> mapTrace (TraceStyle.SetErrorX(xError)) + ) + + /// Apply styling to the xError(s) of the chart as Object + [] + static member withXErrorStyle + ( + [] ?Array, + [] ?Arrayminus, + [] ?Symmetric, + [] ?Color, + [] ?Thickness, + [] ?Width + ) = + let error = Error.init(?Array=Array,?Arrayminus=Arrayminus,?Symmetric=Symmetric,?Color=Color,?Thickness=Thickness,?Width=Width) + Chart.withXError error + + /// Apply styling to the yError(s) of the chart as Object + [] + static member withYError(yError:Error) = + (fun (ch:GenericChart) -> + ch |> mapTrace (TraceStyle.SetErrorY(yError)) + ) + + /// Apply styling to the yError(s) of the chart as Object + [] + static member withYErrorStyle + ( + [] ?Array, + [] ?Arrayminus, + [] ?Symmetric, + [] ?Color, + [] ?Thickness, + [] ?Width + ) = + let error = Error.init(?Array=Array,?Arrayminus=Arrayminus,?Symmetric=Symmetric,?Color=Color,?Thickness=Thickness,?Width=Width) + Chart.withYError error + + /// Apply styling to the zError(s) of the chart as Object + [] + static member withZError(zError:Error) = + (fun (ch:GenericChart) -> + ch |> mapTrace (TraceStyle.SetErrorZ(zError)) + ) + + /// Apply styling to the zError(s) of the chart as Object + [] + static member withZErrorStyle + ( + [] ?Array, + [] ?Arrayminus, + [] ?Symmetric, + [] ?Color, + [] ?Thickness, + [] ?Width + ) = + let error = Error.init(?Array=Array,?Arrayminus=Arrayminus,?Symmetric=Symmetric,?Color=Color,?Thickness=Thickness,?Width=Width) + Chart.withZError error + + +// ############################################################ +// ####################### Apply to layout + + [] + [] + static member withX_Axis(xAxis:LinearAxis,[] ?Id : StyleParam.SubPlotId) = + Chart.withXAxis(xAxis, ?Id = Id) + + // Sets x-Axis of 2d and 3d- Charts + [] + static member withXAxis(xAxis:LinearAxis,[] ?Id: StyleParam.SubPlotId) = + fun (ch:GenericChart) -> + + let id = defaultArg Id (StyleParam.SubPlotId.XAxis 1) + + match id with + | StyleParam.SubPlotId.XAxis _ -> + let layout = + GenericChart.getLayout ch + |> Layout.UpdateLinearAxisById(id,axis=xAxis) + GenericChart.setLayout layout ch + + | StyleParam.SubPlotId.Scene _ -> + + let layout = GenericChart.getLayout ch + + let updatedScene = + layout + |> Layout.tryGetSceneById(id) + |> Option.defaultValue (Scene.init()) + |> Scene.style(XAxis = xAxis) + + let updatedLayout = + layout + |> Layout.updateSceneById(id,updatedScene) + + GenericChart.addLayout updatedLayout ch + + | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a xaxis" + + + + [] + [] + static member withX_AxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Side, + [] ?Overlaying, + [] ?Id, + [] ?Domain, + [] ?Position, + [] ?Zeroline, + [] ?Anchor) = + Chart.withXAxisStyle(title, + ?TitleFont = TitleFont, + ?MinMax = MinMax, + ?ShowGrid = ShowGrid, + ?ShowLine = ShowLine, + ?Side = Side, + ?Overlaying = Overlaying, + ?Id = Id, + ?Domain = Domain, + ?Position = Position, + ?Zeroline = Zeroline, + ?Anchor = Anchor) + + + // Sets x-Axis of 2d and 3d- Charts + [] + static member withXAxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Side, + [] ?Overlaying, + [] ?Id, + [] ?Domain, + [] ?Position, + [] ?Zeroline, + [] ?Anchor) = + let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None + let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None + let xaxis = LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, + ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=Zeroline) + Chart.withXAxis(xaxis,?Id=Id) + + [] + [] + static member withX_AxisRangeSlider(rangeSlider:RangeSlider, + [] ?Id) = + Chart.withXAxisRangeSlider(rangeSlider, ?Id = Id) + + /// Sets the range slider for the xAxis + [] + static member withXAxisRangeSlider(rangeSlider:RangeSlider, + [] ?Id) = + let xaxis = LinearAxis.init(RangeSlider = rangeSlider) + Chart.withXAxis(xaxis,?Id=Id) + + [] + [] + static member withY_Axis(yAxis:LinearAxis,[] ?Id: StyleParam.SubPlotId) = + Chart.withYAxis(yAxis, ?Id = Id) + + // Sets y-Axis of 2d and 3d- Charts + [] + static member withYAxis(yAxis:LinearAxis,[] ?Id: StyleParam.SubPlotId) = + fun (ch:GenericChart) -> + + let id = defaultArg Id (StyleParam.SubPlotId.YAxis 1) + + match id with + | StyleParam.SubPlotId.YAxis _ -> + let layout = + GenericChart.getLayout ch + |> Layout.UpdateLinearAxisById(id,axis=yAxis) + GenericChart.setLayout layout ch + + | StyleParam.SubPlotId.Scene sceneId -> + + let layout = GenericChart.getLayout ch + + let updatedScene = + layout + |> Layout.tryGetSceneById(id) + |> Option.defaultValue (Scene.init()) + |> Scene.style(YAxis = yAxis) + + let updatedLayout = + layout + |> Layout.updateSceneById(id,updatedScene) + + GenericChart.addLayout updatedLayout ch + + | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a xaxis" + + + [] + [] + static member withY_AxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Side, + [] ?Overlaying, + [] ?Id, + [] ?Domain, + [] ?Position, + [] ?ZeroLine, + [] ?Anchor) = + Chart.withYAxisStyle(title, + ?MinMax = MinMax, + ?ShowGrid = ShowGrid, + ?ShowLine = ShowLine, + ?Side = Side, + ?Overlaying = Overlaying, + ?Id = Id, + ?Domain = Domain, + ?Position = Position, + ?ZeroLine = ZeroLine, + ?Anchor = Anchor) + + // Sets y-Axis of 3d- Charts + [] + static member withYAxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Side, + [] ?Overlaying, + [] ?Id, + [] ?Domain, + [] ?Position, + [] ?ZeroLine, + [] ?Anchor) = + let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None + let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None + let yaxis = LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid, + ?ShowLine=ShowLine,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) + Chart.withYAxis(yaxis,?Id=Id) + + + [] + [] + static member withZ_Axis(xAxis:LinearAxis) = + Chart.withZAxis xAxis + + // Sets z-Axis of 3d- Charts + [] + static member withZAxis(zAxis:LinearAxis,[] ?Id: StyleParam.SubPlotId) = + fun (ch:GenericChart) -> + + let id = defaultArg Id (StyleParam.SubPlotId.Scene 1) + + match id with + | StyleParam.SubPlotId.Scene sceneId -> + + let layout = GenericChart.getLayout ch + + let updatedScene = + layout + |> Layout.tryGetSceneById(id) + |> Option.defaultValue (Scene.init()) + |> Scene.style(ZAxis = zAxis) + + let updatedLayout = + layout + |> Layout.updateSceneById(id,updatedScene) + + GenericChart.addLayout updatedLayout ch + + | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a xaxis" + + + + [] + [] + static member withZ_AxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Domain, + [] ?Anchor) = + Chart.withZAxisStyle(title, + ?MinMax = MinMax, + ?ShowGrid = ShowGrid, + ?ShowLine = ShowLine, + ?Domain = Domain, + ?Anchor = Anchor) + + + // Sets z-Axis style with ... + [] + static member withZAxisStyle(title, + [] ?TitleFont, + [] ?MinMax, + [] ?ShowGrid, + [] ?ShowLine, + [] ?Domain, + [] ?Anchor) = + let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None + let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None + let zaxis = LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine,?Anchor=Anchor,?Domain=domain) + Chart.withZ_Axis(zaxis) + + [] + static member withColorBar(colorbar:ColorBar) = + (fun (ch:GenericChart) -> + ch + |> GenericChart.mapTrace(fun t -> + colorbar |> DynObj.setValue t "colorbar" + t + ) + ) + + + [] + static member withColorBarStyle(title, + [] ?Length, + [] ?OutlineColor, + [] ?BorderColor, + [] ?BGColor) = + let colorbar = ColorBar.init(Title=title,?Len = Length,?OutlineColor=OutlineColor,?BGColor=BGColor,?BorderColor=BorderColor) + Chart.withColorBar(colorbar) + //// Sets second x-Axis of 2d- Charts + //static member withX_Axis2(xAxis2:Axis.LinearAxis) = + // (fun (ch:GenericChart) -> + // let layout = + // GenericChart.getLayout ch + // |> Layout.style (xAxis2=xAxis2) + // GenericChart.setLayout layout ch + // ) + + + // // Sets second x-Axis of 2d- Charts + //static member withX_Axis2Style(title,?MinMax,?Showgrid,?Showline) = + // let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None + // let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline,Side=StyleParam.Side.Top) + // Chart.withX_Axis2(xaxis) + + + //// Sets second y-Axis of 2d- Charts + //static member withY_Axis2(yAxis2:Axis.LinearAxis) = + // (fun (ch:GenericChart) -> + // let layout = + // GenericChart.getLayout ch + // |> Layout.style (yAxis2=yAxis2) + // GenericChart.setLayout layout ch + // ) + + + // // Sets second x-Axis of 2d- Charts + //static member withY_Axis2Style(title,?MinMax,?Showgrid,?Showline) = + // let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None + // let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline,Side=StyleParam.Side.Right) + // Chart.withY_Axis2(yaxis) + + + // Set the Layout options of a Chart + [] + static member withLayout(layout:Layout) = + (fun (ch:GenericChart) -> + GenericChart.addLayout layout ch) + + // Set the LayoutGrid options of a Chart + [] + static member withLayoutGrid(layoutGrid:LayoutGrid) = + (fun (ch:GenericChart) -> + let layout = + GenericChart.getLayout ch + |> Layout.SetLayoutGrid layoutGrid + GenericChart.setLayout layout ch) + + // Set the LayoutGrid options of a Chart + [] + static member withLegend(legend:Legend) = + (fun (ch:GenericChart) -> + let layout = + GenericChart.getLayout ch + |> Layout.setLegend legend + GenericChart.setLayout layout ch) + + /// Sets a map for the given chart (will only work with traces supporting geo, e.g. choropleth, scattergeo) + [] + static member withGeo(map:Geo,[] ?Id:StyleParam.SubPlotId ) = + (fun (ch:GenericChart) -> + let layout = + let id = defaultArg Id (StyleParam.SubPlotId.Geo 1) + GenericChart.getLayout ch + |> Layout.UpdateGeoById(id,map) + GenericChart.setLayout layout ch + ) + + /// Sets a mapbox for the given chart (will only work with traces supporting mapboxes, e.g. choroplethmapbox, scattermapbox) + [] + static member withMapbox(mapBox:Mapbox,[] ?Id:StyleParam.SubPlotId ) = + (fun (ch:GenericChart) -> + let layout = + let id = defaultArg Id (StyleParam.SubPlotId.MapBox 1) + GenericChart.getLayout ch + |> Layout.UpdateMapboxById(id,mapBox) + GenericChart.setLayout layout ch + ) + + /// Sets the map style for the given chart (will only work with traces supporting geo, e.g. choropleth, scattergeo) + /// + /// Parameters : + /// + /// FitBounds : Determines if and how this subplot's view settings are auto-computed to fit trace data + /// + /// Resolution : Sets the resolution of the base layers + /// + /// Scope : Set the scope of the map. + /// + /// Projection : Determines the type of projection used to display the map + /// + /// Center : Sets the (lon,lat) coordinates of the map's center. By default, the map's longitude center lies at the middle of the longitude range for scoped projection and above `projection.rotation.lon` otherwise. For all projection types, the map's latitude center lies at the middle of the latitude range by default. + /// + /// Visible : Wether or not the base layers are visible + /// + /// Domain : The domain of this geo subplot + /// + /// ShowCoastLine : Sets whether or not the coastlines are drawn. + /// + /// CoastLineColor : Sets the coastline color. + /// + /// CoastLineWidth : Sets the coastline stroke width (in px). + /// + /// ShowLand : Sets whether or not land masses are filled in color. + /// + /// LandColor : Sets the land mass color. + /// + /// ShowOcean : Sets whether or not oceans are filled in color. + /// + /// OceanColor : Sets the ocean color + /// + /// ShowLakes : Sets whether or not lakes are drawn. + /// + /// LakeColor : Sets the color of the lakes. + /// + /// ShowRivers : Sets whether or not rivers are drawn. + /// + /// RiverColor : Sets color of the rivers. + /// + /// RiverWidth : Sets the stroke width (in px) of the rivers. + /// + /// ShowCountries : Sets whether or not country boundaries are drawn. + /// + /// CountryColor : Sets line color of the country boundaries. + /// + /// CountryWidth : Sets line width (in px) of the country boundaries. + /// + /// ShowSubunits : Sets whether or not boundaries of subunits within countries (e.g. states, provinces) are drawn. + /// + /// SubunitColor : Sets the color of the subunits boundaries. + /// + /// SubunitWidth : Sets the stroke width (in px) of the subunits boundaries. + /// + /// ShowFrame : Sets whether or not a frame is drawn around the map. + /// + /// FrameColor : Sets the color the frame. + /// + /// FrameWidth : Sets the stroke width (in px) of the frame. + /// + /// BgColor : Set the background color of the map + /// + /// LatAxis : Sets the latitudinal axis for this geo trace + /// + /// LonAxis : Sets the longitudinal axis for this geo trace + [] + static member withGeoStyle + ( + [] ?Id: StyleParam.SubPlotId, + []?FitBounds : StyleParam.GeoFitBounds, + []?Resolution : StyleParam.GeoResolution, + []?Scope : StyleParam.GeoScope, + []?Projection : GeoProjection, + []?Center : (float*float), + []?Visible : bool, + []?Domain : Domain, + []?ShowCoastLines : bool, + []?CoastLineColor, + []?CoastLineWidth : float, + []?ShowLand : bool, + []?LandColor, + []?ShowOcean : bool, + []?OceanColor, + []?ShowLakes : bool, + []?LakeColor, + []?ShowRivers : bool, + []?RiverColor, + []?RiverWidth : float, + []?ShowCountries : bool, + []?CountryColor, + []?CountryWidth : float, + []?ShowSubunits : bool, + []?SubunitColor, + []?SubunitWidth : float, + []?ShowFrame : bool, + []?FrameColor, + []?FrameWidth : float, + []?BgColor, + []?LatAxis : LinearAxis, + []?LonAxis : LinearAxis + ) = + fun (ch:GenericChart) -> + + let map = + Geo.init( + ?FitBounds = FitBounds , + ?Resolution = Resolution , + ?Scope = Scope , + ?Projection = Projection , + ?Center = Center , + ?Visible = Visible , + ?Domain = Domain , + ?ShowCoastLines = ShowCoastLines, + ?CoastLineColor = CoastLineColor, + ?CoastLineWidth = CoastLineWidth, + ?ShowLand = ShowLand , + ?LandColor = LandColor , + ?ShowOcean = ShowOcean , + ?OceanColor = OceanColor , + ?ShowLakes = ShowLakes , + ?LakeColor = LakeColor , + ?ShowRivers = ShowRivers , + ?RiverColor = RiverColor , + ?RiverWidth = RiverWidth , + ?ShowCountries = ShowCountries , + ?CountryColor = CountryColor , + ?CountryWidth = CountryWidth , + ?ShowSubunits = ShowSubunits , + ?SubunitColor = SubunitColor , + ?SubunitWidth = SubunitWidth , + ?ShowFrame = ShowFrame , + ?FrameColor = FrameColor , + ?FrameWidth = FrameWidth , + ?BgColor = BgColor , + ?LatAxis = LatAxis , + ?LonAxis = LonAxis + ) + let id = defaultArg Id (StyleParam.SubPlotId.Geo 1) + ch |> Chart.withGeo(map,id) + + [] + static member withGeoProjection(projectionType : StyleParam.GeoProjectionType, + []?Rotation , + []?Parallels, + []?Scale , + []?Id: StyleParam.SubPlotId + ) = + (fun (ch:GenericChart) -> + + let projection = + GeoProjection.init( + projectionType = projectionType, + ?Rotation = Rotation , + ?Parallels = Parallels , + ?Scale = Scale + ) + + let map = Geo.init(Projection = projection) + let id = defaultArg Id (StyleParam.SubPlotId.Geo 1) + ch |> Chart.withGeo(map,id) + ) + + /// Set the LayoutGrid options of a Chart + /// The number of rows in the grid. If you provide a 2D `subplots` array or a `yaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. + /// The number of columns in the grid. If you provide a 2D `subplots` array, the length of its longest row is used as the default. If you give an `xaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. + /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. + /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. + /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. + /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. + /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. + /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. + /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. + /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. + [] + static member withLayoutGridStyle + ( + []?SubPlots : (StyleParam.LinearAxisId * StyleParam.LinearAxisId) [] [], + []?XAxes : StyleParam.LinearAxisId [], + []?YAxes : StyleParam.LinearAxisId [], + []?Rows : int, + []?Columns : int, + []?RowOrder : StyleParam.LayoutGridRowOrder, + []?Pattern : StyleParam.LayoutGridPattern, + []?XGap : float, + []?YGap : float, + []?Domain : Domain, + []?XSide : StyleParam.LayoutGridXSide, + []?YSide : StyleParam.LayoutGridYSide + ) = + (fun (ch:GenericChart) -> + let layout = GenericChart.getLayout ch + let updatedGrid = + let currentGrid = + match layout.TryGetTypedValue "grid" with + | Some grid -> grid + | None -> LayoutGrid() + currentGrid + |> LayoutGrid.style( + ?SubPlots = SubPlots, + ?XAxes = XAxes , + ?YAxes = YAxes , + ?Rows = Rows , + ?Columns = Columns , + ?RowOrder = RowOrder, + ?Pattern = Pattern , + ?XGap = XGap , + ?YGap = YGap , + ?Domain = Domain , + ?XSide = XSide , + ?YSide = YSide + ) + let updatedLayout = layout |> Layout.SetLayoutGrid updatedGrid + GenericChart.setLayout updatedLayout ch) + + [] + static member withConfig (config:Config) = + (fun (ch:GenericChart) -> + GenericChart.setConfig config ch) + + [] + static member withAnnotations(annotations:seq) = + (fun (ch:GenericChart) -> + ch + |> GenericChart.mapLayout + (Layout.style (Annotations = annotations))) + + // Set the title of a Chart + [] + static member withTitle(title,[] ?TitleFont) = + (fun (ch:GenericChart) -> + let layout = + Layout() + |> Layout.style( + Title= + Title.init( + Text = title, + ?Font = TitleFont + ) + ) + GenericChart.addLayout layout ch + ) + + + // Set showLegend of a Chart + [] + static member withLegend(showlegend) = + (fun (ch:GenericChart) -> + let layout = + Layout() + |> Layout.style(ShowLegend=showlegend) + GenericChart.addLayout layout ch + ) + + + // Set the size of a Chart + [] + static member withSize + ( + [] ?Width: int, + [] ?Height: int + ) = + + fun (ch:GenericChart) -> + let layout = + GenericChart.getLayout ch + |> Layout.style (?Width=Width,?Height=Height) + GenericChart.setLayout layout ch + + + + // Set the size of a Chart + [] + static member withSize(width:float,height:float) = + Chart.withSize(Width = int width, Height = int height) + + // Set the margin of a Chart + [] + static member withMargin(margin:Margin) = + (fun (ch:GenericChart) -> + let layout = + GenericChart.getLayout ch + |> Layout.style (Margin=margin) + GenericChart.setLayout layout ch) + + // Set the margin of a Chart + [] + static member withMarginSize + ( + [] ?Left, + [] ?Right, + [] ?Top, + [] ?Bottom, + [] ?Pad, + [] ?Autoexpand + ) = + let margin = + Margin.init ( ?Left=Left,?Right=Right,?Top=Top,?Bottom=Bottom,?Pad=Pad,?Autoexpand=Autoexpand ) + Chart.withMargin(margin) + + [] + static member withTemplate(template: Template) = + (fun (ch:GenericChart) -> + ch + |> GenericChart.mapLayout (fun l -> + template |> DynObj.setValue l "template" + l + ) + ) + + // TODO: Include withLegend & withLegendStyle + +//Specifies the shape type to be drawn. If "line", a line is drawn from (`x0`,`y0`) to (`x1`,`y1`) If "circle", a circle is drawn from +//((`x0`+`x1`)/2, (`y0`+`y1`)/2)) with radius (|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|) If "rect", a rectangle is drawn linking +//(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`) + [] + static member withShape(shape:Shape) = + (fun (ch:GenericChart) -> + let layout = + GenericChart.getLayout ch + |> Layout.style (Shapes=[shape]) + GenericChart.setLayout layout ch) + + + [] + static member withShapes(shapes:Shape seq) = + (fun (ch:GenericChart) -> + let layout = + GenericChart.getLayout ch + |> Layout.style (Shapes=shapes) + GenericChart.setLayout layout ch) + + + // ####################### + /// Create a combined chart with the given charts merged + [] + static member combine(gCharts:seq) = + GenericChart.combine gCharts + + /// + /// Creates a subplot grid with the given dimensions (nRows x nCols) for the input charts. + /// + /// The number of rows in the grid. If you provide a 2D `subplots` array or a `yaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. + /// The number of columns in the grid. If you provide a 2D `subplots` array, the length of its longest row is used as the default. If you give an `xaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. + /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. + /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. + /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. + /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. + /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. + /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. + /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. + /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. + [] + static member Grid (nRows: int, nCols: int, + []?SubPlots : (StyleParam.LinearAxisId*StyleParam.LinearAxisId) [] [], + []?XAxes : StyleParam.LinearAxisId [], + []?YAxes : StyleParam.LinearAxisId [], + []?RowOrder : StyleParam.LayoutGridRowOrder, + []?Pattern : StyleParam.LayoutGridPattern, + []?XGap : float, + []?YGap : float, + []?Domain : Domain, + []?XSide : StyleParam.LayoutGridXSide, + []?YSide : StyleParam.LayoutGridYSide + ) = + fun (gCharts:#seq) -> + + let pattern = defaultArg Pattern StyleParam.LayoutGridPattern.Independent + + let hasSharedAxes = pattern = StyleParam.LayoutGridPattern.Coupled + + // rows x cols coordinate grid + let gridCoordinates = + Array.init nRows (fun i -> + Array.init nCols (fun j -> + i+1,j+1 + ) + ) + |> Array.concat + + // extract all axes from the plots to later add them with an updated axis anchor + // TODO: currently only gets the default (first) x and y axis. There might be charts with multiple axes which might cause havoc downstream. + // those should either be removed or accounted for + let axes = + gCharts + |> Seq.map (fun gChart -> + gChart + |> GenericChart.getLayout + |> fun l -> + let xAxis = l.TryGetTypedValue "xaxis" |> Option.defaultValue (LinearAxis.init()) + let yAxis = l.TryGetTypedValue "yaxis" |> Option.defaultValue (LinearAxis.init()) + xAxis,yAxis + ) + + gCharts + |> Seq.zip gridCoordinates + |> Seq.zip axes + |> Seq.mapi (fun i ((xAxis,yAxis), ((y,x), gChart)) -> + + let xAnchor, yAnchor = + if hasSharedAxes then + x, y //set axis anchors according to grid coordinates + else + i+1, i+1 //set individual axis anchors for each subplot + + gChart + |> Chart.withAxisAnchor(xAnchor,yAnchor) // set adapted axis anchors + |> Chart.withXAxis(xAxis,(StyleParam.SubPlotId.XAxis (i+1))) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) + |> Chart.withYAxis(yAxis,(StyleParam.SubPlotId.YAxis (i+1))) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) + |> GenericChart.mapLayout (fun l -> + if i > 0 then + // remove default axes from consecutive charts, otherwise they will override the first one + l.Remove("xaxis") |> ignore + l.Remove("yaxis") |> ignore + l + ) + ) + |> Chart.combine + |> Chart.withLayoutGrid ( + LayoutGrid.init( + Rows = nRows, + Columns = nCols, + Pattern = pattern, + ?SubPlots = SubPlots, + ?XAxes = XAxes, + ?YAxes = YAxes, + ?RowOrder = RowOrder, + ?XGap = XGap, + ?YGap = YGap, + ?Domain = Domain, + ?XSide = XSide, + ?YSide = YSide + ) + ) + + /// + /// Creates a subplot grid with the the dimensions of the input 2D sequence containing the charts to render in the respective cells. + /// + /// ATTENTION: when the individual rows do not have the same amount of charts, they will be filled with dummy charts TO THE RIGHT. + /// + /// prevent this behaviour by using Chart.Invisible at the cells that should be empty. + /// + /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. + /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. + /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. + /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. + /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. + /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. + /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. + /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. + [] + static member Grid + ( + []?SubPlots : (StyleParam.LinearAxisId*StyleParam.LinearAxisId) [] [], + []?XAxes : StyleParam.LinearAxisId [], + []?YAxes : StyleParam.LinearAxisId [], + []?RowOrder : StyleParam.LayoutGridRowOrder, + []?Pattern : StyleParam.LayoutGridPattern, + []?XGap : float, + []?YGap : float, + []?Domain : Domain, + []?XSide : StyleParam.LayoutGridXSide, + []?YSide : StyleParam.LayoutGridYSide + ) = + fun (gCharts:#seq<#seq>) -> + + let nRows = Seq.length gCharts + let nCols = Seq.maxBy Seq.length gCharts |> Seq.length + + if Seq.exists (fun s -> (s |> Seq.length) <> nCols) gCharts then + printfn "WARNING: not all rows contain the same amount of charts." + printfn "The rows will be filled TO THE RIGHT with invisible dummy charts." + printfn "To have more positional control, use Chart.Empty() in your Grid where you want to have empty cells." + + let copy = + gCharts + |> Seq.map Seq.cast // this is ugly but i did not find another way for the inner seq to be be a flexible type (so you can use list, array, and seq). + + let newGrid = + copy + |> Seq.map (fun (row) -> + let nCharts = Seq.length row + if nCharts <> nCols then + seq {yield! row; for i in nCharts .. nCols-1 do yield Chart.Invisible()} + else + row + ) + |> Seq.concat + + newGrid + |> Chart.Grid( + nRows,nCols, + ?SubPlots = SubPlots, + ?XAxes = XAxes, + ?YAxes = YAxes, + ?RowOrder = RowOrder, + ?Pattern = Pattern, + ?XGap = XGap, + ?YGap = YGap, + ?Domain = Domain, + ?XSide = XSide, + ?YSide = YSide + ) + + else + gCharts + |> Seq.concat + |> Chart.Grid( + nRows,nCols, + ?SubPlots = SubPlots, + ?XAxes = XAxes, + ?YAxes = YAxes, + ?RowOrder = RowOrder, + ?Pattern = Pattern, + ?XGap = XGap, + ?YGap = YGap, + ?Domain = Domain, + ?XSide = XSide, + ?YSide = YSide + ) + + /// Creates a chart stack (a subplot grid with one column) from the input charts. + /// + /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. + /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. + /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. + /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. + /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. + /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. + /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. + /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. + /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. + [] + static member SingleStack + ( + []?SubPlots : (StyleParam.LinearAxisId*StyleParam.LinearAxisId) [] [], + []?XAxes : StyleParam.LinearAxisId [], + []?YAxes : StyleParam.LinearAxisId [], + []?RowOrder : StyleParam.LayoutGridRowOrder, + []?Pattern : StyleParam.LayoutGridPattern, + []?XGap : float, + []?YGap : float, + []?Domain : Domain, + []?XSide : StyleParam.LayoutGridXSide, + []?YSide : StyleParam.LayoutGridYSide + ) = + + fun (gCharts: #seq) -> + + gCharts + |> Chart.Grid( + nRows = Seq.length gCharts, + nCols = 1, + ?SubPlots = SubPlots, + ?XAxes = XAxes, + ?YAxes = YAxes, + ?RowOrder = RowOrder, + ?Pattern = Pattern, + ?XGap = XGap, + ?YGap = YGap, + ?Domain = Domain, + ?XSide = XSide, + ?YSide = YSide + ) + + /// Create a combined chart with the given charts merged + [] + [] + static member Stack ( [] ?Columns:int, + [] ?Space) = + (fun (charts:#seq) -> + + let col = defaultArg Columns 2 + let len = charts |> Seq.length + let colWidth = 1. / float col + let rowWidth = + let tmp = float len / float col |> ceil + 1. / tmp + let space = + let s = defaultArg Space 0.05 + if s < 0. || s > 1. then + printfn "Space should be between 0.0 - 1.0. Automaticaly set to default (0.05)" + 0.05 + else + s + + let contains3d ch = + ch + |> existsTrace (fun t -> + match t with + | :? Trace3D -> true + | _ -> false) + + charts + |> Seq.mapi (fun i ch -> + let colI,rowI,index = (i%col+1), (i/col+1),(i+1) + let xdomain = (colWidth * float (colI-1), (colWidth * float colI) - space ) + let ydomain = (1. - ((rowWidth * float rowI) - space ),1. - (rowWidth * float (rowI-1))) + + if contains3d ch then + let sceneId = StyleParam.SubPlotId.Scene (i+1) + + let scene = + Scene.init ( + Domain = + Domain.init(X = StyleParam.Range.MinMax xdomain,Y= StyleParam.Range.MinMax ydomain) + ) + let layout = + GenericChart.getLayout ch + |> Layout.addScene ( + sceneId, + scene + ) + ch + |> mapTrace + (fun t -> + t?scene <- (StyleParam.SubPlotId.toString sceneId) + t + ) + |> GenericChart.setLayout layout + //|> Chart.withAxisAnchor(X=index,Y=index) + else + + let xaxis,yaxis,layout = + let layout = GenericChart.getLayout ch + let xName, yName = StyleParam.LinearAxisId.X 1 |> StyleParam.LinearAxisId.toString, StyleParam.LinearAxisId.Y 1 |> StyleParam.LinearAxisId.toString + match (layout.TryGetTypedValue xName),(layout.TryGetTypedValue yName) with + | Some x, Some y -> + // remove axis + DynObj.remove layout xName + DynObj.remove layout yName + + x |> LinearAxis.style(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), + y |> LinearAxis.style(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), + layout + | Some x, None -> + // remove x - axis + DynObj.remove layout xName + x |> LinearAxis.style(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), + LinearAxis.init(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), + layout + | None, Some y -> + // remove y - axis + DynObj.remove layout yName + LinearAxis.init(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), + y |> LinearAxis.style(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), + layout + | None, None -> + LinearAxis.init(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), + LinearAxis.init(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), + layout + + ch + |> GenericChart.setLayout layout + |> Chart.withAxisAnchor(X=index,Y=index) + |> Chart.withXAxis(xaxis,StyleParam.SubPlotId.YAxis index) + |> Chart.withYAxis(yaxis,StyleParam.SubPlotId.XAxis index) + ) + + |> Chart.combine + ) + +// ############################################################ +// ####################### Apply to DisplayOptions + + /// Show chart in browser + [] + static member withDescription (description:ChartDescription) (ch:GenericChart) = + ch + |> mapDisplayOptions (DisplayOptions.style(Description=description)) + + + /// Adds the given additional html tags on the chart's DisplayOptions. They will be included in the document's + [] + static member withAdditionalHeadTags (additionalHeadTags:seq) (ch:GenericChart) = + ch + |> mapDisplayOptions ( fun d -> + let tags = d.TryGetTypedValue>("AdditionalHeadTags") + let newTags = + tags + |> Option.map (fun tags -> seq{yield! tags; yield! additionalHeadTags}) + |> Option.defaultValue additionalHeadTags + d |> DisplayOptions.style(AdditionalHeadTags=newTags) + ) + + /// Sets the given additional head tags on the chart's DisplayOptions. They will be included in the document's + [] + static member withHeadTags (headTags:seq) (ch:GenericChart) = + ch + |> mapDisplayOptions (DisplayOptions.style(AdditionalHeadTags=headTags)) + + + /// Adds the necessary script tags to render tex strings to the chart's DisplayOptions + [] + static member withMathTex ([]?AppendTags:bool) = + let tags = [ + """""" + """""" + ] + (fun (ch:GenericChart) -> + + if (AppendTags |> Option.defaultValue true) then + ch |> Chart.withAdditionalHeadTags tags + else + ch |> Chart.withHeadTags tags + ) + + /// Save chart as html single page + [] + static member saveHtmlAs + ( + pathName: string, + [] ?Verbose + ) = + fun (ch:GenericChart) -> + let html = GenericChart.toEmbeddedHTML ch + let file = sprintf "%s.html" pathName // remove file extension + File.WriteAllText(file, html) + + let verbose = defaultArg Verbose false + if verbose then + file |> openOsSpecificFile + + /// Show chart in browser + [] + static member show (ch:GenericChart) = + let guid = Guid.NewGuid().ToString() + let html = GenericChart.toEmbeddedHTML ch + let tempPath = Path.GetTempPath() + let file = sprintf "%s.html" guid + let path = Path.Combine(tempPath, file) + File.WriteAllText(path, html) + path |> openOsSpecificFile + + /// Show chart in browser + [] + static member showAsImage (format:StyleParam.ImageFormat) (ch:GenericChart) = + let guid = Guid.NewGuid().ToString() + let html = GenericChart.toEmbeddedImage format ch + let tempPath = Path.GetTempPath() + let file = sprintf "%s.html" guid + let path = Path.Combine(tempPath, file) + File.WriteAllText(path, html) + path |> openOsSpecificFile + + /// Sets the polar object with the given id on the chart layout + [] + static member withPolar(polar:Polar, [] ?Id) = + (fun (ch:GenericChart) -> + let layout = + let id = defaultArg Id (StyleParam.SubPlotId.Polar 1) + GenericChart.getLayout ch + |> Layout.updatePolarById(id,polar) + GenericChart.setLayout layout ch + ) + + + /// Sets the angular axis of the polar object with the given id on the chart layout + [] + static member withAngularAxis(angularAxis:AngularAxis, [] ?Id) = + (fun (ch:GenericChart) -> + + let id = defaultArg Id (StyleParam.SubPlotId.Polar 1) + let layout = GenericChart.getLayout ch + + let updatedPolar = + layout + |> Layout.tryGetPolarById(id) + |> Option.defaultValue (Polar.init()) + |> Polar.style(AngularAxis = angularAxis) + + let updatedLayout = + layout + |> Layout.updatePolarById(id,updatedPolar) + + GenericChart.setLayout updatedLayout ch + ) + + /// Sets the radial axis of the polar object with the given id on the chart layout + [] + static member withRadialAxis(radialAxis:RadialAxis, [] ?Id) = + (fun (ch:GenericChart) -> + let id = defaultArg Id (StyleParam.SubPlotId.Polar 1) + let layout = GenericChart.getLayout ch + + let updatedPolar = + layout + |> Layout.tryGetPolarById(id) + |> Option.defaultValue (Polar.init()) + |> Polar.style(RadialAxis = radialAxis) + + let updatedLayout = + layout + |> Layout.updatePolarById(id,updatedPolar) + + GenericChart.setLayout updatedLayout ch + ) + + /// Sets the color axis with the given id on the chart layout + [] + static member withColorAxis(colorAxis:ColorAxis, [] ?Id) = + (fun (ch:GenericChart) -> + let layout = + let id = defaultArg Id (StyleParam.SubPlotId.ColorAxis 1) + GenericChart.getLayout ch + |> Layout.updateColorAxisById(id,colorAxis) + GenericChart.setLayout layout ch + ) + + /// Sets the scene with the given id on the chart layout + [] + static member withScene(scene:Scene, [] ?Id) = + (fun (ch:GenericChart) -> + let layout = + let id = defaultArg Id (StyleParam.SubPlotId.Scene 1) + GenericChart.getLayout ch + |> Layout.updateSceneById(id,scene) + GenericChart.setLayout layout ch + ) diff --git a/src/Plotly.NET/ChartAPI/Chart2D.fs b/src/Plotly.NET/ChartAPI/Chart2D.fs new file mode 100644 index 000000000..c98bdedb7 --- /dev/null +++ b/src/Plotly.NET/ChartAPI/Chart2D.fs @@ -0,0 +1,1650 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO +//open FSharp.Care.Collections + +open GenericChart +open System.Runtime.InteropServices + +[] +module Chart2D = + + type Chart with + + static member internal renderScatterTrace (useWebGL:bool) (style: Trace2D -> Trace2D) = + if useWebGL then + Trace2D.initScatterGL style + |> GenericChart.ofTraceObject + else + Trace2D.initScatter style + |> GenericChart.ofTraceObject + + static member internal renderHeatmapTrace (useWebGL:bool) (style: Trace2D -> Trace2D) = + if useWebGL then + Trace2D.initHeatmapGL style + |> GenericChart.ofTraceObject + else + Trace2D.initHeatmap style + |> GenericChart.ofTraceObject + + /// Creates a Scatter chart. Scatter charts are the basis of Point, Line, and Bubble Charts in Plotly, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Determines the drawing mode for this scatter trace. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// Sets the Line Dash style + /// Sets the Line width + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Scatter(x, y, mode, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Dash , + [] ?Width : float , + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + + let style = + Trace2DStyle.Scatter( + X = x , + Y = y , + Mode = mode , + ?StackGroup = StackGroup , + ?Orientation= Orientation , + ?GroupNorm = GroupNorm + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterTrace useWebGL style + + + /// Creates a Scatter chart. Scatter charts are the basis of Point, Line, and Bubble Charts in Plotly, and can be customized as such. We also provide abstractions for those: Chart.Line, Chart.Point, Chart.Bubble + /// Sets the x,y coordinates of the plotted data. + /// Determines the drawing mode for this scatter trace. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// Sets the Line Dash style + /// Sets the Line width + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Scatter(xy,mode, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Dash , + [] ?Width , + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool) = + let x,y = Seq.unzip xy + Chart.Scatter(x, y, mode, + ?Name = Name , + ?Showlegend = Showlegend , + ?MarkerSymbol = MarkerSymbol , + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition = TextPosition , + ?TextFont = TextFont , + ?Dash = Dash , + ?Width = Width , + ?StackGroup = StackGroup , + ?Orientation = Orientation , + ?GroupNorm = GroupNorm , + ?UseWebGL = UseWebGL + ) + + + + /// Creates a Point chart, which uses Points in a 2D space to visualize data. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Point(x, y, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + // if text position or font is set, then show labels (not only when hovering) + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + let useWebGL = defaultArg UseWebGL false + + let style = + Trace2DStyle.Scatter( + X = x, + Y = y, + Mode = changeMode StyleParam.Mode.Markers, + ?StackGroup = StackGroup, + ?Orientation= Orientation, + ?GroupNorm = GroupNorm) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + Chart.renderScatterTrace useWebGL style + + /// Creates a Point chart, which uses Points in a 2D space to visualize data. + /// Sets the x,y coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Point(xy, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + let x,y = Seq.unzip xy + Chart.Point(x, y, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?StackGroup = StackGroup, + ?Orientation = Orientation, + ?GroupNorm = GroupNorm, + ?UseWebGL = UseWebGL + ) + + + /// Creates a Line chart, which uses a Line plotted between the given datums in a 2D space to visualize typically an evolution of Y depending on X. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Wether to show markers for the individual data points + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// Sets the Line Dash style + /// Sets the Line width + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Line(x, y, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + // if text position or font is set than show labels (not only when hovering) + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + + let style = + Trace2DStyle.Scatter( + X = x, + Y = y, + Mode = changeMode StyleParam.Mode.Lines, + ?StackGroup = StackGroup, + ?Orientation= Orientation, + ?GroupNorm = GroupNorm) + >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterTrace useWebGL style + + + /// Creates a Line chart, which uses a Line plotted between the given datums in a 2D space to visualize typically an evolution of Y depending on X. + /// Sets the x,y coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Wether to show markers for the individual data points + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// Sets the Line Dash style + /// Sets the Line width + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Line(xy, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + let x,y = Seq.unzip xy + Chart.Line( + x, y, + ?Name = Name, + ?ShowMarkers = ShowMarkers, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?Dash = Dash, + ?Width = Width, + ?StackGroup = StackGroup, + ?Orientation = Orientation, + ?GroupNorm = GroupNorm, + ?UseWebGL = UseWebGL + ) + + + /// Creates a Spline chart. A spline chart is a line chart in which data points are connected by smoothed curves: this modification is aimed to improve the design of a chart. + /// Very similar to Line Plots, spline charts are typically used to visualize an evolution of Y depending on X. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Wether to show markers for the individual data points + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// Sets the Line Dash style + /// Sets the Line width + /// 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 amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Spline(x, y, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?Smoothing: float, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + let style = + Trace2DStyle.Scatter( + X = x, + Y = y, + Mode=changeMode StyleParam.Mode.Lines, + ?StackGroup = StackGroup, + ?Orientation= Orientation, + ?GroupNorm = GroupNorm) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + Chart.renderScatterTrace useWebGL style + + + /// Creates a Spline chart. A spline chart is a line chart in which data points are connected by smoothed curves: this modification is aimed to improve the design of a chart. + /// Very similar to Line Plots, spline charts are typically used to visualize an evolution of Y depending on X. + /// Sets the x,y coordinates of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Wether to show markers for the individual data points + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// Sets the Line Dash style + /// Sets the Line width + /// 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 amount of smoothing. "0" corresponds to no smoothing (equivalent to a "linear" shape). Use values between 0. and 1.3 + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Spline(xy, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?Smoothing, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + let x,y = Seq.unzip xy + Chart.Spline(x, y, + ?Name = Name, + ?ShowMarkers = ShowMarkers, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?Dash = Dash, + ?Width = Width, + ?Smoothing = Smoothing, + ?StackGroup = StackGroup, + ?Orientation = Orientation, + ?GroupNorm = GroupNorm, + ?UseWebGL = UseWebGL + ) + + + /// Creates a bubble chart. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes. + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets the bubble size of the plotted data + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Bubble(x, y,sizes:seq<#IConvertible>, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + // if text position or font is set than show labels (not only when hovering) + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + let style = + Trace2DStyle.Scatter( + X = x, + Y = y, + Mode=changeMode StyleParam.Mode.Markers, + ?StackGroup = StackGroup, + ?Orientation= Orientation, + ?GroupNorm = GroupNorm) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol, MultiSizes=sizes) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + Chart.renderScatterTrace useWebGL style + + /// Creates a bubble chart. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes. + /// Sets the x coordinates, y coordinates, and bubble sizes of the plotted data. + /// Sets the trace name. The trace name appear as the legend item and on hover + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the type of symbol that datums are displayed as + /// Sets Line/Marker Color + /// Sets the Opacity of the trace + /// Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the text font of this trace + /// 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 + /// If true, plotly.js will use the WebGL engine to render this chart. use this when you want to render many objects at once. + static member Bubble(xysizes,[] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?StackGroup , + [] ?Orientation , + [] ?GroupNorm , + []?UseWebGL : bool + ) = + let x,y,sizes = Seq.unzip3 xysizes + Chart.Bubble( + x, y,sizes, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?StackGroup = StackGroup, + ?Orientation = Orientation, + ?GroupNorm = GroupNorm, + ?UseWebGL = UseWebGL + ) + + /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line + static member Range(x, y, upper, lower,mode, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?Color, + [] ?RangeColor, + [] ?Labels, + [] ?UpperLabels, + [] ?LowerLabels, + [] ?TextPosition, + [] ?TextFont, + [] ?LowerName: string, + [] ?UpperName: string) = + + let upperName = defaultArg UpperName "upper" + let lowerName = defaultArg LowerName "lower" + + // if text position or font is set than show labels (not only when hovering) + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + let trace = + Trace2D.initScatter ( + Trace2DStyle.Scatter(X = x,Y = y, Mode=mode, ?Fillcolor=Color) ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend) + |> TraceStyle.Line(?Color=Color) + |> TraceStyle.Marker(?Color=Color) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let lower = + Trace2D.initScatter ( + Trace2DStyle.Scatter(X = x,Y = lower, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor) ) + |> TraceStyle.TraceInfo(?Name = Some lowerName, Showlegend=false) + |> TraceStyle.Line(Width=0.) + |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,0,0.5)") + |> TraceStyle.TextLabel(?Text=LowerLabels,?Textposition=TextPosition,?Textfont=TextFont) + + let upper = + Trace2D.initScatter ( + Trace2DStyle.Scatter(X = x,Y = upper, Mode=StyleParam.Mode.Lines, ?Fillcolor=RangeColor, Fill=StyleParam.Fill.ToNext_y) ) + |> TraceStyle.TraceInfo(?Name = Some upperName, Showlegend=false) + |> TraceStyle.Line(Width=0.) + |> TraceStyle.Marker(Color=if RangeColor.IsSome then RangeColor.Value else "rgba(0,0,0,0.5)") + |> TraceStyle.TextLabel(?Text=UpperLabels,?Textposition=TextPosition,?Textfont=TextFont) + + GenericChart.MultiChart ([lower;upper;trace],Layout(),Config(), DisplayOptions()) + + /// Displays a range of data by plotting two Y values per data point, with each Y value being drawn as a line + static member Range(xy, upper, lower, mode, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?Color, + [] ?RangeColor, + [] ?Labels, + [] ?UpperLabels, + [] ?LowerLabels, + [] ?TextPosition, + [] ?TextFont, + [] ?LowerName, + [] ?UpperName) = + let x,y = Seq.unzip xy + Chart.Range(x, y, upper, lower, mode, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?Color=Color,?RangeColor=RangeColor,?Labels=Labels,?UpperLabels=UpperLabels,?LowerLabels=LowerLabels,?TextPosition=TextPosition,?TextFont=TextFont,?LowerName=LowerName,?UpperName=UpperName) + + + /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. + static member Area(x, y, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width) = + // if text position or font is set than show labels (not only when hovering) + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + Trace2D.initScatter ( + Trace2DStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Lines,Fill=StyleParam.Fill.ToZero_y) ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. + static member Area(xy, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width) = + let x,y = Seq.unzip xy + Chart.Area(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + + + /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. + static member SplineArea(x, y, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?Smoothing) = + // if text position or font is set than show labels (not only when hovering) + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + Trace2D.initScatter ( + Trace2DStyle.Scatter(X = x,Y = y, Mode=changeMode StyleParam.Mode.Lines,Fill=StyleParam.Fill.ToZero_y) ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. + static member SplineArea(xy, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?Smoothing) = + let x,y = Seq.unzip xy + Chart.SplineArea(x, y, ?Name=Name,?ShowMarkers=ShowMarkers,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width,?Smoothing=Smoothing) + + /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. + static member StackedArea(x, y, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width) = + Trace2D.initScatter ( + Trace2DStyle.Scatter(X = x,Y = y, Mode=StyleParam.Mode.Lines) ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> TraceStyle.SetStackGroup "static" + |> GenericChart.ofTraceObject + + /// Emphasizes the degree of change over time and shows the relationship of the parts to a whole. + static member StackedArea(xy, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width) = + let x,y = Seq.unzip xy + Chart.StackedArea(x, y, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + + + /// Creates a Funnel chart. + /// Funnel charts visualize stages in a process using length-encoded bars. This trace can be used to show data in either a part-to-whole representation wherein each item appears in a single stage, or in a "drop-off" representation wherein each item appears in each stage it traversed. See also the "funnelarea" trace type for a different approach to visualizing funnel data. + /// + /// Parameters: + /// + /// x : Sets the x coordinates. + /// + /// y : Sets the y coordinates. + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition : Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// Color : Sets Marker Color + /// + /// Line : Line type + /// + /// x0 : Alternate to `x`. Builds a linear space of x coordinates. Use with `dx` where `x0` is the starting coordinate and `dx` the step. + /// + /// dX : Sets the x coordinate step. See `x0` for more info. + /// + /// y0 : Alternate to `y`. Builds a linear space of y coordinates. Use with `dy` where `y0` is the starting coordinate and `dy` the step. + /// + /// dY : Sets the y coordinate step. See `y0` for more info. + /// + /// Width : Sets the bar width (in position axis units). + /// + /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. + /// + /// Orientation : Sets the orientation of the funnels. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). By default funnels are tend to be oriented horizontally; unless only "y" array is presented or orientation is set to "v". Also regarding graphs including only 'horizontal' funnels, "autorange" on the "y-axis" are set to "reversed". + /// + /// Alignmentgroup : 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. + /// + /// Offsetgroup : 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. + /// + /// Cliponaxis : Determines whether the text nodes are clipped about the subplot axes. To show the text nodes above axis lines and tick labels, make sure to set `xaxis.layer` and `yaxis.layer` to "below traces". + /// + /// Connector : Connector type + /// + /// Insidetextfont : Sets the font used for `text` lying inside the bar. + /// + /// Outsidetextfont: Sets the font used for `text` lying outside the bar. + static member Funnel (x, y, + [] ?Name , + [] ?Showlegend , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Color , + [] ?Line , + [] ?x0 , + [] ?dX , + [] ?y0 , + [] ?dY , + [] ?Width , + [] ?Offset , + [] ?Orientation , + [] ?Alignmentgroup , + [] ?Offsetgroup , + [] ?Cliponaxis , + [] ?Connector , + [] ?Insidetextfont , + [] ?Outsidetextfont + ) = + + Trace2D.initFunnel( + Trace2DStyle.Funnel( + x = x , + y = y , + ?x0 = x0 , + ?dX = dX , + ?y0 = y0 , + ?dY = dY , + ?Width = Width , + ?Offset = Offset , + ?Orientation = Orientation , + ?Alignmentgroup = Alignmentgroup , + ?Offsetgroup = Offsetgroup , + ?Cliponaxis = Cliponaxis , + ?Connector = Connector , + ?Insidetextfont = Insidetextfont , + ?Outsidetextfont = Outsidetextfont + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Line=Line) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a waterfall chart. Waterfall charts are special bar charts that help visualizing the cumulative effect of sequentially introduced positive or negative values + /// + /// Parameters: + /// + /// x : Sets the x coordinates. + /// + /// y : Sets the y coordinates. + /// + /// Base : Sets where the bar base is drawn (in position axis units). + /// + /// Width : Sets the bar width (in position axis units). + /// + /// Measure : An array containing types of values. By default the values are considered as 'relative'. However; it is possible to use 'total' to compute the sums. Also 'absolute' could be applied to reset the computed total or to declare an initial value where needed. + /// + /// Orientation : Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). + /// + /// Connector : Sets the styling of the connector lines + /// + /// AlignmentGroup : 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. + /// + /// OffsetGroup : 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. + /// + /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. + static member Waterfall + ( + x : #IConvertible seq, + y : #IConvertible seq, + []?Base : IConvertible , + []?Width : float , + []?Measure : StyleParam.WaterfallMeasure seq, + []?Orientation : StyleParam.Orientation, + []?Connector : WaterfallConnector , + []?AlignmentGroup : string, + []?OffsetGroup : string, + []?Offset + ) = + Trace2D.initWaterfall( + Trace2DStyle.Waterfall(x,y, + ?Base = Base , + ?Width = Width , + ?Measure = Measure , + ?Orientation = Orientation , + ?Connector = Connector , + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup , + ?Offset = Offset + ) + ) + |> GenericChart.ofTraceObject + + + /// Creates a waterfall chart. Waterfall charts are special bar charts that help visualizing the cumulative effect of sequentially introduced positive or negative values + /// + /// Parameters: + /// + /// xyMeasures : triple sequence containing x coordinates, y coordinates, and the type of measure used for each bar. + /// + /// Base : Sets where the bar base is drawn (in position axis units). + /// + /// Width : Sets the bar width (in position axis units). + /// + /// Orientation : Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). + /// + /// Connector : Sets the styling of the connector lines + /// + /// AlignmentGroup : 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. + /// + /// OffsetGroup : 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. + /// + /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. + static member Waterfall + ( + xyMeasure: (#IConvertible*#IConvertible*StyleParam.WaterfallMeasure) seq, + []?Base : IConvertible , + []?Width : float , + []?Orientation : StyleParam.Orientation, + []?Connector : WaterfallConnector , + []?AlignmentGroup : string, + []?OffsetGroup : string, + []?Offset + ) = + let x,y,measure = Seq.unzip3 xyMeasure + Trace2D.initWaterfall( + Trace2DStyle.Waterfall(x,y, + ?Base = Base , + ?Width = Width , + ?Measure = Some measure , + ?Orientation = Orientation , + ?Connector = Connector , + ?AlignmentGroup = AlignmentGroup, + ?OffsetGroup = OffsetGroup , + ?Offset = Offset + ) + ) + |> GenericChart.ofTraceObject + + + /// Illustrates comparisons among individual items + static member Column(keys, values, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker: Marker) = + + let marker = + match Marker with + | Some marker -> marker |> TraceObjects.Marker.style(?Color=Color) + | Option.None -> TraceObjects.Marker.init (?Color=Color) + + Trace2D.initBar (Trace2DStyle.Bar(X = keys,Y = values,Marker=marker)) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Illustrates comparisons among individual items + static member Column(keysvalues, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let keys,values = Seq.unzip keysvalues + Chart.Column(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + + + /// Displays series of column chart type as stacked columns. + static member StackedColumn(keys, values, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let marker = + match Marker with + | Some marker -> marker |> TraceObjects.Marker.style(?Color=Color) + | Option.None -> TraceObjects.Marker.init (?Color=Color) + + Trace2D.initBar (Trace2DStyle.Bar(X = keys,Y = values,Marker=marker)) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + //|> GenericChart.setLayout (Layout.init (Layout.style(Barmode=StyleParam.Barmode.Stack))) + |> GenericChart.setLayout (Layout.init (BarMode=StyleParam.BarMode.Stack)) + + + /// Displays series of column chart type as stacked columns. + static member StackedColumn(keysvalues, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let keys,values = Seq.unzip keysvalues + Chart.StackedColumn(keys, values,?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + + + /// Illustrates comparisons among individual items + static member Bar(keys, values, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let marker = + match Marker with + | Some marker -> marker |> TraceObjects.Marker.style(?Color=Color) + | Option.None -> TraceObjects.Marker.init (?Color=Color) + Trace2D.initBar (Trace2DStyle.Bar(X = values,Y = keys,Marker=marker,Orientation = StyleParam.Orientation.Horizontal)) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Illustrates comparisons among individual items + static member Bar(keysvalues, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let keys,values = Seq.unzip keysvalues + Chart.Bar(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + + + /// Displays series of tcolumn chart type as stacked bars. + static member StackedBar(keys, values, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let marker = + match Marker with + | Some marker -> marker |> TraceObjects.Marker.style(?Color=Color) + | Option.None -> TraceObjects.Marker.init (?Color=Color) + Trace2D.initBar (Trace2DStyle.Bar(X = values,Y = keys,Marker=marker,Orientation = StyleParam.Orientation.Horizontal)) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + //|> GenericChart.setLayout (Layout.init (Layout.style(Barmode=StyleParam.Barmode.Stack))) + |> GenericChart.setLayout (Layout.init (BarMode=StyleParam.BarMode.Stack)) + + + /// Displays series of tcolumn chart type as stacked bars. + static member StackedBar(keysvalues, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Marker) = + let keys,values = Seq.unzip keysvalues + Chart.StackedBar(keys, values, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Marker=Marker) + + /// Computes a histogram with auto-determined the bin size. + static member Histogram + ( + data, + [] ?Orientation, + [] ?Name, + [] ?Showlegend, + [] ?Opacity, + [] ?Color, + [] ?HistNorm, + [] ?HistFunc, + [] ?nBinsx, + [] ?nBinsy, + [] ?Xbins, + [] ?Ybins, + // TODO + [] ?xError, + [] ?yError + ) = + + Trace2D.initHistogram ( + Trace2DStyle.Histogram ( + X=data, + ?Orientation=Orientation, + ?HistNorm=HistNorm, + ?HistFunc=HistFunc, + ?nBinsx=nBinsx, + ?nBinsy=nBinsy, + ?xBins=Xbins, + ?yBins=Ybins + ) + ) + |> TraceStyle.Marker(?Color=Color) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + + |> GenericChart.ofTraceObject + + /// Computes the bi-dimensional histogram of two data samples and auto-determines the bin size. + static member Histogram2d + ( + x,y, + [] ?Z, + [] ?Name, + [] ?Showlegend, + [] ?Opacity, + [] ?Colorscale, + [] ?Showscale, + [] ?zSmooth, + [] ?ColorBar, + [] ?zAuto, + [] ?zMin, + [] ?zMax, + [] ?nBinsx, + [] ?nBinsy, + [] ?xBins, + [] ?yBins, + [] ?HistNorm, + [] ?HistFunc + ) = + Trace2D.initHistogram2d ( + Trace2DStyle.Histogram2d ( + X=x, + Y=y, + ?Z=Z, + ?Colorscale=Colorscale, + ?Showscale=Showscale, + ?zSmooth=zSmooth, + ?ColorBar=ColorBar, + ?zAuto=zAuto, + ?zMin=zMin, + ?zMax=zMax, + ?nBinsx=nBinsx, + ?nBinsy=nBinsy, + ?xBins=xBins, + ?yBins=yBins, + ?HistNorm=HistNorm, + ?HistFunc=HistFunc + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. + static member BoxPlot + ( + [] ?x, + [] ?y, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Fillcolor, + [] ?Opacity, + [] ?Whiskerwidth, + [] ?Boxpoints, + [] ?Boxmean, + [] ?Jitter, + [] ?Pointpos, + [] ?Orientation, + [] ?Marker, + [] ?Line, + [] ?Alignmentgroup, + [] ?Offsetgroup, + [] ?Notched, + [] ?NotchWidth, + [] ?QuartileMethod + ) = + Trace2D.initBoxPlot ( + Trace2DStyle.BoxPlot( + ?X=x, ?Y = y, + ?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints, + ?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation,?Fillcolor=Fillcolor, + ?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Notched=Notched,?NotchWidth=NotchWidth,?QuartileMethod=QuartileMethod + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color) + |> GenericChart.ofTraceObject + + + /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. + static member BoxPlot(xy, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Fillcolor, + [] ?Opacity, + [] ?Whiskerwidth, + [] ?Boxpoints, + [] ?Boxmean, + [] ?Jitter, + [] ?Pointpos, + [] ?Orientation, + [] ?Marker, + [] ?Line, + [] ?Alignmentgroup, + [] ?Offsetgroup, + [] ?Notched, + [] ?NotchWidth, + [] ?QuartileMethod + ) = + let x,y = Seq.unzip xy + Chart.BoxPlot(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Whiskerwidth=Whiskerwidth,?Boxpoints=Boxpoints,?Boxmean=Boxmean,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, + ?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Notched=Notched,?NotchWidth=NotchWidth,?QuartileMethod=QuartileMethod) + + + /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. + static member Violin + ( + [] ?x, + [] ?y, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Fillcolor, + [] ?Opacity, + [] ?Points, + [] ?Jitter, + [] ?Pointpos, + [] ?Orientation, + [] ?Width, + [] ?Marker, + [] ?Line, + [] ?Alignmentgroup, + [] ?Offsetgroup, + [] ?Box, + [] ?Bandwidth, + [] ?Meanline, + [] ?Scalegroup, + [] ?Scalemode, + [] ?Side, + [] ?Span, + [] ?SpanMode, + [] ?Uirevision + ) = + Trace2D.initViolin ( + Trace2DStyle.Violin( + ?X=x, ?Y = y,?Points=Points, + ?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation,?Fillcolor=Fillcolor, + ?Width=Width,?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Box=Box,?Bandwidth=Bandwidth,?Meanline=Meanline, + ?Scalegroup=Scalegroup,?Scalemode=Scalemode,?Side=Side,?Span=Span,?SpanMode=SpanMode,?Uirevision=Uirevision + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color) + |> GenericChart.ofTraceObject + + + /// Displays the distribution of data based on the five number summary: minimum, first quartile, median, third quartile, and maximum. + static member Violin(xy, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Fillcolor, + [] ?Opacity, + [] ?Points, + [] ?Jitter, + [] ?Pointpos, + [] ?Orientation, + [] ?Width, + [] ?Marker, + [] ?Line, + [] ?Alignmentgroup, + [] ?Offsetgroup, + [] ?Box, + [] ?Bandwidth, + [] ?Meanline, + [] ?Scalegroup, + [] ?Scalemode, + [] ?Side, + [] ?Span, + [] ?SpanMode, + [] ?Uirevision + ) = + let x,y = Seq.unzip xy + Chart.Violin(x, y, ?Name=Name,?Showlegend=Showlegend,?Color=Color,?Fillcolor=Fillcolor,?Opacity=Opacity,?Points=Points,?Jitter=Jitter,?Pointpos=Pointpos,?Orientation=Orientation, + ?Width=Width,?Marker=Marker,?Line=Line,?Alignmentgroup=Alignmentgroup,?Offsetgroup=Offsetgroup,?Box=Box,?Bandwidth=Bandwidth,?Meanline=Meanline, + ?Scalegroup=Scalegroup,?Scalemode=Scalemode,?Side=Side,?Span=Span,?SpanMode=SpanMode,?Uirevision=Uirevision + ) + + + /// Computes the bi-dimensional histogram of two data samples and auto-determines the bin size. + static member Histogram2dContour + ( + x,y, + [] ?Z, + [] ?Name, + [] ?Colorscale, + [] ?Showscale, + [] ?Line, + [] ?zSmooth, + [] ?ColorBar, + [] ?zAuto, + [] ?zMin, + [] ?zMax, + [] ?nBinsx, + [] ?nBinsy, + [] ?xBins, + [] ?yBins, + [] ?HistNorm, + [] ?HistFunc + ) = + Trace2D.initHistogram2dContour ( + Trace2DStyle.Histogram2dContour (X=x, Y=y,? Z=Z,?Line=Line, + ?Colorscale=Colorscale, + ?Showscale=Showscale, + ?zSmooth=zSmooth, + ?ColorBar=ColorBar, + ?zAuto=zAuto, + ?zMin=zMin, + ?zMax=zMax, + ?nBinsx=nBinsx, + ?nBinsy=nBinsy, + ?xBins=xBins, + ?yBins=yBins, + ?HistNorm=HistNorm, + ?HistFunc=HistFunc + ) + ) + |> GenericChart.ofTraceObject + + /// Shows a graphical representation of a 3-dimensional surface by plotting constant z slices, called contours, on a 2-dimensional format. + /// That is, given a value for z, lines are drawn for connecting the (x,y) coordinates where that z value occurs. + static member Heatmap(data:seq<#seq<#IConvertible>>, + [] ?ColNames, + [] ?RowNames, + [] ?Name, + [] ?Showlegend, + [] ?Opacity, + [] ?Colorscale, + [] ?Showscale, + [] ?Xgap, + [] ?Ygap, + [] ?zSmooth, + [] ?ColorBar, + []?UseWebGL : bool) + = + let style = + Trace2DStyle.Heatmap( + Z=data, + ?X=ColNames, + ?Y=RowNames, + ?Xgap=Xgap, + ?Ygap=Ygap, + ?Colorscale=Colorscale, + ?Showscale=Showscale, + ?zSmooth=zSmooth, + ?ColorBar=ColorBar + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderHeatmapTrace useWebGL style + + + /// Shows a graphical representation of data where the individual values contained in a matrix are represented as colors. + static member Contour(data:seq<#seq<#IConvertible>>, + [] ?X, + [] ?Y, + [] ?Name, + [] ?Showlegend, + [] ?Opacity, + [] ?Colorscale, + [] ?Showscale, + [] ?zSmooth, + [] ?ColorBar) = + Trace2D.initContour ( + Trace2DStyle.Contour( + Z=data,?X=X, ?Y=Y, + ?Colorscale=Colorscale,?Showscale=Showscale,?zSmooth=zSmooth,?ColorBar=ColorBar + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. + /// + /// ``open`` : Sets the open values. + /// + /// high : Sets the high values. + /// + /// low : Sets the low values. + /// + /// close : Sets the close values. + /// + /// x : Sets the x coordinates. If absent, linear coordinate will be generated. + /// + /// ?Increasing : Sets the Line style of the Increasing part of the chart + /// + /// ?Decreasing : Sets the Line style of the Decreasing part of the chart + /// + /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart + /// + /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. + /// + /// ?XCalendar : Sets the calendar system to use with `x` date data. + static member OHLC + ( + ``open`` : #IConvertible seq, + high : #IConvertible seq, + low : #IConvertible seq, + close : #IConvertible seq, + x : #IConvertible seq, + []?Increasing : Line, + []?Decreasing : Line, + []?Tickwidth : float, + []?Line : Line, + []?XCalendar : StyleParam.Calendar + ) = + Trace2D.initOHLC( + Trace2DStyle.OHLC( + ``open`` = ``open`` , + high = high , + low = low , + close = close , + x = x , + ?Increasing = Increasing , + ?Decreasing = Decreasing , + ?Tickwidth = Tickwidth , + ?Line = Line , + ?XCalendar = XCalendar + ) + ) + |> GenericChart.ofTraceObject + + /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. + /// + /// stockTimeSeries : tuple list of time * stock (OHLC) data + /// + /// ?Increasing : Sets the Line style of the Increasing part of the chart + /// + /// ?Decreasing : Sets the Line style of the Decreasing part of the chart + /// + /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart + /// + /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. + /// + /// ?XCalendar : Sets the calendar system to use with `x` date data. + static member OHLC + ( + stockTimeSeries: seq, + []?Increasing : Line, + []?Decreasing : Line, + []?Tickwidth : float, + []?Line : Line, + []?XCalendar : StyleParam.Calendar + ) = + Trace2D.initOHLC( + Trace2DStyle.OHLC( + ``open`` = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Open))) , + high = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.High))) , + low = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Low))) , + close = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Close))) , + x = (stockTimeSeries |> Seq.map fst) , + ?Increasing = Increasing , + ?Decreasing = Decreasing , + ?Tickwidth = Tickwidth , + ?Line = Line , + ?XCalendar = XCalendar + ) + ) + |> GenericChart.ofTraceObject + + /// Creates a candlestick chart. A candlestick cart is a style of financial chart used to describe price movements of a + /// security, derivative, or currency. Each "candlestick" typically shows one day, thus a one-month chart may show the 20 + /// trading days as 20 candlesticks. Candlestick charts can also be built using intervals shorter or longer than one day. + /// + /// ``open`` : Sets the open values. + /// + /// high : Sets the high values. + /// + /// low : Sets the low values. + /// + /// close : Sets the close values. + /// + /// x : Sets the x coordinates. If absent, linear coordinate will be generated. + /// + /// ?Increasing : Sets the Line style of the Increasing part of the chart + /// + /// ?Decreasing : Sets the Line style of the Decreasing part of the chart + /// + /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart + /// + /// ?WhiskerWidth : Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). + /// + /// ?XCalendar : Sets the calendar system to use with `x` date data. + static member Candlestick + ( + ``open`` : #IConvertible seq, + high : #IConvertible seq, + low : #IConvertible seq, + close : #IConvertible seq, + x : #IConvertible seq, + []?Increasing : Line, + []?Decreasing : Line, + []?WhiskerWidth : float, + []?Line : Line, + []?XCalendar : StyleParam.Calendar + ) = + Trace2D.initCandlestick( + Trace2DStyle.Candlestick( + ``open`` = ``open`` , + high = high , + low = low , + close = close , + x = x , + ?Increasing = Increasing , + ?Decreasing = Decreasing , + ?WhiskerWidth = WhiskerWidth, + ?Line = Line , + ?XCalendar = XCalendar + ) + ) + |> GenericChart.ofTraceObject + + /// Creates an OHLC (open-high-low-close) chart. OHLC charts are typically used to illustrate movements in the price of a financial instrument over time. + /// + /// stockTimeSeries : tuple list of time * stock (OHLC) data + /// + /// ?Increasing : Sets the Line style of the Increasing part of the chart + /// + /// ?Decreasing : Sets the Line style of the Decreasing part of the chart + /// + /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart + /// + /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. + /// + /// ?XCalendar : Sets the calendar system to use with `x` date data. + static member Candlestick + ( + stockTimeSeries: seq, + []?Increasing : Line, + []?Decreasing : Line, + []?WhiskerWidth : float, + []?Line : Line, + []?XCalendar : StyleParam.Calendar + ) = + Trace2D.initCandlestick( + Trace2DStyle.Candlestick( + ``open`` = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Open))) , + high = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.High))) , + low = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Low))) , + close = (stockTimeSeries |> Seq.map (snd >> (fun x -> x.Close))) , + x = (stockTimeSeries |> Seq.map fst) , + ?Increasing = Increasing , + ?Decreasing = Decreasing , + ?WhiskerWidth = WhiskerWidth, + ?Line = Line , + ?XCalendar = XCalendar + ) + ) + |> GenericChart.ofTraceObject + + + + /// Computes the parallel coordinates plot + static member Splom + ( + dims:seq<'key*#seq<'values>>, + [] ?Range, + [] ?Constraintrange, + [] ?Color, + [] ?Colorscale, + [] ?Width, + [] ?Dash, + [] ?Domain, + [] ?Labelfont, + [] ?Tickfont, + [] ?Rangefont + ) = + + let dims' = + dims |> Seq.map (fun (k,vals) -> + Dimensions.init(vals) + |> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k) + ) + + Trace2D.initSplom ( + Trace2DStyle.Splom (Dimensions=dims') + ) + |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) + |> GenericChart.ofTraceObject + + + /// Computes the Splom plot + static member Splom + ( + dims:seq, + [] ?Color, + [] ?Colorscale, + [] ?Width, + [] ?Dash, + [] ?Domain, + [] ?Labelfont, + [] ?Tickfont, + [] ?Rangefont + ) = + Trace2D.initSplom ( + Trace2DStyle.Splom ( + Dimensions=dims + ) + ) + |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) + |> GenericChart.ofTraceObject diff --git a/src/Plotly.NET/ChartAPI/Chart3D.fs b/src/Plotly.NET/ChartAPI/Chart3D.fs new file mode 100644 index 000000000..8289325e0 --- /dev/null +++ b/src/Plotly.NET/ChartAPI/Chart3D.fs @@ -0,0 +1,494 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO +//open FSharp.Care.Collections + +open GenericChart +open StyleParam +open System.Runtime.InteropServices + +[] +module Chart3D = + + type Chart with + + /// Uses points, line or both depending on the mode to represent 3d-data points + static member Scatter3d + ( + x, y, z, mode, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width + ) = + Trace3D.initScatter3d (Trace3DStyle.Scatter3d(X = x,Y = y,Z=z, Mode=mode) ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Uses points, line or both depending on the mode to represent 3d-data points + static member Scatter3d(xyz, mode, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width) = + let x,y,z = Seq.unzip3 xyz + Chart.Scatter3d(x, y, z, mode, ?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + + /// + static member Point3d + ( + x, y, z, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont + ) = + // if text position or font is set, then show labels (not only when hovering) + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + Chart.Scatter3d( + x = x, + y = y, + z = z, + mode = changeMode StyleParam.Mode.Markers, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont + ) + + /// + static member Point3d + ( + xyz, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont + ) = + let x, y, z = Seq.unzip3 xyz + + Chart.Point3d( + x, y, z, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont + ) + + + /// Uses points, line or both depending on the mode to represent 3d-data points + static member Line3d + ( + x, y, z, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width + ) = + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + Chart.Scatter3d( + x = x, + y = y, + z = z, + mode = changeMode StyleParam.Mode.Lines, + ?Name = Name , + ?Showlegend = Showlegend , + ?MarkerSymbol = MarkerSymbol, + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition = TextPosition, + ?TextFont = TextFont , + ?Dash = Dash , + ?Width = Width + ) + + /// Uses points, line or both depending on the mode to represent 3d-data points + static member Line3d + ( + xyz, + [] ?Name, + [] ?ShowMarkers, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width + ) = + let x, y, z = Seq.unzip3 xyz + + Chart.Line3d( + x, y, z, + ?Name = Name , + ?ShowMarkers = ShowMarkers , + ?Showlegend = Showlegend , + ?MarkerSymbol = MarkerSymbol, + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition = TextPosition, + ?TextFont = TextFont , + ?Dash = Dash , + ?Width = Width + ) + + /// + static member Bubble3d + ( + x, y, z, sizes, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont + ) = + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + Trace3D.initScatter3d ( + Trace3DStyle.Scatter3d( + X = x, + Y = y, + Z = z, + Mode=changeMode StyleParam.Mode.Markers + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol, MultiSizes=sizes) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// + static member Bubble3d + ( + xyz, sizes, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont + ) = + let x, y, z = Seq.unzip3 xyz + + Chart.Bubble3d( + x, y, z, sizes, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont + ) + + + /// Uses points, line or both depending on the mode to represent 3d-data points + static member Surface + ( + zData, + [] ?X, + [] ?Y, + [] ?Name, + [] ?Showlegend, + [] ?Opacity, + [] ?Contours, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar + ) = + Trace3D.initSurface ( + Trace3DStyle.Surface( + ?X=X, + ?Y=Y, + Z=zData, + ?Contours=Contours, + ?ColorScale=ColorScale, + ?ShowScale=ShowScale, + ?ColorBar=ColorBar + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + + /// Uses points, line or both depending on the mode to represent 3d-data points + static member Mesh3d + ( + x, y, z, + [] ?I, + [] ?J, + [] ?K, + [] ?Name, + [] ?Showlegend, + [] ?Opacity, + [] ?Contours, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar + ) = + Trace3D.initMesh3d ( + Trace3DStyle.Mesh3d( + X = x, + Y = y, + Z = z, + ?I = I, + ?J = J, + ?K = K + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + static member Cone + ( + x, y, z, u, v, w, + [] ?Name, + [] ?ShowLegend, + [] ?Opacity, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar + ) = + + Trace3D.initCone( + Trace3DStyle.Cone( + X = x, + Y = y, + Z = z, + U = u, + V = v, + W = w, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?ColorBar = ColorBar + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + static member Cone + ( + coneXYZ, coneUVW, + [] ?Name, + [] ?ShowLegend, + [] ?Opacity, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar + ) = + let x, y, z = Seq.unzip3 coneXYZ + let u, v, w = Seq.unzip3 coneUVW + + Chart.Cone( + x, y, z, u, v, w, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?ColorScale = ColorScale , + ?ShowScale = ShowScale , + ?ColorBar = ColorBar + ) + + + static member StreamTube + ( + x, y, z, u, v, w, + [] ?Name, + [] ?ShowLegend, + [] ?Opacity, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar, + [] ?MaxDisplayed: int, + [] ?Starts: StreamTubeStarts + + ) = + + Trace3D.initStreamTube( + Trace3DStyle.StreamTube( + X = x, + Y = y, + Z = z, + U = u, + V = v, + W = w, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?ColorBar = ColorBar, + ?MaxDisplayed = MaxDisplayed, + ?Starts = Starts + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + static member StreamTube + ( + streamTubeXYZ, streamTubeUVW, + [] ?Name, + [] ?ShowLegend, + [] ?Opacity, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar, + [] ?MaxDisplayed: int, + [] ?Starts: StreamTubeStarts + ) = + let x, y, z = Seq.unzip3 streamTubeXYZ + let u, v, w = Seq.unzip3 streamTubeUVW + + Chart.StreamTube( + x, y, z, u, v, w, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Opacity = Opacity , + ?ColorScale = ColorScale , + ?ShowScale = ShowScale , + ?ColorBar = ColorBar , + ?MaxDisplayed = MaxDisplayed , + ?Starts = Starts + ) + + static member Volume + ( + x,y,z,value, + [] ?Name, + [] ?ShowLegend, + [] ?Opacity, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar, + [] ?IsoMin, + [] ?IsoMax, + [] ?Caps : Caps, + [] ?Slices : Slices, + [] ?Surface : Surface + ) = + Trace3D.initVolume( + Trace3DStyle.Volume( + X = x, + Y = y, + Z = z, + Value = value, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?ColorBar = ColorBar, + ?IsoMin = IsoMin, + ?IsoMax = IsoMax, + ?Caps = Caps, + ?Slices = Slices, + ?Surface = Surface + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + + + static member IsoSurface + ( + x,y,z,value, + [] ?Name, + [] ?ShowLegend, + [] ?Opacity, + [] ?ColorScale, + [] ?ShowScale, + [] ?ColorBar, + [] ?IsoMin, + [] ?IsoMax, + [] ?Caps : Caps, + [] ?Slices : Slices, + [] ?Surface : Surface + ) = + Trace3D.initIsoSurface( + Trace3DStyle.IsoSurface( + X = x, + Y = y, + Z = z, + Value = value, + ?Name = Name, + ?ShowLegend = ShowLegend, + ?Opacity = Opacity, + ?ColorScale = ColorScale, + ?ShowScale = ShowScale, + ?ColorBar = ColorBar, + ?IsoMin = IsoMin, + ?IsoMax = IsoMax, + ?Caps = Caps, + ?Slices = Slices, + ?Surface = Surface + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> GenericChart.ofTraceObject + \ No newline at end of file diff --git a/src/Plotly.NET/ChartAPI/ChartDomain.fs b/src/Plotly.NET/ChartAPI/ChartDomain.fs new file mode 100644 index 000000000..65c48bb1c --- /dev/null +++ b/src/Plotly.NET/ChartAPI/ChartDomain.fs @@ -0,0 +1,432 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO + +open GenericChart +open StyleParam +open System.Runtime.InteropServices + +[] +module ChartDomain = + + type Chart with + + /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data. + static member Pie(values, + [] ?Labels:seq<'IConvertible>, + [] ?Name, + [] ?Showlegend, + [] ?Colors, + [] ?TextPosition, + [] ?TextFont, + [] ?Hoverinfo, + [] ?Textinfo, + [] ?Opacity) = + TraceDomain.initPie (TraceDomainStyle.Pie(Values=values,?Labels=Labels,?Textinfo=Textinfo)) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity,?Hoverinfo=Hoverinfo) + |> TraceStyle.Marker(?Colors=Colors) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data. + static member Pie(data:seq<#IConvertible*#IConvertible>, + [] ?Name, + [] ?Showlegend, + [] ?Colors, + [] ?TextPosition, + [] ?TextFont, + [] ?Hoverinfo, + [] ?Textinfo, + [] ?Opacity) = + let values,labels = Seq.unzip data + Chart.Pie(values,Labels=labels,?Name=Name,?Showlegend=Showlegend,?Colors=Colors,?TextPosition=TextPosition,?TextFont=TextFont,?Hoverinfo=Hoverinfo,?Textinfo=Textinfo,?Opacity=Opacity) + + + /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole. + static member Doughnut(values, + [] ?Labels, + [] ?Name, + [] ?Showlegend, + [] ?Colors, + [] ?Hole, + [] ?TextPosition, + [] ?TextFont, + [] ?Hoverinfo, + [] ?Textinfo, + [] ?Opacity) = + let hole' = if Hole.IsSome then Hole.Value else 0.4 + TraceDomain.initPie (TraceDomainStyle.Pie(Values=values,?Labels=Labels,?Textinfo=Textinfo,Hole=hole')) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity,?Hoverinfo=Hoverinfo) + |> TraceStyle.Marker(?Colors=Colors) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Shows how proportions of data, shown as pie-shaped pieces, contribute to the data as a whole. + static member Doughnut(data:seq<#IConvertible*#IConvertible>, + [] ?Name, + [] ?Showlegend, + [] ?Colors, + [] ?Hole, + [] ?TextPosition, + [] ?TextFont, + [] ?Hoverinfo, + [] ?Textinfo, + [] ?Opacity) = + let values,labels = Seq.unzip data + Chart.Doughnut(values,Labels=labels,?Name=Name,?Showlegend=Showlegend,?Colors=Colors,?Hole=Hole,?TextPosition=TextPosition,?TextFont=TextFont,?Hoverinfo=Hoverinfo,?Textinfo=Textinfo,?Opacity=Opacity) + + + + /// Creates a FunnelArea chart. + /// FunnelArea charts visualize stages in a process using area-encoded trapezoids. This trace can be used to show data in a part-to-whole representation similar to a "pie" trace, wherein each item appears in a single stage. See also the "funnel" trace type for a different approach to visualizing funnel data. + /// + /// Parameters: + /// + /// Values : Sets the values of the sectors. If omitted, we count occurrences of each label. + /// + /// Labels : Sets the sector labels. If `labels` entries are duplicated, we sum associated `values` or simply count occurrences if `values` is not provided. For other array attributes (including color) we use the first non-empty entry among all occurrences of the label. + /// + /// dLabel : Sets the label step. See `label0` for more info. + /// + /// Label0 : Alternate to `labels`. Builds a numeric set of labels. Use with `dlabel` where `label0` is the starting label and `dlabel` the step. + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover. + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// Opacity : Sets the opacity of the trace. + /// + /// Color : Sets Marker Color + /// + /// Line : Line type + /// + /// Text : Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition : Specifies the location of the `textinfo`. + /// + /// X : Sets the horizontal domain of this funnelarea trace (in plot fraction). + /// + /// Y : Sets the vertical domain of this funnelarea trace (in plot fraction). + /// + /// Row : If there is a layout grid, use the domain for this row in the grid for this funnelarea trace . + /// + /// Column : If there is a layout grid, use the domain for this column in the grid for this funnelarea trace . + /// + /// Aspectratio : Sets the ratio between height and width + /// + /// Baseratio : Sets the ratio between bottom length and maximum top length. + /// + /// Insidetextfont: Sets the font used for `textinfo` lying inside the sector. + /// + /// Scalegroup : If there are multiple funnelareas that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group. + static member FunnelArea + ( + [] ?Values , + [] ?Labels , + [] ?dLabel , + [] ?Label0 , + [] ?Name , + [] ?Showlegend , + [] ?Opacity , + [] ?Color , + [] ?Line , + [] ?Text , + [] ?TextPosition , + [] ?X , + [] ?Y , + [] ?Row , + [] ?Column , + [] ?Aspectratio , + [] ?Baseratio , + [] ?Insidetextfont, + [] ?Scalegroup + ) = + + TraceDomain.initFunnelArea( + TraceDomainStyle.FunnelArea( + ?Values = Values , + ?Labels = Labels , + ?dLabel = dLabel , + ?Label0 = Label0 , + ?Aspectratio = Aspectratio , + ?Baseratio = Baseratio , + ?Insidetextfont = Insidetextfont, + ?Scalegroup = Scalegroup + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Line=Line) + |> TraceStyle.Domain(?X=X,?Y=Y,?Row=Row,?Column=Column) + |> TraceStyle.TextLabel(?Text=Text,?Textposition=TextPosition) + |> GenericChart.ofTraceObject + + + /// Creates a sunburst chart. Visualize hierarchical data spanning outward radially from root to leaves. + /// Applies the styles of sundburst plot to TraceObjects + /// + /// Parameters: + /// + /// labels: Sets the labels of each of the sectors. + /// + /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// + /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// + /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. + /// + /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// + /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// + /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// + /// ColorBar: Sets the ColorBar for the chart + /// + ///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors. + static member Sunburst(labels,parents, + []?Ids, + []?Values , + []?Text , + []?Branchvalues , + []?Level , + []?Maxdepth , + []?Colors: seq, + []?ColorBar:ColorBar + ) = + TraceDomain.initSunburst( + TraceDomainStyle.Sunburst( + labels = labels, + parents = parents, + ?Ids = Ids, + ?Values = Values, + ?Text = Text, + ?Branchvalues = Branchvalues, + ?Level = Level, + ?Maxdepth = Maxdepth + ) + ) + |> TraceStyle.Marker(?Colors=Colors,?ColorBar=ColorBar) + |> GenericChart.ofTraceObject + + + /// Creates a treemap chart. Treemap charts visualize hierarchical data using nested rectangles. Same as Sunburst the hierarchy is defined by labels and parents attributes. Click on one sector to zoom in/out, which also displays a pathbar in the upper-left corner of your treemap. To zoom out you can use the path bar as well. + /// + /// Parameters: + /// + /// labels: Sets the labels of each of the sectors. + /// + /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// + /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// + /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. + /// + /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// + /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// + /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + /// + /// ColorBar: Sets the ColorBar for the chart + /// + ///Colors: Sets the color of each sector of this trace. If not specified, the default trace color set is used to pick the sector colors. + static member Treemap(labels,parents, + []?Ids, + []?Values , + []?Text , + []?Branchvalues , + []?Tiling , + []?PathBar , + []?Level , + []?Maxdepth , + []?Colors: seq, + []?ColorBar:ColorBar + ) = + TraceDomain.initTreemap( + TraceDomainStyle.Treemap( + labels = labels, + parents = parents, + ?Ids = Ids, + ?Values = Values, + ?Text = Text, + ?Branchvalues = Branchvalues, + ?Tiling = Tiling, + ?PathBar = PathBar, + ?Level = Level, + ?Maxdepth = Maxdepth + ) + ) + |> TraceStyle.Marker(?Colors=Colors,?ColorBar=ColorBar) + |> GenericChart.ofTraceObject + + + /// Computes the parallel coordinates plot + static member ParallelCoord + ( + dims:seq<'key*#seq<'values>>, + [] ?Range, + [] ?Constraintrange, + [] ?Color, + [] ?Colorscale, + [] ?Width, + [] ?Dash, + [] ?Domain, + [] ?Labelfont, + [] ?Tickfont, + [] ?Rangefont + ) = + + let dims' = + dims + |> Seq.map (fun (k,vals) -> + Dimensions.init(vals) + |> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k) + ) + TraceDomain.initParallelCoord( + TraceDomainStyle.ParallelCoord( + Dimensions=dims', + ?Domain=Domain, + ?Labelfont=Labelfont, + ?Tickfont=Tickfont, + ?Rangefont=Rangefont + ) + ) + |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) + |> GenericChart.ofTraceObject + + + /// Computes the parallel coordinates plot + static member ParallelCoord + ( + dims:seq, + [] ?Color, + [] ?Colorscale, + [] ?Width, + [] ?Dash, + [] ?Domain, + [] ?Labelfont, + [] ?Tickfont, + [] ?Rangefont + ) = + + TraceDomain.initParallelCoord ( + TraceDomainStyle.ParallelCoord ( + Dimensions=dims, + ?Domain=Domain, + ?Labelfont=Labelfont, + ?Tickfont=Tickfont, + ?Rangefont=Rangefont + ) + ) + |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) + |> GenericChart.ofTraceObject + + ///Parallel categories diagram for multidimensional categorical data. + static member ParallelCategories + ( + dims:seq<'key*#seq<'values>>, + [] ?Range, + [] ?Constraintrange, + [] ?Color, + [] ?Colorscale, + [] ?Width, + [] ?Dash, + [] ?Domain, + [] ?Labelfont, + [] ?Tickfont, + [] ?Rangefont + ) = + let dims' = + dims + |> Seq.map (fun (k,vals) -> + Dimensions.init(vals) + |> Dimensions.style(vals,?Range=Range,?Constraintrange=Constraintrange,Label=k) + ) + TraceDomain.initParallelCategories ( + TraceDomainStyle.ParallelCategories( + Dimensions=dims', + ?Domain=Domain, + ?Labelfont=Labelfont, + ?Tickfont=Tickfont, + ?Rangefont=Rangefont + ) + ) + |> TraceStyle.Line(?Width=Width,?Color=Color,?Dash=Dash,?Colorscale=Colorscale) + |> GenericChart.ofTraceObject + + /// + static member ParallelCategories + ( + dims:seq, + [] ?Color, + [] ?Colorscale, + [] ?Width, + [] ?Dash, + [] ?Domain, + [] ?Labelfont, + [] ?Tickfont, + [] ?Rangefont + ) = + TraceDomain.initParallelCategories( + TraceDomainStyle.ParallelCategories( + Dimensions=dims, + ?Domain=Domain, + ?Color=Color, + ?Labelfont=Labelfont, + ?Tickfont=Tickfont, + ?Rangefont=Rangefont + ) + ) + |> TraceStyle.Line(?Width=Width,?Dash=Dash,?Colorscale=Colorscale) + |> GenericChart.ofTraceObject + + + /// creates table out of header sequence and row sequences + static member Table + ( + headerValues, cellValues, + [] ?AlignHeader, + [] ?AlignCells, + [] ?ColumnWidth, + [] ?ColumnOrder, + [] ?ColorHeader, + [] ?ColorCells, + [] ?FontHeader, + [] ?FontCells, + [] ?HeightHeader, + [] ?HeightCells, + [] ?LineHeader, + [] ?LineCells + ) = + + TraceDomain.initTable ( + + let CellFilling = + match ColorCells with + | Some color -> Some (CellColor.init (?Color=ColorCells)) + | Option.None -> Option.None + + let HeaderFilling = + match ColorHeader with + | Some color -> Some (CellColor.init (?Color=ColorHeader)) + | Option.None -> Option.None + + TraceDomainStyle.Table ( + header = TableHeader.init (headerValues|> Seq.map seq, ?Align=AlignHeader, ?Fill=HeaderFilling, ?Font=FontHeader, ?Height=HeightHeader, ?Line=LineHeader), + cells = TableCells.init(cellValues |> Seq.transpose, ?Align=AlignCells, ?Fill=CellFilling, ?Font=FontCells, ?Height=HeightCells, ?Line=LineCells), + ?ColumnWidth = ColumnWidth, + ?ColumnOrder = ColumnOrder + ) + ) + |> GenericChart.ofTraceObject diff --git a/src/Plotly.NET/ChartAPI/ChartMap.fs b/src/Plotly.NET/ChartAPI/ChartMap.fs new file mode 100644 index 000000000..5773d7b50 --- /dev/null +++ b/src/Plotly.NET/ChartAPI/ChartMap.fs @@ -0,0 +1,1199 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO + +open GenericChart +open StyleParam +open System.Runtime.InteropServices + +[] +module ChartMap = + + type Chart with + + /// Computes the choropleth map plot + static member ChoroplethMap(locations,z, + [] ?Text, + [] ?Locationmode, + [] ?Autocolorscale, + [] ?Colorscale, + [] ?ColorBar, + [] ?Marker, + [] ?GeoJson, + [] ?FeatureIdKey: string, + [] ?Zmin, + [] ?Zmax) = + + TraceMap.initChoroplethMap ( + TraceMapStyle.ChoroplethMap( + Locations=locations, + Z=z, + ?Text=Text, + ?Locationmode=Locationmode, + ?Autocolorscale=Autocolorscale, + ?Colorscale=Colorscale, + ?ColorBar=ColorBar, + ?Marker=Marker, + ?Zmin=Zmin, + ?Zmax=Zmax, + ?GeoJson=GeoJson, + ?FeatureIdKey=FeatureIdKey + ) + ) + |> GenericChart.ofTraceObject + + + /// Creates a ScatterGeo chart, where data is visualized on a geographic map. + /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble + /// + /// Parameters: + /// + /// longitudes : Sets the longitude coordinates (in degrees East). + /// + /// latitudes : Sets the latitude coordinates (in degrees North). + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// Dash : Sets the Line Dash style + /// + /// Width : Sets the Line width + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member ScatterGeo(longitudes, latitudes, mode, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Dash , + [] ?Width : float , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = mode , + Longitudes = longitudes , + Latitudes = latitudes , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + /// Creates a ScatterGeo chart, where data is visualized on a geographic map. + /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble + /// + /// Parameters: + /// + /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// + /// mode : Determines the drawing mode for this scatter trace. + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// Dash : Sets the Line Dash style + /// + /// Width : Sets the Line width + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member ScatterGeo(lonlat, mode, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Dash , + [] ?Width : float , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + let longitudes, latitudes = Seq.unzip lonlat + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = mode , + Longitudes = longitudes , + Latitudes = latitudes , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a ScatterGeo chart, where data is visualized on a geographic map. + /// ScatterGeo charts are the basis of GeoPoint, GeoLine, and GeoBubble Charts, and can be customized as such. We also provide abstractions for those: Chart.GeoPoint, Chart.GeoLine, Chart.GeoBubble + /// + /// Parameters: + /// + /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. + /// + /// mode : Determines the drawing mode for this scatter trace. + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// Dash : Sets the Line Dash style + /// + /// Width : Sets the Line width + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member ScatterGeo(locations, mode, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Dash , + [] ?Width : float , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = mode , + ?Locations = locations , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a PointGeo chart, where data is visualized as points on a geographic map. + /// + /// Parameters: + /// + /// longitudes : Sets the longitude coordinates (in degrees East). + /// + /// latitudes : Sets the latitude coordinates (in degrees North). + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member PointGeo(longitudes, latitudes, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = changeMode StyleParam.Mode.Markers , + Longitudes = longitudes , + Latitudes = latitudes , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a PointGeo chart, where data is visualized as points on a geographic map. + /// + /// Parameters: + /// + /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member PointGeo(lonlat, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + let longitudes, latitudes = Seq.unzip lonlat + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = changeMode StyleParam.Mode.Markers , + Longitudes = longitudes , + Latitudes = latitudes , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a PointGeo chart, where data is visualized as points on a geographic map. + /// + /// Parameters: + /// + /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member PointGeo(locations, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = changeMode StyleParam.Mode.Markers , + ?Locations = locations , + ?GeoJson = GeoJson , + ?Connectgaps= Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. + /// + /// Parameters: + /// + /// longitudes : Sets the longitude coordinates (in degrees East). + /// + /// latitudes : Sets the latitude coordinates (in degrees North). + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// ShowMarkers : Determines wether or not markers will be rendered for each datum. + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// Dash : Sets the Line Dash style + /// + /// Width : Sets the Line width + /// + /// TextFont : Sets the text font of this trace + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member LineGeo(longitudes, latitudes, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?ShowMarkers , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = changeMode StyleParam.Mode.Lines, + Longitudes = longitudes , + Latitudes = latitudes , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. + /// + /// Parameters: + /// + /// lonlat : Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// ShowMarkers : Determines wether or not markers will be rendered for each datum. + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// TextFont : Sets the text font of this trace + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member LineGeo(lonlat, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?ShowMarkers , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + let longitudes, latitudes = Seq.unzip lonlat + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = changeMode StyleParam.Mode.Lines, + Longitudes = longitudes , + Latitudes = latitudes , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// Creates a LineGeo chart, where data is visualized as coordinates connected via lines on a geographic map. + /// + /// Parameters: + /// + /// locations : Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info. + /// + /// Name : Sets the trace name. The trace name appear as the legend item and on hover + /// + /// ShowMarkers : Determines wether or not markers will be rendered for each datum. + /// + /// Showlegend : Determines whether or not an item corresponding to this trace is shown in the legend. + /// + /// MarkerSymbol: Sets the type of symbol that datums are displayed as + /// + /// Color : Sets Line/Marker Color + /// + /// Opacity : Sets the Opacity of the trace + /// + /// Labels : Sets text elements associated with each (x,y) pair. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// TextPosition: Sets the positions of the `text` elements with respects to the (lon,lat) coordinates. + /// + /// TextFont : Sets the text font of this trace + /// + /// TextFont : Sets the text font of this trace + /// + /// GeoJson : Sets optional GeoJSON data associated with this trace. If not given, the features on the base map are used when `locations` is set. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// + /// Connectgaps : Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// + /// Fill : Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// + /// Fillcolor : Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + + static member LineGeo(locations, + [] ?Name , + [] ?Showlegend , + [] ?MarkerSymbol , + [] ?ShowMarkers , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?GeoJson , + [] ?FeatureIdKey: string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + TraceMap.initScatterGeo( + TraceMapStyle.ScatterGeo( + mode = changeMode StyleParam.Mode.Lines, + Locations = locations , + ?GeoJson = GeoJson , + ?FeatureIdKey = FeatureIdKey , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + + + /// + /// Creates a ScatterMapbox chart, where data is visualized by (longitude,latitude) pairs on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// ScatterGeo charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// 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. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". + /// Sets the line width (in px). + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member ScatterMapbox(longitudes, latitudes, mode, + [] ?Name , + [] ?ShowLegend , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Width : float , + [] ?Below : string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + TraceMap.initScatterMapbox( + TraceMapStyle.ScatterMapbox( + mode = mode , + Longitudes = longitudes , + Latitudes = latitudes , + ?Below = Below , + ?Connectgaps = Connectgaps , + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=ShowLegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Width=Width) + |> TraceStyle.Marker(?Color=Color) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject + + /// + /// Creates a ScatterMapbox chart, where data is visualized by (longitude,latitude) pairs on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// ScatterGeo charts are the basis of PointMapbox and LineMapbox Charts, and can be customized as such. We also provide abstractions for those: Chart.PointMapbox and Chart.LineMapbox + /// + /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// 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. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". + /// Sets the line width (in px). + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member ScatterMapbox(lonlat, mode, + [] ?Name , + [] ?ShowLegend , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Width : float , + [] ?Below : string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let longitudes, latitudes = Seq.unzip lonlat + + Chart.ScatterMapbox( + longitudes, + latitudes, + mode, + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition= TextPosition, + ?TextFont = TextFont , + ?Width = Width , + ?Below = Below , + ?Connectgaps = Connectgaps, + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + + /// + /// Creates a PointMapbox chart, where data is visualized by (longitude,latitude) pairs as Points on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// 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. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". + /// Sets the line width (in px). + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member PointMapbox(longitudes,latitudes, + [] ?Name , + [] ?ShowLegend , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Width : float , + [] ?Below : string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + Chart.ScatterMapbox( + longitudes, + latitudes, + mode = changeMode StyleParam.Mode.Markers , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition= TextPosition, + ?TextFont = TextFont , + ?Width = Width , + ?Below = Below , + ?Connectgaps = Connectgaps, + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + + /// + /// Creates a PointMapbox chart, where data is visualized by (longitude,latitude) pairs as Points on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// 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. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". + /// Sets the line width (in px). + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member PointMapbox(lonlat, + [] ?Name , + [] ?ShowLegend , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Width : float , + [] ?Below : string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + let longitudes, latitudes = Seq.unzip lonlat + + Chart.ScatterMapbox( + longitudes, + latitudes, + mode = changeMode StyleParam.Mode.Markers , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition= TextPosition, + ?TextFont = TextFont , + ?Width = Width , + ?Below = Below , + ?Connectgaps = Connectgaps, + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + /// + /// Creates a LineMapbox chart, where data is visualized by (longitude,latitude) pairs connected by a line on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not To show markers for the individual datums. + /// 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. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". + /// Sets the line width (in px). + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member LineMapbox(longitudes,latitudes, + [] ?Name , + [] ?ShowLegend , + [] ?ShowMarkers , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Width : float , + [] ?Below : string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + Chart.ScatterMapbox( + longitudes, + latitudes, + mode = changeMode StyleParam.Mode.Lines , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition= TextPosition, + ?TextFont = TextFont , + ?Width = Width , + ?Below = Below , + ?Connectgaps = Connectgaps, + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + + /// + /// Creates a LineMapbox chart, where data is visualized by (longitude,latitude) pairs connected by a line on a geographic map using mapbox. + /// + /// Customize the mapbox layers, style, etc. by using Chart.withMapbox. + /// + /// You might need a Mapbox token, which you can also configure with Chart.withMapbox. + /// + /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Determines whether or not To show markers for the individual datums. + /// 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. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Sets the icon text font (color=mapbox.layer.paint.text-color, size=mapbox.layer.layout.text-size). Has an effect only when `type` is set to "symbol". + /// Sets the line width (in px). + /// Determines if this scattermapbox trace's layers are to be inserted before the layer with the specified ID. By default, scattermapbox layers are inserted above all the base layers. To place the scattermapbox layers above every other layer, set `below` to "''". + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the area to fill with a solid color. Use with `fillcolor` if not "none". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. + /// Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. + static member LineMapbox(lonlat, + [] ?Name , + [] ?ShowLegend , + [] ?ShowMarkers , + [] ?Color , + [] ?Opacity , + [] ?Labels , + [] ?TextPosition , + [] ?TextFont , + [] ?Width : float , + [] ?Below : string , + [] ?Connectgaps : bool , + [] ?Fill : StyleParam.Fill , + [] ?Fillcolor + ) = + + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + let longitudes, latitudes = Seq.unzip lonlat + + Chart.ScatterMapbox( + longitudes, + latitudes, + mode = changeMode StyleParam.Mode.Lines , + ?Name = Name , + ?ShowLegend = ShowLegend , + ?Color = Color , + ?Opacity = Opacity , + ?Labels = Labels , + ?TextPosition= TextPosition, + ?TextFont = TextFont , + ?Width = Width , + ?Below = Below , + ?Connectgaps = Connectgaps, + ?Fill = Fill , + ?Fillcolor = Fillcolor + ) + + /// + /// Creates a ChoroplethMapbox Chart. + /// + /// Choropleth Maps display divided geographical areas or regions that are coloured, shaded or patterned in relation to + /// a data variable. This provides a way to visualise values over a geographical area, which can show variation or + /// patterns across the displayed location. + /// + /// GeoJSON features to be filled are set in `geojson` The data that describes the choropleth value-to-color mapping is set in `locations` and `z`. + /// + /// Sets which features found in "geojson" to plot using their feature `id` field. + /// Sets the color values. + /// Sets the GeoJSON data associated with this trace. It can be set as a valid GeoJSON object or as a URL string. Note that we only accept GeoJSONs of type "FeatureCollection" or "Feature" with geometries of type "Polygon" or "MultiPolygon". + /// Sets the key in GeoJSON features which is used as id to match the items included in the `locations` array. Support nested property, for example "properties.name". + /// Sets the text elements associated with each location. + /// Determines if the choropleth polygons will be inserted before the layer with the specified ID. By default, choroplethmapbox traces are placed above the water layers. If set to '', the layer will be inserted above every existing layer. + /// Sets the colorscale. + /// Sets the ColorBar object asociated with this trace + /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. + static member ChoroplethMapbox(locations,z,geoJson, + [] ?FeatureIdKey, + [] ?Text, + [] ?Below, + [] ?Colorscale, + [] ?ColorBar, + [] ?ZAuto, + [] ?ZMin, + [] ?ZMid, + [] ?ZMax + ) = + + TraceMap.initChoroplethMapbox ( + TraceMapStyle.ChoroplethMapbox ( + Z = z, + Locations = locations, + GeoJson = geoJson, + ?FeatureIdKey = FeatureIdKey, + ?Text = Text, + ?Below = Below, + ?Colorscale = Colorscale, + ?ColorBar = ColorBar, + ?ZAuto = ZAuto, + ?ZMin = ZMin, + ?ZMid = ZMid, + ?ZMax = ZMax + ) + ) + |> GenericChart.ofTraceObject + + /// + /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. + /// + /// Sets the longitude coordinates (in degrees East). + /// Sets the latitude coordinates (in degrees North). + /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot + /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to '', the layer will be inserted above every existing layer. + /// Sets the colorscale. + /// Sets the ColorBar object asociated with this trace + /// Determines whether or not a colorbar is displayed for this trace. + /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. + static member DensityMapbox (lon,lat, + [] ?Z, + [] ?Radius, + [] ?Opacity, + [] ?Text, + [] ?Below, + [] ?Colorscale, + [] ?ColorBar, + [] ?Showscale , + [] ?ZAuto, + [] ?ZMin, + [] ?ZMid, + [] ?ZMax + ) = + TraceMap.initDensityMapbox( + TraceMapStyle.DensityMapbox( + Longitudes = lon, + Latitudes = lat, + ?Z = Z, + ?Radius = Radius, + ?Opacity = Opacity, + ?Text = Text, + ?Below = Below, + ?Colorscale = Colorscale, + ?ColorBar = ColorBar, + ?Showscale = Showscale, + ?ZAuto = ZAuto, + ?ZMin = ZMin, + ?ZMid = ZMid, + ?ZMax = ZMax + ) + ) + |> GenericChart.ofTraceObject + + /// + /// Creates a DensityMapbox Chart that draws a bivariate kernel density estimation with a Gaussian kernel from `lon` and `lat` coordinates and optional `z` values using a colorscale. + /// + /// Sets the (longitude,latitude) coordinates (in degrees North, degrees South). + /// Sets the points' weight. For example, a value of 10 would be equivalent to having 10 points of weight 1 in the same spot + /// Sets the radius of influence of one `lon` / `lat` point in pixels. Increasing the value makes the densitymapbox trace smoother, but less detailed. + /// Sets the opacity of the trace. + /// Sets text elements associated with each (lon,lat) pair If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (lon,lat) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Determines if the densitymapbox trace will be inserted before the layer with the specified ID. By default, densitymapbox traces are placed below the first layer of type symbol If set to '', the layer will be inserted above every existing layer. + /// Sets the colorscale. + /// Sets the ColorBar object asociated with this trace + /// Determines whether or not a colorbar is displayed for this trace. + /// Determines whether or not the color domain is computed with respect to the input data (here in `z`) or the bounds set in `zmin` and `zmax` Defaults to `false` when `zmin` and `zmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as in `z` and if set, `zmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `zmin` and/or `zmax` to be equidistant to this point. Value should have the same units as in `z`. Has no effect when `zauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as in `z` and if set, `zmin` must be set as well. + static member DensityMapbox (lonlat, + [] ?Z, + [] ?Radius, + [] ?Opacity, + [] ?Text, + [] ?Below, + [] ?Colorscale, + [] ?ColorBar, + [] ?Showscale , + [] ?ZAuto, + [] ?ZMin, + [] ?ZMid, + [] ?ZMax + ) = + + let longitudes, latitudes = Seq.unzip lonlat + + Chart.DensityMapbox( + longitudes, + latitudes, + ?Z = Z, + ?Radius = Radius, + ?Opacity = Opacity, + ?Text = Text, + ?Below = Below, + ?Colorscale = Colorscale, + ?ColorBar = ColorBar, + ?Showscale = Showscale, + ?ZAuto = ZAuto, + ?ZMin = ZMin, + ?ZMid = ZMid, + ?ZMax = ZMax + ) \ No newline at end of file diff --git a/src/Plotly.NET/ChartAPI/ChartPolar.fs b/src/Plotly.NET/ChartAPI/ChartPolar.fs new file mode 100644 index 000000000..766a93433 --- /dev/null +++ b/src/Plotly.NET/ChartAPI/ChartPolar.fs @@ -0,0 +1,388 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects + +open DynamicObj +open System +open System.IO + +open GenericChart +open StyleParam +open System.Runtime.InteropServices + +[] +module ChartPolar = + + type Chart with + + static member internal renderScatterPolarTrace (useWebGL:bool) (style: TracePolar -> TracePolar) = + if useWebGL then + TracePolar.initScatterPolarGL style + |> GenericChart.ofTraceObject + else + TracePolar.initScatterPolar style + |> GenericChart.ofTraceObject + + /// Uses points, line or both depending on the mode to represent data points in a polar chart + static member ScatterPolar + ( + r, theta, mode, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?UseWebGL + ) = + + let style = + TracePolarStyle.ScatterPolar( + R = r, + Theta = theta, + Mode = mode + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterPolarTrace useWebGL style + + /// Uses points, line or both depending on the mode to represent data points in a polar chart + static member ScatterPolar + ( + rtheta, mode, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?UseWebGL + ) = + + let r,t = Seq.unzip rtheta + + Chart.ScatterPolar( + r, t, mode, + ?Name=Name, + ?Showlegend=Showlegend, + ?MarkerSymbol=MarkerSymbol, + ?Color=Color, + ?Opacity=Opacity, + ?Labels=Labels, + ?TextPosition=TextPosition, + ?TextFont=TextFont, + ?Dash=Dash, + ?Width=Width, + ?UseWebGL = UseWebGL + ) + + /// + static member PointPolar + ( + r, theta, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?UseWebGL + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + let style = + TracePolarStyle.ScatterPolar( + R = r, + Theta = theta, + Mode = changeMode StyleParam.Mode.Markers + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterPolarTrace useWebGL style + + /// + static member PointPolar + ( + rTheta, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?UseWebGL + ) = + let r,t = Seq.unzip rTheta + + Chart.PointPolar( + r, t, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?UseWebGL = UseWebGL + ) + + /// + static member LinePolar + ( + r, theta, + [] ?Name, + [] ?Showlegend, + [] ?ShowMarkers, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?UseWebGL + ) = + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + let style = + TracePolarStyle.ScatterPolar( + R = r, + Theta = theta, + Mode = changeMode StyleParam.Mode.Lines + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterPolarTrace useWebGL style + + /// + static member LinePolar + ( + rTheta, + [] ?Name, + [] ?Showlegend, + [] ?ShowMarkers, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?Width, + [] ?UseWebGL + ) = + let r,t = Seq.unzip rTheta + + Chart.LinePolar( + r, t, + ?Name = Name, + ?Showlegend = Showlegend, + ?ShowMarkers = ShowMarkers, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?Dash = Dash, + ?Width = Width, + ?UseWebGL = UseWebGL + ) + + /// + static member SplinePolar + ( + r, theta, + [] ?Name, + [] ?Showlegend, + [] ?ShowMarkers, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Smoothing, + [] ?Dash, + [] ?Width, + [] ?UseWebGL + ) = + let changeMode = + let isShowMarker = + match ShowMarkers with + | Some isShow -> isShow + | Option.None -> false + StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + >> StyleParam.ModeUtils.showMarker (isShowMarker) + + let style = + TracePolarStyle.ScatterPolar( + R = r, + Theta = theta, + Mode = changeMode StyleParam.Mode.Lines + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width, Shape=StyleParam.Shape.Spline, ?Smoothing=Smoothing) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterPolarTrace useWebGL style + /// + static member SplinePolar + ( + rTheta, + [] ?Name, + [] ?Showlegend, + [] ?ShowMarkers, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Smoothing, + [] ?Dash, + [] ?Width, + [] ?UseWebGL + ) = + let r,t = Seq.unzip rTheta + + Chart.SplinePolar( + r, t, + ?Name = Name, + ?Showlegend = Showlegend, + ?ShowMarkers = ShowMarkers, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?Smoothing = Smoothing, + ?Dash = Dash, + ?Width = Width, + ?UseWebGL = UseWebGL + ) + + /// + static member BubblePolar + ( + r, theta, sizes:seq<#IConvertible>, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?UseWebGL + ) = + + let changeMode = StyleParam.ModeUtils.showText (TextPosition.IsSome || TextFont.IsSome) + + let style = + TracePolarStyle.ScatterPolar( + R = r, + Theta = theta, + Mode = changeMode StyleParam.Mode.Markers + ) + >> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + >> TraceStyle.Marker(?Color=Color,?Symbol=MarkerSymbol,MultiSizes=sizes) + >> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + + let useWebGL = defaultArg UseWebGL false + + Chart.renderScatterPolarTrace useWebGL style + + /// + static member BubblePolar + ( + rThetaSizes:seq<#IConvertible*#IConvertible*#IConvertible>, + [] ?Name, + [] ?Showlegend, + [] ?MarkerSymbol, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?UseWebGL + ) = + let r,t,sizes = Seq.unzip3 rThetaSizes + + Chart.BubblePolar( + r, t, sizes, + ?Name = Name, + ?Showlegend = Showlegend, + ?MarkerSymbol = MarkerSymbol, + ?Color = Color, + ?Opacity = Opacity, + ?Labels = Labels, + ?TextPosition = TextPosition, + ?TextFont = TextFont, + ?UseWebGL = UseWebGL + ) + + /// + static member BarPolar + ( + r, theta, + [] ?Name, + [] ?Showlegend, + [] ?Color, + [] ?Opacity, + [] ?Labels, + [] ?TextPosition, + [] ?TextFont, + [] ?Dash, + [] ?LineWidth + ) = + TracePolar.initBarPolar( + TracePolarStyle.BarPolar( + R = r, Theta = theta + ) + ) + |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) + |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=LineWidth) + |> TraceStyle.Marker(?Color=Color) + |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) + |> GenericChart.ofTraceObject \ No newline at end of file diff --git a/src/Plotly.NET/GenericChart.fs b/src/Plotly.NET/ChartAPI/GenericChart.fs similarity index 99% rename from src/Plotly.NET/GenericChart.fs rename to src/Plotly.NET/ChartAPI/GenericChart.fs index eba26ef45..65359f140 100644 --- a/src/Plotly.NET/GenericChart.fs +++ b/src/Plotly.NET/ChartAPI/GenericChart.fs @@ -123,8 +123,6 @@ module GenericChart = let internal jsonConfig = JsonSerializerSettings() jsonConfig.ReferenceLoopHandling <- ReferenceLoopHandling.Serialize - open Trace - type Figure = { [] @@ -404,7 +402,7 @@ module GenericChart = match gChart with | Chart (trace, layout, config, displayOpts) -> Chart (trace, layout, f config, displayOpts) | MultiChart (traces, layout, config, displayOpts) -> MultiChart (traces, layout, f config, displayOpts) - + /// let mapDisplayOptions f gChart = match gChart with diff --git a/src/Plotly.NET/ChartExtensions.fs b/src/Plotly.NET/ChartExtensions.fs deleted file mode 100644 index dc27af652..000000000 --- a/src/Plotly.NET/ChartExtensions.fs +++ /dev/null @@ -1,1342 +0,0 @@ -namespace Plotly.NET - -open DynamicObj -open System -open System.IO - -open GenericChart -open System.Runtime.InteropServices -open System.Runtime.CompilerServices - -/// Extensions methods for Charts supporting the fluent pipeline style 'Chart.WithXYZ(...)'. -[] - -module ChartExtensions = - - ///Choose process to open plots with depending on OS. Thanks to @zyzhu for hinting at a solution (https://github.com/plotly/Plotly.NET/issues/31) - let internal openOsSpecificFile path = - if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then - let psi = new System.Diagnostics.ProcessStartInfo(FileName = path, UseShellExecute = true) - System.Diagnostics.Process.Start(psi) |> ignore - elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then - System.Diagnostics.Process.Start("xdg-open", path) |> ignore - elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then - System.Diagnostics.Process.Start("open", path) |> ignore - else - invalidOp "Not supported OS platform" - - open Trace - - /// Provides a set of static methods for creating charts. - type Chart with - -// ############################################################ -// ####################### Apply to trace - - /// Set the name related properties of a trace - [] - static member withTraceName - ( - [] ?Name, - [] ?Showlegend, - [] ?Legendgroup, - [] ?Visible - ) = - fun (ch:GenericChart) -> - ch |> 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),?Showlegend=Showlegend,?Legendgroup=Legendgroup,?Visible=Visible) - ) - - /// Set the axis anchor id the trace is belonging to - [] - 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 |> mapTrace (fun trace -> - trace - |> TraceStyle.SetAxisAnchor(?X=idx,?Y=idy) - ) - [] - static member withAxisAnchor - ( - (ch:GenericChart), - [] ?X, - [] ?Y - ) = - ch |> Chart.withAxisAnchor(?X=X,?Y=Y) - - /// Apply styling to the Marker(s) of the chart as Object. - [] - static member withMarker(marker:Marker) = - (fun (ch:GenericChart) -> - ch |> mapTrace (TraceStyle.SetMarker(marker)) - ) - - /// Apply styling to the Marker(s) of the chart. - [] - static member withMarkerStyle - ( - [] ?Size, - [] ?Color, - [] ?Symbol, - [] ?Opacity - ) = - let marker = - Marker.init ( - ?Size=Size,?Color=Color,?Symbol=Symbol,?Opacity=Opacity - ) - Chart.withMarker(marker) - - /// Apply styling to the Line(s) of the chart as Object. - [] - static member withLine(line:Line) = - (fun (ch:GenericChart) -> - ch |> mapTrace (TraceStyle.SetLine(line)) - ) - - /// Apply styling to the Line(s) of the chart. - [] - static member withLineStyle - ( - [] ?Width, - [] ?Color, - [] ?Shape, - [] ?Dash, - [] ?Smoothing, - [] ?Colorscale - ) = - let line = - Line.init ( - ?Width=Width,?Color=Color,?Shape=Shape,?Dash=Dash,?Smoothing=Smoothing,?Colorscale=Colorscale) - - Chart.withLine(line) - - /// Apply styling to the xError(s) of the chart as Object - [] - static member withXError(xError:Error) = - (fun (ch:GenericChart) -> - ch |> mapTrace (TraceStyle.SetErrorX(xError)) - ) - - /// Apply styling to the xError(s) of the chart as Object - [] - static member withXErrorStyle - ( - [] ?Array, - [] ?Arrayminus, - [] ?Symmetric, - [] ?Color, - [] ?Thickness, - [] ?Width - ) = - let error = Error.init(?Array=Array,?Arrayminus=Arrayminus,?Symmetric=Symmetric,?Color=Color,?Thickness=Thickness,?Width=Width) - Chart.withXError error - - /// Apply styling to the yError(s) of the chart as Object - [] - static member withYError(yError:Error) = - (fun (ch:GenericChart) -> - ch |> mapTrace (TraceStyle.SetErrorY(yError)) - ) - - /// Apply styling to the yError(s) of the chart as Object - [] - static member withYErrorStyle - ( - [] ?Array, - [] ?Arrayminus, - [] ?Symmetric, - [] ?Color, - [] ?Thickness, - [] ?Width - ) = - let error = Error.init(?Array=Array,?Arrayminus=Arrayminus,?Symmetric=Symmetric,?Color=Color,?Thickness=Thickness,?Width=Width) - Chart.withYError error - - /// Apply styling to the zError(s) of the chart as Object - [] - static member withZError(zError:Error) = - (fun (ch:GenericChart) -> - ch |> mapTrace (TraceStyle.SetErrorZ(zError)) - ) - - /// Apply styling to the zError(s) of the chart as Object - [] - static member withZErrorStyle - ( - [] ?Array, - [] ?Arrayminus, - [] ?Symmetric, - [] ?Color, - [] ?Thickness, - [] ?Width - ) = - let error = Error.init(?Array=Array,?Arrayminus=Arrayminus,?Symmetric=Symmetric,?Color=Color,?Thickness=Thickness,?Width=Width) - Chart.withZError error - - -// ############################################################ -// ####################### Apply to layout - - [] - [] - static member withX_Axis(xAxis:Axis.LinearAxis,[] ?Id : StyleParam.SubPlotId) = - Chart.withXAxis(xAxis, ?Id = Id) - - // Sets x-Axis of 2d and 3d- Charts - [] - static member withXAxis(xAxis:Axis.LinearAxis,[] ?Id: StyleParam.SubPlotId) = - fun (ch:GenericChart) -> - - let id = defaultArg Id (StyleParam.SubPlotId.XAxis 1) - - match id with - | StyleParam.SubPlotId.XAxis _ -> - let layout = - GenericChart.getLayout ch - |> Layout.UpdateLinearAxisById(id,axis=xAxis) - GenericChart.setLayout layout ch - - | StyleParam.SubPlotId.Scene _ -> - - let layout = GenericChart.getLayout ch - - let updatedScene = - layout - |> Layout.tryGetSceneById(id) - |> Option.defaultValue (Scene.init()) - |> Scene.style(XAxis = xAxis) - - let updatedLayout = - layout - |> Layout.updateSceneById(id,updatedScene) - - GenericChart.addLayout updatedLayout ch - - | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a xaxis" - - - - [] - [] - static member withX_AxisStyle(title, - [] ?TitleFont, - [] ?MinMax, - [] ?ShowGrid, - [] ?ShowLine, - [] ?Side, - [] ?Overlaying, - [] ?Id, - [] ?Domain, - [] ?Position, - [] ?Zeroline, - [] ?Anchor) = - Chart.withXAxisStyle(title, - ?TitleFont = TitleFont, - ?MinMax = MinMax, - ?ShowGrid = ShowGrid, - ?ShowLine = ShowLine, - ?Side = Side, - ?Overlaying = Overlaying, - ?Id = Id, - ?Domain = Domain, - ?Position = Position, - ?Zeroline = Zeroline, - ?Anchor = Anchor) - - - // Sets x-Axis of 2d and 3d- Charts - [] - static member withXAxisStyle(title, - [] ?TitleFont, - [] ?MinMax, - [] ?ShowGrid, - [] ?ShowLine, - [] ?Side, - [] ?Overlaying, - [] ?Id, - [] ?Domain, - [] ?Position, - [] ?Zeroline, - [] ?Anchor) = - let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None - let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None - let xaxis = Axis.LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, - ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=Zeroline) - Chart.withXAxis(xaxis,?Id=Id) - - [] - [] - static member withX_AxisRangeSlider(rangeSlider:RangeSlider, - [] ?Id) = - Chart.withXAxisRangeSlider(rangeSlider, ?Id = Id) - - /// Sets the range slider for the xAxis - [] - static member withXAxisRangeSlider(rangeSlider:RangeSlider, - [] ?Id) = - let xaxis = Axis.LinearAxis.init(RangeSlider = rangeSlider) - Chart.withXAxis(xaxis,?Id=Id) - - [] - [] - static member withY_Axis(yAxis:Axis.LinearAxis,[] ?Id: StyleParam.SubPlotId) = - Chart.withYAxis(yAxis, ?Id = Id) - - // Sets y-Axis of 2d and 3d- Charts - [] - static member withYAxis(yAxis:Axis.LinearAxis,[] ?Id: StyleParam.SubPlotId) = - fun (ch:GenericChart) -> - - let id = defaultArg Id (StyleParam.SubPlotId.YAxis 1) - - match id with - | StyleParam.SubPlotId.YAxis _ -> - let layout = - GenericChart.getLayout ch - |> Layout.UpdateLinearAxisById(id,axis=yAxis) - GenericChart.setLayout layout ch - - | StyleParam.SubPlotId.Scene sceneId -> - - let layout = GenericChart.getLayout ch - - let updatedScene = - layout - |> Layout.tryGetSceneById(id) - |> Option.defaultValue (Scene.init()) - |> Scene.style(YAxis = yAxis) - - let updatedLayout = - layout - |> Layout.updateSceneById(id,updatedScene) - - GenericChart.addLayout updatedLayout ch - - | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a xaxis" - - - [] - [] - static member withY_AxisStyle(title, - [] ?TitleFont, - [] ?MinMax, - [] ?ShowGrid, - [] ?ShowLine, - [] ?Side, - [] ?Overlaying, - [] ?Id, - [] ?Domain, - [] ?Position, - [] ?ZeroLine, - [] ?Anchor) = - Chart.withYAxisStyle(title, - ?MinMax = MinMax, - ?ShowGrid = ShowGrid, - ?ShowLine = ShowLine, - ?Side = Side, - ?Overlaying = Overlaying, - ?Id = Id, - ?Domain = Domain, - ?Position = Position, - ?ZeroLine = ZeroLine, - ?Anchor = Anchor) - - // Sets y-Axis of 3d- Charts - [] - static member withYAxisStyle(title, - [] ?TitleFont, - [] ?MinMax, - [] ?ShowGrid, - [] ?ShowLine, - [] ?Side, - [] ?Overlaying, - [] ?Id, - [] ?Domain, - [] ?Position, - [] ?ZeroLine, - [] ?Anchor) = - let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None - let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None - let yaxis = Axis.LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid, - ?ShowLine=ShowLine,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) - Chart.withYAxis(yaxis,?Id=Id) - - - [] - [] - static member withZ_Axis(xAxis:Axis.LinearAxis) = - Chart.withZAxis xAxis - - // Sets z-Axis of 3d- Charts - [] - static member withZAxis(zAxis:Axis.LinearAxis,[] ?Id: StyleParam.SubPlotId) = - fun (ch:GenericChart) -> - - let id = defaultArg Id (StyleParam.SubPlotId.Scene 1) - - match id with - | StyleParam.SubPlotId.Scene sceneId -> - - let layout = GenericChart.getLayout ch - - let updatedScene = - layout - |> Layout.tryGetSceneById(id) - |> Option.defaultValue (Scene.init()) - |> Scene.style(ZAxis = zAxis) - - let updatedLayout = - layout - |> Layout.updateSceneById(id,updatedScene) - - GenericChart.addLayout updatedLayout ch - - | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a xaxis" - - - - [] - [] - static member withZ_AxisStyle(title, - [] ?TitleFont, - [] ?MinMax, - [] ?ShowGrid, - [] ?ShowLine, - [] ?Domain, - [] ?Anchor) = - Chart.withZAxisStyle(title, - ?MinMax = MinMax, - ?ShowGrid = ShowGrid, - ?ShowLine = ShowLine, - ?Domain = Domain, - ?Anchor = Anchor) - - - // Sets z-Axis style with ... - [] - static member withZAxisStyle(title, - [] ?TitleFont, - [] ?MinMax, - [] ?ShowGrid, - [] ?ShowLine, - [] ?Domain, - [] ?Anchor) = - let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None - let domain = if Domain.IsSome then Some (StyleParam.Range.MinMax (Domain.Value)) else None - let zaxis = Axis.LinearAxis.init(Title=Title.init(Text=title, ?Font=TitleFont),?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine,?Anchor=Anchor,?Domain=domain) - Chart.withZ_Axis(zaxis) - - [] - static member withColorBar(colorbar:ColorBar) = - (fun (ch:GenericChart) -> - ch - |> GenericChart.mapTrace(fun t -> - colorbar |> DynObj.setValue t "colorbar" - t - ) - ) - - - [] - static member withColorBarStyle(title, - [] ?Length, - [] ?OutlineColor, - [] ?BorderColor, - [] ?BGColor) = - let colorbar = ColorBar.init(Title=title,?Len = Length,?OutlineColor=OutlineColor,?BGColor=BGColor,?BorderColor=BorderColor) - Chart.withColorBar(colorbar) - //// Sets second x-Axis of 2d- Charts - //static member withX_Axis2(xAxis2:Axis.LinearAxis) = - // (fun (ch:GenericChart) -> - // let layout = - // GenericChart.getLayout ch - // |> Layout.style (xAxis2=xAxis2) - // GenericChart.setLayout layout ch - // ) - - - // // Sets second x-Axis of 2d- Charts - //static member withX_Axis2Style(title,?MinMax,?Showgrid,?Showline) = - // let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None - // let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline,Side=StyleParam.Side.Top) - // Chart.withX_Axis2(xaxis) - - - //// Sets second y-Axis of 2d- Charts - //static member withY_Axis2(yAxis2:Axis.LinearAxis) = - // (fun (ch:GenericChart) -> - // let layout = - // GenericChart.getLayout ch - // |> Layout.style (yAxis2=yAxis2) - // GenericChart.setLayout layout ch - // ) - - - // // Sets second x-Axis of 2d- Charts - //static member withY_Axis2Style(title,?MinMax,?Showgrid,?Showline) = - // let range = if MinMax.IsSome then Some (StyleParam.Range.MinMax (MinMax.Value)) else None - // let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?Showgrid=Showgrid,?Showline=Showline,Side=StyleParam.Side.Right) - // Chart.withY_Axis2(yaxis) - - - // Set the Layout options of a Chart - [] - static member withLayout(layout:Layout) = - (fun (ch:GenericChart) -> - GenericChart.addLayout layout ch) - - // Set the LayoutGrid options of a Chart - [] - static member withLayoutGrid(layoutGrid:LayoutGrid) = - (fun (ch:GenericChart) -> - let layout = - GenericChart.getLayout ch - |> Layout.SetLayoutGrid layoutGrid - GenericChart.setLayout layout ch) - - // Set the LayoutGrid options of a Chart - [] - static member withLegend(legend:Legend) = - (fun (ch:GenericChart) -> - let layout = - GenericChart.getLayout ch - |> Layout.setLegend legend - GenericChart.setLayout layout ch) - - /// Sets a map for the given chart (will only work with traces supporting geo, e.g. choropleth, scattergeo) - [] - static member withGeo(map:Geo,[] ?Id:StyleParam.SubPlotId ) = - (fun (ch:GenericChart) -> - let layout = - let id = defaultArg Id (StyleParam.SubPlotId.Geo 1) - GenericChart.getLayout ch - |> Layout.UpdateGeoById(id,map) - GenericChart.setLayout layout ch - ) - - /// Sets a mapbox for the given chart (will only work with traces supporting mapboxes, e.g. choroplethmapbox, scattermapbox) - [] - static member withMapbox(mapBox:Mapbox,[] ?Id:StyleParam.SubPlotId ) = - (fun (ch:GenericChart) -> - let layout = - let id = defaultArg Id (StyleParam.SubPlotId.MapBox 1) - GenericChart.getLayout ch - |> Layout.UpdateMapboxById(id,mapBox) - GenericChart.setLayout layout ch - ) - - /// Sets the map style for the given chart (will only work with traces supporting geo, e.g. choropleth, scattergeo) - /// - /// Parameters : - /// - /// FitBounds : Determines if and how this subplot's view settings are auto-computed to fit trace data - /// - /// Resolution : Sets the resolution of the base layers - /// - /// Scope : Set the scope of the map. - /// - /// Projection : Determines the type of projection used to display the map - /// - /// Center : Sets the (lon,lat) coordinates of the map's center. By default, the map's longitude center lies at the middle of the longitude range for scoped projection and above `projection.rotation.lon` otherwise. For all projection types, the map's latitude center lies at the middle of the latitude range by default. - /// - /// Visible : Wether or not the base layers are visible - /// - /// Domain : The domain of this geo subplot - /// - /// ShowCoastLine : Sets whether or not the coastlines are drawn. - /// - /// CoastLineColor : Sets the coastline color. - /// - /// CoastLineWidth : Sets the coastline stroke width (in px). - /// - /// ShowLand : Sets whether or not land masses are filled in color. - /// - /// LandColor : Sets the land mass color. - /// - /// ShowOcean : Sets whether or not oceans are filled in color. - /// - /// OceanColor : Sets the ocean color - /// - /// ShowLakes : Sets whether or not lakes are drawn. - /// - /// LakeColor : Sets the color of the lakes. - /// - /// ShowRivers : Sets whether or not rivers are drawn. - /// - /// RiverColor : Sets color of the rivers. - /// - /// RiverWidth : Sets the stroke width (in px) of the rivers. - /// - /// ShowCountries : Sets whether or not country boundaries are drawn. - /// - /// CountryColor : Sets line color of the country boundaries. - /// - /// CountryWidth : Sets line width (in px) of the country boundaries. - /// - /// ShowSubunits : Sets whether or not boundaries of subunits within countries (e.g. states, provinces) are drawn. - /// - /// SubunitColor : Sets the color of the subunits boundaries. - /// - /// SubunitWidth : Sets the stroke width (in px) of the subunits boundaries. - /// - /// ShowFrame : Sets whether or not a frame is drawn around the map. - /// - /// FrameColor : Sets the color the frame. - /// - /// FrameWidth : Sets the stroke width (in px) of the frame. - /// - /// BgColor : Set the background color of the map - /// - /// LatAxis : Sets the latitudinal axis for this geo trace - /// - /// LonAxis : Sets the longitudinal axis for this geo trace - [] - static member withGeoStyle([] ?Id: StyleParam.SubPlotId, - []?FitBounds : StyleParam.GeoFitBounds, - []?Resolution : StyleParam.GeoResolution, - []?Scope : StyleParam.GeoScope, - []?Projection : GeoProjection, - []?Center : (float*float), - []?Visible : bool, - []?Domain : Domain, - []?ShowCoastLines : bool, - []?CoastLineColor, - []?CoastLineWidth : float, - []?ShowLand : bool, - []?LandColor, - []?ShowOcean : bool, - []?OceanColor, - []?ShowLakes : bool, - []?LakeColor, - []?ShowRivers : bool, - []?RiverColor, - []?RiverWidth : float, - []?ShowCountries : bool, - []?CountryColor, - []?CountryWidth : float, - []?ShowSubunits : bool, - []?SubunitColor, - []?SubunitWidth : float, - []?ShowFrame : bool, - []?FrameColor, - []?FrameWidth : float, - []?BgColor, - []?LatAxis : Axis.LinearAxis, - []?LonAxis : Axis.LinearAxis - ) = - (fun (ch:GenericChart) -> - - let map = - Geo.init( - ?FitBounds = FitBounds , - ?Resolution = Resolution , - ?Scope = Scope , - ?Projection = Projection , - ?Center = Center , - ?Visible = Visible , - ?Domain = Domain , - ?ShowCoastLines = ShowCoastLines, - ?CoastLineColor = CoastLineColor, - ?CoastLineWidth = CoastLineWidth, - ?ShowLand = ShowLand , - ?LandColor = LandColor , - ?ShowOcean = ShowOcean , - ?OceanColor = OceanColor , - ?ShowLakes = ShowLakes , - ?LakeColor = LakeColor , - ?ShowRivers = ShowRivers , - ?RiverColor = RiverColor , - ?RiverWidth = RiverWidth , - ?ShowCountries = ShowCountries , - ?CountryColor = CountryColor , - ?CountryWidth = CountryWidth , - ?ShowSubunits = ShowSubunits , - ?SubunitColor = SubunitColor , - ?SubunitWidth = SubunitWidth , - ?ShowFrame = ShowFrame , - ?FrameColor = FrameColor , - ?FrameWidth = FrameWidth , - ?BgColor = BgColor , - ?LatAxis = LatAxis , - ?LonAxis = LonAxis - ) - let id = defaultArg Id (StyleParam.SubPlotId.Geo 1) - ch |> Chart.withGeo(map,id) - ) - - [] - static member withGeoProjection(projectionType : StyleParam.GeoProjectionType, - []?Rotation , - []?Parallels, - []?Scale , - []?Id: StyleParam.SubPlotId - ) = - (fun (ch:GenericChart) -> - - let projection = - GeoProjection.init( - projectionType = projectionType, - ?Rotation = Rotation , - ?Parallels = Parallels , - ?Scale = Scale - ) - - let map = Geo.init(Projection = projection) - let id = defaultArg Id (StyleParam.SubPlotId.Geo 1) - ch |> Chart.withGeo(map,id) - ) - - /// Set the LayoutGrid options of a Chart - /// The number of rows in the grid. If you provide a 2D `subplots` array or a `yaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. - /// The number of columns in the grid. If you provide a 2D `subplots` array, the length of its longest row is used as the default. If you give an `xaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. - /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. - /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. - /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. - /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. - /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. - /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. - /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. - /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. - [] - static member withLayoutGridStyle([]?SubPlots : (StyleParam.LinearAxisId * StyleParam.LinearAxisId) [] [], - []?XAxes : StyleParam.LinearAxisId [], - []?YAxes : StyleParam.LinearAxisId [], - []?Rows : int, - []?Columns : int, - []?RowOrder : StyleParam.LayoutGridRowOrder, - []?Pattern : StyleParam.LayoutGridPattern, - []?XGap : float, - []?YGap : float, - []?Domain : Domain, - []?XSide : StyleParam.LayoutGridXSide, - []?YSide : StyleParam.LayoutGridYSide - ) = - (fun (ch:GenericChart) -> - let layout = GenericChart.getLayout ch - let updatedGrid = - let currentGrid = - match layout.TryGetTypedValue "grid" with - | Some grid -> grid - | None -> LayoutGrid() - currentGrid - |> LayoutGrid.style( - ?SubPlots = SubPlots, - ?XAxes = XAxes , - ?YAxes = YAxes , - ?Rows = Rows , - ?Columns = Columns , - ?RowOrder = RowOrder, - ?Pattern = Pattern , - ?XGap = XGap , - ?YGap = YGap , - ?Domain = Domain , - ?XSide = XSide , - ?YSide = YSide - ) - let updatedLayout = layout |> Layout.SetLayoutGrid updatedGrid - GenericChart.setLayout updatedLayout ch) - - [] - static member withConfig (config:Config) = - (fun (ch:GenericChart) -> - GenericChart.setConfig config ch) - - [] - static member withAnnotations(annotations:seq) = - (fun (ch:GenericChart) -> - ch - |> GenericChart.mapLayout - (Layout.style (Annotations = annotations))) - - // Set the title of a Chart - [] - static member withTitle(title,[] ?TitleFont) = - (fun (ch:GenericChart) -> - let layout = - Layout() - |> Layout.style( - Title= - Title.init( - Text = title, - ?Font = TitleFont - ) - ) - GenericChart.addLayout layout ch - ) - - - // Set showLegend of a Chart - [] - static member withLegend(showlegend) = - (fun (ch:GenericChart) -> - let layout = - Layout() - |> Layout.style(Showlegend=showlegend) - GenericChart.addLayout layout ch - ) - - - // Set the size of a Chart - [] - static member withSize(width,height) = - (fun (ch:GenericChart) -> - let layout = - GenericChart.getLayout ch - |> Layout.style (Width=width,Height=height) - GenericChart.setLayout layout ch - ) - - // Set the margin of a Chart - [] - static member withMargin(margin:Margin) = - (fun (ch:GenericChart) -> - let layout = - GenericChart.getLayout ch - |> Layout.style (Margin=margin) - GenericChart.setLayout layout ch) - - // Set the margin of a Chart - [] - static member withMarginSize - ( - [] ?Left, - [] ?Right, - [] ?Top, - [] ?Bottom, - [] ?Pad, - [] ?Autoexpand - ) = - let margin = - Margin.init ( ?Left=Left,?Right=Right,?Top=Top,?Bottom=Bottom,?Pad=Pad,?Autoexpand=Autoexpand ) - Chart.withMargin(margin) - - [] - static member withTemplate(template: Template) = - (fun (ch:GenericChart) -> - ch - |> GenericChart.mapLayout (fun l -> - template |> DynObj.setValue l "template" - l - ) - ) - - // TODO: Include withLegend & withLegendStyle - - //Specifies the shape type to be drawn. If "line", a line is drawn from (`x0`,`y0`) to (`x1`,`y1`) If "circle", a circle is drawn from - //((`x0`+`x1`)/2, (`y0`+`y1`)/2)) with radius (|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|) If "rect", a rectangle is drawn linking - //(`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`) - [] - static member withShape(shape:Shape) = - (fun (ch:GenericChart) -> - let layout = - GenericChart.getLayout ch - |> Layout.style (Shapes=[shape]) - GenericChart.setLayout layout ch) - - - [] - static member withShapes(shapes:Shape seq) = - (fun (ch:GenericChart) -> - let layout = - GenericChart.getLayout ch - |> Layout.style (Shapes=shapes) - GenericChart.setLayout layout ch) - - - // ####################### - /// Create a combined chart with the given charts merged - [] - static member combine(gCharts:seq) = - GenericChart.combine gCharts - - /// - /// Creates a subplot grid with the given dimensions (nRows x nCols) for the input charts. - /// - /// The number of rows in the grid. If you provide a 2D `subplots` array or a `yaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. - /// The number of columns in the grid. If you provide a 2D `subplots` array, the length of its longest row is used as the default. If you give an `xaxes` array, its length is used as the default. But it's also possible to have a different length, if you want to leave a row at the end for non-cartesian subplots. - /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. - /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. - /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. - /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. - /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. - /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. - /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. - /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. - [] - static member Grid (nRows: int, nCols: int, - []?SubPlots : (StyleParam.LinearAxisId*StyleParam.LinearAxisId) [] [], - []?XAxes : StyleParam.LinearAxisId [], - []?YAxes : StyleParam.LinearAxisId [], - []?RowOrder : StyleParam.LayoutGridRowOrder, - []?Pattern : StyleParam.LayoutGridPattern, - []?XGap : float, - []?YGap : float, - []?Domain : Domain, - []?XSide : StyleParam.LayoutGridXSide, - []?YSide : StyleParam.LayoutGridYSide - ) = - fun (gCharts:#seq) -> - - let pattern = defaultArg Pattern StyleParam.LayoutGridPattern.Independent - - let hasSharedAxes = pattern = StyleParam.LayoutGridPattern.Coupled - - // rows x cols coordinate grid - let gridCoordinates = - Array.init nRows (fun i -> - Array.init nCols (fun j -> - i+1,j+1 - ) - ) - |> Array.concat - - // extract all axes from the plots to later add them with an updated axis anchor - // TODO: currently only gets the default (first) x and y axis. There might be charts with multiple axes which might cause havoc downstream. - // those should either be removed or accounted for - let axes = - gCharts - |> Seq.map (fun gChart -> - gChart - |> GenericChart.getLayout - |> fun l -> - let xAxis = l.TryGetTypedValue "xaxis" |> Option.defaultValue (Axis.LinearAxis.init()) - let yAxis = l.TryGetTypedValue "yaxis" |> Option.defaultValue (Axis.LinearAxis.init()) - xAxis,yAxis - ) - - gCharts - |> Seq.zip gridCoordinates - |> Seq.zip axes - |> Seq.mapi (fun i ((xAxis,yAxis), ((y,x), gChart)) -> - - let xAnchor, yAnchor = - if hasSharedAxes then - x, y //set axis anchors according to grid coordinates - else - i+1, i+1 //set individual axis anchors for each subplot - - gChart - |> Chart.withAxisAnchor(xAnchor,yAnchor) // set adapted axis anchors - |> Chart.withXAxis(xAxis,(StyleParam.SubPlotId.XAxis (i+1))) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) - |> Chart.withYAxis(yAxis,(StyleParam.SubPlotId.YAxis (i+1))) // set previous axis with adapted id (one individual axis for each subplot, wether or not they will be used later) - |> GenericChart.mapLayout (fun l -> - if i > 0 then - // remove default axes from consecutive charts, otherwise they will override the first one - l.Remove("xaxis") |> ignore - l.Remove("yaxis") |> ignore - l - ) - ) - |> Chart.combine - |> Chart.withLayoutGrid ( - LayoutGrid.init( - Rows = nRows, - Columns = nCols, - Pattern = pattern, - ?SubPlots = SubPlots, - ?XAxes = XAxes, - ?YAxes = YAxes, - ?RowOrder = RowOrder, - ?XGap = XGap, - ?YGap = YGap, - ?Domain = Domain, - ?XSide = XSide, - ?YSide = YSide - ) - ) - - /// - /// Creates a subplot grid with the the dimensions of the input 2D sequence containing the charts to render in the respective cells. - /// - /// ATTENTION: when the individual rows do not have the same amount of charts, they will be filled with dummy charts TO THE RIGHT. - /// - /// prevent this behaviour by using Chart.Invisible at the cells that should be empty. - /// - /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. - /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. - /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. - /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. - /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. - /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. - /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. - /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. - [] - static member Grid - ( - []?SubPlots : (StyleParam.LinearAxisId*StyleParam.LinearAxisId) [] [], - []?XAxes : StyleParam.LinearAxisId [], - []?YAxes : StyleParam.LinearAxisId [], - []?RowOrder : StyleParam.LayoutGridRowOrder, - []?Pattern : StyleParam.LayoutGridPattern, - []?XGap : float, - []?YGap : float, - []?Domain : Domain, - []?XSide : StyleParam.LayoutGridXSide, - []?YSide : StyleParam.LayoutGridYSide - ) = - fun (gCharts:#seq<#seq>) -> - - let nRows = Seq.length gCharts - let nCols = Seq.maxBy Seq.length gCharts |> Seq.length - - if Seq.exists (fun s -> (s |> Seq.length) <> nCols) gCharts then - printfn "WARNING: not all rows contain the same amount of charts." - printfn "The rows will be filled TO THE RIGHT with invisible dummy charts." - printfn "To have more positional control, use Chart.Empty() in your Grid where you want to have empty cells." - - let copy = - gCharts - |> Seq.map Seq.cast // this is ugly but i did not find another way for the inner seq to be be a flexible type (so you can use list, array, and seq). - - let newGrid = - copy - |> Seq.map (fun (row) -> - let nCharts = Seq.length row - if nCharts <> nCols then - seq {yield! row; for i in nCharts .. nCols-1 do yield Chart.Invisible()} - else - row - ) - |> Seq.concat - - newGrid - |> Chart.Grid( - nRows,nCols, - ?SubPlots = SubPlots, - ?XAxes = XAxes, - ?YAxes = YAxes, - ?RowOrder = RowOrder, - ?Pattern = Pattern, - ?XGap = XGap, - ?YGap = YGap, - ?Domain = Domain, - ?XSide = XSide, - ?YSide = YSide - ) - - else - gCharts - |> Seq.concat - |> Chart.Grid( - nRows,nCols, - ?SubPlots = SubPlots, - ?XAxes = XAxes, - ?YAxes = YAxes, - ?RowOrder = RowOrder, - ?Pattern = Pattern, - ?XGap = XGap, - ?YGap = YGap, - ?Domain = Domain, - ?XSide = XSide, - ?YSide = YSide - ) - - /// Creates a chart stack (a subplot grid with one column) from the input charts. - /// - /// Used for freeform grids, where some axes may be shared across subplots but others are not. Each entry should be a cartesian subplot id, like "xy" or "x3y2", or "" to leave that cell empty. You may reuse x axes within the same column, and y axes within the same row. Non-cartesian subplots and traces that support `domain` can place themselves in this grid separately using the `gridcell` attribute. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an y axis id like "y", "y2", etc., or "" to not put a y axis in that row. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `xaxes` is present, will generate consecutive IDs. - /// Used with `yaxes` when the x and y axes are shared across columns and rows. Each entry should be an x axis id like "x", "x2", etc., or "" to not put an x axis in that column. Entries other than "" must be unique. Ignored if `subplots` is present. If missing but `yaxes` is present, will generate consecutive IDs. - /// Is the first row the top or the bottom? Note that columns are always enumerated from left to right. - /// If no `subplots`, `xaxes`, or `yaxes` are given but we do have `rows` and `columns`, we can generate defaults using consecutive axis IDs, in two ways: "coupled" gives one x axis per column and one y axis per row. "independent" uses a new xy pair for each cell, left-to-right across each row then iterating rows according to `roworder`. - /// Horizontal space between grid cells, expressed as a fraction of the total width available to one cell. Defaults to 0.1 for coupled-axes grids and 0.2 for independent grids. - /// Vertical space between grid cells, expressed as a fraction of the total height available to one cell. Defaults to 0.1 for coupled-axes grids and 0.3 for independent grids. - /// Sets the domains of this grid subplot (in plot fraction). The first and last cells end exactly at the domain edges, with no grout around the edges. - /// Sets where the x axis labels and titles go. "bottom" means the very bottom of the grid. "bottom plot" is the lowest plot that each x axis is used in. "top" and "top plot" are similar. - /// Sets where the y axis labels and titles go. "left" means the very left edge of the grid. "left plot" is the leftmost plot that each y axis is used in. "right" and "right plot" are similar. - [] - static member SingleStack - ( - []?SubPlots : (StyleParam.LinearAxisId*StyleParam.LinearAxisId) [] [], - []?XAxes : StyleParam.LinearAxisId [], - []?YAxes : StyleParam.LinearAxisId [], - []?RowOrder : StyleParam.LayoutGridRowOrder, - []?Pattern : StyleParam.LayoutGridPattern, - []?XGap : float, - []?YGap : float, - []?Domain : Domain, - []?XSide : StyleParam.LayoutGridXSide, - []?YSide : StyleParam.LayoutGridYSide - ) = - - fun (gCharts: #seq) -> - - gCharts - |> Chart.Grid( - nRows = Seq.length gCharts, - nCols = 1, - ?SubPlots = SubPlots, - ?XAxes = XAxes, - ?YAxes = YAxes, - ?RowOrder = RowOrder, - ?Pattern = Pattern, - ?XGap = XGap, - ?YGap = YGap, - ?Domain = Domain, - ?XSide = XSide, - ?YSide = YSide - ) - - /// Create a combined chart with the given charts merged - [] - [] - static member Stack ( [] ?Columns:int, - [] ?Space) = - (fun (charts:#seq) -> - - let col = defaultArg Columns 2 - let len = charts |> Seq.length - let colWidth = 1. / float col - let rowWidth = - let tmp = float len / float col |> ceil - 1. / tmp - let space = - let s = defaultArg Space 0.05 - if s < 0. || s > 1. then - printfn "Space should be between 0.0 - 1.0. Automaticaly set to default (0.05)" - 0.05 - else - s - - let contains3d ch = - ch - |> existsTrace (fun t -> - match t with - | :? Trace3d -> true - | _ -> false) - - charts - |> Seq.mapi (fun i ch -> - let colI,rowI,index = (i%col+1), (i/col+1),(i+1) - let xdomain = (colWidth * float (colI-1), (colWidth * float colI) - space ) - let ydomain = (1. - ((rowWidth * float rowI) - space ),1. - (rowWidth * float (rowI-1))) - - if contains3d ch then - let sceneId = StyleParam.SubPlotId.Scene (i+1) - - let scene = - Scene.init ( - Domain = - Domain.init(X = StyleParam.Range.MinMax xdomain,Y= StyleParam.Range.MinMax ydomain) - ) - let layout = - GenericChart.getLayout ch - |> Layout.addScene ( - sceneId, - scene - ) - ch - |> mapTrace - (fun t -> - t?scene <- (StyleParam.SubPlotId.toString sceneId) - t - ) - |> GenericChart.setLayout layout - //|> Chart.withAxisAnchor(X=index,Y=index) - else - - let xaxis,yaxis,layout = - let layout = GenericChart.getLayout ch - let xName, yName = StyleParam.LinearAxisId.X 1 |> StyleParam.LinearAxisId.toString, StyleParam.LinearAxisId.Y 1 |> StyleParam.LinearAxisId.toString - match (layout.TryGetTypedValue xName),(layout.TryGetTypedValue yName) with - | Some x, Some y -> - // remove axis - DynObj.remove layout xName - DynObj.remove layout yName - - x |> Axis.LinearAxis.style(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), - y |> Axis.LinearAxis.style(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), - layout - | Some x, None -> - // remove x - axis - DynObj.remove layout xName - x |> Axis.LinearAxis.style(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), - Axis.LinearAxis.init(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), - layout - | None, Some y -> - // remove y - axis - DynObj.remove layout yName - Axis.LinearAxis.init(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), - y |> Axis.LinearAxis.style(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), - layout - | None, None -> - Axis.LinearAxis.init(Anchor=StyleParam.LinearAxisId.Y index,Domain=StyleParam.Range.MinMax xdomain), - Axis.LinearAxis.init(Anchor=StyleParam.LinearAxisId.X index,Domain=StyleParam.Range.MinMax ydomain), - layout - - ch - |> GenericChart.setLayout layout - |> Chart.withAxisAnchor(X=index,Y=index) - |> Chart.withXAxis(xaxis,StyleParam.SubPlotId.YAxis index) - |> Chart.withYAxis(yaxis,StyleParam.SubPlotId.XAxis index) - ) - - |> Chart.combine - ) - -// ############################################################ -// ####################### Apply to DisplayOptions - - /// Show chart in browser - [] - static member withDescription (description:ChartDescription) (ch:GenericChart) = - ch - |> mapDisplayOptions (DisplayOptions.style(Description=description)) - - - /// Adds the given additional html tags on the chart's DisplayOptions. They will be included in the document's - [] - static member withAdditionalHeadTags (additionalHeadTags:seq) (ch:GenericChart) = - ch - |> mapDisplayOptions ( fun d -> - let tags = d.TryGetTypedValue>("AdditionalHeadTags") - let newTags = - tags - |> Option.map (fun tags -> seq{yield! tags; yield! additionalHeadTags}) - |> Option.defaultValue additionalHeadTags - d |> DisplayOptions.style(AdditionalHeadTags=newTags) - ) - - /// Sets the given additional head tags on the chart's DisplayOptions. They will be included in the document's - [] - static member withHeadTags (headTags:seq) (ch:GenericChart) = - ch - |> mapDisplayOptions (DisplayOptions.style(AdditionalHeadTags=headTags)) - - - /// Adds the necessary script tags to render tex strings to the chart's DisplayOptions - [] - static member withMathTex ([]?AppendTags:bool) = - let tags = [ - """""" - """""" - ] - (fun (ch:GenericChart) -> - - if (AppendTags |> Option.defaultValue true) then - ch |> Chart.withAdditionalHeadTags tags - else - ch |> Chart.withHeadTags tags - ) - - /// Save chart as html single page - [] - static member saveHtmlAs pathName (ch:GenericChart,[] ?Verbose) = - let html = GenericChart.toEmbeddedHTML ch - let file = sprintf "%s.html" pathName // remove file extension - File.WriteAllText(file, html) - - let verbose = defaultArg Verbose false - if verbose then - file |> openOsSpecificFile - - /// Show chart in browser - [] - static member show (ch:GenericChart) = - let guid = Guid.NewGuid().ToString() - let html = GenericChart.toEmbeddedHTML ch - let tempPath = Path.GetTempPath() - let file = sprintf "%s.html" guid - let path = Path.Combine(tempPath, file) - File.WriteAllText(path, html) - path |> openOsSpecificFile - - /// Show chart in browser - [] - static member showAsImage (format:StyleParam.ImageFormat) (ch:GenericChart) = - let guid = Guid.NewGuid().ToString() - let html = GenericChart.toEmbeddedImage format ch - let tempPath = Path.GetTempPath() - let file = sprintf "%s.html" guid - let path = Path.Combine(tempPath, file) - File.WriteAllText(path, html) - path |> openOsSpecificFile - - /// Sets the polar object with the given id on the chart layout - [] - static member withPolar(polar:Polar, [] ?Id) = - (fun (ch:GenericChart) -> - let layout = - let id = defaultArg Id (StyleParam.SubPlotId.Polar 1) - GenericChart.getLayout ch - |> Layout.updatePolarById(id,polar) - GenericChart.setLayout layout ch - ) - - - /// Sets the angular axis of the polar object with the given id on the chart layout - [] - static member withAngularAxis(angularAxis:Axis.AngularAxis, [] ?Id) = - (fun (ch:GenericChart) -> - - let id = defaultArg Id (StyleParam.SubPlotId.Polar 1) - let layout = GenericChart.getLayout ch - - let updatedPolar = - layout - |> Layout.tryGetPolarById(id) - |> Option.defaultValue (Polar.init()) - |> Polar.style(AngularAxis = angularAxis) - - let updatedLayout = - layout - |> Layout.updatePolarById(id,updatedPolar) - - GenericChart.setLayout updatedLayout ch - ) - - /// Sets the radial axis of the polar object with the given id on the chart layout - [] - static member withRadialAxis(radialAxis:Axis.RadialAxis, [] ?Id) = - (fun (ch:GenericChart) -> - let id = defaultArg Id (StyleParam.SubPlotId.Polar 1) - let layout = GenericChart.getLayout ch - - let updatedPolar = - layout - |> Layout.tryGetPolarById(id) - |> Option.defaultValue (Polar.init()) - |> Polar.style(RadialAxis = radialAxis) - - let updatedLayout = - layout - |> Layout.updatePolarById(id,updatedPolar) - - GenericChart.setLayout updatedLayout ch - ) - - /// Sets the color axis with the given id on the chart layout - [] - static member withColorAxis(colorAxis:Axis.ColorAxis, [] ?Id) = - (fun (ch:GenericChart) -> - let layout = - let id = defaultArg Id (StyleParam.SubPlotId.ColorAxis 1) - GenericChart.getLayout ch - |> Layout.updateColorAxisById(id,colorAxis) - GenericChart.setLayout layout ch - ) - - /// Sets the scene with the given id on the chart layout - [] - static member withScene(scene:Scene, [] ?Id) = - (fun (ch:GenericChart) -> - let layout = - let id = defaultArg Id (StyleParam.SubPlotId.Scene 1) - GenericChart.getLayout ch - |> Layout.updateSceneById(id,scene) - GenericChart.setLayout layout ch - ) diff --git a/src/Plotly.NET/Colors.fs b/src/Plotly.NET/CommonAbstractions/Colors.fs similarity index 100% rename from src/Plotly.NET/Colors.fs rename to src/Plotly.NET/CommonAbstractions/Colors.fs diff --git a/src/Plotly.NET/Font.fs b/src/Plotly.NET/CommonAbstractions/Font.fs similarity index 100% rename from src/Plotly.NET/Font.fs rename to src/Plotly.NET/CommonAbstractions/Font.fs diff --git a/src/Plotly.NET/Frame.fs b/src/Plotly.NET/CommonAbstractions/Frame.fs similarity index 100% rename from src/Plotly.NET/Frame.fs rename to src/Plotly.NET/CommonAbstractions/Frame.fs diff --git a/src/Plotly.NET/Line.fs b/src/Plotly.NET/CommonAbstractions/Line.fs similarity index 100% rename from src/Plotly.NET/Line.fs rename to src/Plotly.NET/CommonAbstractions/Line.fs diff --git a/src/Plotly.NET/StyleParams.fs b/src/Plotly.NET/CommonAbstractions/StyleParams.fs similarity index 92% rename from src/Plotly.NET/StyleParams.fs rename to src/Plotly.NET/CommonAbstractions/StyleParams.fs index f13804466..6dff4bd29 100644 --- a/src/Plotly.NET/StyleParams.fs +++ b/src/Plotly.NET/CommonAbstractions/StyleParams.fs @@ -206,16 +206,37 @@ module StyleParam = /// appear on the plot. If set to 'stack' the bars are stacked on top of one another. If set to 'group', the bars are plotted next to one another, centered /// around the shared location. If set to 'overlay', the bars are simply plotted over one another, you may need to set the opacity to see this. [] - type Barmode = - | Stack | Group | Overlay + type BarMode = + | Stack | Group | Overlay | Relative static member toString = function | Stack -> "stack" | Group -> "group" | Overlay -> "overlay" + | Relative-> "relative" + + static member convert = BarMode.toString >> box + + [] + type BoxMode = + | Group | Overlay + + static member toString = function + | Group -> "group" + | Overlay -> "overlay" + static member convert = BoxMode.toString >> box + + [] + type BarNorm = + | NoNorm | Fraction | Percent + + static member toString = function + | NoNorm -> "" + | Fraction -> "fraction" + | Percent -> "percent" - static member convert = Barmode.toString >> box + static member convert = BarNorm.toString >> box [] type BranchValues = @@ -232,6 +253,21 @@ module StyleParam = // #C# //-------------------------- + [] + type ClickMode = + | Event + | Select + | EventSelect + | NoClickMode + + static member toString = function + | Event -> "event" + | Select -> "select" + | EventSelect -> "event+select" + | NoClickMode -> "none" + + static member convert = ClickMode.toString >> box + /// Sets the calendar system to use with `x y z` date data. Default: "gregorian" [] type Calendar = @@ -524,6 +560,17 @@ module StyleParam = // #F# //-------------------------- + [] + type FunnelMode = + | Stack | Group | Overlay + + static member toString = function + | Stack -> "stack" + | Group -> "group" + | Overlay -> "overlay" + + static member convert = FunnelMode.toString >> box + /// Names of installed font families [] type FontFamily = @@ -1200,6 +1247,20 @@ module StyleParam = // #S# //-------------------------- + [] + type SelectDirection = + | Horizontal + | Vertical + | Diagonal + | Any + + static member toString = function + | Horizontal -> "h" + | Vertical -> "v" + | Diagonal -> "d" + | Any -> "any" + + static member convert = SelectDirection.toString >> box /// Specifies the shape type to be drawn. If "line", a line is drawn from (`x0`,`y0`) to (`x1`,`y1`) If "circle", a circle is drawn from ((`x0`+`x1`)/2, (`y0`+`y1`)/2)) /// with radius (|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|) If "rect", a rectangle is drawn linking (`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`) @@ -1452,6 +1513,95 @@ module StyleParam = //-------------------------- // #T# //-------------------------- + + [] + type TransitionEasing = + | Linear + | Quad + | Cubic + | Sin + | Exp + | Circle + | Elastic + | Back + | Bounce + | LinearIn + | QuadIn + | CubicIn + | SinIn + | ExpIn + | CircleIn + | ElasticIn + | BackIn + | BounceIn + | LinearOut + | QuadOut + | CubicOut + | SinOut + | ExpOut + | CircleOut + | ElasticOut + | BackOut + | BounceOut + | LinearInOut + | QuadInOut + | CubicInOut + | SinInOut + | ExpInOut + | CircleInOut + | ElasticInOut + | BackInOut + | BounceInOut + + static member toString = function + | Linear -> "linear" + | Quad -> "quad" + | Cubic -> "cubic" + | Sin -> "sin" + | Exp -> "exp" + | Circle -> "circle" + | Elastic -> "elastic" + | Back -> "back" + | Bounce -> "bounce" + | LinearIn -> "linear-in" + | QuadIn -> "quad-in" + | CubicIn -> "cubic-in" + | SinIn -> "sin-in" + | ExpIn -> "exp-in" + | CircleIn -> "circle-in" + | ElasticIn -> "elastic-in" + | BackIn -> "back-in" + | BounceIn -> "bounce-in" + | LinearOut -> "linear-out" + | QuadOut -> "quad-out" + | CubicOut -> "cubic-out" + | SinOut -> "sin-out" + | ExpOut -> "exp-out" + | CircleOut -> "circle-out" + | ElasticOut -> "elastic-out" + | BackOut -> "back-out" + | BounceOut -> "bounce-out" + | LinearInOut -> "linear-in-out" + | QuadInOut -> "quad-in-out" + | CubicInOut -> "cubic-in-out" + | SinInOut -> "sin-in-out" + | ExpInOut -> "exp-in-out" + | CircleInOut -> "circle-in-out" + | ElasticInOut -> "elastic-in-out" + | BackInOut -> "back-in-out" + | BounceInOut -> "bounce-in-out" + + static member convert = TransitionEasing.toString >> box + + [] + type TransitionOrdering = + | LayoutFirst + | TracesFirst + + static member toString = function + | LayoutFirst -> "layout first" + | TracesFirst -> "traces first" + static member convert = TransitionOrdering.toString >> box /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. (default: MiddleCenter) [] @@ -1683,11 +1833,31 @@ module StyleParam = //-------------------------- // #U# //-------------------------- + [] + type UniformTextMode = + | Hide | False | Show + + static member toString = function + | Hide -> "hide" + | False -> "false" + | Show -> "show" + static member convert = UniformTextMode.toString >> box //-------------------------- // #V# //-------------------------- + + [] + type ViolinMode = + | Group | Overlay + + static member toString = function + | Group -> "group" + | Overlay -> "overlay" + + static member convert = ViolinMode.toString >> box + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). [] type Visible = @@ -1716,6 +1886,16 @@ module StyleParam = // #W# //-------------------------- + [] + type WaterfallMode = + | Group | Overlay + + static member toString = function + | Group -> "group" + | Overlay -> "overlay" + + static member convert = WaterfallMode.toString >> box + ///How to compute differences between bars in Waterfall Charts [] type WaterfallMeasure = diff --git a/src/Plotly.NET/Title.fs b/src/Plotly.NET/CommonAbstractions/Title.fs similarity index 100% rename from src/Plotly.NET/Title.fs rename to src/Plotly.NET/CommonAbstractions/Title.fs diff --git a/src/Plotly.NET/Config.fs b/src/Plotly.NET/Config/Config.fs similarity index 100% rename from src/Plotly.NET/Config.fs rename to src/Plotly.NET/Config/Config.fs diff --git a/src/Plotly.NET/DisplayOptions.fs b/src/Plotly.NET/DisplayOptions/DisplayOptions.fs similarity index 100% rename from src/Plotly.NET/DisplayOptions.fs rename to src/Plotly.NET/DisplayOptions/DisplayOptions.fs diff --git a/src/Plotly.NET/SankeyExtension.fs b/src/Plotly.NET/Extensions/SankeyExtension.fs similarity index 99% rename from src/Plotly.NET/SankeyExtension.fs rename to src/Plotly.NET/Extensions/SankeyExtension.fs index df2d96349..5c28ca95a 100644 --- a/src/Plotly.NET/SankeyExtension.fs +++ b/src/Plotly.NET/Extensions/SankeyExtension.fs @@ -1,7 +1,6 @@ namespace Plotly.NET open DynamicObj -open Trace open System.Runtime.InteropServices type Node = @@ -52,7 +51,7 @@ type Link = [] module SankeyExtension = - type TraceStyle with + type TraceDomainStyle with [] static member Sankey ( @@ -194,7 +193,7 @@ module SankeyExtension = [] ?linkLineColor: obj, [] ?linkLineWidth:float ) = - Trace.initSankey(TraceStyle.Sankey + TraceDomain.initSankey(TraceDomainStyle.Sankey ( nodes, links, diff --git a/src/Plotly.NET/Layout.fs b/src/Plotly.NET/Layout.fs deleted file mode 100644 index 1894a6034..000000000 --- a/src/Plotly.NET/Layout.fs +++ /dev/null @@ -1,424 +0,0 @@ -namespace Plotly.NET - -open DynamicObj - -/// Margin -type Margin() = - inherit DynamicObj () - - /// Init Margin type - static member init - ( - ?Left , - ?Right , - ?Top , - ?Bottom , - ?Pad , - ?Autoexpand - ) = - Margin() - |> Margin.style - ( - ?Left = Left , - ?Right = Right , - ?Top = Top , - ?Bottom = Bottom , - ?Pad = Pad , - ?Autoexpand = Autoexpand - ) - - - // Applies the styles to Margin() - static member style - ( - ?Left , - ?Right , - ?Top , - ?Bottom , - ?Pad , - ?Autoexpand - ) = - (fun (margin:Margin) -> - Left |> DynObj.setValueOpt margin "l" - Right |> DynObj.setValueOpt margin "r" - Top |> DynObj.setValueOpt margin "t" - Bottom |> DynObj.setValueOpt margin "b" - - Pad |> DynObj.setValueOpt margin "pad" - Autoexpand |> DynObj.setValueOpt margin "autoexpand" - - margin - ) - -/// Layout -type Layout() = - inherit DynamicObj () - - /// Init Layout type - static member init - ( - ?Title : Title, - ?Font : Font , - ?Showlegend : bool , - ?Autosize , - ?Width : float , - ?Height : float , - //?xAxis : Axis.LinearAxis, - //?yAxis : Axis.LinearAxis, - ?Legend : Legend, - ?Annotations : seq , - ?Margin , - - ?Paper_bgcolor , - ?Plot_bgcolor , - ?Hovermode , - ?Dragmode , - - ?Separators , - ?Barmode , - ?Bargap , - ?Radialaxis , - ?Angularaxis , - ?Scene:Scene , - ?Direction , - ?Orientation , - ?Shapes , - - ?Hidesources , - ?Smith , - ?Geo : Geo, - ?Polar : Polar - - ) = - Layout() - |> Layout.style - ( - ?Title = Title , - ?Font = Font , - ?Showlegend = Showlegend , - ?Autosize = Autosize , - ?Width = Width , - ?Height = Height , - //?xAxis = xAxis , - //?yAxis = yAxis , - ?Legend = Legend , - ?Annotations = Annotations , - ?Margin = Margin , - - ?Paper_bgcolor = Paper_bgcolor , - ?Plot_bgcolor = Plot_bgcolor , - ?Hovermode = Hovermode , - ?Dragmode = Dragmode , - - ?Separators = Separators , - ?Barmode = Barmode , - ?Bargap = Bargap , - ?Radialaxis = Radialaxis , - ?Angularaxis = Angularaxis , - ?Scene = Scene , - ?Direction = Direction , - ?Orientation = Orientation , - ?Shapes = Shapes , - - ?Hidesources = Hidesources , - ?Smith = Smith , - ?Geo = Geo , - ?Polar = Polar - ) - - // Applies the styles to Layout() - static member style - ( - ?Title: Title, - ?Font:Font, - ?Showlegend:bool, - ?Autosize:bool, - ?Width, - ?Height, - //?xAxis:Axis.LinearAxis,//?xAxis2:Axis.LinearAxis, - //?yAxis:Axis.LinearAxis,//?yAxis2:Axis.LinearAxis, - ?Legend:Legend, - // TODO: annotations - ?Annotations, - ?Margin:Margin, - - ?Paper_bgcolor, - ?Plot_bgcolor, - ?Hovermode:StyleParam.HoverMode, - ?Dragmode:StyleParam.DragMode, - - ?Separators, - ?Barmode:StyleParam.Barmode, - ?Bargap, // Some bar.. /box... is missing - // bargroupgap - // - ?Radialaxis:Axis.RadialAxis, - ?Angularaxis:Axis.AngularAxis, - ?Scene:Scene, - ?Direction:StyleParam.Direction, - ?Orientation, - ?Shapes:Shape seq, - - ?Hidesources, - ?Smith, - ?Geo:Geo, - ?Polar : Polar - - ) = - (fun (layout:Layout) -> - Title |> DynObj.setValueOpt layout "title" - Autosize |> DynObj.setValueOpt layout "autosize" - Width |> DynObj.setValueOpt layout "width" - Height |> DynObj.setValueOpt layout "height" - - Paper_bgcolor |> DynObj.setValueOpt layout "paper_bgcolor" - Plot_bgcolor |> DynObj.setValueOpt layout "plot_bgcolor" - Separators |> DynObj.setValueOpt layout "separators" - Hidesources |> DynObj.setValueOpt layout "hidesources" - Smith |> DynObj.setValueOpt layout "smith" - Showlegend |> DynObj.setValueOpt layout "showlegend" - Hovermode |> DynObj.setValueOptBy layout "hovermode" StyleParam.HoverMode.toString - Dragmode |> DynObj.setValueOptBy layout "dragmode" StyleParam.DragMode.toString - - Geo |> DynObj.setValueOpt layout "geo" - Polar |> DynObj.setValueOpt layout "polar" - - Annotations |> DynObj.setValueOpt layout "annotations" - - - Direction |> DynObj.setValueOptBy layout "direction" StyleParam.Direction.toString - Orientation |> DynObj.setValueOpt layout "orientation" - Barmode |> DynObj.setValueOptBy layout "barmode" StyleParam.Barmode.toString - Bargap |> DynObj.setValueOpt layout "bargap" - Shapes |> DynObj.setValueOpt layout "shapes" - - // Update - Font |> DynObj.setValueOpt layout "font" - Margin |> DynObj.setValueOpt layout "margin" - //xAxis |> DynObj.setValueOpt layout "xaxis" - //xAxis2 |> DynObj.setValueOpt layout "xaxis2" - //yAxis |> DynObj.setValueOpt layout "yaxis" - //yAxis2 |> DynObj.setValueOpt layout "yaxis2" - Legend |> DynObj.setValueOpt layout "legend" - Radialaxis |> DynObj.setValueOpt layout "radialaxis" - Angularaxis |> DynObj.setValueOpt layout "angularaxis" - Scene |> DynObj.setValueOpt layout "scene" - //Shapes |> Option.iter (updatePropertyValueAndIgnore layout <@ layout.shapes @>) - - //// xAxis - //match xAxis with - //| Some xaxis -> match xaxis.TryGetValue ("anchor") with - // | None -> layout.SetValue("xaxis",xaxis) - // | Some anchor -> let anchor' = StyleParam.AxisAnchorId.parse (unbox anchor) - // let pname = StyleParam.AxisAnchorId.toPropertyName anchor' - // layout.SetValue(pname,xaxis) - //| None -> () - - //// yAxis - //match yAxis with - //| Some yaxis -> match yaxis.TryGetValue ("anchor") with - // | None -> layout.SetValue("xaxis",yaxis) - // | Some anchor -> let anchor' = StyleParam.AxisAnchorId.parse (unbox anchor) - // let pname = StyleParam.AxisAnchorId.toPropertyName anchor' - // layout.SetValue(pname,yaxis) - //| None -> () - - - layout - ) - - - static member AddLinearAxis - ( - id : StyleParam.SubPlotId, - axis : Axis.LinearAxis - ) = - (fun (layout:Layout) -> - - match id with - | StyleParam.SubPlotId.XAxis _ | StyleParam.SubPlotId.YAxis _ -> - axis |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout - - | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a linear axis on layout" - ) - - // Updates the style of current axis with given AxisId - static member UpdateLinearAxisById - ( - id : StyleParam.SubPlotId, - axis : Axis.LinearAxis - ) = - (fun (layout:Layout) -> - - match id with - | StyleParam.SubPlotId.XAxis _ | StyleParam.SubPlotId.YAxis _ -> - - let axis' = - match layout.TryGetValue (StyleParam.SubPlotId.toString id) with - | Some a -> DynObj.combine (unbox a) axis - | None -> axis :> DynamicObj - - axis' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout - | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a linear axis on layout" - ) - - static member addScene - ( - id : StyleParam.SubPlotId, - scene : Scene - ) = - (fun (layout:Layout) -> - scene |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout - ) - - static member updateSceneById - ( - id : StyleParam.SubPlotId, - scene : Scene - ) = - (fun (layout:Layout) -> - let scene' = - match layout.TryGetValue (StyleParam.SubPlotId.toString id) with - | Some a -> DynObj.combine (unbox a) scene - | None -> scene :> DynamicObj - - scene' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout - ) - - static member tryGetSceneById (id:StyleParam.SubPlotId) = - (fun (layout:Layout) -> - layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) - ) - - static member AddGeo - ( - id : StyleParam.SubPlotId, - geo : Geo - ) = - (fun (layout:Layout) -> - - geo |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout - ) - - // Updates the style of current geo map with given Id - static member UpdateGeoById - ( - id : StyleParam.SubPlotId, - geo : Geo - ) = - (fun (layout:Layout) -> - let geo' = - match layout.TryGetValue (StyleParam.SubPlotId.toString id) with - | Some a -> DynObj.combine (unbox a) geo - | None -> geo :> DynamicObj - - geo' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout - ) - - static member AddMapbox - ( - id : StyleParam.SubPlotId, - mapbox : Mapbox - ) = - (fun (layout:Layout) -> - - mapbox |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout - ) - - // Updates the style of current geo map with given Id - static member UpdateMapboxById - ( - id : StyleParam.SubPlotId, - mapbox : Mapbox - ) = - (fun (layout:Layout) -> - let mapbox' = - match layout.TryGetValue (StyleParam.SubPlotId.toString id) with - | Some a -> DynObj.combine (unbox a) mapbox - | None -> mapbox :> DynamicObj - - mapbox' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - layout - ) - - static member tryGetPolarById (id:StyleParam.SubPlotId) = - (fun (layout:Layout) -> - layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) - ) - - /// Updates the style of current polar object with given Id. - /// If there does not exist a polar object with the given id, sets it with the given polar object - static member updatePolarById - ( - id : StyleParam.SubPlotId, - polar : Polar - ) = - (fun (layout:Layout) -> - - let polar' = - match layout |> Layout.tryGetPolarById(id) with - | Some a -> DynObj.combine (unbox a) polar - | None -> polar :> DynamicObj - - polar' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout - ) - - static member tryGetColorAxisById (id:StyleParam.SubPlotId) = - (fun (layout:Layout) -> - layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) - ) - - /// Updates the style of current ColorAxis object with given Id. - /// If there does not exist a ColorAxis object with the given id, sets it with the given ColorAxis object - static member updateColorAxisById - ( - id : StyleParam.SubPlotId, - colorAxis: Axis.ColorAxis - ) = - (fun (layout:Layout) -> - - let colorAxis' = - match layout |> Layout.tryGetColorAxisById(id) with - | Some a -> DynObj.combine (unbox a) colorAxis - | None -> colorAxis :> DynamicObj - - colorAxis' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) - - layout - ) - - static member SetLayoutGrid - ( - grid: LayoutGrid - ) = - (fun (layout:Layout) -> - grid |> DynObj.setValue layout "grid" - layout - ) - - static member GetLayoutGrid - ( - grid: LayoutGrid - ) = - (fun (layout:Layout) -> - grid |> DynObj.setValue layout "grid" - layout - ) - - static member setLegend(legend:Legend) = - (fun (layout:Layout) -> - legend |> DynObj.setValue layout "legend" - layout - ) diff --git a/src/Plotly.NET/Layout/Layout.fs b/src/Plotly.NET/Layout/Layout.fs new file mode 100644 index 000000000..ec72d016d --- /dev/null +++ b/src/Plotly.NET/Layout/Layout.fs @@ -0,0 +1,484 @@ +namespace Plotly.NET + +open DynamicObj +open Plotly.NET.LayoutObjects +open System + +/// Layout +type Layout() = + inherit DynamicObj () + + /// Init Layout type + static member init + ( + ?Title : Title, + ?ShowLegend : bool, + ?Legend : Legend, + ?Margin : Margin, + ?AutoSize : bool, + ?Width : int, + ?Height : int, + ?Font : Font, + ?UniformText : UniformText, + ?Separators : string, + ?PaperBGColor : string, + ?PlotBGColor : string, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?Colorscale : DefaultColorScales, + ?Colorway : seq, + ?ModeBar : ModeBar, + ?HoverMode : StyleParam.HoverMode, + ?ClickMode : StyleParam.ClickMode, + ?DragMode : StyleParam.DragMode, + ?SelectDirection : StyleParam.SelectDirection, + ?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, + ?NewShape : Shape, + ?ActiveShape : ActiveShape, + ?HideSources : bool, + ?BarGap : float, + ?BarGroupGap : float, + ?BarMode : StyleParam.BarMode, + ?BarNorm : StyleParam.BarNorm, + ?ExtendPieColors : bool, + ?HiddenLabels : seq<#IConvertible>, + ?PieColorWay : seq, + ?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 : seq, + ?ExtendSunBurstColors : bool, + ?SunBurstColorWay : seq, + ?ExtendTreeMapColors : bool, + ?TreeMapColorWay : seq, + ?ExtendIcicleColors : bool, + ?IcicleColorWay : seq, + ?Annotations : seq, + ?Shapes : seq + ) = + Layout() + |> Layout.style + ( + ?Title = Title , + ?ShowLegend = ShowLegend , + ?Legend = Legend , + ?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 , + ?HoverDistance = HoverDistance , + ?SpikeDistance = SpikeDistance , + ?Hoverlabel = Hoverlabel , + ?Transition = Transition , + ?DataRevision = DataRevision , + ?UIRevision = UIRevision , + ?EditRevision = EditRevision , + ?SelectRevision = SelectRevision , + ?Template = Template , + ?Meta = Meta , + ?Computed = Computed , + ?Grid = Grid , + ?Calendar = Calendar , + ?NewShape = NewShape , + ?ActiveShape = ActiveShape , + ?HideSources = HideSources , + ?BarGap = BarGap , + ?BarGroupGap = BarGroupGap , + ?BarMode = BarMode , + ?BarNorm = BarNorm , + ?ExtendPieColors = ExtendPieColors , + ?HiddenLabels = HiddenLabels , + ?PieColorWay = PieColorWay , + ?BoxGap = BoxGap , + ?BoxGroupGap = BoxGroupGap , + ?BoxMode = BoxMode , + ?ViolinGap = ViolinGap , + ?ViolinGroupGap = ViolinGroupGap , + ?ViolinMode = ViolinMode , + ?WaterfallGap = WaterfallGap , + ?WaterfallGroupGap = WaterfallGroupGap , + ?WaterfallMode = WaterfallMode , + ?FunnelGap = FunnelGap , + ?FunnelGroupGap = FunnelGroupGap , + ?FunnelMode = FunnelMode , + ?ExtendFunnelAreaColors = ExtendFunnelAreaColors , + ?FunnelAreaColorWay = FunnelAreaColorWay , + ?ExtendSunBurstColors = ExtendSunBurstColors , + ?SunBurstColorWay = SunBurstColorWay , + ?ExtendTreeMapColors = ExtendTreeMapColors , + ?TreeMapColorWay = TreeMapColorWay , + ?ExtendIcicleColors = ExtendIcicleColors , + ?IcicleColorWay = IcicleColorWay , + ?Annotations = Annotations , + ?Shapes = Shapes + ) + + // Applies the styles to Layout() + static member style + ( + ?Title : Title, + ?ShowLegend : bool, + ?Legend : Legend, + ?Margin : Margin, + ?AutoSize : bool, + ?Width : int, + ?Height : int, + ?Font : Font, + ?UniformText : UniformText, + ?Separators : string, + ?PaperBGColor : string, + ?PlotBGColor : string, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?Colorscale : DefaultColorScales, + ?Colorway : seq, + ?ModeBar : ModeBar, + ?HoverMode : StyleParam.HoverMode, + ?ClickMode : StyleParam.ClickMode, + ?DragMode : StyleParam.DragMode, + ?SelectDirection : StyleParam.SelectDirection, + ?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, + ?NewShape : Shape, + ?ActiveShape : ActiveShape, + ?HideSources : bool, + ?BarGap : float, + ?BarGroupGap : float, + ?BarMode : StyleParam.BarMode, + ?BarNorm : StyleParam.BarNorm, + ?ExtendPieColors : bool, + ?HiddenLabels : seq<#IConvertible>, + ?PieColorWay : seq, + ?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 : seq, + ?ExtendSunBurstColors : bool, + ?SunBurstColorWay : seq, + ?ExtendTreeMapColors : bool, + ?TreeMapColorWay : seq, + ?ExtendIcicleColors : bool, + ?IcicleColorWay : seq, + ?Annotations : seq, + ?Shapes : seq + ) = + (fun (layout:Layout) -> + + Title |> DynObj.setValueOpt layout "title" + ShowLegend |> DynObj.setValueOpt layout "showlegend" + Legend |> DynObj.setValueOpt layout "legend" + Margin |> DynObj.setValueOpt layout "margin" + AutoSize |> DynObj.setValueOpt layout "autosize" + Width |> DynObj.setValueOpt layout "width" + Height |> DynObj.setValueOpt layout "height" + Font |> DynObj.setValueOpt layout "font" + UniformText |> DynObj.setValueOpt layout "uniformtext" + Separators |> DynObj.setValueOpt layout "separators" + PaperBGColor |> DynObj.setValueOpt layout "paper_bgcolor" + PlotBGColor |> DynObj.setValueOpt layout "plot_bgcolor" + AutoTypeNumbers |> DynObj.setValueOptBy layout "autotypenumbers" StyleParam.AutoTypeNumbers.convert + Colorscale |> DynObj.setValueOpt layout "colorscale" + Colorway |> DynObj.setValueOpt layout "colorway" + ModeBar |> DynObj.setValueOpt layout "modebar" + HoverMode |> DynObj.setValueOptBy layout "hovermode" StyleParam.HoverMode.convert + ClickMode |> DynObj.setValueOptBy layout "clickmode" StyleParam.ClickMode.convert + DragMode |> DynObj.setValueOptBy layout "dragmode" StyleParam.DragMode.convert + SelectDirection |> DynObj.setValueOptBy layout "selectdirection" StyleParam.SelectDirection.convert + HoverDistance |> DynObj.setValueOpt layout "hoverdistance" + SpikeDistance |> DynObj.setValueOpt layout "spikedistance" + Hoverlabel |> DynObj.setValueOpt layout "hoverlabel" + Transition |> DynObj.setValueOpt layout "transition" + DataRevision |> DynObj.setValueOpt layout "datarevision" + UIRevision |> DynObj.setValueOpt layout "uirevision" + EditRevision |> DynObj.setValueOpt layout "editrevision" + SelectRevision |> DynObj.setValueOpt layout "selectrevision" + Template |> DynObj.setValueOpt layout "template" + Meta |> DynObj.setValueOpt layout "meta" + Computed |> DynObj.setValueOpt layout "computed" + Grid |> DynObj.setValueOpt layout "grid" + Calendar |> DynObj.setValueOptBy layout "calendar" StyleParam.Calendar.convert + NewShape |> DynObj.setValueOpt layout "newshape" + ActiveShape |> DynObj.setValueOpt layout "activeshape" + HideSources |> DynObj.setValueOpt layout "hidesources" + BarGap |> DynObj.setValueOpt layout "bargap" + BarGroupGap |> DynObj.setValueOpt layout "bargroupgap" + BarMode |> DynObj.setValueOptBy layout "barmode" StyleParam.BarMode.convert + BarNorm |> DynObj.setValueOptBy layout "barnorm" StyleParam.BarNorm.convert + ExtendPieColors |> DynObj.setValueOpt layout "extendpiecolors" + HiddenLabels |> DynObj.setValueOpt layout "hiddenlabels" + PieColorWay |> DynObj.setValueOpt layout "piecolorway" + BoxGap |> DynObj.setValueOpt layout "boxgap" + BoxGroupGap |> DynObj.setValueOpt layout "boxgroupgap" + BoxMode |> DynObj.setValueOptBy layout "boxmode" StyleParam.BoxMode.convert + ViolinGap |> DynObj.setValueOpt layout "violingap" + ViolinGroupGap |> DynObj.setValueOpt layout "violingroupgap" + ViolinMode |> DynObj.setValueOptBy layout "violinmode" StyleParam.ViolinMode.convert + WaterfallGap |> DynObj.setValueOpt layout "waterfallgap" + WaterfallGroupGap |> DynObj.setValueOpt layout "waterfallgroupgap" + WaterfallMode |> DynObj.setValueOptBy layout "waterfallmode" StyleParam.WaterfallMode.convert + FunnelGap |> DynObj.setValueOpt layout "funnelgap" + FunnelGroupGap |> DynObj.setValueOpt layout "funnelgroupgap" + FunnelMode |> DynObj.setValueOptBy layout "funnelmode" StyleParam.FunnelMode.convert + ExtendFunnelAreaColors |> DynObj.setValueOpt layout "extendfunnelareacolors " + FunnelAreaColorWay |> DynObj.setValueOpt layout "funnelareacolorway" + ExtendSunBurstColors |> DynObj.setValueOpt layout "extendsunburstcolors" + SunBurstColorWay |> DynObj.setValueOpt layout "sunburstcolorway" + ExtendTreeMapColors |> DynObj.setValueOpt layout "extendtreemapcolors" + TreeMapColorWay |> DynObj.setValueOpt layout "treemapcolorway" + ExtendIcicleColors |> DynObj.setValueOpt layout "extendiciclecolors" + IcicleColorWay |> DynObj.setValueOpt layout "iciclecolorway" + Annotations |> DynObj.setValueOpt layout "annotations" + Shapes |> DynObj.setValueOpt layout "shapes" + + layout + ) + + + static member AddLinearAxis + ( + id : StyleParam.SubPlotId, + axis : LinearAxis + ) = + (fun (layout:Layout) -> + + match id with + | StyleParam.SubPlotId.XAxis _ | StyleParam.SubPlotId.YAxis _ -> + axis |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + layout + + | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a linear axis on layout" + ) + + // Updates the style of current axis with given AxisId + static member UpdateLinearAxisById + ( + id : StyleParam.SubPlotId, + axis : LinearAxis + ) = + (fun (layout:Layout) -> + + match id with + | StyleParam.SubPlotId.XAxis _ | StyleParam.SubPlotId.YAxis _ -> + + let axis' = + match layout.TryGetValue (StyleParam.SubPlotId.toString id) with + | Some a -> DynObj.combine (unbox a) axis + | None -> axis :> DynamicObj + + axis' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + + layout + | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting a linear axis on layout" + ) + + static member addScene + ( + id : StyleParam.SubPlotId, + scene : Scene + ) = + (fun (layout:Layout) -> + scene |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + layout + ) + + static member updateSceneById + ( + id : StyleParam.SubPlotId, + scene : Scene + ) = + (fun (layout:Layout) -> + let scene' = + match layout.TryGetValue (StyleParam.SubPlotId.toString id) with + | Some a -> DynObj.combine (unbox a) scene + | None -> scene :> DynamicObj + + scene' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + layout + ) + + static member tryGetSceneById (id:StyleParam.SubPlotId) = + (fun (layout:Layout) -> + layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) + ) + + static member AddGeo + ( + id : StyleParam.SubPlotId, + geo : Geo + ) = + (fun (layout:Layout) -> + + geo |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + + layout + ) + + // Updates the style of current geo map with given Id + static member UpdateGeoById + ( + id : StyleParam.SubPlotId, + geo : Geo + ) = + (fun (layout:Layout) -> + let geo' = + match layout.TryGetValue (StyleParam.SubPlotId.toString id) with + | Some a -> DynObj.combine (unbox a) geo + | None -> geo :> DynamicObj + + geo' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + layout + ) + + static member AddMapbox + ( + id : StyleParam.SubPlotId, + mapbox : Mapbox + ) = + (fun (layout:Layout) -> + + mapbox |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + + layout + ) + + // Updates the style of current geo map with given Id + static member UpdateMapboxById + ( + id : StyleParam.SubPlotId, + mapbox : Mapbox + ) = + (fun (layout:Layout) -> + let mapbox' = + match layout.TryGetValue (StyleParam.SubPlotId.toString id) with + | Some a -> DynObj.combine (unbox a) mapbox + | None -> mapbox :> DynamicObj + + mapbox' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + layout + ) + + static member tryGetPolarById (id:StyleParam.SubPlotId) = + (fun (layout:Layout) -> + layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) + ) + + /// Updates the style of current polar object with given Id. + /// If there does not exist a polar object with the given id, sets it with the given polar object + static member updatePolarById + ( + id : StyleParam.SubPlotId, + polar : Polar + ) = + (fun (layout:Layout) -> + + let polar' = + match layout |> Layout.tryGetPolarById(id) with + | Some a -> DynObj.combine (unbox a) polar + | None -> polar :> DynamicObj + + polar' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + + layout + ) + + static member tryGetColorAxisById (id:StyleParam.SubPlotId) = + (fun (layout:Layout) -> + layout.TryGetTypedValue(StyleParam.SubPlotId.toString id) + ) + + /// Updates the style of current ColorAxis object with given Id. + /// If there does not exist a ColorAxis object with the given id, sets it with the given ColorAxis object + static member updateColorAxisById + ( + id : StyleParam.SubPlotId, + colorAxis: ColorAxis + ) = + (fun (layout:Layout) -> + + let colorAxis' = + match layout |> Layout.tryGetColorAxisById(id) with + | Some a -> DynObj.combine (unbox a) colorAxis + | None -> colorAxis :> DynamicObj + + colorAxis' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id) + + layout + ) + + static member SetLayoutGrid + ( + grid: LayoutGrid + ) = + (fun (layout:Layout) -> + grid |> DynObj.setValue layout "grid" + layout + ) + + static member GetLayoutGrid + ( + grid: LayoutGrid + ) = + (fun (layout:Layout) -> + grid |> DynObj.setValue layout "grid" + layout + ) + + static member setLegend(legend:Legend) = + (fun (layout:Layout) -> + legend |> DynObj.setValue layout "legend" + layout + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs b/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs new file mode 100644 index 000000000..8c4f5a155 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/3D/AspectRatio.fs @@ -0,0 +1,8 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type AspectRatio() = + inherit DynamicObj () diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs new file mode 100644 index 000000000..2739c4676 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Camera.fs @@ -0,0 +1,8 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type Camera() = + inherit DynamicObj () diff --git a/src/Plotly.NET/Scene.fs b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs similarity index 93% rename from src/Plotly.NET/Scene.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs index 532ea0a6a..3c7d703e0 100644 --- a/src/Plotly.NET/Scene.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/3D/Scene.fs @@ -1,12 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj - -type AspectRatio() = - inherit DynamicObj () - -type Camera() = - inherit DynamicObj () +open System /// Scene type Scene() = @@ -38,9 +34,9 @@ type Scene() = ?DragMode : StyleParam.DragMode, ?HoverMode : StyleParam.HoverMode, ?UIRevision : string, - ?XAxis : Axis.LinearAxis, - ?YAxis : Axis.LinearAxis, - ?ZAxis : Axis.LinearAxis + ?XAxis : LinearAxis, + ?YAxis : LinearAxis, + ?ZAxis : LinearAxis ) = Scene () |> Scene.style @@ -85,9 +81,9 @@ type Scene() = ?DragMode : StyleParam.DragMode, ?HoverMode : StyleParam.HoverMode, ?UIRevision : string, - ?XAxis : Axis.LinearAxis, - ?YAxis : Axis.LinearAxis, - ?ZAxis : Axis.LinearAxis + ?XAxis : LinearAxis, + ?YAxis : LinearAxis, + ?ZAxis : LinearAxis ) = (fun (scene:Scene) -> diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs new file mode 100644 index 000000000..6a82ddb72 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ActiveShape.fs @@ -0,0 +1,33 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type ActiveShape() = + inherit DynamicObj () + + static member init + ( + ?FillColor : string, + ?Opacity : float + ) = + ActiveShape() + |> ActiveShape.style + ( + ?FillColor = FillColor, + ?Opacity = Opacity + ) + + static member style + ( + ?FillColor : string, + ?Opacity : float + ) = + (fun (activeShape:ActiveShape) -> + + FillColor |> DynObj.setValueOpt activeShape "fillcolor" + Opacity |> DynObj.setValueOpt activeShape "opacity" + + activeShape + ) \ No newline at end of file diff --git a/src/Plotly.NET/Annotation.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs similarity index 98% rename from src/Plotly.NET/Annotation.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs index 2ee0d8bf8..3bf7ff182 100644 --- a/src/Plotly.NET/Annotation.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Annotation.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Text annotations inside a plot type Annotation() = diff --git a/src/Plotly.NET/Button.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs similarity index 96% rename from src/Plotly.NET/Button.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs index 953f65901..a872773c5 100644 --- a/src/Plotly.NET/Button.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Button.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Dimensions type inherits from dynamic object type Button () = diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs new file mode 100644 index 000000000..e86198ffc --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorAxis.fs @@ -0,0 +1,84 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type ColorAxis() = + inherit DynamicObj() + + /// + /// Initializes a ColorAxis object + /// + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Determines whether or not the color domain is computed with respect to the input data (here corresponding trace color array(s)) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as corresponding trace color array(s). Has no effect when `cauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmin` must be set as well. + /// Sets the colorbar associated with this color axis. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not a colorbar is displayed for this trace. + static member init + ( + ?AutoColorScale : bool, + ?CAuto : float, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?ColorBar : ColorBar, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool + ) = + + ColorAxis() + |> ColorAxis.style + ( + ?AutoColorScale = AutoColorScale, + ?CAuto = CAuto , + ?CMin = CMin , + ?CMid = CMid , + ?CMax = CMax , + ?ColorBar = ColorBar , + ?ColorScale = ColorScale , + ?ShowScale = ShowScale , + ?ReverseScale = ReverseScale + ) + /// + /// Creates a function that applies the given style parameters to a ColorAxis object + /// + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Determines whether or not the color domain is computed with respect to the input data (here corresponding trace color array(s)) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as corresponding trace color array(s). Has no effect when `cauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as corresponding trace color array(s) and if set, `cmin` must be set as well. + /// Sets the colorbar associated with this color axis. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not a colorbar is displayed for this trace. + static member style + ( + ?AutoColorScale : bool, + ?CAuto : float, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?ColorBar : ColorBar, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool + ) = + fun (ca:ColorAxis) -> + + AutoColorScale |> DynObj.setValueOpt ca "autocolorscale" + CAuto |> DynObj.setValueOpt ca "cauto" + CMin |> DynObj.setValueOpt ca "cmin" + CMid |> DynObj.setValueOpt ca "cmid" + CMax |> DynObj.setValueOpt ca "cmax" + ColorBar |> DynObj.setValueOpt ca "colorbar" + ColorScale |> DynObj.setValueOpt ca "colorscale" + ShowScale |> DynObj.setValueOpt ca "showscale" + ReverseScale |> DynObj.setValueOpt ca "reversescale" + + ca \ No newline at end of file diff --git a/src/Plotly.NET/ColorBar.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorBar.fs similarity index 99% rename from src/Plotly.NET/ColorBar.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorBar.fs index 5527a9ba7..742da84b9 100644 --- a/src/Plotly.NET/ColorBar.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ColorBar.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs new file mode 100644 index 000000000..02cb7465f --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/DefaultColorScales.fs @@ -0,0 +1,37 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type DefaultColorScales() = + inherit DynamicObj () + + static member init + ( + ?Diverging : StyleParam.Colorscale, + ?Sequential : StyleParam.Colorscale, + ?SequentialMinus: StyleParam.Colorscale + ) = + DefaultColorScales() + |> DefaultColorScales.style + ( + ?Diverging = Diverging , + ?Sequential = Sequential , + ?SequentialMinus= SequentialMinus + ) + + static member style + ( + ?Diverging : StyleParam.Colorscale, + ?Sequential : StyleParam.Colorscale, + ?SequentialMinus: StyleParam.Colorscale + ) = + (fun (defaultColorScales:DefaultColorScales) -> + + Diverging |> DynObj.setValueOptBy defaultColorScales "diverging" StyleParam.Colorscale.convert + Sequential |> DynObj.setValueOptBy defaultColorScales "sequential" StyleParam.Colorscale.convert + SequentialMinus |> DynObj.setValueOptBy defaultColorScales "sequentialminus" StyleParam.Colorscale.convert + + defaultColorScales + ) \ No newline at end of file diff --git a/src/Plotly.NET/Domain.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs similarity index 95% rename from src/Plotly.NET/Domain.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs index 9f27d7898..ae4d05f00 100644 --- a/src/Plotly.NET/Domain.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Domain.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/Hoverlabel.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs similarity index 96% rename from src/Plotly.NET/Hoverlabel.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs index 287ef0c2a..f448b67db 100644 --- a/src/Plotly.NET/Hoverlabel.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Hoverlabel.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/LayoutGrid.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs similarity index 99% rename from src/Plotly.NET/LayoutGrid.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs index 35b56274d..26f62c8f4 100644 --- a/src/Plotly.NET/LayoutGrid.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LayoutGrid.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/Legend.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs similarity index 98% rename from src/Plotly.NET/Legend.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs index 7354b2d3f..015a89805 100644 --- a/src/Plotly.NET/Legend.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Legend.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Legend type Legend() = diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs new file mode 100644 index 000000000..50f7ae2c3 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/LinearAxis.fs @@ -0,0 +1,717 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +/// Linear axes can be used as x and y scales on 2D plots, and as x,y, and z scales on 3D plots. +type LinearAxis () = + inherit DynamicObj () + + /// + /// Initialize a LinearAxis object that can be used as a positional scale for Y, X or Z coordinates. + /// + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Sets the axis title. + /// Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question. + /// 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. Defaults to layout.autotypenumbers. + /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". + /// If "normal", the range is computed in relation to the extrema of the input data. If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. Applies only to linear axes. + /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. + /// Determines whether or not this axis is zoom-able. If true, then zoom is disabled. + /// If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: "x"}, xaxis2: {scaleanchor: "y"}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: "x"}, xaxis: {scaleanchor: "y"}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. + /// If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal. + /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the "range", or by decreasing the "domain". Default is "domain" for axes containing image traces, "range" otherwise. + /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are "left", "center" (default), and "right" for x axes, and "top", "middle" (default), and "bottom" for y axes. + /// If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`. + /// Sets breaks in the axis range + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Determines where ticks and grid lines are drawn with respect to their corresponding tick labels. Only has an effect for axes of `type` "category" or "multicategory". When set to "boundaries", ticks and grid lines are drawn half a category to the left/bottom of labels. + /// Determines where tick labels are drawn with respect to their corresponding ticks and grid lines. Only has an effect for axes of `type` "date" When set to "period", tick labels are drawn in the middle of the period between ticks. + /// Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when `ticklabelmode` is set to "period". Similarly left or right has no effect on y axes or when `ticklabelmode` is set to "period". Has no effect on "multicategory" axes or when `tickson` is set to "boundaries". When used on axes linked by `matches` or `scaleanchor`, no extra padding for inside labels would be added by autorange, so that the scales could match. + /// 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". Otherwise on "category" and "multicategory" axes the default is "allow". In other cases the default is "hide past div". + /// Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored. If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// Determines whether long tick labels automatically grow the figure margins. + /// Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest + /// Sets the spike color. If undefined, will use the series color + /// Sets the width (in px) of the zero line. + /// Sets the dash style of lines + /// Determines the drawing mode for the spike line If "toaxis", the line is drawn from the data point to the axis the series is plotted on. If "across", the line is drawn across the entire plot area, and supercedes "toaxis". If "marker", then a marker dot is drawn on the axis the series is plotted on + /// Determines whether spikelines are stuck to the cursor or to the closest datapoints. + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines. + /// Sets the line color of the zero line. + /// Sets the width (in px) of the zero line. + /// Determines whether or not a dividers are drawn between the category levels of this axis. Only has an effect on "multicategory" axes. + /// Sets the color of the dividers Only has an effect on "multicategory" axes. + /// Sets the width (in px) of the dividers Only has an effect on "multicategory" axes. + /// If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`. + /// Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area. + /// If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible. + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + /// Sets the domain of this axis (in plot fraction). + /// Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free". + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Controls persistence of user-driven changes in axis `range`, `autorange`, and `title` if in `editable: true` configuration. Defaults to `layout.uirevision`. + /// Sets a range slider for this axis + /// Sets a range selector for this axis. This object contains toggable presets for the rangeslider. + /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` + static member init + ( + ?Visible : bool, + ?Color : string, + ?Title : Title, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?FixedRange : bool, + ?ScaleAnchor : StyleParam.LinearAxisId, + ?ScaleRatio : float, + ?Constrain : StyleParam.AxisConstraint, + ?ConstrainToward : StyleParam.AxisConstraintDirection, + ?Matches : StyleParam.LinearAxisId, + ?Rangebreaks : seq, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TicksOn : StyleParam.CategoryTickAnchor, + ?TickLabelMode : StyleParam.TickLabelMode, + ?TickLabelPosition : StyleParam.TickLabelPosition, + ?TickLabelOverflow : StyleParam.TickLabelOverflow, + ?Mirror : StyleParam.Mirror, + ?TickLen : float, + ?TickWidth : float, + ?TickColor : string, + ?ShowTickLabels : bool, + ?AutoMargin : bool, + ?ShowSpikes : bool, + ?SpikeColor : string, + ?SpikeThickness : int, + ?SpikeDash : StyleParam.DrawingStyle, + ?SpikeMode : StyleParam.SpikeMode, + ?SpikeSnap : StyleParam.SpikeSnap, + ?TickFont : Font, + ?TickAngle : int, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFormat : string, + ?TickFormatStops : seq, + ?HoverFormat : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : float, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : float, + ?ZeroLine : bool, + ?ZeroLineColor : string, + ?ZeroLineWidth : float, + ?ShowDividers : bool, + ?DividerColor : string, + ?DividerWidth : int, + ?Anchor : StyleParam.LinearAxisId, + ?Side : StyleParam.Side, + ?Overlaying : StyleParam.LinearAxisId, + ?Layer : StyleParam.Layer, + ?Domain : StyleParam.Range, + ?Position : float, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?UIRevision : #IConvertible, + ?RangeSlider : RangeSlider, + ?RangeSelector : RangeSelector, + ?Calendar : StyleParam.Calendar + + ) = + LinearAxis() + |> LinearAxis.style + ( + ?Visible = Visible , + ?Color = Color , + ?Title = Title , + ?AxisType = AxisType , + ?AutoTypeNumbers = AutoTypeNumbers , + ?AutoRange = AutoRange , + ?RangeMode = RangeMode , + ?Range = Range , + ?FixedRange = FixedRange , + ?ScaleAnchor = ScaleAnchor , + ?ScaleRatio = ScaleRatio , + ?Constrain = Constrain , + ?ConstrainToward = ConstrainToward , + ?Matches = Matches , + ?Rangebreaks = Rangebreaks , + ?TickMode = TickMode , + ?NTicks = NTicks , + ?Tick0 = Tick0 , + ?DTick = DTick , + ?TickVals = TickVals , + ?TickText = TickText , + ?Ticks = Ticks , + ?TicksOn = TicksOn , + ?TickLabelMode = TickLabelMode , + ?TickLabelPosition = TickLabelPosition , + ?TickLabelOverflow = TickLabelOverflow , + ?Mirror = Mirror , + ?TickLen = TickLen , + ?TickWidth = TickWidth , + ?TickColor = TickColor , + ?ShowTickLabels = ShowTickLabels , + ?AutoMargin = AutoMargin , + ?ShowSpikes = ShowSpikes , + ?SpikeColor = SpikeColor , + ?SpikeThickness = SpikeThickness , + ?SpikeDash = SpikeDash , + ?SpikeMode = SpikeMode , + ?SpikeSnap = SpikeSnap , + ?TickFont = TickFont , + ?TickAngle = TickAngle , + ?ShowTickPrefix = ShowTickPrefix , + ?TickPrefix = TickPrefix , + ?ShowTickSuffix = ShowTickSuffix , + ?TickSuffix = TickSuffix , + ?ShowExponent = ShowExponent , + ?ExponentFormat = ExponentFormat , + ?MinExponent = MinExponent , + ?SeparateThousands = SeparateThousands , + ?TickFormat = TickFormat , + ?TickFormatStops = TickFormatStops , + ?HoverFormat = HoverFormat , + ?ShowLine = ShowLine , + ?LineColor = LineColor , + ?LineWidth = LineWidth , + ?ShowGrid = ShowGrid , + ?GridColor = GridColor , + ?GridWidth = GridWidth , + ?ZeroLine = ZeroLine , + ?ZeroLineColor = ZeroLineColor , + ?ZeroLineWidth = ZeroLineWidth , + ?ShowDividers = ShowDividers , + ?DividerColor = DividerColor , + ?DividerWidth = DividerWidth , + ?Anchor = Anchor , + ?Side = Side , + ?Overlaying = Overlaying , + ?Layer = Layer , + ?Domain = Domain , + ?Position = Position , + ?CategoryOrder = CategoryOrder , + ?CategoryArray = CategoryArray , + ?UIRevision = UIRevision , + ?RangeSlider = RangeSlider , + ?RangeSelector = RangeSelector , + ?Calendar = Calendar + ) + + /// + /// Initialize a categorical LinearAxis object that can be used as a positional scale for Y, X or Z coordinates. + /// + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Sets the axis title. + /// 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. Defaults to layout.autotypenumbers. + /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". + /// If "normal", the range is computed in relation to the extrema of the input data. If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. Applies only to linear axes. + /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. + /// Determines whether or not this axis is zoom-able. If true, then zoom is disabled. + /// If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: "x"}, xaxis2: {scaleanchor: "y"}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: "x"}, xaxis: {scaleanchor: "y"}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. + /// If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal. + /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the "range", or by decreasing the "domain". Default is "domain" for axes containing image traces, "range" otherwise. + /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are "left", "center" (default), and "right" for x axes, and "top", "middle" (default), and "bottom" for y axes. + /// If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`. + /// Sets breaks in the axis range + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Determines where ticks and grid lines are drawn with respect to their corresponding tick labels. Only has an effect for axes of `type` "category" or "multicategory". When set to "boundaries", ticks and grid lines are drawn half a category to the left/bottom of labels. + /// Determines where tick labels are drawn with respect to their corresponding ticks and grid lines. Only has an effect for axes of `type` "date" When set to "period", tick labels are drawn in the middle of the period between ticks. + /// Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when `ticklabelmode` is set to "period". Similarly left or right has no effect on y axes or when `ticklabelmode` is set to "period". Has no effect on "multicategory" axes or when `tickson` is set to "boundaries". When used on axes linked by `matches` or `scaleanchor`, no extra padding for inside labels would be added by autorange, so that the scales could match. + /// 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". Otherwise on "category" and "multicategory" axes the default is "allow". In other cases the default is "hide past div". + /// Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored. If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// Determines whether long tick labels automatically grow the figure margins. + /// Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest + /// Sets the spike color. If undefined, will use the series color + /// Sets the width (in px) of the zero line. + /// Sets the dash style of lines + /// Determines the drawing mode for the spike line If "toaxis", the line is drawn from the data point to the axis the series is plotted on. If "across", the line is drawn across the entire plot area, and supercedes "toaxis". If "marker", then a marker dot is drawn on the axis the series is plotted on + /// Determines whether spikelines are stuck to the cursor or to the closest datapoints. + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines. + /// Sets the line color of the zero line. + /// Sets the width (in px) of the zero line. + /// Determines whether or not a dividers are drawn between the category levels of this axis. Only has an effect on "multicategory" axes. + /// Sets the color of the dividers Only has an effect on "multicategory" axes. + /// Sets the width (in px) of the dividers Only has an effect on "multicategory" axes. + /// If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`. + /// Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area. + /// If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible. + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + /// Sets the domain of this axis (in plot fraction). + /// Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free". + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Controls persistence of user-driven changes in axis `range`, `autorange`, and `title` if in `editable: true` configuration. Defaults to `layout.uirevision`. + /// Sets a range slider for this axis + /// Sets a range selector for this axis. This object contains toggable presets for the rangeslider. + /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` + static member initCategorical + ( + categoryOrder : StyleParam.CategoryOrder, + ?Visible : bool, + ?Color : string, + ?Title : Title, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?FixedRange : bool, + ?ScaleAnchor : StyleParam.LinearAxisId, + ?ScaleRatio : float, + ?Constrain : StyleParam.AxisConstraint, + ?ConstrainToward : StyleParam.AxisConstraintDirection, + ?Matches : StyleParam.LinearAxisId, + ?Rangebreaks : seq, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TicksOn : StyleParam.CategoryTickAnchor, + ?TickLabelMode : StyleParam.TickLabelMode, + ?TickLabelPosition : StyleParam.TickLabelPosition, + ?TickLabelOverflow : StyleParam.TickLabelOverflow, + ?Mirror : StyleParam.Mirror, + ?TickLen : float, + ?TickWidth : float, + ?TickColor : string, + ?ShowTickLabels : bool, + ?AutoMargin : bool, + ?ShowSpikes : bool, + ?SpikeColor : string, + ?SpikeThickness : int, + ?SpikeDash : StyleParam.DrawingStyle, + ?SpikeMode : StyleParam.SpikeMode, + ?SpikeSnap : StyleParam.SpikeSnap, + ?TickFont : Font, + ?TickAngle : int, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFormat : string, + ?TickFormatStops : seq, + ?HoverFormat : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : float, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : float, + ?ZeroLine : bool, + ?ZeroLineColor : string, + ?ZeroLineWidth : float, + ?ShowDividers : bool, + ?DividerColor : string, + ?DividerWidth : int, + ?Anchor : StyleParam.LinearAxisId, + ?Side : StyleParam.Side, + ?Overlaying : StyleParam.LinearAxisId, + ?Layer : StyleParam.Layer, + ?Domain : StyleParam.Range, + ?Position : float, + ?CategoryArray : seq<#IConvertible>, + ?UIRevision : #IConvertible, + ?RangeSlider : RangeSlider, + ?RangeSelector : RangeSelector, + ?Calendar : StyleParam.Calendar + ) = + LinearAxis() + |> LinearAxis.style + ( + CategoryOrder = categoryOrder, + AxisType = StyleParam.AxisType.Category, + ?Visible = Visible , + ?Color = Color , + ?Title = Title , + ?AutoTypeNumbers = AutoTypeNumbers , + ?AutoRange = AutoRange , + ?RangeMode = RangeMode , + ?Range = Range , + ?FixedRange = FixedRange , + ?ScaleAnchor = ScaleAnchor , + ?ScaleRatio = ScaleRatio , + ?Constrain = Constrain , + ?ConstrainToward = ConstrainToward , + ?Matches = Matches , + ?Rangebreaks = Rangebreaks , + ?TickMode = TickMode , + ?NTicks = NTicks , + ?Tick0 = Tick0 , + ?DTick = DTick , + ?TickVals = TickVals , + ?TickText = TickText , + ?Ticks = Ticks , + ?TicksOn = TicksOn , + ?TickLabelMode = TickLabelMode , + ?TickLabelPosition = TickLabelPosition , + ?TickLabelOverflow = TickLabelOverflow , + ?Mirror = Mirror , + ?TickLen = TickLen , + ?TickWidth = TickWidth , + ?TickColor = TickColor , + ?ShowTickLabels = ShowTickLabels , + ?AutoMargin = AutoMargin , + ?ShowSpikes = ShowSpikes , + ?SpikeColor = SpikeColor , + ?SpikeThickness = SpikeThickness , + ?SpikeDash = SpikeDash , + ?SpikeMode = SpikeMode , + ?SpikeSnap = SpikeSnap , + ?TickFont = TickFont , + ?TickAngle = TickAngle , + ?ShowTickPrefix = ShowTickPrefix , + ?TickPrefix = TickPrefix , + ?ShowTickSuffix = ShowTickSuffix , + ?TickSuffix = TickSuffix , + ?ShowExponent = ShowExponent , + ?ExponentFormat = ExponentFormat , + ?MinExponent = MinExponent , + ?SeparateThousands = SeparateThousands , + ?TickFormat = TickFormat , + ?TickFormatStops = TickFormatStops , + ?HoverFormat = HoverFormat , + ?ShowLine = ShowLine , + ?LineColor = LineColor , + ?LineWidth = LineWidth , + ?ShowGrid = ShowGrid , + ?GridColor = GridColor , + ?GridWidth = GridWidth , + ?ZeroLine = ZeroLine , + ?ZeroLineColor = ZeroLineColor , + ?ZeroLineWidth = ZeroLineWidth , + ?ShowDividers = ShowDividers , + ?DividerColor = DividerColor , + ?DividerWidth = DividerWidth , + ?Anchor = Anchor , + ?Side = Side , + ?Overlaying = Overlaying , + ?Layer = Layer , + ?Domain = Domain , + ?Position = Position , + ?CategoryArray = CategoryArray , + ?UIRevision = UIRevision , + ?RangeSlider = RangeSlider , + ?RangeSelector = RangeSelector , + ?Calendar = Calendar + ) + + /// + /// Create a function that applies the given style parameters to a LinearAxis object + /// + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Sets the axis title. + /// Sets the axis type. By default, plotly attempts to determined the axis type by looking into the data of the traces that referenced the axis in question. + /// 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. Defaults to layout.autotypenumbers. + /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". + /// If "normal", the range is computed in relation to the extrema of the input data. If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. Applies only to linear axes. + /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. + /// Determines whether or not this axis is zoom-able. If true, then zoom is disabled. + /// If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: "x"}, xaxis2: {scaleanchor: "y"}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: "x"}, xaxis: {scaleanchor: "y"}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. + /// If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal. + /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the "range", or by decreasing the "domain". Default is "domain" for axes containing image traces, "range" otherwise. + /// If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are "left", "center" (default), and "right" for x axes, and "top", "middle" (default), and "bottom" for y axes. + /// If set to another axis id (e.g. `x2`, `y`), the range of this axis will match the range of the corresponding axis in data-coordinates space. Moreover, matching axes share auto-range values, category lists and histogram auto-bins. Note that setting axes simultaneously in both a `scaleanchor` and a `matches` constraint is currently forbidden. Moreover, note that matching axes must have the same `type`. + /// Sets breaks in the axis range + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Determines where ticks and grid lines are drawn with respect to their corresponding tick labels. Only has an effect for axes of `type` "category" or "multicategory". When set to "boundaries", ticks and grid lines are drawn half a category to the left/bottom of labels. + /// Determines where tick labels are drawn with respect to their corresponding ticks and grid lines. Only has an effect for axes of `type` "date" When set to "period", tick labels are drawn in the middle of the period between ticks. + /// Determines where tick labels are drawn with respect to the axis Please note that top or bottom has no effect on x axes or when `ticklabelmode` is set to "period". Similarly left or right has no effect on y axes or when `ticklabelmode` is set to "period". Has no effect on "multicategory" axes or when `tickson` is set to "boundaries". When used on axes linked by `matches` or `scaleanchor`, no extra padding for inside labels would be added by autorange, so that the scales could match. + /// 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". Otherwise on "category" and "multicategory" axes the default is "allow". In other cases the default is "hide past div". + /// Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored. If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// Determines whether long tick labels automatically grow the figure margins. + /// Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest + /// Sets the spike color. If undefined, will use the series color + /// Sets the width (in px) of the zero line. + /// Sets the dash style of lines + /// Determines the drawing mode for the spike line If "toaxis", the line is drawn from the data point to the axis the series is plotted on. If "across", the line is drawn across the entire plot area, and supercedes "toaxis". If "marker", then a marker dot is drawn on the axis the series is plotted on + /// Determines whether spikelines are stuck to the cursor or to the closest datapoints. + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// Determines whether or not a line is drawn at along the 0 value of this axis. If "true", the zero line is drawn on top of the grid lines. + /// Sets the line color of the zero line. + /// Sets the width (in px) of the zero line. + /// Determines whether or not a dividers are drawn between the category levels of this axis. Only has an effect on "multicategory" axes. + /// Sets the color of the dividers Only has an effect on "multicategory" axes. + /// Sets the width (in px) of the dividers Only has an effect on "multicategory" axes. + /// If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to "free", this axis' position is determined by `position`. + /// Determines whether a x (y) axis is positioned at the "bottom" ("left") or "top" ("right") of the plotting area. + /// If set a same-letter axis id, this axis is overlaid on top of the corresponding same-letter axis, with traces and axes visible for both axes. If "false", this axis does not overlay any same-letter axes. In this case, for axes with overlapping domains only the highest-numbered axis will be visible. + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + /// Sets the domain of this axis (in plot fraction). + /// Sets the position of this axis in the plotting space (in normalized coordinates). Only has an effect if `anchor` is set to "free". + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Controls persistence of user-driven changes in axis `range`, `autorange`, and `title` if in `editable: true` configuration. Defaults to `layout.uirevision`. + /// Sets a range slider for this axis + /// Sets a range selector for this axis. This object contains toggable presets for the rangeslider. + /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` + static member style + ( + ?Visible : bool, + ?Color : string, + ?Title : Title, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?FixedRange : bool, + ?ScaleAnchor : StyleParam.LinearAxisId, + ?ScaleRatio : float, + ?Constrain : StyleParam.AxisConstraint, + ?ConstrainToward : StyleParam.AxisConstraintDirection, + ?Matches : StyleParam.LinearAxisId, + ?Rangebreaks : seq, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TicksOn : StyleParam.CategoryTickAnchor, + ?TickLabelMode : StyleParam.TickLabelMode, + ?TickLabelPosition : StyleParam.TickLabelPosition, + ?TickLabelOverflow : StyleParam.TickLabelOverflow, + ?Mirror : StyleParam.Mirror, + ?TickLen : float, + ?TickWidth : float, + ?TickColor : string, + ?ShowTickLabels : bool, + ?AutoMargin : bool, + ?ShowSpikes : bool, + ?SpikeColor : string, + ?SpikeThickness : int, + ?SpikeDash : StyleParam.DrawingStyle, + ?SpikeMode : StyleParam.SpikeMode, + ?SpikeSnap : StyleParam.SpikeSnap, + ?TickFont : Font, + ?TickAngle : int, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFormat : string, + ?TickFormatStops : seq, + ?HoverFormat : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : float, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : float, + ?ZeroLine : bool, + ?ZeroLineColor : string, + ?ZeroLineWidth : float, + ?ShowDividers : bool, + ?DividerColor : string, + ?DividerWidth : int, + ?Anchor : StyleParam.LinearAxisId, + ?Side : StyleParam.Side, + ?Overlaying : StyleParam.LinearAxisId, + ?Layer : StyleParam.Layer, + ?Domain : StyleParam.Range, + ?Position : float, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?UIRevision : #IConvertible, + ?RangeSlider : RangeSlider, + ?RangeSelector : RangeSelector, + ?Calendar : StyleParam.Calendar + ) = + (fun (axis:LinearAxis) -> + + Visible |> DynObj.setValueOpt axis "visible" + Color |> DynObj.setValueOpt axis "color" + Title |> DynObj.setValueOpt axis "title" + AxisType |> DynObj.setValueOptBy axis "axistype" StyleParam.AxisType.convert + AutoTypeNumbers |> DynObj.setValueOptBy axis "autotypenumbers" StyleParam.AutoTypeNumbers.convert + AutoRange |> DynObj.setValueOptBy axis "autorange" StyleParam.AutoRange.convert + RangeMode |> DynObj.setValueOptBy axis "rangemode" StyleParam.RangeMode.convert + Range |> DynObj.setValueOptBy axis "range" StyleParam.Range.convert + FixedRange |> DynObj.setValueOpt axis "fixedrange" + ScaleAnchor |> DynObj.setValueOptBy axis "scaleanchor" StyleParam.LinearAxisId.convert + ScaleRatio |> DynObj.setValueOpt axis "scaleratio" + Constrain |> DynObj.setValueOptBy axis "constrain" StyleParam.AxisConstraint.convert + ConstrainToward |> DynObj.setValueOptBy axis "constraitoward" StyleParam.AxisConstraintDirection.convert + Matches |> DynObj.setValueOptBy axis "matches" StyleParam.LinearAxisId.convert + Rangebreaks |> DynObj.setValueOpt axis "rangebreaks" + TickMode |> DynObj.setValueOptBy axis "tickmode" StyleParam.TickMode.convert + NTicks |> DynObj.setValueOpt axis "nticks" + Tick0 |> DynObj.setValueOpt axis "tick0" + DTick |> DynObj.setValueOpt axis "dtick" + TickVals |> DynObj.setValueOpt axis "tickvals" + TickText |> DynObj.setValueOpt axis "ticktext" + Ticks |> DynObj.setValueOptBy axis "ticks" StyleParam.TickOptions.convert + TicksOn |> DynObj.setValueOptBy axis "tickson" StyleParam.CategoryTickAnchor.convert + TickLabelMode |> DynObj.setValueOptBy axis "ticklabelmode" StyleParam.TickLabelMode.convert + TickLabelPosition |> DynObj.setValueOptBy axis "ticklabelposition" StyleParam.TickLabelPosition.convert + TickLabelOverflow |> DynObj.setValueOptBy axis "ticklabeloverflow" StyleParam.TickLabelOverflow.convert + Mirror |> DynObj.setValueOptBy axis "mirror" StyleParam.Mirror.convert + TickLen |> DynObj.setValueOpt axis "ticklen" + TickWidth |> DynObj.setValueOpt axis "tickwidth" + TickColor |> DynObj.setValueOpt axis "tickcolor" + ShowTickLabels |> DynObj.setValueOpt axis "showticklabels" + AutoMargin |> DynObj.setValueOpt axis "automargin" + ShowSpikes |> DynObj.setValueOpt axis "showspikes" + SpikeColor |> DynObj.setValueOpt axis "spikecolor" + SpikeThickness |> DynObj.setValueOpt axis "spikethickness" + SpikeDash |> DynObj.setValueOptBy axis "spikedash" StyleParam.DrawingStyle.convert + SpikeMode |> DynObj.setValueOptBy axis "spikemode" StyleParam.SpikeMode.convert + SpikeSnap |> DynObj.setValueOptBy axis "spikesnap" StyleParam.SpikeSnap.convert + TickFont |> DynObj.setValueOpt axis "tickfont" + TickAngle |> DynObj.setValueOpt axis "tickangle" + ShowTickPrefix |> DynObj.setValueOptBy axis "showtickprefix" StyleParam.ShowTickOption.convert + TickPrefix |> DynObj.setValueOpt axis "tickprefix" + ShowTickSuffix |> DynObj.setValueOptBy axis "showticksuffix" StyleParam.ShowTickOption.convert + TickSuffix |> DynObj.setValueOpt axis "ticksuffix" + ShowExponent |> DynObj.setValueOptBy axis "showexponent" StyleParam.ShowExponent.convert + ExponentFormat |> DynObj.setValueOptBy axis "exponentformat" StyleParam.ExponentFormat.convert + MinExponent |> DynObj.setValueOpt axis "minexponent" + SeparateThousands |> DynObj.setValueOpt axis "separatethousands" + TickFormat |> DynObj.setValueOpt axis "tickformat" + TickFormatStops |> DynObj.setValueOpt axis "tickformatstops" + HoverFormat |> DynObj.setValueOpt axis "hoverformat" + ShowLine |> DynObj.setValueOpt axis "showline" + LineColor |> DynObj.setValueOpt axis "linecolor" + LineWidth |> DynObj.setValueOpt axis "linewidth" + ShowGrid |> DynObj.setValueOpt axis "showgrid" + GridColor |> DynObj.setValueOpt axis "gridcolor" + GridWidth |> DynObj.setValueOpt axis "gridwidth" + ZeroLine |> DynObj.setValueOpt axis "zeroline" + ZeroLineColor |> DynObj.setValueOpt axis "zerolinecolor" + ZeroLineWidth |> DynObj.setValueOpt axis "zerolinewidth" + ShowDividers |> DynObj.setValueOpt axis "showdividers" + DividerColor |> DynObj.setValueOpt axis "dividercolor" + DividerWidth |> DynObj.setValueOpt axis "dividerwidth" + Anchor |> DynObj.setValueOptBy axis "anchor" StyleParam.LinearAxisId.convert + Side |> DynObj.setValueOptBy axis "side" StyleParam.Side.convert + Overlaying |> DynObj.setValueOptBy axis "overlaying" StyleParam.LinearAxisId.convert + Layer |> DynObj.setValueOptBy axis "layer" StyleParam.Layer.convert + Domain |> DynObj.setValueOptBy axis "domain" StyleParam.Range.convert + Position |> DynObj.setValueOpt axis "position" + CategoryOrder |> DynObj.setValueOptBy axis "categoryorder" StyleParam.CategoryOrder.convert + CategoryArray |> DynObj.setValueOpt axis "categoryarray" + UIRevision |> DynObj.setValueOpt axis "uirevision" + RangeSlider |> DynObj.setValueOpt axis "rangeslider" + RangeSelector |> DynObj.setValueOpt axis "rangeselector" + Calendar |> DynObj.setValueOptBy axis "calendar" StyleParam.Calendar.convert + + axis + ) diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs new file mode 100644 index 000000000..12de8ef56 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Margin.fs @@ -0,0 +1,51 @@ +namespace Plotly.NET.LayoutObjects + +open DynamicObj + +/// Margin +type Margin() = + inherit DynamicObj () + + /// Init Margin type + static member init + ( + ?Left , + ?Right , + ?Top , + ?Bottom , + ?Pad , + ?Autoexpand + ) = + Margin() + |> Margin.style + ( + ?Left = Left , + ?Right = Right , + ?Top = Top , + ?Bottom = Bottom , + ?Pad = Pad , + ?Autoexpand = Autoexpand + ) + + + // Applies the styles to Margin() + static member style + ( + ?Left , + ?Right , + ?Top , + ?Bottom , + ?Pad , + ?Autoexpand + ) = + (fun (margin:Margin) -> + Left |> DynObj.setValueOpt margin "l" + Right |> DynObj.setValueOpt margin "r" + Top |> DynObj.setValueOpt margin "t" + Bottom |> DynObj.setValueOpt margin "b" + + Pad |> DynObj.setValueOpt margin "pad" + Autoexpand |> DynObj.setValueOpt margin "autoexpand" + + margin + ) \ No newline at end of file diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs new file mode 100644 index 000000000..7e00fe020 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/ModeBar.fs @@ -0,0 +1,53 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type ModeBar() = + inherit DynamicObj () + + static member init + ( + ?ActiveColor : string, + ?Add : seq, + ?BGColor : string, + ?Color : string, + ?Orientation : StyleParam.Orientation, + ?Remove : string, + ?UIRevision : string + ) = + ModeBar() + |> ModeBar.style + ( + ?ActiveColor = ActiveColor , + ?Add = Add , + ?BGColor = BGColor , + ?Color = Color , + ?Orientation = Orientation , + ?Remove = Remove , + ?UIRevision = UIRevision + ) + + static member style + ( + ?ActiveColor : string, + ?Add : seq, + ?BGColor : string, + ?Color : string, + ?Orientation : StyleParam.Orientation, + ?Remove : string, + ?UIRevision : string + ) = + (fun (modeBar:ModeBar) -> + + ActiveColor |> DynObj.setValueOpt modeBar "activecolor" + Add |> DynObj.setValueOpt modeBar "add" + BGColor |> DynObj.setValueOpt modeBar "bgcolor" + Color |> DynObj.setValueOpt modeBar "color" + Orientation |> DynObj.setValueOptBy modeBar "orientation" StyleParam.Orientation.convert + Remove |> DynObj.setValueOpt modeBar "remove" + UIRevision |> DynObj.setValueOpt modeBar "uirevision " + + modeBar + ) \ No newline at end of file diff --git a/src/Plotly.NET/RangeSelector.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs similarity index 97% rename from src/Plotly.NET/RangeSelector.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs index 92f72e2c1..6e462e431 100644 --- a/src/Plotly.NET/RangeSelector.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSelector.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Dimensions type inherits from dynamic object type RangeSelector () = diff --git a/src/Plotly.NET/RangeSlider.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs similarity index 98% rename from src/Plotly.NET/RangeSlider.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs index ac330a13e..091f0823e 100644 --- a/src/Plotly.NET/RangeSlider.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/RangeSlider.fs @@ -1,7 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj -open System +open System //rangeslider //Parent: layout.xaxis diff --git a/src/Plotly.NET/Rangebreak.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs similarity index 99% rename from src/Plotly.NET/Rangebreak.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs index dcc04b47d..eeeb207a2 100644 --- a/src/Plotly.NET/Rangebreak.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Rangebreak.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/Shape.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs similarity index 98% rename from src/Plotly.NET/Shape.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs index dd30caa7a..96f05b35c 100644 --- a/src/Plotly.NET/Shape.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Shape.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/TickFormatStop.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/TickFormatStop.fs similarity index 95% rename from src/Plotly.NET/TickFormatStop.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Common/TickFormatStop.fs index aa7034db3..a0fdc176a 100644 --- a/src/Plotly.NET/TickFormatStop.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/TickFormatStop.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System type TickFormatStop() = inherit DynamicObj () diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs new file mode 100644 index 000000000..f9284dc44 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/Transition.fs @@ -0,0 +1,37 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type Transition() = + inherit DynamicObj () + + static member init + ( + ?Duration : int, + ?Easing : StyleParam.TransitionEasing, + ?Ordering : StyleParam.TransitionOrdering + ) = + Transition() + |> Transition.style + ( + ?Duration = Duration, + ?Easing = Easing , + ?Ordering = Ordering + ) + + static member style + ( + ?Duration: int, + ?Easing: StyleParam.TransitionEasing, + ?Ordering: StyleParam.TransitionOrdering + ) = + (fun (transition:Transition) -> + + Duration |> DynObj.setValueOpt transition "duration" + Easing |> DynObj.setValueOptBy transition "easing" StyleParam.TransitionEasing.convert + Ordering |> DynObj.setValueOptBy transition "ordering" StyleParam.TransitionOrdering.convert + + transition + ) \ No newline at end of file diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs new file mode 100644 index 000000000..203006a28 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Common/UniformText.fs @@ -0,0 +1,33 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +type UniformText() = + inherit DynamicObj () + + static member init + ( + ?MinSize: int, + ?Mode:StyleParam.UniformTextMode + ) = + UniformText() + |> UniformText.style + ( + ?MinSize = MinSize, + ?Mode = Mode + ) + + static member style + ( + ?MinSize : int, + ?Mode : StyleParam.UniformTextMode + ) = + (fun (uniformText:UniformText) -> + + MinSize |> DynObj.setValueOpt uniformText "minsize" + Mode |> DynObj.setValueOptBy uniformText "mode" StyleParam.UniformTextMode.convert + + uniformText + ) \ No newline at end of file diff --git a/src/Plotly.NET/Geo.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs similarity index 98% rename from src/Plotly.NET/Geo.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs index 7bf1bf202..42a3ba0ec 100644 --- a/src/Plotly.NET/Geo.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Geo.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Determines the style of the map shown in geo traces type Geo() = @@ -70,8 +72,8 @@ type Geo() = ?FrameColor: string, ?FrameWidth: float, ?BgColor: string, - ?LatAxis: Axis.LinearAxis, - ?LonAxis: Axis.LinearAxis + ?LatAxis: LinearAxis, + ?LonAxis: LinearAxis ) = Geo() @@ -173,8 +175,8 @@ type Geo() = ?FrameColor: string, ?FrameWidth: float, ?BgColor: string, - ?LatAxis: Axis.LinearAxis, - ?LonAxis: Axis.LinearAxis + ?LatAxis: LinearAxis, + ?LonAxis: LinearAxis ) = (fun (geo:Geo) -> diff --git a/src/Plotly.NET/GeoProjection.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs similarity index 98% rename from src/Plotly.NET/GeoProjection.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs index 245f819ab..432675c8e 100644 --- a/src/Plotly.NET/GeoProjection.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/GeoProjection.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Determines Map rotation in GeoProjections type GeoProjectionRotation () = diff --git a/src/Plotly.NET/Mapbox.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs similarity index 97% rename from src/Plotly.NET/Mapbox.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs index bcc74f87c..4097da4b2 100644 --- a/src/Plotly.NET/Mapbox.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/Mapbox.fs @@ -1,6 +1,8 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System /// Determines the style of the map shown in mapbox traces type Mapbox() = diff --git a/src/Plotly.NET/MapboxLayer.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs similarity index 98% rename from src/Plotly.NET/MapboxLayer.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs index eb8395051..a624484f6 100644 --- a/src/Plotly.NET/MapboxLayer.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayer.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/MapboxLayerSymbol.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs similarity index 97% rename from src/Plotly.NET/MapboxLayerSymbol.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs index 5b18088a3..480086b6f 100644 --- a/src/Plotly.NET/MapboxLayerSymbol.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Map/MapboxLayerSymbol.fs @@ -1,5 +1,6 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj open System diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs new file mode 100644 index 000000000..4b834f020 --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/AngularAxis.fs @@ -0,0 +1,284 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + + +/// Angular axes can be used as a scale for the angular coordinates in polar plots. +type AngularAxis () = + inherit DynamicObj () + + /// + /// Initialize an AngularAxis object that can be used as a angular scale for polar coordinates. + /// + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. + /// 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. Defaults to layout.autotypenumbers. + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Sets the format unit of the formatted "theta" values. Has an effect only when `angularaxis.type` is "linear". + /// Set the angular period. Has an effect only when `angularaxis.type` is "category". + /// Sets the direction corresponding to positive angles. + /// Sets that start position (in degrees) of the angular axis By default, polar subplots with `direction` set to "counterclockwise" get a `rotation` of "0" which corresponds to due East (like what mathematicians prefer). In turn, polar with `direction` set to "clockwise" get a rotation of "90" which corresponds to due North (like on a compass), + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + static member init + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?ThetaUnit : StyleParam.AngularUnit, + ?Period : float, + ?Direction : StyleParam.Direction, + ?Rotation : int, + ?HoverFormat : string, + ?UIRevision : #IConvertible, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer + ) = + AngularAxis() + |> AngularAxis.style + ( + ?Visible = Visible , + ?AxisType = AxisType , + ?AutoTypeNumbers = AutoTypeNumbers , + ?CategoryOrder = CategoryOrder , + ?CategoryArray = CategoryArray , + ?ThetaUnit = ThetaUnit , + ?Period = Period , + ?Direction = Direction , + ?Rotation = Rotation , + ?HoverFormat = HoverFormat , + ?UIRevision = UIRevision , + ?Color = Color , + ?ShowLine = ShowLine , + ?LineColor = LineColor , + ?LineWidth = LineWidth , + ?ShowGrid = ShowGrid , + ?GridColor = GridColor , + ?GridWidth = GridWidth , + ?TickMode = TickMode , + ?NTicks = NTicks , + ?Tick0 = Tick0 , + ?DTick = DTick , + ?TickVals = TickVals , + ?TickText = TickText , + ?Ticks = Ticks , + ?TickLen = TickLen , + ?TickWidth = TickWidth , + ?TickColor = TickColor , + ?ShowTickLabels = ShowTickLabels , + ?ShowTickPrefix = ShowTickPrefix , + ?TickPrefix = TickPrefix , + ?ShowTickSuffix = ShowTickSuffix , + ?TickSuffix = TickSuffix , + ?ShowExponent = ShowExponent , + ?ExponentFormat = ExponentFormat , + ?MinExponent = MinExponent , + ?SeparateThousands = SeparateThousands, + ?TickFont = TickFont , + ?TickAngle = TickAngle , + ?TickFormat = TickFormat , + ?TickFormatStops = TickFormatStops , + ?Layer = Layer + ) + + /// + /// Creates a function that applies the given style parameters to a AngularAxis object + /// + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. + /// 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. Defaults to layout.autotypenumbers. + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Sets the format unit of the formatted "theta" values. Has an effect only when `angularaxis.type` is "linear". + /// Set the angular period. Has an effect only when `angularaxis.type` is "category". + /// Sets the direction corresponding to positive angles. + /// Sets that start position (in degrees) of the angular axis By default, polar subplots with `direction` set to "counterclockwise" get a `rotation` of "0" which corresponds to due East (like what mathematicians prefer). In turn, polar with `direction` set to "clockwise" get a rotation of "90" which corresponds to due North (like on a compass), + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + static member style + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?ThetaUnit : StyleParam.AngularUnit, + ?Period : float, + ?Direction : StyleParam.Direction, + ?Rotation : int, + ?HoverFormat : string, + ?UIRevision : #IConvertible, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer + ) = + fun (angularAxis: AngularAxis) -> + + Visible |> DynObj.setValueOpt angularAxis "visible" + AxisType |> DynObj.setValueOptBy angularAxis "type" StyleParam.AxisType.convert + AutoTypeNumbers |> DynObj.setValueOptBy angularAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert + CategoryOrder |> DynObj.setValueOptBy angularAxis "categoryorder" StyleParam.CategoryOrder.convert + CategoryArray |> DynObj.setValueOpt angularAxis "categoryarray" + ThetaUnit |> DynObj.setValueOpt angularAxis "thetaunit" + Period |> DynObj.setValueOpt angularAxis "Period" + Direction |> DynObj.setValueOpt angularAxis "Direction" + Rotation |> DynObj.setValueOpt angularAxis "Rotation" + HoverFormat |> DynObj.setValueOpt angularAxis "hoverformat" + UIRevision |> DynObj.setValueOpt angularAxis "uirevision" + Color |> DynObj.setValueOpt angularAxis "color" + ShowLine |> DynObj.setValueOpt angularAxis "showline" + LineColor |> DynObj.setValueOpt angularAxis "linecolor" + LineWidth |> DynObj.setValueOpt angularAxis "linewidth" + ShowGrid |> DynObj.setValueOpt angularAxis "showgrid" + GridColor |> DynObj.setValueOpt angularAxis "gridcolor" + GridWidth |> DynObj.setValueOpt angularAxis "gridwidth" + TickMode |> DynObj.setValueOptBy angularAxis "tickmode" StyleParam.TickMode.convert + NTicks |> DynObj.setValueOpt angularAxis "nticks" + Tick0 |> DynObj.setValueOpt angularAxis "tick0" + DTick |> DynObj.setValueOpt angularAxis "dtick" + TickVals |> DynObj.setValueOpt angularAxis "TickVals" + TickText |> DynObj.setValueOpt angularAxis "TickText" + Ticks |> DynObj.setValueOptBy angularAxis "ticks" StyleParam.TickOptions.convert + TickLen |> DynObj.setValueOpt angularAxis "ticklen" + TickWidth |> DynObj.setValueOpt angularAxis "tickwidth" + TickColor |> DynObj.setValueOpt angularAxis "tickcolor" + ShowTickLabels |> DynObj.setValueOpt angularAxis "showticklabels" + ShowTickPrefix |> DynObj.setValueOptBy angularAxis "showtickprefix" StyleParam.ShowTickOption.convert + TickPrefix |> DynObj.setValueOpt angularAxis "tickprefix" + ShowTickSuffix |> DynObj.setValueOptBy angularAxis "showticksuffix" StyleParam.ShowTickOption.convert + TickSuffix |> DynObj.setValueOpt angularAxis "ticksuffix" + ShowExponent |> DynObj.setValueOptBy angularAxis "showexponent" StyleParam.ShowExponent.convert + ExponentFormat |> DynObj.setValueOptBy angularAxis "exponentformat" StyleParam.ExponentFormat.convert + MinExponent |> DynObj.setValueOpt angularAxis "minexponent" + SeparateThousands |> DynObj.setValueOpt angularAxis "separatethousands" + TickFont |> DynObj.setValueOpt angularAxis "tickfont" + TickAngle |> DynObj.setValueOpt angularAxis "tickangle" + TickFormat |> DynObj.setValueOpt angularAxis "TickFormat" + TickFormatStops |> DynObj.setValueOpt angularAxis "tickformatstops" + Layer |> DynObj.setValueOptBy angularAxis "layer" StyleParam.Layer.convert + + angularAxis diff --git a/src/Plotly.NET/Polar.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs similarity index 94% rename from src/Plotly.NET/Polar.fs rename to src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs index b9129b140..9570bca3d 100644 --- a/src/Plotly.NET/Polar.fs +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/Polar.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.LayoutObjects +open Plotly.NET open DynamicObj +open System + type Polar () = inherit DynamicObj () @@ -22,8 +25,8 @@ type Polar () = ?Sector : float*float, ?Hole : float, ?BGColor : string, - ?RadialAxis : Axis.RadialAxis, - ?AngularAxis: Axis.AngularAxis, + ?RadialAxis : RadialAxis, + ?AngularAxis: AngularAxis, ?GridShape : StyleParam.PolarGridShape, ?UIRevision : string ) = @@ -59,12 +62,12 @@ type Polar () = ?Sector : float*float, ?Hole : float, ?BGColor : string, - ?RadialAxis : Axis.RadialAxis, - ?AngularAxis: Axis.AngularAxis, + ?RadialAxis : RadialAxis, + ?AngularAxis: AngularAxis, ?GridShape : StyleParam.PolarGridShape, ?UIRevision : string, //these are not documented in the official reference but seem to be the only way to make this work?! - ?BarMode : StyleParam.Barmode, + ?BarMode : StyleParam.BarMode, ?BarGap : float ) = @@ -78,7 +81,7 @@ type Polar () = AngularAxis |> DynObj.setValueOpt polar "angularaxis" GridShape |> DynObj.setValueOptBy polar "gridshape" StyleParam.PolarGridShape.convert UIRevision |> DynObj.setValueOpt polar "uirevision" - BarMode |> DynObj.setValueOptBy polar "barmode" StyleParam.Barmode.convert + BarMode |> DynObj.setValueOptBy polar "barmode" StyleParam.BarMode.convert BarGap |> DynObj.setValueOpt polar "bargap" polar diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs new file mode 100644 index 000000000..9f0f179da --- /dev/null +++ b/src/Plotly.NET/Layout/ObjectAbstractions/Polar/RadialAxis.fs @@ -0,0 +1,301 @@ +namespace Plotly.NET.LayoutObjects + +open Plotly.NET +open DynamicObj +open System + +/// Radial axes can be used as a scale for the radial coordinates in polar plots. +type RadialAxis () = + inherit DynamicObj () + + /// + /// Initialize an AngularAxis object that can be used as a angular scale for polar coordinates. + /// + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. + /// 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. Defaults to layout.autotypenumbers. + /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". + /// If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. If "normal", the range is computed in relation to the extrema of the input data (same behavior as for cartesian axes). + /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Sets the angle (in degrees) from which the radial axis is drawn. Note that by default, radial axis line on the theta=0 line corresponds to a line pointing right (like what mathematicians prefer). Defaults to the first `polar.sector` angle. + /// Determines on which side of radial axis line the tick and tick labels appear. + /// Sets the title of the Radial Axis. + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` + static member init + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?Angle : float, + ?Side : StyleParam.Direction, + ?Title : Title, + ?HoverFormat : string, + ?UIRevision : #IConvertible, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer, + ?Calendar : StyleParam.Calendar + ) = + RadialAxis() + |> RadialAxis.style + ( + ?Visible = Visible , + ?AxisType = AxisType , + ?AutoTypeNumbers = AutoTypeNumbers , + ?AutoRange = AutoRange , + ?RangeMode = RangeMode , + ?Range = Range , + ?CategoryOrder = CategoryOrder , + ?CategoryArray = CategoryArray , + ?Angle = Angle , + ?Side = Side , + ?Title = Title , + ?HoverFormat = HoverFormat , + ?UIRevision = UIRevision , + ?Color = Color , + ?ShowLine = ShowLine , + ?LineColor = LineColor , + ?LineWidth = LineWidth , + ?ShowGrid = ShowGrid , + ?GridColor = GridColor , + ?GridWidth = GridWidth , + ?TickMode = TickMode , + ?NTicks = NTicks , + ?Tick0 = Tick0 , + ?DTick = DTick , + ?TickVals = TickVals , + ?TickText = TickText , + ?Ticks = Ticks , + ?TickLen = TickLen , + ?TickWidth = TickWidth , + ?TickColor = TickColor , + ?ShowTickLabels = ShowTickLabels , + ?ShowTickPrefix = ShowTickPrefix , + ?TickPrefix = TickPrefix , + ?ShowTickSuffix = ShowTickSuffix , + ?TickSuffix = TickSuffix , + ?ShowExponent = ShowExponent , + ?ExponentFormat = ExponentFormat , + ?MinExponent = MinExponent , + ?SeparateThousands = SeparateThousands , + ?TickFont = TickFont , + ?TickAngle = TickAngle , + ?TickFormat = TickFormat , + ?TickFormatStops = TickFormatStops , + ?Layer = Layer , + ?Calendar = Calendar + ) + + /// + /// Creates a function that applies the given style parameters to a RadialAxis object + /// + /// A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false + /// Sets the angular axis type. If "linear", set `thetaunit` to determine the unit in which axis value are shown. If "category, use `period` to set the number of integer coordinates around polar axis. + /// 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. Defaults to layout.autotypenumbers. + /// Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to "false". + /// If "tozero"`, the range extends to 0, regardless of the input data If "nonnegative", the range is non-negative, regardless of the input data. If "normal", the range is computed in relation to the extrema of the input data (same behavior as for cartesian axes). + /// Sets the range of this axis. If the axis `type` is "log", then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is "date", it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is "category", it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. + /// Specifies the ordering logic for the case of categorical variables. By default, plotly uses "trace", which specifies the order that is present in the data supplied. Set `categoryorder` to "category ascending" or "category descending" if order should be determined by the alphanumerical order of the category names. Set `categoryorder` to "array" to derive the ordering from the attribute `categoryarray`. If a category is not found in the `categoryarray` array, the sorting behavior for that attribute will be identical to the "trace" mode. The unspecified categories will follow the categories in `categoryarray`. Set `categoryorder` to "total ascending" or "total descending" if order should be determined by the numerical order of the values. Similarly, the order can be determined by the min, max, sum, mean or median of all the values. + /// Sets the order in which categories on this axis appear. Only has an effect if `categoryorder` is set to "array". Used with `categoryorder`. + /// Sets the angle (in degrees) from which the radial axis is drawn. Note that by default, radial axis line on the theta=0 line corresponds to a line pointing right (like what mathematicians prefer). Defaults to the first `polar.sector` angle. + /// Determines on which side of radial axis line the tick and tick labels appear. + /// Sets the title of the Radial Axis. + /// Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Controls persistence of user-driven changes in axis `rotation`. Defaults to `polar<N>.uirevision`. + /// Sets default for all colors associated with this axis all at once: line, font, tick, and grid colors. Grid color is lightened by blending this with the plot background Individual pieces can override this. + /// Determines whether or not a line bounding this axis is drawn. + /// Sets the axis line color. + /// Sets the width (in px) of the axis line. + /// Determines whether or not grid lines are drawn. If "true", the grid lines are drawn at every tick mark. + /// Sets the color of the grid lines. + /// Sets the width (in px) of the grid lines. + /// 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). + /// 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". + /// 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<f>" (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. + /// 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<f>", 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<n>" 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" + /// Sets the values at which ticks on this axis appear. Only has an effect if `tickmode` is set to "array". Used with `TickText`. + /// Sets the text displayed at the ticks position via `TickVals`. Only has an effect if `tickmode` is set to "array". Used with `TickVals`. + /// 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. + /// Sets the tick length (in px). + /// Sets the tick width (in px). + /// Sets the tick color. + /// Determines whether or not the tick labels are drawn. + /// 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. + /// Sets a tick label prefix. + /// Same as `showtickprefix` but for tick suffixes. + /// Sets a tick label suffix. + /// 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. + /// 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. + /// Hide SI prefix for 10^n if |n| is below this number. This only has an effect when `TickFormat` is "SI" or "B". + /// If "true", even 4-digit integers are separated + /// Sets the tick font. + /// Sets the angle of the tick labels with respect to the horizontal. For example, a `tickangle` of -90 draws the tick labels vertically. + /// 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-3.x-api-reference/blob/master/Formatting.md#d3_format. And for dates see: https://github.com/d3/d3-time-format#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" + /// Set rules for customizing TickFormat on different zoom levels + /// Sets the layer on which this axis is displayed. If "above traces", this axis is displayed above all the subplot's traces If "below traces", this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to "false" to show markers and/or text nodes above this axis. + /// Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar` + static member style + ( + ?Visible : bool, + ?AxisType : StyleParam.AxisType, + ?AutoTypeNumbers : StyleParam.AutoTypeNumbers, + ?AutoRange : StyleParam.AutoRange, + ?RangeMode : StyleParam.RangeMode, + ?Range : StyleParam.Range, + ?CategoryOrder : StyleParam.CategoryOrder, + ?CategoryArray : seq<#IConvertible>, + ?Angle : float, + ?Side : StyleParam.Direction, + ?Title : Title, + ?HoverFormat : string, + ?UIRevision : #IConvertible, + ?Color : string, + ?ShowLine : bool, + ?LineColor : string, + ?LineWidth : int, + ?ShowGrid : bool, + ?GridColor : string, + ?GridWidth : int, + ?TickMode : StyleParam.TickMode, + ?NTicks : int, + ?Tick0 : #IConvertible, + ?DTick : #IConvertible, + ?TickVals : seq<#IConvertible>, + ?TickText : seq<#IConvertible>, + ?Ticks : StyleParam.TickOptions, + ?TickLen : int, + ?TickWidth : int, + ?TickColor : string, + ?ShowTickLabels : bool, + ?ShowTickPrefix : StyleParam.ShowTickOption, + ?TickPrefix : string, + ?ShowTickSuffix : StyleParam.ShowTickOption, + ?TickSuffix : string, + ?ShowExponent : StyleParam.ShowExponent, + ?ExponentFormat : StyleParam.ExponentFormat, + ?MinExponent : float, + ?SeparateThousands : bool, + ?TickFont : Font, + ?TickAngle : int, + ?TickFormat : string, + ?TickFormatStops : seq, + ?Layer : StyleParam.Layer, + ?Calendar : StyleParam.Calendar + ) = + fun (radialAxis:RadialAxis) -> + + Visible |> DynObj.setValueOpt radialAxis "visible" + AxisType |> DynObj.setValueOptBy radialAxis "type" StyleParam.AxisType.convert + AutoTypeNumbers |> DynObj.setValueOptBy radialAxis "autotypenumbers" StyleParam.AutoTypeNumbers.convert + AutoRange |> DynObj.setValueOptBy radialAxis "autorange" StyleParam.AutoRange.convert + RangeMode |> DynObj.setValueOptBy radialAxis "rangemode" StyleParam.RangeMode.convert + Range |> DynObj.setValueOptBy radialAxis "range" StyleParam.Range.convert + CategoryOrder |> DynObj.setValueOptBy radialAxis "categoryorder" StyleParam.CategoryOrder.convert + CategoryArray |> DynObj.setValueOpt radialAxis "categoryarray" + Angle |> DynObj.setValueOpt radialAxis "angle" + Side |> DynObj.setValueOptBy radialAxis "side" StyleParam.Direction.convert + Title |> DynObj.setValueOpt radialAxis "title" + HoverFormat |> DynObj.setValueOpt radialAxis "hoverformat" + UIRevision |> DynObj.setValueOpt radialAxis "uirevision" + Color |> DynObj.setValueOpt radialAxis "color" + ShowLine |> DynObj.setValueOpt radialAxis "showline" + LineColor |> DynObj.setValueOpt radialAxis "linecolor" + LineWidth |> DynObj.setValueOpt radialAxis "linewidth" + ShowGrid |> DynObj.setValueOpt radialAxis "showgrid" + GridColor |> DynObj.setValueOpt radialAxis "gridcolor" + GridWidth |> DynObj.setValueOpt radialAxis "gridwidth" + TickMode |> DynObj.setValueOptBy radialAxis "tickmode" StyleParam.TickMode.convert + NTicks |> DynObj.setValueOpt radialAxis "nticks" + Tick0 |> DynObj.setValueOpt radialAxis "tick0" + DTick |> DynObj.setValueOpt radialAxis "dtick" + TickVals |> DynObj.setValueOpt radialAxis "TickVals" + TickText |> DynObj.setValueOpt radialAxis "TickText" + Ticks |> DynObj.setValueOptBy radialAxis "ticks" StyleParam.TickOptions.convert + TickLen |> DynObj.setValueOpt radialAxis "ticklen" + TickWidth |> DynObj.setValueOpt radialAxis "tickwidth" + TickColor |> DynObj.setValueOpt radialAxis "tickcolor" + ShowTickLabels |> DynObj.setValueOpt radialAxis "showticklabels" + ShowTickPrefix |> DynObj.setValueOptBy radialAxis "showtickprefix" StyleParam.ShowTickOption.convert + TickPrefix |> DynObj.setValueOpt radialAxis "tickprefix" + ShowTickSuffix |> DynObj.setValueOptBy radialAxis "showticksuffix" StyleParam.ShowTickOption.convert + TickSuffix |> DynObj.setValueOpt radialAxis "ticksuffix" + ShowExponent |> DynObj.setValueOptBy radialAxis "showexponent" StyleParam.ShowExponent.convert + ExponentFormat |> DynObj.setValueOptBy radialAxis "exponentformat" StyleParam.ExponentFormat.convert + MinExponent |> DynObj.setValueOpt radialAxis "minexponent" + SeparateThousands |> DynObj.setValueOpt radialAxis "separatethousands" + TickFont |> DynObj.setValueOpt radialAxis "tickfont" + TickAngle |> DynObj.setValueOpt radialAxis "tickangle" + TickFormat |> DynObj.setValueOpt radialAxis "TickFormat" + TickFormatStops |> DynObj.setValueOpt radialAxis "tickformatstops" + Layer |> DynObj.setValueOptBy radialAxis "layer" StyleParam.Layer.convert + Calendar |> DynObj.setValueOptBy radialAxis "calendar" StyleParam.Calendar.convert + + radialAxis diff --git a/src/Plotly.NET/Playground.fsx b/src/Plotly.NET/Playground.fsx index 23dcf4653..cd8eedd9c 100644 --- a/src/Plotly.NET/Playground.fsx +++ b/src/Plotly.NET/Playground.fsx @@ -4,8 +4,63 @@ #r "nuget: DynamicObj" #r "nuget: Newtonsoft.Json, 13.0.1" +#I "CommonAbstractions" + #load "StyleParams.fs" #load "Colors.fs" +#load "Frame.fs" +#load "Font.fs" +#load "Title.fs" +#load "Line.fs" + +#I "Layout/ObjectAbstractions/Common" + +#load "Button.fs" +#load "RangeSelector.fs" +#load "RangeSlider.fs" +#load "Transition.fs" +#load "ActiveShape.fs" +#load "ModeBar.fs" +#load "DefaultColorScales.fs" +#load "UniformText.fs" +#load "Margin.fs" +#load "Domain.fs" +#load "Shape.fs" +#load "Annotation.fs" +#load "LayoutGrid.fs" +#load "Legend.fs" +#load "Hoverlabel.fs" +#load "TickFormatStop.fs" +#load "ColorBar.fs" +#load "Rangebreak.fs" +#load "LinearAxis.fs" +#load "ColorAxis.fs" + +#I "Layout/ObjectAbstractions/Map" + +#load "GeoProjection.fs" +#load "Geo.fs" +#load "MapboxLayerSymbol.fs" +#load "MapboxLayer.fs" +#load "Mapbox.fs" + +#I "Layout/ObjectAbstractions/3D" + +#load "Camera.fs" +#load "AspectRatio.fs" +#load "Scene.fs" + +#I "Layout/ObjectAbstractions/Polar" + +#load "AngularAxis.fs" +#load "RadialAxis.fs" +#load "Polar.fs" + +#load "Layout/Layout.fs" + +#I "Traces/ObjectAbstractions" + +#load "Marker.fs" #load "Projection.fs" #load "Surface.fs" #load "SpaceFrame.fs" @@ -13,61 +68,67 @@ #load "Caps.fs" #load "StreamTubeStarts.fs" #load "Lighting.fs" -#load "Rangebreak.fs" -#load "TickFormatStop.fs" #load "Selection.fs" -#load "Frame.fs" #load "StockData.fs" -#load "Font.fs" -#load "Title.fs" #load "Pathbar.fs" #load "TreemapTiling.fs" -#load "ColorBar.fs" -#load "RangeSlider.fs" -#load "Button.fs" -#load "RangeSelector.fs" -#load "Legend.fs" #load "Contours.fs" #load "Dimensions.fs" -#load "Domain.fs" -#load "Line.fs" #load "WaterfallConnector.fs" #load "FunnelConnector.fs" #load "Box.fs" #load "Meanline.fs" -#load "Marker.fs" -#load "Hoverlabel.fs" -#load "Axis.fs" -#load "Polar.fs" #load "Bins.fs" #load "Cumulative.fs" -#load "Annotation.fs" -#load "Scene.fs" -#load "Shape.fs" #load "Error.fs" #load "Table.fs" + +#I "Traces" + #load "Trace.fs" -#load "Trace3d.fs" -#load "GeoProjection.fs" -#load "Geo.fs" -#load "MapboxLayerSymbol.fs" -#load "MapboxLayer.fs" -#load "Mapbox.fs" -#load "LayoutGrid.fs" -#load "Layout.fs" +#load "Trace2D.fs" +#load "Trace3D.fs" +#load "TracePolar.fs" +#load "TraceMap.fs" +#load "TraceTernary.fs" +#load "TraceCarpet.fs" +#load "TraceDomain.fs" + +#I "Template" + #load "Template.fs" + +#I "Config" + #load "Config.fs" + +#I "DisplayOptions" + #load "DisplayOptions.fs" + +#I "ChartAPI" + #load "GenericChart.fs" #load "Chart.fs" -#load "ChartExtensions.fs" +#load "Chart2D.fs" +#load "Chart3D.fs" +#load "ChartPolar.fs" +#load "ChartMap.fs" +#load "ChartDomain.fs" + +#I "CSharpLayer" + #load "GenericChartExtensions.fs" -#load "CandelstickExtension.fs" + +#I "Extensions" + #load "SankeyExtension.fs" open DynamicObj open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open GenericChart open FSharp.Data @@ -79,951 +140,3 @@ open FSharpAux open System -let scene1 = - Scene.init( - Domain = Domain.init( - Row = 0, - Column = 1 - ) - ) - -let scene2 = - Scene.init( - Domain = Domain.init( - Row = 0, - Column = 3 - ) - ) - -let p1 = - Chart.Point3d( - [1,2,3; 4,5,6; 7,8,9], - Labels = ["A"; "B"; "C"], - TextPosition = StyleParam.TextPosition.BottomCenter - ) - |> GenericChart.mapTrace( - Trace3d.Trace3dStyle.Scatter3d( - Scene = StyleParam.SubPlotId.Scene 1 - ) - ) - -let p2 = - Chart.Point3d( - [1,2,3; 4,5,6; 7,8,9], - Labels = ["A2"; "B2"; "C2"], - TextPosition = StyleParam.TextPosition.BottomCenter - ) - |> GenericChart.mapTrace( - Trace3d.Trace3dStyle.Scatter3d( - Scene = StyleParam.SubPlotId.Scene 2 - ) -) - -let c1 = Chart.Line([1,2; 3,4]) -let c2 = Chart.Line([1,2; 3,4]) - -[c1;p1;c2;p2] -|> Chart.Grid(1,4,Pattern=StyleParam.LayoutGridPattern.Coupled) -|> Chart.withScene(scene1, StyleParam.SubPlotId.Scene 1) -|> Chart.withScene(scene2, StyleParam.SubPlotId.Scene 2) -|> Chart.withSize(1000.,500.) -|> Chart.show - -Chart.Line3d( - [1,3,2; 6,5,4; 7,9,8], - Labels = ["A"; "B"; "C"], - TextPosition = StyleParam.TextPosition.BottomCenter, - ShowMarkers = true -) -|> Chart.show - -Chart.Bubble3d( - [1,3,2; 6,5,4; 7,9,8], - [20; 40; 30], - Labels = ["A"; "B"; "C"], - TextPosition = StyleParam.TextPosition.TopLeft -) -|> Chart.show - - -let linspace (min,max,n) = - if n <= 2 then failwithf "n needs to be larger then 2" - let bw = float (max - min) / (float n - 1.) - Array.init n (fun i -> min + (bw * float i)) - -let mgrid (min,max,n) = - - let data = linspace(min,max,n) - - let z = [|for i in 1 .. n do [|for i in 1 .. n do yield data|]|] - let x = [|for i in 1 .. n do [|for j in 1 .. n do yield [|for k in 1 .. n do yield data.[i-1]|]|]|] - let y = [|for i in 1 .. n do [|for j in 1 .. n do yield [|for k in 1 .. n do yield data.[j-1]|]|]|] - - x,y,z - - -let xIso,yIso,zIso = - mgrid(-5.,5.,40) - |> fun (x,y,z) -> - (x |> Array.concat |> Array.concat), - (y |> Array.concat |> Array.concat), - (z |> Array.concat |> Array.concat) - -let valueIso = - Array.map3 (fun x y z -> - x * x * 0.5 + y * y + z * z * 2. - ) xIso yIso zIso - -let contains3d ch= - ch - |> existsTrace (fun t -> - match t with - | :? Trace3d -> true - | _ -> false) - -let iso = - Chart.IsoSurface( - xIso,yIso,zIso,valueIso, - IsoMin = 10., - IsoMax = 40., - Caps = Caps.init( - X = (CapFill.init(Show=false)), - Y = (CapFill.init(Show=false)) - ), - Surface = Surface.init(Count=5), - ColorScale = StyleParam.Colorscale.Viridis - ) - |> GenericChart.mapTrace(fun t -> - t - |> Trace3d.Trace3dStyle.Cone(Name="soos") - ) - -contains3d iso - -iso |> Chart.show - -let x,y,z = - mgrid(-8.,8.,40) - |> fun (x,y,z) -> - (x |> Array.concat |> Array.concat), - (y |> Array.concat |> Array.concat), - (z |> Array.concat |> Array.concat) - -let values = - Array.map3 (fun x y z -> - sin(x*y*z) / (x*y*z) - ) x y z - - -Chart.Volume( - x, y, z, values, - Opacity=0.1, - Surface=(Surface.init(Count=17)), - IsoMin=0.1, - IsoMax=0.8, - ColorScale = StyleParam.Colorscale.Viridis - -) -|> Chart.show - -let tubeData = - Http.RequestString @"https://raw.githubusercontent.com/plotly/datasets/master/streamtube-wind.csv" - |> Frame.ReadCsvString - -tubeData.Print() - -Chart.StreamTube( - x = (tubeData.["x"] |> Series.values), - y = (tubeData.["y"] |> Series.values), - z = (tubeData.["z"] |> Series.values), - u = (tubeData.["u"] |> Series.values), - v = (tubeData.["v"] |> Series.values), - w = (tubeData.["w"] |> Series.values), - Starts = - StreamTubeStarts.init( - X = Array.init 16 (fun _ -> 80), - Y = [20;30;40;50;20;30;40;50;20;30;40;50;20;30;40;50], - Z = [0;0;0;0;5;5;5;5;10;10;10;10;15;15;15;15] - ), - ColorScale = StyleParam.Colorscale.Viridis -) -|> Chart.show - -Chart.Cone( - x = [1; 1; 1], - y = [1; 2; 3], - z = [1; 1; 1], - u = [1; 2; 3], - v = [1; 1; 2], - w = [4; 4; 1] -) -|> Chart.show - -Chart.Point([1,2]) -|> Chart.withXAxisStyle ("X axis title quack quack", MinMax = (-1.,10.)) -|> Chart.withYAxisStyle ("Y axis title boo foo", MinMax = (-1.,10.)) -|> Chart.show - -let r = [ 1; 2; 3; 4; 5; 6; 7;] |> List.map ((*) 10000) -let r2 = [ 5; 6; 7; 1; 2; 3; 4;] |> List.map ((*) 10000) -let r3 = [ 3; 1; 5; 2; 8; 7; 5;] |> List.map ((*) 10000) - -let t = [0; 45; 90; 135; 200; 320; 184;] - -(** -A polar chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart -of three or more quantitative variables represented on axes starting from the same point. -The relative position and angle of the axes is typically uninformative. -*) - -// webGL Comparison - -let largeRTSizes = [for i in 0. .. 0.01 .. 360. do yield i,i, 0.1 * i ] - -let noGL = Chart.BubblePolar(largeRTSizes) |> Chart.show -let yesGL = Chart.BubblePolar(largeRTSizes,UseWebGL=true) |> Chart.show // it is so much faster, damn - -let polar1 = - [ - Chart.PointPolar(r,t,Name="PointPolar") - Chart.LinePolar(r2,t,Name="LinePolar", ShowMarkers = true) - Chart.SplinePolar(r3,t,Name="SplinePolar", ShowMarkers = true) - ] - |> Chart.combine - |> Chart.withPolar( - Polar.init( - Sector= (0., 270.), - Hole=0.1 - ) - ) - |> Chart.withAngularAxis( - Axis.AngularAxis.init( - Color="darkblue" - ) - ) - |> Chart.withRadialAxis( - Axis.RadialAxis.init( - Title = Title.init("Hi, i am the radial axis"), - Color="darkblue", - SeparateThousands = true - ) - ) - |> Chart.show - -[ - [ - Chart.Point([1,2],Name="1,1") - |> Chart.withXAxisStyle "x1" - |> Chart.withYAxisStyle "y1" - Chart.Point([1,2],Name="1,2") - |> Chart.withXAxisStyle "x2" - |> Chart.withYAxisStyle "y2" - ] - [ - Chart.Point([1,2],Name="2,1") - |> Chart.withXAxisStyle "x3" - |> Chart.withYAxisStyle "y3" - ] - [ - Chart.Point([1,2],Name="3,1") - |> Chart.withXAxisStyle "x4" - |> Chart.withYAxisStyle "y4" - Chart.Point([1,2],Name="3,2") - |> Chart.withXAxisStyle "x5" - |> Chart.withYAxisStyle "y5" - ] -] -|> Chart.Grid() -|> Chart.show - -[ - Chart.Point([1,2],Name="1,1") - |> Chart.withXAxisStyle "x1" - |> Chart.withYAxisStyle "y1" - Chart.Point([1,2],Name="1,2") - |> Chart.withXAxisStyle "x2" - |> Chart.withYAxisStyle "y2" - Chart.Point([1,2],Name="2,2") - |> Chart.withXAxisStyle "x3" - |> Chart.withYAxisStyle "y3" - Chart.Point([1,2],Name="3,2") - |> Chart.withXAxisStyle "x4" - |> Chart.withYAxisStyle "y4" - Chart.Point([1,2],Name="1,1") - |> Chart.withXAxisStyle "x5" - |> Chart.withYAxisStyle "y5" - Chart.Point([1,2],Name="1,2") - |> Chart.withXAxisStyle "x6" - |> Chart.withYAxisStyle "y6" - Chart.Point([1,2],Name="2,2") - |> Chart.withXAxisStyle "x7" - |> Chart.withYAxisStyle "y7" - Chart.Point([1,2],Name="3,2") - |> Chart.withXAxisStyle "x8" - |> Chart.withYAxisStyle "y8" - Chart.Point([1,2],Name="1,1") - |> Chart.withXAxisStyle "x9" - |> Chart.withYAxisStyle "y9" - Chart.Point([1,2],Name="1,2") - |> Chart.withXAxisStyle "x10" - |> Chart.withYAxisStyle "y10" - Chart.Point([1,2],Name="2,2") - |> Chart.withXAxisStyle "x11" - |> Chart.withYAxisStyle "y11" - Chart.Point([1,2],Name="3,2") - |> Chart.withXAxisStyle "x12" - |> Chart.withYAxisStyle "y12" -] -|> Chart.Grid(6,2,Pattern=StyleParam.LayoutGridPattern.Coupled) -|> Chart.withSize (1000., 2000.) -|> Chart.show - - -[ - Chart.Point([(1.,2.)]) - |> GenericChart.mapTrace (fun t -> - t?legendgroup <- "2" - t - ) - Chart.Point([(1.,2.)]) - |> GenericChart.mapTrace (fun t -> - t?legendgroup <- "1" - t - ) - Chart.Point([(1.,2.)]) - |> GenericChart.mapTrace (fun t -> - t?legendgroup <- "1" - t - ) -] -|> Chart.SingleStack(Pattern=StyleParam.LayoutGridPattern.Coupled) -|> Chart.withLegend( - Legend.init( - TraceOrder = StyleParam.TraceOrder.Grouped, - TraceGroupGap = 300. - ) -) -|> Chart.withAnnotations [ - Annotation.init(1,2,Text= "soos1",YRef="y") - Annotation.init(1,2,Text= "soos2",YRef="y2") -] -|> Chart.show - - -let dataDensityMapbox = - Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/earthquakes-23k.csv" - |> fun d -> Frame.ReadCsvString(d,true,separators=",") - -dataDensityMapbox.Print() - -let lonDensity = dataDensityMapbox.["Longitude"] |> Series.values -let latDensity = dataDensityMapbox.["Latitude"] |> Series.values -let magnitudes = dataDensityMapbox.["Magnitude"] |> Series.values - -Chart.DensityMapbox( - lonDensity, - latDensity, - Z = magnitudes, - Radius=8., - Colorscale=StyleParam.Colorscale.Viridis -) -|> Chart.withMapbox( - Mapbox.init( - Style = StyleParam.MapboxStyle.StamenTerrain, - Center = (60.,30.) - ) -) -|> Chart.show - - -let dataMapbox = - let dataString = Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/us-cities-top-1k.csv" - let byteArray = Encoding.UTF8.GetBytes(dataString) - use stream = new MemoryStream(byteArray) - Frame.ReadCsv(stream,true,separators=",",schema="City=string,State=string,Population=int,lat=float,lon=float") - -dataMapbox.Print() - -let lon: float [] = - dataMapbox - |> Frame.getCol "lon" - |> Series.values - |> Array.ofSeq - -let lat: float [] = - dataMapbox - |> Frame.getCol "lat" - |> Series.values - |> Array.ofSeq - -Chart.LineMapbox( - longitudes=lon, - latitudes=lat, - ShowMarkers=true, - Name="soos" -) -|> Chart.withMapbox( - Mapbox.init( - Style = StyleParam.MapboxStyle.OpenStreetMap, - Center = (-97.61142,38.84028) - ) -) -|> Chart.withSize(1000.,1000.) -|> Chart.withTitle "lol?" -|> Chart.show - -Chart.Column( - keysvalues= [ - "second",3 - "first", 6 - "third", 1 - ] -) -|> Chart.withX_Axis( - Axis.LinearAxis.initCategorical( - StyleParam.CategoryOrder.Array, - CategoryArray = ["first"; "second"; "third"] - ) -) -|> Chart.show - -Chart.Range( - x = [1;2], - y = [2;3], - upper=[3;4], - lower=[1;2], - mode=StyleParam.Mode.Lines, - UpperLabels=["upper1";"upper2"], - LowerLabels=["lower1";"lower2"] -) -|> Chart.show - -let geoJson = - Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json" - |> JsonConvert.DeserializeObject - -let data = - let dataString = Http.RequestString "https://raw.githubusercontent.com/plotly/datasets/master/fips-unemp-16.csv" - Frame.ReadCsvString(dataString,true,separators=",",schema="fips=string,unemp=float") - -let locations: string [] = - data - |> Frame.getCol "fips" - |> Series.values - |> Array.ofSeq - -let z: int [] = - data - |> Frame.getCol "unemp" - |> Series.values - |> Array.ofSeq - -Chart.ChoroplethMapbox( - locations = locations, - z = z, - geoJson = geoJson, - FeatureIdKey="id" -) -|> Chart.withMapbox( - Mapbox.init(Style=StyleParam.MapboxStyle.OpenStreetMap) -) -|> Chart.show - -Chart.ChoroplethMap( - locations = locations, - z = z, - Locationmode=StyleParam.LocationFormat.GeoJson_Id, - GeoJson = geoJson, - FeatureIdKey="id" -) -|> Chart.withGeo( - Geo.init( - Scope=StyleParam.GeoScope.Usa - ) -) -|> Chart.show - -Trace.initChoroplethMap(id) -|> fun t -> - t?z <- z - t?locations <- locations - t?geojson <- geoJson - t?featureidkey <- "id" - t?locationmode <- "geojson-id" - t -|> GenericChart.ofTraceObject -|> Chart.withGeo( - Geo.init( - Scope=StyleParam.GeoScope.Usa - ) -) -|> Chart.show - -System.Random().Next(1,40) - -// Funnel examples adapted from Plotly docs: https://plotly.com/javascript/funnel-charts/ -let funnel = - let y = [|"Sales person A"; "Sales person B"; "Sales person C"; "Sales person D"; "Sales person E"|] - let x = [|1200.; 909.4; 600.6; 300.; 80.|] - let line = Line.init(Width=2.,Color="3E4E88") - let connectorLine = Line.init (Color="royalblue", Dash=StyleParam.DrawingStyle.Dot, Width=3.) - let connector = FunnelConnector.init(Line=connectorLine) - Chart.Funnel (x,y,Color="59D4E8", Line=line, Connector=connector) - |> Chart.withMarginSize(Left=100) - |> Chart.show - -let funnelArea = - let values = [|5; 4; 3; 2; 1|] - let text = [|"The 1st"; "The 2nd"; "The 3rd"; "The 4th"; "The 5th"|] - let line = Line.init (Color="purple", Width=3.) - Chart.FunnelArea(Values=values, Text=text, Line=line) - |> Chart.show - -let funnelArea2 = - let labels = [|1;2;2;3;3;3|] - Chart.FunnelArea(Labels=labels) - |> Chart.show - -let yAxis = - Axis.LinearAxis.init( - Title = Title.init(Text="Y"), - ShowLine = true, - Range = StyleParam.Range.MinMax (0.0, 2.0), - TickVals = [0.0 .. 2.0], - TickText = [ "zero"; "one"; "two" ] - ) - -Chart.Range( - [1;2], - [1;1], - [0.0;0.53622183], - [1.0;2.0], - StyleParam.Mode.None, - Name = "", - LowerName = "Lower", - UpperName = "Upper", - Labels = []) -|> Chart.withY_Axis (yAxis) -|> GenericChart.mapiTrace (fun i t -> - match i with - | 0 -> t |> Trace.TraceStyle.TextLabel ["upperOne";"upperTwo"] - | 1 -> t |> Trace.TraceStyle.TextLabel ["lowerOne";"lowerTwo"] - | 2 -> t -) -|> Chart.show - -let testAnnotation = - Annotation.init(X=System.DateTime.Now, Y=0,Text="test") - -Chart.Line([System.DateTime.Now, 5]) -|> Chart.withAnnotations [testAnnotation] -|> Chart.show - - -let descritptionTable =""" - - - - - - - - -
A - B -
AABB
-""" - -Chart.Point([1.,2.]) -|> Chart.withDescription (ChartDescription.create "Some Table" descritptionTable) -|> Chart.show - -[ - Chart.Line([(1.,2.)],@"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$") - Chart.Line([(1.,2.)],@"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$") -] -|> Chart.combine -|> Chart.withTitle @"$\beta_{1c} = 25 \pm 11 \text{ km s}^{-1}$" -|> Chart.withMathTex(true) -|> Chart.show - - -let myTemplate = - ChartTemplates.dark - |> Template.withColorWay ChartTemplates.ColorWays.plotly - -let myLegend = - Legend.init( - Orientation = StyleParam.Orientation.Horizontal - ) - -//F# functional pipeline to compose a chart with functions -// -[ - [(1,5);(2,10)] - [(2,4);(3,9)] - [(3,3);(4,8)] - [(4,2);(5,7)] - [(5,1);(6,6)] - [(6,-1);(7,5)] - [(7,-2);(8,4)] - [(8,-3);(9,3)] - [(9,-4);(10,2)] - [(10,-5);(11,1)] - -] -|> List.map Chart.Line -|> Chart.combine -|> Chart.withLegend(myLegend) -|> Chart.show - - -// Dynamic object style, which is more or less equivalent to how you would create figure objects in plotly.js. -// Member names set via the `?` operator must be named exactly tzhe same as the javascript equivalent -// It is more verbose, but has the advantage of being able to generate any type of Chart. Usefull if there are no abstractions provided for a certain property -let xAxis = - let tmp = Axis.LinearAxis() - tmp?title <- "xAxis" - tmp?showgrid <- false - tmp?showline <- true - tmp - -let yAxis2 = - let tmp = Axis.LinearAxis() - tmp?title <- "yAxis" - tmp?showgrid <- false - tmp?showline <- true - tmp - -let layout = - let tmp = Layout() - tmp?xaxis <- xAxis - tmp?yaxis <- yAxis2 - tmp?showlegend <- true - tmp - -let trace = - let tmp = Trace("scatter") - tmp?x <- [1;2] - tmp?y <- [5;10] - tmp?mode <- "markers" - tmp?name <- "Hello from F#" - tmp - -trace -|> GenericChart.ofTraceObject -|> GenericChart.setLayout layout -|> Chart.show - - -Chart.LineGeo( - [ - -73.57; -79.24; -123.06; -114.1; -113.28; - -75.43; -63.57; -123.21; -97.13; -104.6 - ], - [ - 45.5; 43.4; 49.13; 51.1; 53.34; 45.24; - 44.64; 48.25; 49.89; 50.45 - ],ShowMarkers = true,MarkerSymbol = StyleParam.Symbol.Cross -) -|> Chart.show - -Chart.ScatterGeo( - [ - -73.57; -79.24; -123.06; -114.1; -113.28; - -75.43; -63.57; -123.21; -97.13; -104.6 - ], - [ - 45.5; 43.4; 49.13; 51.1; 53.34; 45.24; - 44.64; 48.25; 49.89; 50.45 - ], - StyleParam.Mode.Lines -) -|> Chart.withGeoStyle( - Projection=GeoProjection.init(projectionType=StyleParam.GeoProjectionType.AzimuthalEqualArea), - ShowLakes=true, - ShowOcean=true, - OceanColor="lightblue", - ShowRivers=true) -|> Chart.show -//test new withGeoStyle function - -let locations2,z2 = - [("Belarus",17.5); ("Moldova",16.8);("Lithuania",15.4);("Russia",15.1); - ("Romania",14.4);("Ukraine",13.9);("Andorra",13.8);("Hungary",13.3); - ("Czech Republic",13.);("Slovakia",13.);("Portugal",12.9);("Serbia",12.6); - ("Grenada",12.5);("Poland",12.5);("Latvia",12.3);("Finland",12.3); - ("South Korea",12.3);("France",12.2);("Australia",12.2);("Croatia",12.2); - ("Ireland",11.9);("Luxembourg",11.9);("Germany",11.8);("Slovenia",11.6); - ("United Kingdom",11.6);("Denmark",11.4);("Bulgaria",11.4);("Spain",11.2); - ("Belgium",11.);("South Africa",11.);("New Zealand",10.9);("Gabon",10.9); - ("Namibia",10.8);("Switzerland",10.7);("Saint Lucia",10.4);("Austria",10.3); - ("Estonia",10.3);("Greece",10.3);("Kazakhstan",10.3);("Canada",10.2); - ("Nigeria",10.1);("Netherlands",9.9);("Uganda",9.8);("Rwanda",9.8); - ("Chile",9.6);("Argentina",9.3);("Burundi",9.3);("United States",9.2); - ("Cyprus",9.2);("Sweden",9.2);("Venezuela",8.9);("Paraguay",8.8);("Brazil",8.7); - ("Sierra Leone",8.7);("Montenegro",8.7);("Belize",8.5);("Cameroon",8.4); - ("Botswana",8.4);("Saint Kitts and Nevis",8.2);("Guyana",8.1);("Peru",8.1); - ("Panama",8.);("Niue",8.);("Palau",7.9);("Norway",7.7);("Tanzania",7.7); - ("Georgia",7.7);("Uruguay",7.6);("Angola",7.5);("Laos",7.3);("Japan",7.2); - ("Mexico",7.2);("Ecuador",7.2);("Dominica",7.1);("Iceland",7.1); - ("Thailand",7.1);("Bosnia and Herzegovina",7.1);("Sao Tome and Principe",7.1); - ("Malta",7.);("Albania",7.);("Bahamas",6.9);("Dominican Republic",6.9); - ("Mongolia",6.9);("Cape Verde",6.9);("Barbados",6.8);("Burkina Faso",6.8); - ("Italy",6.7);("Trinidad and Tobago",6.7);("China",6.7);("Macedonia",6.7); - ("Saint Vincent and the Grenadines",6.6);("Equatorial Guinea",6.6); - ("Suriname",6.6);("Vietnam",6.6);("Lesotho",6.5);("Haiti",6.4); - ("Cook Islands",6.4);("Colombia",6.2);("Ivory Coast",6.);("Bolivia",5.9); - ("Swaziland",5.7);("Zimbabwe",5.7);("Seychelles",5.6);("Cambodia",5.5); - ("Puerto Rico",5.4);("Netherlands Antilles",5.4);("Philippines",5.4); - ("Costa Rica",5.4);("Armenia",5.3);("Cuba",5.2);("Nicaragua",5.); - ("Jamaica",4.9);("Ghana",4.8);("Liberia",4.7);("Uzbekistan",4.6); - ("Chad",4.4);("United Arab Emirates",4.3);("Kyrgyzstan",4.3);("India",4.3); - ("Turkmenistan",4.3);("Kenya",4.3);("Ethiopia",4.2);("Honduras",4.); - ("Guinea-Bissau",4.);("Zambia",4.);("Republic of the Congo",3.9);("Guatemala",3.8); - ("Central African Republic",3.8);("North Korea",3.7);("Sri Lanka",3.7); - ("Mauritius",3.6);("Samoa",3.6);("Democratic Republic of the Congo",3.6); - ("Nauru",3.5);("Gambia",3.4);("Federated States of Micronesia",3.3); - ("El Salvador",3.2);("Fiji",3.);("Papua New Guinea",3.);("Kiribati",3.); - ("Tajikistan",2.8);("Israel",2.8);("Sudan",2.7);("Malawi",2.5);("Lebanon",2.4); - ("Azerbaijan",2.3);("Mozambique",2.3);("Togo",2.3);("Nepal",2.2);("Brunei",2.1); - ("Benin",2.1);("Singapore",2.);("Turkey",2.);("Madagascar",1.8);("Solomon Islands",1.7); - ("Tonga",1.6);("Tunisia",1.5);("Tuvalu",1.5);("Qatar",1.5);("Vanuatu",1.4); - ("Djibouti",1.3);("Malaysia",1.3);("Syria",1.2);("Maldives",1.2);("Mali",1.1); - ("Eritrea",1.1);("Algeria",1.);("Iran",1.);("Oman",0.9);("Brunei",0.9); - ("Morocco",0.9);("Jordan",0.7);("Bhutan",0.7);("Guinea",0.7);("Burma",0.7); - ("Afghanistan",0.7);("Senegal",0.6);("Indonesia",0.6);("Timor-Leste",0.6); - ("Iraq",0.5);("Somalia",0.5);("Egypt",0.4);("Niger",0.3);("Yemen",0.3); - ("Comoros",0.2);("Saudi Arabia",0.2);("Bangladesh",0.2);("Kuwait",0.1); - ("Libya",0.1);("Mauritania",0.1);("Pakistan",0.1);] - |> List.unzip - - -// Pure alcohol consumption among adults (age 15+) in 2010 -Chart.ChoroplethMap(locations2,z2,Locationmode=StyleParam.LocationFormat.CountryNames,Colorscale=StyleParam.Colorscale.Electric) -|> Chart.withGeoStyle( - Projection=GeoProjection.init(projectionType=StyleParam.GeoProjectionType.Mollweide), - ShowLakes=true, - ShowOcean=true, - OceanColor="lightblue", - ShowRivers=true) -|> Chart.withColorBarStyle (Title.init("Alcohol consumption[l/y]"),Length=0.5) -|> Chart.withSize(1000.,1000.) -|> Chart.show - -let waterfallData = [ - "Sales" , 60 , StyleParam.WaterfallMeasure.Relative - "Consulting" , 80 , StyleParam.WaterfallMeasure.Relative - "Net revenue" , 0 , StyleParam.WaterfallMeasure.Total - "Purchases" , -60 , StyleParam.WaterfallMeasure.Relative - "Other expenses" , -20 , StyleParam.WaterfallMeasure.Relative - "Profit before tax" , 0 , StyleParam.WaterfallMeasure.Total -] - -Chart.Waterfall(waterfallData) -|> Chart.show - - -let manyPoints = - let rnd = new System.Random() - [for i = 0 to 50000 do (rnd.NextDouble(),rnd.NextDouble()) ] - -let manyBubbles = - let rnd = new System.Random() - [for i = 0 to 50000 do (rnd.NextDouble(),rnd.NextDouble(),rnd.NextDouble()) ] -//we can see here that the advantage of webgl fades with many small scattergl traces. -let manyLines = - let rnd = new System.Random() - [for i = 0 to 5000 do - [for i in [0 .. 10 .. 100] do (rnd.NextDouble(),rnd.NextDouble())] - ] - - -//Test Stackgroups - -[ - Chart.Scatter(x = [1;2;3], y = [2;3;4],mode=StyleParam.Mode.Markers, StackGroup = "meem", Orientation= StyleParam.Orientation.Vertical, GroupNorm = StyleParam.GroupNorm.Percent ) - Chart.Scatter(x = [1;2;3], y = [4;3;4],mode=StyleParam.Mode.Markers, StackGroup = "meem", Orientation= StyleParam.Orientation.Vertical, GroupNorm = StyleParam.GroupNorm.Percent ) -] -|> Chart.combine -|> Chart.show - -//Just try this, its amazing how much faster WebGL loads and zooms -Chart.Point(manyPoints,UseWebGL=true) -|> Chart.show - -Chart.Point(manyPoints) -|> Chart.show - -manyLines -|> List.map (fun l -> Chart.Line(l,UseWebGL=true)) -|> Chart.combine -|> Chart.show - -Chart.Line(manyPoints,UseWebGL=true) -|> Chart.show - -Chart.Line(manyPoints,UseWebGL=false) -|> Chart.show - -Chart.Spline(manyPoints,UseWebGL=true) -|> Chart.show - -Chart.Spline(manyPoints,UseWebGL=false) -|> Chart.show - -Chart.Bubble(manyBubbles,UseWebGL=true) -|> Chart.show - -Chart.Bubble(manyBubbles,UseWebGL=false) -|> Chart.show - -let stockData = - [|("2020-01-17T13:40:00", 0.68888, 0.68888, 0.68879, 0.6888); - ("2020-01-17T13:41:00", 0.68883, 0.68884, 0.68875, 0.68877); - ("2020-01-17T13:42:00", 0.68878, 0.68889, 0.68878, 0.68886); - ("2020-01-17T13:43:00", 0.68886, 0.68886, 0.68876, 0.68879); - ("2020-01-17T13:44:00", 0.68879, 0.68879, 0.68873, 0.68874); - ("2020-01-17T13:45:00", 0.68875, 0.68877, 0.68867, 0.68868); - ("2020-01-17T13:46:00", 0.68869, 0.68887, 0.68869, 0.68883); - ("2020-01-17T13:47:00", 0.68883, 0.68899, 0.68883, 0.68899); - ("2020-01-17T13:48:00", 0.68898, 0.689, 0.68885, 0.68889); - ("2020-01-17T13:49:00", 0.68889, 0.68893, 0.68881, 0.68893); - ("2020-01-17T13:50:00", 0.68891, 0.68896, 0.68886, 0.68891); - |] - |> Array.map (fun (d,o,h,l,c)->System.DateTime.Parse d, StockData.Create(o,h,l,c)) - -Chart.Candlestick stockData -|> Chart.show - -Chart.OHLC stockData -|> Chart.show - -Chart.Treemap( - ["Eve"; "Cain"; "Seth"; "Enos"; "Noam"; "Abel"; "Awan"; "Enoch"; "Azura"], - [""; "Eve"; "Eve"; "Seth"; "Seth"; "Eve"; "Eve"; "Awan"; "Eve" ], - Values = [10.; 14.; 12.; 10.; 2.; 6.; 6.; 4.; 4.] -) -|> Chart.withTitle "Treemap test" -|> Chart.show - - -//Sunbursst example from plotly docs: https://plotly.com/javascript/sunburst-charts -Chart.Sunburst( - ["Eve"; "Cain"; "Seth"; "Enos"; "Noam"; "Abel"; "Awan"; "Enoch"; "Azura"], - [""; "Eve"; "Eve"; "Seth"; "Seth"; "Eve"; "Eve"; "Awan"; "Eve" ], - Values = [10.; 14.; 12.; 10.; 2.; 6.; 6.; 4.; 4.] -) -|> Chart.withTitle "Sunburst test" -|> Chart.show - - -let stack ( columns:int, space) = - (fun (charts:#seq) -> - - let col = columns - let len = charts |> Seq.length - let colWidth = 1. / float col - let rowWidth = - let tmp = float len / float col |> ceil - 1. / tmp - let space = - let s = defaultArg space 0.05 - if s < 0. || s > 1. then - printfn "Space should be between 0.0 - 1.0. Automaticaly set to default (0.05)" - 0.05 - else - s - - let contains3d ch = - ch - |> existsTrace (fun t -> - match t with - | :? Trace3d -> true - | _ -> false) - - charts - |> Seq.mapi (fun i ch -> - let colI,rowI,index = (i%col+1), (i/col+1),(i+1) - let xdomain = (colWidth * float (colI-1), (colWidth * float colI) - space ) - let ydomain = (1. - ((rowWidth * float rowI) - space ),1. - (rowWidth * float (rowI-1))) - xdomain) - ) - -let a = - stack (2, None) [Chart.Point([0,1]);Chart.Point([0,1])] - |> Array.ofSeq - -let generateDomainRanges nRows nCols = - - if nCols > 0 && nRows > 0 then - - [0. .. (1. / (float nRows)) .. 1.] - |> List.windowed 2 - |> List.map (fun x -> x.[0], x.[1]) - , - [0. .. (1. / (float nCols)) .. 1.] - |> List.windowed 2 - |> List.map (fun x -> x.[0], x.[1]) - - else failwith "negative amount of rows or columns is stupid." - -generateDomainRanges 8 1 - - - - -[ - Chart.Point([(0,1)]) |> Chart.withYAxisStyle("This title") - Chart.Point([(0,1)]) - |> Chart.withYAxisStyle("Must be set",ZeroLine=false) - Chart.Point([(0,1)]) - |> Chart.withYAxisStyle("on the respective charts",ZeroLine=false) -] -|> Chart.SingleStack() -|> Chart.withLayoutGridStyle(XSide=StyleParam.LayoutGridXSide.Bottom) -|> Chart.withTitle("Hi i am the new SingleStackChart") -|> Chart.withXAxisStyle("im the shared xAxis") -|> Chart.show - -[ - [1;2] - [3;4] -] -|> Chart.Heatmap -|> Chart.withColorBarStyle( - Title.init("Hallo?",Side=StyleParam.Side.Right) -) -|> Chart.show - -// Heatmap example from Plotly docs: https://plotly.net/2_7_heatmaps.html -let matrix = - [[1.;1.5;0.7;2.7]; - [2.;0.5;1.2;1.4]; - [0.1;2.6;2.4;3.0];] - -let rownames = ["p3";"p2";"p1"] -let colnames = ["Tp0";"Tp30";"Tp60";"Tp160"] -let colorscaleValue = StyleParam.Colorscale.Custom [(0.0,"#3D9970");(1.0,"#001f3f")] - - - -let heat1 = - Chart.Heatmap( - matrix,colnames,rownames, - Colorscale=colorscaleValue, - Showscale=true, - UseWebGL=true - ) - |> Chart.withSize(700.,500.) - |> Chart.withMarginSize(Left=200.) - |> Chart.show - -let values,labels = - [ - 1,"v1" - 2,"v2" - ] - |> Seq.unzip - -let cols =[|"black";"blue"|] diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index 34469cead..57568d77c 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -34,66 +34,88 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -102,4 +124,10 @@ + + + + + + diff --git a/src/Plotly.NET/Template.fs b/src/Plotly.NET/Template/Template.fs similarity index 80% rename from src/Plotly.NET/Template.fs rename to src/Plotly.NET/Template/Template.fs index 6e93c3636..a040d4aee 100644 --- a/src/Plotly.NET/Template.fs +++ b/src/Plotly.NET/Template/Template.fs @@ -1,16 +1,17 @@ namespace Plotly.NET +open Plotly.NET.LayoutObjects + open DynamicObj -/// Margin + type Template() = inherit DynamicObj () - /// Init Margin type static member init ( layoutTemplate: Layout , - ?TraceTemplates: Trace [] + ?TraceTemplates: #Trace [] ) = Template() |> Template.style @@ -22,7 +23,7 @@ type Template() = static member style ( layoutTemplate: Layout , - ?TraceTemplates: Trace [] + ?TraceTemplates: #Trace [] ) = (fun (template:Template) -> layoutTemplate |> DynObj.setValue template "layout" @@ -31,16 +32,14 @@ type Template() = template ) - /// Applies the styles to Margin() static member mapLayoutTemplate (styleF: Layout -> Layout) (template:Template) = template.TryGetTypedValue("layout") |> Option.map (styleF) |> DynObj.setValueOpt template "layout" template - /// Applies the styles to Margin() - static member mapTraceTemplates (styleF: Trace [] -> Trace []) (template:Template) = - template.TryGetTypedValue("data") + static member mapTraceTemplates (styleF: #Trace [] -> #Trace []) (template:Template) = + template.TryGetTypedValue<#Trace []>("data") |> Option.map (styleF) |> DynObj.setValueOpt template "data" template @@ -85,15 +84,15 @@ module ChartTemplates = let light = let initLightAxisTemplate() = - Axis.LinearAxis.init( + LinearAxis.init( ShowLine = true, ZeroLine = true ) let defaultLayout = Layout.init ( - Paper_bgcolor = "white", - Plot_bgcolor = "white" + PaperBGColor = "white", + PlotBGColor = "white" ) |> Layout.AddLinearAxis((StyleParam.SubPlotId.XAxis 1),(initLightAxisTemplate())) |> Layout.AddLinearAxis((StyleParam.SubPlotId.YAxis 1),(initLightAxisTemplate())) @@ -102,7 +101,7 @@ module ChartTemplates = let lightMirrored = let initLightAxisTemplate() = - Axis.LinearAxis.init( + LinearAxis.init( ShowLine = true, ZeroLine = true, Mirror = StyleParam.Mirror.All, @@ -112,8 +111,8 @@ module ChartTemplates = let defaultLayout = Layout.init ( - Paper_bgcolor = "white", - Plot_bgcolor = "white" + PaperBGColor = "white", + PlotBGColor = "white" ) |> Layout.AddLinearAxis((StyleParam.SubPlotId.XAxis 1),(initLightAxisTemplate())) |> Layout.AddLinearAxis((StyleParam.SubPlotId.YAxis 1),(initLightAxisTemplate())) @@ -123,7 +122,7 @@ module ChartTemplates = let dark = let initDarkAxisTemplate() = - Axis.LinearAxis.init( + LinearAxis.init( LineColor = "rgb(204, 204, 204)", ZeroLineColor = "rgb(204, 204, 204)", GridColor = "rgba(204, 204, 204, 0.3)", @@ -135,8 +134,8 @@ module ChartTemplates = let darkLayoutTemplate = Layout.init( - Paper_bgcolor = "rgb(55, 55, 61)", - Plot_bgcolor= "rgb(55, 55, 61)", + PaperBGColor = "rgb(55, 55, 61)", + PlotBGColor= "rgb(55, 55, 61)", Font = Font.init(Color = "rgb(204, 204, 204)") ) |> Layout.AddLinearAxis((StyleParam.SubPlotId.XAxis 1),(initDarkAxisTemplate())) @@ -147,12 +146,12 @@ module ChartTemplates = let darkMirrored = dark |> Template.mapLayoutTemplate (fun l -> - l.TryGetTypedValue("xaxis") - |> Option.map (Axis.LinearAxis.style (Mirror=StyleParam.Mirror.AllTicks)) + l.TryGetTypedValue("xaxis") + |> Option.map (LinearAxis.style (Mirror=StyleParam.Mirror.AllTicks)) |> DynObj.setValueOpt l "xaxis" - l.TryGetTypedValue("yaxis") - |> Option.map (Axis.LinearAxis.style (Mirror=StyleParam.Mirror.AllTicks)) + l.TryGetTypedValue("yaxis") + |> Option.map (LinearAxis.style (Mirror=StyleParam.Mirror.AllTicks)) |> DynObj.setValueOpt l "yaxis" l @@ -161,7 +160,7 @@ module ChartTemplates = let fslab = let initFslabAxisTemplate() = - Axis.LinearAxis.init( + LinearAxis.init( LineColor = "white", ZeroLineColor = "rgba(67, 138, 254, 0.5)", GridColor = "rgba(67, 138, 254, 0.5)", @@ -173,8 +172,8 @@ module ChartTemplates = let fslabLayoutTemplate = Layout.init( - Paper_bgcolor = "#200117", - Plot_bgcolor= "#200117", + PaperBGColor = "#200117", + PlotBGColor= "#200117", Font = Font.init(Color = "white") ) |> Layout.AddLinearAxis((StyleParam.SubPlotId.XAxis 1),(initFslabAxisTemplate())) @@ -186,15 +185,15 @@ module ChartTemplates = let transparent = let initTransparentAxisTemplate() = - Axis.LinearAxis.init( + LinearAxis.init( ShowLine = true, ZeroLine = true ) let defaultLayout = Layout.init ( - Paper_bgcolor = "rgba(255, 255, 255, 0)", - Plot_bgcolor = "rgba(255, 255, 255, 0)" + PaperBGColor = "rgba(255, 255, 255, 0)", + PlotBGColor = "rgba(255, 255, 255, 0)" ) |> Layout.AddLinearAxis((StyleParam.SubPlotId.XAxis 1),(initTransparentAxisTemplate())) |> Layout.AddLinearAxis((StyleParam.SubPlotId.YAxis 1),(initTransparentAxisTemplate())) @@ -203,7 +202,7 @@ module ChartTemplates = let transparentMirrored = let initTransparentAxisTemplate() = - Axis.LinearAxis.init( + LinearAxis.init( ShowLine = true, ZeroLine = true, Mirror = StyleParam.Mirror.All, @@ -212,8 +211,8 @@ module ChartTemplates = let defaultLayout = Layout.init ( - Paper_bgcolor = "rgba(255, 255, 255, 0)", - Plot_bgcolor = "rgba(255, 255, 255, 0)" + PaperBGColor = "rgba(255, 255, 255, 0)", + PlotBGColor = "rgba(255, 255, 255, 0)" ) |> Layout.AddLinearAxis((StyleParam.SubPlotId.XAxis 1),(initTransparentAxisTemplate())) |> Layout.AddLinearAxis((StyleParam.SubPlotId.YAxis 1),(initTransparentAxisTemplate())) diff --git a/src/Plotly.NET/Trace.fs b/src/Plotly.NET/Trace.fs deleted file mode 100644 index bbe496325..000000000 --- a/src/Plotly.NET/Trace.fs +++ /dev/null @@ -1,1826 +0,0 @@ -namespace Plotly.NET - -open DynamicObj -open System - -/// Trace type inherits from dynamic object -type Trace (traceTypeName) = - inherit DynamicObj () - //interface ITrace with - // Implictit ITrace - member val ``type`` = traceTypeName with get,set - - - -[] -module Trace = - - - //Trace Types - - //------------------------------------------------------------------------------------------------------------------------------------------------- - //Simple - - ///initializes a trace of type "scatter" applying the given trace styling function - let initScatter (applyStyle:Trace->Trace) = - Trace("scatter") |> applyStyle - - ///initializes a trace of type "scattergl" applying the given trace styling function - let initScatterGL (applyStyle:Trace->Trace) = - Trace("scattergl") |> applyStyle - - ///initializes a trace of type "bar" applying the given trace styling function - let initBar (applyStyle:Trace->Trace) = - Trace("bar") |> applyStyle - - ///initializes a trace of type "pie" applying the given trace styling function - let initPie (applyStyle:Trace->Trace) = - Trace("pie") |> applyStyle - - ///initializes a trace of type "heatmap" applying the given trace styling function - let initHeatmap (applyStyle:Trace->Trace) = - Trace("heatmap") |> applyStyle - - ///initializes a trace of type "heatmapgl" applying the given trace styling function - let initHeatmapGL (applyStyle:Trace->Trace) = - Trace("heatmapgl") |> applyStyle - - ///initializes a trace of type "image" applying the given trace styling function - let initImage (applyStyle:Trace->Trace) = - Trace("image") |> applyStyle - - ///initializes a trace of type "contour" applying the given trace styling function - let initContour (applyStyle:Trace->Trace) = - Trace("contour") |> applyStyle - - ///initializes a trace of type "Table" applying the given trace styling function - /// Init trace for table - let initTable (applyStyle:Trace->Trace) = - Trace("table") |> applyStyle - - //------------------------------------------------------------------------------------------------------------------------------------------------- - //Distributions - - ///initializes a trace of type "box" applying the given trace styling function - let initBoxPlot (applyStyle:Trace->Trace) = - Trace("box") |> applyStyle - - ///initializes a trace of type "violin" applying the given trace styling function - let initViolin (applyStyle:Trace->Trace) = - Trace("violin") |> applyStyle - - ///initializes a trace of type "histogram" applying the given trace styling function - let initHistogram (applyStyle:Trace->Trace) = - Trace("histogram") |> applyStyle - - ///initializes a trace of type "histogram2d" applying the given trace styling function - let initHistogram2d (applyStyle:Trace->Trace) = - Trace("histogram2d") |> applyStyle - - ///initializes a trace of type "histogram2dcontour" applying the given trace styling function - let initHistogram2dContour (applyStyle:Trace->Trace) = - Trace("histogram2dcontour") |> applyStyle - - //------------------------------------------------------------------------------------------------------------------------------------------------- - //Finance - - ///initializes a trace of type "ohlc" applying the given trace styling function - let initOHLC (applyStyle:Trace->Trace) = - Trace("ohlc") |> applyStyle - - ///initializes a trace of type "candlestick" applying the given trace styling function - let initCandlestick (applyStyle:Trace->Trace) = - Trace("candlestick") |> applyStyle - - ///initializes a trace of type "waterfall" applying the given trace styling function - let initWaterfall (applyStyle:Trace->Trace) = - Trace("waterfall") |> applyStyle - - ///initializes a trace of type "funnel" applying the given trace styling function - let initFunnel (applyStyle:Trace->Trace) = - Trace("funnel") |> applyStyle - - ///initializes a trace of type "funnelarea" applying the given trace styling function - let initFunnelArea (applyStyle:Trace->Trace) = - Trace("funnelarea") |> applyStyle - - ///initializes a trace of type "indicator" applying the given trace styling function - let initIndicator (applyStyle:Trace->Trace) = - Trace("indicator") |> applyStyle - - //------------------------------------------------------------------------------------------------------------------------------------------------- - //Maps - - ///initializes a trace of type "scattergeo" applying the given trace styling function - let initScatterGeo (applyStyle:Trace->Trace) = - Trace("scattergeo") |> applyStyle - - ///initializes a trace of type "choropleth" applying the given trace styling function - let initChoroplethMap (applyStyle:Trace->Trace) = - Trace("choropleth") |> applyStyle - - ///initializes a trace of type "scattermapbox" applying the given trace styling function - let initScatterMapbox (applyStyle:Trace->Trace) = - Trace("scattermapbox") |> applyStyle - - ///initializes a trace of type "choroplethmapbox" applying the given trace styling function - let initChoroplethMapbox (applyStyle:Trace->Trace) = - Trace("choroplethmapbox") |> applyStyle - - ///initializes a trace of type "densitymapbox" applying the given trace styling function - let initDensityMapbox (applyStyle:Trace->Trace) = - Trace("densitymapbox") |> applyStyle - - //------------------------------------------------------------------------------------------------------------------------------------------------- - //Specialized - ///initializes a trace of type "scatterpolar" applying the given trace styling function - let initScatterPolar (applyStyle:Trace->Trace) = - Trace("scatterpolar") |> applyStyle - - ///initializes a trace of type "scatterpolargl" applying the given trace styling function - let initScatterPolarGL (applyStyle:Trace->Trace) = - Trace("scatterpolargl") |> applyStyle - - ///initializes a trace of type "barpolar" applying the given trace styling function - let initBarPolar (applyStyle:Trace->Trace) = - Trace("barpolar") |> applyStyle - - ///initializes a trace of type "scatterternary" applying the given trace styling function - let initScatterTernary (applyStyle:Trace->Trace) = - Trace("scatterternary") |> applyStyle - - ///initializes a trace of type "sunburst" applying the given trace styling function - let initSunburst (applyStyle:Trace->Trace) = - Trace("sunburst") |> applyStyle - - ///initializes a trace of type "treemap" applying the given trace styling function - let initTreemap (applyStyle:Trace->Trace) = - Trace("treemap") |> applyStyle - - ///initializes a trace of type "sankey" applying the given trace styling function - let initSankey (applyStyle:Trace->Trace) = - Trace("sankey") |> applyStyle - - ///initializes a trace of type "SPLOM" applying the given trace styling function - let initSplom (applyStyle:Trace->Trace) = - Trace("splom") |> applyStyle - - ///initializes a trace of type "parcoords" applying the given trace styling function - let initParallelCoord (applyStyle:Trace->Trace) = - Trace("parcoords") |> applyStyle - - ///initializes a trace of type "parcats" applying the given trace styling function - let initParallelCategories (applyStyle: Trace -> Trace) = - Trace("parcats") |> applyStyle - - ///initializes a trace of type "carpet" applying the given trace styling function - let initCarpet (applyStyle:Trace->Trace) = - Trace("carpet") |> applyStyle - - ///initializes a trace of type "scattercarpet" applying the given trace styling function - let initScatterCarpet (applyStyle:Trace->Trace) = - Trace("scattercarpet") |> applyStyle - - ///initializes a trace of type "contourcarpet" applying the given trace styling function - let initContourCarpet (applyStyle:Trace->Trace) = - Trace("contourcarpet") |> applyStyle - - - - //------------------------------------------------------------------------------------------------------------------------------------------------- - //Custom - - /// Init trace for wind rose chart - let initWindRose (applyStyle:Trace->Trace) = - Trace("area") |> applyStyle - - //------------------------------------------------------------------------------------------------------------------------------------------------- - /// Functions provide the styling of the Chart objects - /// These functions are used internally to style traces of Chart objects. Users are usually pointed - /// to the API layer provided by the `Chart` module/object - type TraceStyle() = - - /// Applies the given TraceInfo style parameters to a Trace object. - static member TraceInfo - ( - ?Name: string, - ?Visible: StyleParam.Visible, - ?Showlegend: bool, - ?Legendgroup:string, - ?Opacity: float, - ?Uid: string, - ?Hoverinfo: string - //?Stream: Stream - - ) = - (fun (trace:('T :> Trace)) -> - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.toString - Showlegend |> DynObj.setValueOpt trace "showlegend" - Legendgroup |> DynObj.setValueOpt trace "legendgroup" - Opacity |> DynObj.setValueOpt trace "opacity" - Uid |> DynObj.setValueOpt trace "uid" - Hoverinfo |> DynObj.setValueOpt trace "hoverinfo" - // Update - //Stream: Stream - - // out -> - trace - ) - - /// Sets the given axis anchor id(s) on a Trace object. - static member SetAxisAnchor - ( - ?X:StyleParam.LinearAxisId, - ?Y:StyleParam.LinearAxisId - ) = - (fun (trace:('T :> Trace)) -> - - X |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.toString - Y |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.toString - - trace - ) - - /// Sets selection of data points on a Trace object. - static member SetSelection - ( - ?Selectedpoints, - ?Selected, - ?UnSelected - ) = - (fun (trace:('T :> Trace)) -> - - Selectedpoints |> DynObj.setValueOpt trace "Selectedpoints" - Selected |> DynObj.setValueOpt trace "Selected" - UnSelected |> DynObj.setValueOpt trace "UnSelected" - - trace - ) - - - /// Sets the given text label styles on a Trace object. - static member TextLabel - ( - ?Text : seq<#IConvertible>, - ?Textposition: StyleParam.TextPosition, - ?Textfont: Font, - ?Textsrc : string, - ?Textpositionsrc : string - - ) = - (fun (trace:('T :> Trace)) -> - Text |> DynObj.setValueOpt trace "text" - Textposition |> DynObj.setValueOptBy trace "textposition" StyleParam.TextPosition.toString - Textsrc |> DynObj.setValueOpt trace "textsrc" - Textpositionsrc |> DynObj.setValueOpt trace "textpositionsrc" - Textfont |> DynObj.setValueOpt trace "textfont" - - // out -> - trace - ) - - - /// Sets the given line on a Trace object. - static member SetLine - ( - line:Line - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("line", line) - trace - ) - - - /// Sets the given Line styles on the line property of a Trace object - static member Line - ( - ?Width: float, - ?Color: string, - ?Shape: StyleParam.Shape, - ?Dash: StyleParam.DrawingStyle, - ?Smoothing: float, - ?Colorscale : StyleParam.Colorscale - ) = - (fun (trace:('T :> Trace)) -> - let line = - match (trace.TryGetValue "line") with - | Some line -> line :?> Line - | None -> Line.init() - |> Line.style(?Width=Width,?Color=Color,?Shape=Shape,?Dash=Dash,?Smoothing=Smoothing,?Colorscale=Colorscale) - - trace.SetValue("line", line) - trace - ) - - - /// Sets the given marker on a Trace object. - static member SetMarker - ( - marker:Marker - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("marker", marker) - trace - ) - - - /// Sets the given Marker styles on the marker property of a Trace object - static member Marker - ( - ?Size: int, - ?Opacity: float, - ?Color: string, - ?Symbol: StyleParam.Symbol, - ?MultiSizes: seq<#IConvertible>, - ?Line: Line, - ?ColorBar: ColorBar, - ?Colorscale : StyleParam.Colorscale, - ?Colors: seq, - ?OutlierColor:string, - ?Maxdisplayed: int, - ?Sizeref: float, - ?Sizemin: float, - ?Sizemode: StyleParam.MarkerSizeMode, - ?Cauto: bool, - ?Cmax: float, - ?Cmin: float, - ?Cmid: float, - ?Autocolorscale: bool, - ?Reversescale: bool, - ?Showscale: bool - - - ) = - (fun (trace:('T :> Trace)) -> - let marker = - match (trace.TryGetValue "marker") with - | Some m -> m :?> Marker - | None -> Marker () - - |> Marker.style(?Size=Size,?Color=Color,?Symbol=Symbol, - ?Opacity=Opacity,?MultiSizes=MultiSizes,?Line=Line, - ?ColorBar=ColorBar,?Colorscale=Colorscale,?Colors=Colors,?OutlierColor=OutlierColor, - ?Maxdisplayed=Maxdisplayed,?Sizeref=Sizeref,?Sizemin=Sizemin, - ?Sizemode=Sizemode,?Cauto=Cauto,?Cmax=Cmax,?Cmin=Cmin,?Cmid=Cmid, - ?Autocolorscale=Autocolorscale,?Reversescale=Reversescale,?Showscale=Showscale - ) - - trace.SetValue("marker", marker) - trace - - ) - - - - - /// Sets the given domain on a Trace object. - static member SetDomain - ( - domain:Domain - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("domain", domain) - trace - ) - - /// Sets the given Domain styles on the domain property of a Trace object - static member Domain - ( - ?X : StyleParam.Range, - ?Y : StyleParam.Range, - ?Row : int, - ?Column: int - ) = - (fun (trace:('T :> Trace)) -> - let domain = - match (trace.TryGetValue "domain") with - | Some m -> m :?> Domain - | None -> Domain () - - |> Domain.style(?X=X,?Y=Y,?Row=Row,?Column=Column) - - trace.SetValue("domain", domain) - trace - ) - - // Sets the X-Error an a Trace object. - static member SetErrorX - ( - error:Error - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("error_x", error) - trace - ) - - // Sets Y-Error() to TraceObjects - static member SetErrorY - ( - error:Error - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("error_y", error) - trace - ) - - // Sets Z-Error() to TraceObjects - static member SetErrorZ - ( - error:Error - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("error_z", error) - trace - ) - - // Sets Stackgroup() to TraceObjects - static member SetStackGroup - ( - stackgroup: string - ) = - (fun (trace:('T :> Trace)) -> - - trace.SetValue("stackgroup", stackgroup) - trace - ) - - //############################################################################################################################################# - //# Chart trace style abstractions - //# Ideally, these functions cover the full parameter list supported by plotly.js, while the higher API layers - //# omit some for the sake of usability. - //############################################################################################################################################# - - /// Create a function that applies the styles of a scatter plot to a Trace object - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Determines the drawing mode for this scatter trace. - /// Sets the area to fill with a solid color - /// Sets the color applied to the fill area - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// 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 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 - /// Sets vertical error bars for this this scatter trace. - /// Sets horizontal error bars for this this scatter trace. - static member Scatter - ( - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Mode : StyleParam.Mode, - ?Fill : StyleParam.Fill, - ?Fillcolor : string, - ?Connectgaps: bool, - ?StackGroup : string, - ?Orientation: StyleParam.Orientation, - ?GroupNorm : StyleParam.GroupNorm, - ?Error_y : Error, - ?Error_x : Error - ) = - (fun (trace:('T :> Trace)) -> - - X |> DynObj.setValueOpt trace "x" - Y |> DynObj.setValueOpt trace "y" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.toString - Connectgaps |> DynObj.setValueOpt trace "connectgaps" - StackGroup |> DynObj.setValueOpt trace "stackgroup" - Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert - GroupNorm |> DynObj.setValueOptBy trace "groupnorm" StyleParam.GroupNorm.convert - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.toString - Fillcolor |> DynObj.setValueOpt trace "fillcolor" - Error_x |> DynObj.setValueOpt trace "error_x" - Error_y |> DynObj.setValueOpt trace "error_y" - - trace - ) - - /// Create a function that applies the styles of a bar plot to a Trace object - /// Sets the x coordinates of the plotted data. - /// Sets the y coordinates of the plotted data. - /// Sets Marker - /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. - /// [Legacy] used for polar charts. Will be removed when adding the new polar charts. - /// [Legacy] used for polar charts. Will be removed when adding the new polar charts. - /// Sets vertical error bars for this this scatter trace. - /// Sets horizontal error bars for this this scatter trace. - static member Bar - ( - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Marker : Marker, - ?R : seq<#IConvertible>, - ?T : seq<#IConvertible>, - ?Error_y: Error, - ?Error_x: Error, - ?Orientation - ) = - (fun (bar:('T :> Trace)) -> - X |> DynObj.setValueOpt bar "x" - Y |> DynObj.setValueOpt bar "y" - R |> DynObj.setValueOpt bar "r" - T |> DynObj.setValueOpt bar "t" - Orientation |> DynObj.setValueOptBy bar "orientation" StyleParam.Orientation.convert - - // Update - Marker |> DynObj.setValueOpt bar "marker" - Error_x |> DynObj.setValueOpt bar "error_x" - Error_y |> DynObj.setValueOpt bar "error_y" - - // out -> - bar - - ) - - // Applies the styles of pie plot to TraceObjects - static member Pie - ( - ?Values: seq<#IConvertible>, - ?Labels: seq<#IConvertible>, - ?Label0: #IConvertible, - ?dLabel: #IConvertible, - ?Scalegroup, - ?Textinfo, - //?Textfont: FontOptions, - ?Insidetextfont: Font, - ?Outsidetextfont: Font, - ?Domain, // TODO - ?Hole: float, - ?Sort: bool, - ?Direction, // TODO - ?Rotation: float, - ?Pull: float, - ?Labelssrc: string, - ?Valuessrc: string, - ?Pullsrc - - ) = - (fun (pie:('T :> Trace)) -> - - Values |> DynObj.setValueOpt pie "values" - Labels |> DynObj.setValueOpt pie "labels" - Label0 |> DynObj.setValueOpt pie "label0" - dLabel |> DynObj.setValueOpt pie "dlabel" //-- temporarily - Scalegroup |> DynObj.setValueOpt pie "scalegroup" - Textinfo |> DynObj.setValueOpt pie "textinfo" - - Domain |> DynObj.setValueOpt pie "domain" - Hole |> DynObj.setValueOpt pie "hole" - Sort |> DynObj.setValueOpt pie "sort" - Direction |> DynObj.setValueOpt pie "direction" - Rotation |> DynObj.setValueOpt pie "rotation" - Pull |> DynObj.setValueOpt pie "pull" - Labelssrc |> DynObj.setValueOpt pie "labelssrc" - Valuessrc |> DynObj.setValueOpt pie "valuessrc" - Pullsrc |> DynObj.setValueOpt pie "pullsrc" - - // Update - //Marker |> Option.iter (updatePropertyValueAndIgnore pie <@ pie.marker @>) - //Textfont |> Option.iter (updatePropertyValueAndIgnore pie <@ pie.textfont @>) - Insidetextfont |> DynObj.setValueOpt pie "insidetextfont" - Outsidetextfont |> DynObj.setValueOpt pie "outsidetextfont" - - // out -> - pie - ) - - - // Applies the styles of box plot plot to TraceObjects - static member BoxPlot - ( - ?Y, - ?X, - ?X0, - ?Y0, - ?Whiskerwidth, - ?Boxpoints, - ?Boxmean, - ?Jitter, - ?Pointpos, - ?Orientation, - ?Fillcolor, - ?Marker:Marker, - ?Line:Line, - ?Alignmentgroup, - ?Offsetgroup, - ?Notched:bool, - ?NotchWidth:float, - ?QuartileMethod:StyleParam.QuartileMethod, - ?xAxis, - ?yAxis, - ?Ysrc, - ?Xsrc - - ) = - (fun (boxPlot:('T :> Trace)) -> - - Y |> DynObj.setValueOpt boxPlot "y" - X |> DynObj.setValueOpt boxPlot "x" - X0 |> DynObj.setValueOpt boxPlot "x0" - Y0 |> DynObj.setValueOpt boxPlot "y0" - Whiskerwidth |> DynObj.setValueOpt boxPlot "whiskerwidth" - Boxpoints |> DynObj.setValueOptBy boxPlot "boxpoints" StyleParam.Boxpoints.convert - Boxmean |> DynObj.setValueOptBy boxPlot "boxmean" StyleParam.BoxMean.convert - Jitter |> DynObj.setValueOpt boxPlot "jitter" - Pointpos |> DynObj.setValueOpt boxPlot "pointpos" - Orientation |> DynObj.setValueOptBy boxPlot "orientation" StyleParam.Orientation.convert - Fillcolor |> DynObj.setValueOpt boxPlot "fillcolor" - Marker |> DynObj.setValueOpt boxPlot "marker" - Line |> DynObj.setValueOpt boxPlot "line" - Alignmentgroup |> DynObj.setValueOpt boxPlot "alignmentgroup" - Offsetgroup |> DynObj.setValueOpt boxPlot "offsetgroup" - Notched |> DynObj.setValueOpt boxPlot "notched" - NotchWidth |> DynObj.setValueOpt boxPlot "notchwidth" - QuartileMethod |> DynObj.setValueOptBy boxPlot "quartilemethod" StyleParam.QuartileMethod.convert - - xAxis |> DynObj.setValueOpt boxPlot "xaxis" - yAxis |> DynObj.setValueOpt boxPlot "yaxis" - Ysrc |> DynObj.setValueOpt boxPlot "ysrc" - Xsrc |> DynObj.setValueOpt boxPlot "xsrc" - - // out -> - boxPlot - ) - - - // Applies the styles of violin plot plot to TraceObjects - static member Violin - ( - ?Y, - ?X, - ?X0, - ?Y0, - - ?Width, - ?Marker:Marker, - ?Line:Line, - ?Alignmentgroup, - ?Offsetgroup, - - ?Box:Box, - ?Bandwidth, - ?Meanline:Meanline, - ?Scalegroup, - ?Scalemode, - ?Side, - ?Span, - ?SpanMode, - ?Uirevision, - - - ?Points, - ?Jitter, - ?Pointpos, - ?Orientation, - ?Fillcolor, - ?xAxis, - ?yAxis, - ?Ysrc, - ?Xsrc - - ) = - (fun (boxPlot:('T :> Trace)) -> - - Y |> DynObj.setValueOpt boxPlot "y" - X |> DynObj.setValueOpt boxPlot "x" - X0 |> DynObj.setValueOpt boxPlot "x0" - Y0 |> DynObj.setValueOpt boxPlot "y0" - Points |> DynObj.setValueOptBy boxPlot "points" StyleParam.Jitterpoints.convert - Jitter |> DynObj.setValueOpt boxPlot "jitter" - Pointpos |> DynObj.setValueOpt boxPlot "pointpos" - Orientation |> DynObj.setValueOptBy boxPlot "orientation" StyleParam.Orientation.convert - Fillcolor |> DynObj.setValueOpt boxPlot "fillcolor" - - Width |> DynObj.setValueOpt boxPlot "width" - Marker |> DynObj.setValueOpt boxPlot "marker" - Line |> DynObj.setValueOpt boxPlot "line" - Alignmentgroup |> DynObj.setValueOpt boxPlot "alignmentgroup" - Offsetgroup |> DynObj.setValueOpt boxPlot "offsetgroup" - - Box |> DynObj.setValueOpt boxPlot "box" - Bandwidth |> DynObj.setValueOpt boxPlot "bandwidth" - Meanline |> DynObj.setValueOpt boxPlot "meanline" - Scalegroup |> DynObj.setValueOpt boxPlot "scalegroup" - Scalemode |> DynObj.setValueOpt boxPlot "scalemode" - Side |> DynObj.setValueOpt boxPlot "side" - Span |> DynObj.setValueOpt boxPlot "span" - SpanMode |> DynObj.setValueOpt boxPlot "spanmode" - Uirevision |> DynObj.setValueOpt boxPlot "uirevision" - - - xAxis |> DynObj.setValueOpt boxPlot "xaxis" - yAxis |> DynObj.setValueOpt boxPlot "yaxis" - Ysrc |> DynObj.setValueOpt boxPlot "ysrc" - Xsrc |> DynObj.setValueOpt boxPlot "xsrc" - - // out -> - boxPlot - ) - - - - // Applies the styles of heatmap to TraceObjects - static member Heatmap - ( - ?Z : seq<#seq<#IConvertible>>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?X0 , - ?dX , - ?Y0 , - ?dY , - ?xType , - ?yType , - ?xAxis , - ?yAxis , - ?Zsrc , - ?Xsrc , - ?Ysrc , - - ?Xgap , - ?Ygap , - ?Transpose , - ?zAuto , - ?zMin , - ?zMax , - ?Colorscale , - ?Autocolorscale , - ?Reversescale , - ?Showscale , - ?zSmooth , - ?ColorBar - ) = - (fun (heatmap:('T :> Trace)) -> - - Z |> DynObj.setValueOpt heatmap "z" - X |> DynObj.setValueOpt heatmap "x" - Y |> DynObj.setValueOpt heatmap "y" - X0 |> DynObj.setValueOpt heatmap "x0" - dX |> DynObj.setValueOpt heatmap "dx" - Y0 |> DynObj.setValueOpt heatmap "y0" - dY |> DynObj.setValueOpt heatmap "dy" - xType |> DynObj.setValueOpt heatmap "xtype" - yType |> DynObj.setValueOpt heatmap "ytype" - xAxis |> DynObj.setValueOpt heatmap "xaxis" - yAxis |> DynObj.setValueOpt heatmap "yaxis" - Zsrc |> DynObj.setValueOpt heatmap "zsrc" - Xsrc |> DynObj.setValueOpt heatmap "xsrc" - Ysrc |> DynObj.setValueOpt heatmap "ysrc" - - Xgap |> DynObj.setValueOpt heatmap "xgap" - Ygap |> DynObj.setValueOpt heatmap "ygap" - Transpose |> DynObj.setValueOpt heatmap "transpose" - zAuto |> DynObj.setValueOpt heatmap "zauto" - zMin |> DynObj.setValueOpt heatmap "zmin" - zMax |> DynObj.setValueOpt heatmap "zmax" - Colorscale |> DynObj.setValueOptBy heatmap "colorscale" StyleParam.Colorscale.convert - Autocolorscale |> DynObj.setValueOpt heatmap "autocolorscale" - Reversescale |> DynObj.setValueOpt heatmap "reversescale" - Showscale |> DynObj.setValueOpt heatmap "showscale" - zSmooth |> DynObj.setValueOptBy heatmap "zsmooth" StyleParam.SmoothAlg.convert - ColorBar |> DynObj.setValueOpt heatmap "colorbar" - - // out -> - heatmap - ) - - static member Contour - ( - ?Z : seq<#seq<#IConvertible>>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?X0 , - ?dX , - ?Y0 , - ?dY , - ?xType , - ?yType , - ?xAxis , - ?yAxis , - ?Zsrc , - ?Xsrc , - ?Ysrc , - - ?Xgap , - ?Ygap , - ?Transpose , - ?zAuto , - ?zMin , - ?zMax , - ?Colorscale , - ?Autocolorscale , - ?Reversescale , - ?Showscale , - ?zSmooth , - ?ColorBar - ) = - (fun (contour:('T :> Trace)) -> - - Z |> DynObj.setValueOpt contour "z" - X |> DynObj.setValueOpt contour "x" - Y |> DynObj.setValueOpt contour "y" - X0 |> DynObj.setValueOpt contour "x0" - dX |> DynObj.setValueOpt contour "dx" - Y0 |> DynObj.setValueOpt contour "y0" - dY |> DynObj.setValueOpt contour "dy" - xType |> DynObj.setValueOpt contour "xtype" - yType |> DynObj.setValueOpt contour "ytype" - xAxis |> DynObj.setValueOpt contour "xaxis" - yAxis |> DynObj.setValueOpt contour "yaxis" - Zsrc |> DynObj.setValueOpt contour "zsrc" - Xsrc |> DynObj.setValueOpt contour "xsrc" - Ysrc |> DynObj.setValueOpt contour "ysrc" - - Xgap |> DynObj.setValueOpt contour "xgap" - Ygap |> DynObj.setValueOpt contour "ygap" - Transpose |> DynObj.setValueOpt contour "transpose" - zAuto |> DynObj.setValueOpt contour "zauto" - zMin |> DynObj.setValueOpt contour "zmin" - zMax |> DynObj.setValueOpt contour "zmax" - Colorscale |> DynObj.setValueOptBy contour "colorscale" StyleParam.Colorscale.convert - Autocolorscale |> DynObj.setValueOpt contour "autocolorscale" - Reversescale |> DynObj.setValueOpt contour "reversescale" - Showscale |> DynObj.setValueOpt contour "showscale" - zSmooth |> DynObj.setValueOptBy contour "zsmooth" StyleParam.SmoothAlg.convert - ColorBar |> DynObj.setValueOpt contour "colorbar" - - // out -> - contour - ) - - - // Applies the styles of histogram to TraceObjects - - - static member Histogram - ( - ?X : seq<#IConvertible> , - ?Y : seq<#IConvertible> , - ?Text : seq , - ?xAxis , - ?yAxis , - ?Xsrc , - ?Ysrc , - ?Orientation , - ?HistFunc , - ?HistNorm , - ?Cumulative : Cumulative , - - - ?Autobinx : bool , - ?nBinsx : int , - ?xBins : Bins , - ?Autobiny : bool , - ?nBinsy : int , - ?yBins : Bins , - ?Marker : Marker , - - ?xError : Error , - ?yError : Error - - - - ) = - (fun (histogram:('T :> Trace)) -> - - X |> DynObj.setValueOpt histogram "x" - Y |> DynObj.setValueOpt histogram "y" - Text |> DynObj.setValueOpt histogram "text" - xAxis |> DynObj.setValueOpt histogram "xaxis" - yAxis |> DynObj.setValueOpt histogram "yaxis" - Xsrc |> DynObj.setValueOpt histogram "xsrc" - Ysrc |> DynObj.setValueOpt histogram "ysrc" - - Orientation |> DynObj.setValueOptBy histogram "orientation" StyleParam.Orientation.convert - HistFunc |> DynObj.setValueOptBy histogram "histfunc" StyleParam.HistFunc.convert - HistNorm |> DynObj.setValueOptBy histogram "histnorm" StyleParam.HistNorm.convert - Cumulative |> DynObj.setValueOpt histogram "cumulative" - - Autobinx |> DynObj.setValueOpt histogram "autobinx" - nBinsx |> DynObj.setValueOpt histogram "nbinsx" - xBins |> DynObj.setValueOpt histogram "xbins" - Autobiny |> DynObj.setValueOpt histogram "autobiny" - nBinsy |> DynObj.setValueOpt histogram "nbinsy" - yBins |> DynObj.setValueOpt histogram "ybins" - - // Update - Marker |> DynObj.setValueOpt histogram "marker" - xError |> DynObj.setValueOpt histogram "error_x" - yError |> DynObj.setValueOpt histogram "error_y" - - // out -> - histogram - ) - - - static member Histogram2d - ( - ?X : seq<#IConvertible> , - ?Y : seq<#IConvertible> , - ?Z : seq<#seq<#IConvertible>> , - ?X0 , - ?dX , - ?Y0 , - ?dY , - ?xType , - ?yType , - ?xAxis , - ?yAxis , - ?Zsrc , - ?Xsrc , - ?Ysrc , - - ?Marker : Marker , - ?Orientation , - //?Connectgaps : bool , - ?HistFunc , - ?HistNorm , - ?Autobinx : bool , - ?nBinsx : int , - ?xBins : Bins , - ?Autobiny : bool , - ?nBinsy : int , - ?yBins : Bins , - - ?Xgap , - ?Ygap , - ?Transpose , - ?zAuto , - ?zMin , - ?zMax , - ?Colorscale , - ?Autocolorscale , - ?Reversescale , - ?Showscale , - ?zSmooth , - ?ColorBar - - ) = - (fun (histogram2d:('T :> Trace)) -> - - Z |> DynObj.setValueOpt histogram2d "z" - X |> DynObj.setValueOpt histogram2d "x" - Y |> DynObj.setValueOpt histogram2d "y" - X0 |> DynObj.setValueOpt histogram2d "x0" - dX |> DynObj.setValueOpt histogram2d "dx" - Y0 |> DynObj.setValueOpt histogram2d "y0" - dY |> DynObj.setValueOpt histogram2d "dy" - xType |> DynObj.setValueOpt histogram2d "xtype" - yType |> DynObj.setValueOpt histogram2d "ytype" - xAxis |> DynObj.setValueOpt histogram2d "xaxis" - yAxis |> DynObj.setValueOpt histogram2d "yaxis" - Zsrc |> DynObj.setValueOpt histogram2d "zsrc" - Xsrc |> DynObj.setValueOpt histogram2d "xsrc" - Ysrc |> DynObj.setValueOpt histogram2d "ysrc" - - Orientation |> DynObj.setValueOptBy histogram2d "orientation" StyleParam.Orientation.convert - //Connectgaps |> DynObj.setValueOptBy histogram2d "connectgaps" StyleParam.Orientation.convert - HistFunc |> DynObj.setValueOptBy histogram2d "histfunc " StyleParam.HistFunc.convert - HistNorm |> DynObj.setValueOptBy histogram2d "histnorm " StyleParam.HistNorm.convert - Autobinx |> DynObj.setValueOpt histogram2d "autobinx" - nBinsx |> DynObj.setValueOpt histogram2d "nbinsx" - xBins |> DynObj.setValueOpt histogram2d "xbins" - Autobiny |> DynObj.setValueOpt histogram2d "autobiny" - nBinsy |> DynObj.setValueOpt histogram2d "nbinsy" - yBins |> DynObj.setValueOpt histogram2d "ybins" - - Xgap |> DynObj.setValueOpt histogram2d "xgap" - Ygap |> DynObj.setValueOpt histogram2d "ygap" - Transpose |> DynObj.setValueOpt histogram2d "transpose" - zAuto |> DynObj.setValueOpt histogram2d "zauto" - zMin |> DynObj.setValueOpt histogram2d "zmin" - zMax |> DynObj.setValueOpt histogram2d "zmax" - Colorscale |> DynObj.setValueOptBy histogram2d "colorscale" StyleParam.Colorscale.convert - Autocolorscale |> DynObj.setValueOpt histogram2d "autocolorscale" - Reversescale |> DynObj.setValueOpt histogram2d "reversescale" - Showscale |> DynObj.setValueOpt histogram2d "showscale" - zSmooth |> DynObj.setValueOptBy histogram2d "zsmooth" StyleParam.SmoothAlg.convert - ColorBar |> DynObj.setValueOpt histogram2d "colorbar" - - // Update - Marker |> DynObj.setValueOpt histogram2d "marker" - - // out -> - histogram2d - ) - - - static member Histogram2dContour - ( - ?X : seq<#IConvertible> , - ?Y : seq<#IConvertible> , - ?Z : seq<#seq<#IConvertible>> , - ?X0 , - ?dX , - ?Y0 , - ?dY , - ?xType , - ?yType , - ?xAxis , - ?yAxis , - ?Zsrc , - ?Xsrc , - ?Ysrc , - - ?Marker : Marker , - ?Orientation , - //?Connectgaps : bool , - ?HistFunc , - ?HistNorm , - ?Autobinx : bool , - ?nBinsx : int , - ?xBins : Bins , - ?Autobiny : bool , - ?nBinsy : int , - ?yBins : Bins , - - ?nContours : int , - ?Contours : Contour , - ?Line : Line , - - - ?Xgap , - ?Ygap , - ?Transpose , - ?zAuto , - ?zMin , - ?zMax , - ?Colorscale , - ?Autocolorscale , - ?Reversescale , - ?Showscale , - ?zSmooth , - ?ColorBar - - ) = - (fun (histogram2dContour:('T :> Trace)) -> - - Z |> DynObj.setValueOpt histogram2dContour "z" - X |> DynObj.setValueOpt histogram2dContour "x" - Y |> DynObj.setValueOpt histogram2dContour "y" - X0 |> DynObj.setValueOpt histogram2dContour "x0" - dX |> DynObj.setValueOpt histogram2dContour "dx" - Y0 |> DynObj.setValueOpt histogram2dContour "y0" - dY |> DynObj.setValueOpt histogram2dContour "dy" - xType |> DynObj.setValueOpt histogram2dContour "xtype" - yType |> DynObj.setValueOpt histogram2dContour "ytype" - xAxis |> DynObj.setValueOpt histogram2dContour "xaxis" - yAxis |> DynObj.setValueOpt histogram2dContour "yaxis" - Zsrc |> DynObj.setValueOpt histogram2dContour "zsrc" - Xsrc |> DynObj.setValueOpt histogram2dContour "xsrc" - Ysrc |> DynObj.setValueOpt histogram2dContour "ysrc" - - Orientation |> DynObj.setValueOptBy histogram2dContour "orientation" StyleParam.Orientation.convert - //Connectgaps |> DynObj.setValueOptBy histogram2dContour< "connectgaps" StyleParam.Orientation.convert - HistFunc |> DynObj.setValueOptBy histogram2dContour "histfunc " StyleParam.HistFunc.convert - HistNorm |> DynObj.setValueOptBy histogram2dContour "histnorm " StyleParam.HistNorm.convert - Autobinx |> DynObj.setValueOpt histogram2dContour "autobinx" - nBinsx |> DynObj.setValueOpt histogram2dContour "nbinsx" - xBins |> DynObj.setValueOpt histogram2dContour "xbins" - Autobiny |> DynObj.setValueOpt histogram2dContour "autobiny" - nBinsy |> DynObj.setValueOpt histogram2dContour "nbinsy" - yBins |> DynObj.setValueOpt histogram2dContour "ybins" - - nContours |> DynObj.setValueOpt histogram2dContour "ncontours" - Contours |> DynObj.setValueOpt histogram2dContour "contours" - Line |> DynObj.setValueOpt histogram2dContour "line" - Xgap |> DynObj.setValueOpt histogram2dContour "xgap" - Ygap |> DynObj.setValueOpt histogram2dContour "ygap" - Transpose |> DynObj.setValueOpt histogram2dContour "transpose" - zAuto |> DynObj.setValueOpt histogram2dContour "zauto" - zMin |> DynObj.setValueOpt histogram2dContour "zmin" - zMax |> DynObj.setValueOpt histogram2dContour "zmax" - Colorscale |> DynObj.setValueOptBy histogram2dContour "colorscale" StyleParam.Colorscale.convert - Autocolorscale |> DynObj.setValueOpt histogram2dContour "autocolorscale" - Reversescale |> DynObj.setValueOpt histogram2dContour "reversescale" - Showscale |> DynObj.setValueOpt histogram2dContour "showscale" - zSmooth |> DynObj.setValueOptBy histogram2dContour "zsmooth" StyleParam.SmoothAlg.convert - ColorBar |> DynObj.setValueOpt histogram2dContour "colorbar" - - // Update - Marker |> DynObj.setValueOpt histogram2dContour "marker" - - // out -> - histogram2dContour - ) - - - // Applies the styles of parallel coordinates plot to TraceObjects - static member ParallelCoord - ( - ?Dimensions : seq, - ?Line , - ?Domain , - ?Labelfont , - ?Tickfont : Font, - ?Rangefont : Font - ) = - (fun (parcoords:('T :> Trace)) -> - - Dimensions |> DynObj.setValueOpt parcoords "dimensions" - Line |> DynObj.setValueOpt parcoords "line" - Domain |> DynObj.setValueOpt parcoords "domain" - Labelfont |> DynObj.setValueOpt parcoords "labelfont" - Tickfont |> DynObj.setValueOpt parcoords "tickfont" - Rangefont |> DynObj.setValueOpt parcoords "rangefont" - - // out -> - parcoords - ) - - static member ParallelCategories - ( - ?Dimensions : seq, - ?Line , - ?Domain , - ?Color : seq<#IConvertible>, - ?Labelfont , - ?Tickfont : Font, - ?Rangefont : Font - ) = - (fun (parcats:('T :> Trace)) -> - - Dimensions |> DynObj.setValueOpt parcats "dimensions" - Line |> DynObj.setValueOpt parcats "line" - Domain |> DynObj.setValueOpt parcats "domain" - Color |> DynObj.setValueOpt parcats "color" - Labelfont |> DynObj.setValueOpt parcats "labelfont" - Tickfont |> DynObj.setValueOpt parcats "tickfont" - Rangefont |> DynObj.setValueOpt parcats "rangefont" - - // out -> - parcats - ) - - // Applies the styles of choropleth map plot to TraceObjects - static member ChoroplethMap - ( - ?Locations : seq, - ?Z : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?Locationmode : StyleParam.LocationFormat, - ?Autocolorscale : bool, - ?Colorscale : StyleParam.Colorscale, - ?ColorBar : ColorBar, - ?Marker : Marker, - ?GeoJson, - ?FeatureIdKey : string, - ?Zmin : float, - ?Zmid : float, - ?Zmax : float - - - ) = - (fun (choropleth:('T :> Trace)) -> - - Locations |> DynObj.setValueOpt choropleth "locations" - Z |> DynObj.setValueOpt choropleth "z" - Text |> DynObj.setValueOpt choropleth "text" - Locationmode |> DynObj.setValueOptBy choropleth "locationmode" StyleParam.LocationFormat.convert - Autocolorscale |> DynObj.setValueOpt choropleth "autocolorscale" - - Colorscale |> DynObj.setValueOptBy choropleth "colorscale" StyleParam.Colorscale.convert - ColorBar |> DynObj.setValueOpt choropleth "colorbar" - Marker |> DynObj.setValueOpt choropleth "marker" - GeoJson |> DynObj.setValueOpt choropleth "geojson" - FeatureIdKey |> DynObj.setValueOpt choropleth "featureidkey" - Zmin |> DynObj.setValueOpt choropleth "zmin" - Zmid |> DynObj.setValueOpt choropleth "zmid" - Zmax |> DynObj.setValueOpt choropleth "zmax" - - // out -> - choropleth - ) - - - // Applies the styles of Splom plot to TraceObjects - static member Splom - ( - ?Dimensions : seq - ) = - (fun (trace:('T :> Trace)) -> - Dimensions |> DynObj.setValueOpt trace "dimensions" - - // out -> - trace - ) - - // Applies the styles of table plot to TraceObjects - static member Table - ( - header : TableHeader , - cells : TableCells , - ?ColumnWidth : seq, - ?ColumnOrder : seq - ) = - (fun (trace:('T :> Trace)) -> - header |> DynObj.setValue trace "header" - cells |> DynObj.setValue trace "cells" - ColumnWidth |> DynObj.setValueOpt trace "columnwidth" - ColumnOrder |> DynObj.setValueOpt trace "columnorder" - // out -> - trace - ) - - /// Applies the styles of sundburst plot to TraceObjects - /// - /// Parameters: - /// - /// labels: Sets the labels of each of the sectors. - /// - /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// - /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// - /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. - /// - /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// - /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// - /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - static member Sunburst - ( - labels : seq<#IConvertible>, - parents : seq<#IConvertible>, - ?Ids : seq, - ?Values : seq, - ?Text : seq, - ?Branchvalues : StyleParam.BranchValues, - ?Level , - ?Maxdepth : int - ) = - (fun (trace:('T :> Trace)) -> - labels |> DynObj.setValue trace "labels" - parents |> DynObj.setValue trace "parents" - Ids |> DynObj.setValueOpt trace "ids" - Values |> DynObj.setValueOpt trace "values" - Text |> DynObj.setValueOpt trace "text" - Branchvalues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert - Level |> DynObj.setValueOpt trace "level" - Maxdepth |> DynObj.setValueOpt trace "maxdepth" - trace - ) - - /// Applies the styles of treemap plot to TraceObjects - /// - /// Parameters: - /// - /// labels : Sets the labels of each of the sectors. - /// - /// parents : Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. - /// - /// Ids : Assigns id labels to each datum. These ids for object constancy of data points during animation. - /// - /// Values : Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. - /// - /// Text : Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// - /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. - /// - /// Tiling : Sets Tiling algorithm options - /// - /// PathBar : Sets the Pathbar used to navigate zooming - /// - /// Level : Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. - /// - /// Maxdepth : Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. - static member Treemap - ( - labels : seq<#IConvertible>, - parents : seq<#IConvertible>, - ?Ids : seq, - ?Values : seq, - ?Text : seq, - ?Branchvalues : StyleParam.BranchValues, - ?Tiling : TreemapTiling, - ?PathBar : Pathbar, - ?Level , - ?Maxdepth : int - ) = - (fun (trace:('T :> Trace)) -> - labels |> DynObj.setValue trace "labels" - parents |> DynObj.setValue trace "parents" - Ids |> DynObj.setValueOpt trace "ids" - Values |> DynObj.setValueOpt trace "values" - Text |> DynObj.setValueOpt trace "text" - Branchvalues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert - Tiling |> DynObj.setValueOpt trace "tiling" - PathBar |> DynObj.setValueOpt trace "pathbar" - Level |> DynObj.setValueOpt trace "level" - Maxdepth |> DynObj.setValueOpt trace "maxdepth" - trace - ) - - - /// Applies the styles of ohlc plot to TraceObjects - /// - /// ``open`` : Sets the open values. - /// - /// high : Sets the high values. - /// - /// low : Sets the low values. - /// - /// close : Sets the close values. - /// - /// x : Sets the x coordinates. If absent, linear coordinate will be generated. - /// - /// ?Increasing : Sets the Line style of the Increasing part of the chart - /// - /// ?Decreasing : Sets the Line style of the Decreasing part of the chart - /// - /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart - /// - /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. - /// - /// ?XCalendar : Sets the calendar system to use with `x` date data. - static member OHLC - ( - ``open`` : #IConvertible seq, - high : #IConvertible seq, - low : #IConvertible seq, - close : #IConvertible seq, - x : #IConvertible seq, - ?Increasing : Line, - ?Decreasing : Line, - ?Line : Line, - ?Tickwidth : float, - ?XCalendar : StyleParam.Calendar - ) = - (fun (trace:('T :> Trace)) -> - DynObj.setValue trace "open" ``open`` - DynObj.setValue trace "high" high - DynObj.setValue trace "low" low - DynObj.setValue trace "close" close - DynObj.setValue trace "x" x - DynObj.setValue trace "xaxis" "x" - DynObj.setValue trace "yaxis" "y" - DynObj.setValueOpt trace "increasing" Increasing - DynObj.setValueOpt trace "decreasing" Decreasing - DynObj.setValueOpt trace "tickwidth" Tickwidth - DynObj.setValueOpt trace "line" Line - DynObj.setValueOpt trace "xcalendar" XCalendar - - trace - ) - - - /// Applies the styles of candlestick plot to TraceObjects - /// - /// ``open`` : Sets the open values. - /// - /// high : Sets the high values. - /// - /// low : Sets the low values. - /// - /// close : Sets the close values. - /// - /// x : Sets the x coordinates. If absent, linear coordinate will be generated. - /// - /// ?Increasing : Sets the Line style of the Increasing part of the chart - /// - /// ?Decreasing : Sets the Line style of the Decreasing part of the chart - /// - /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart - /// - /// ?WhiskerWidth : Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). - /// - /// ?XCalendar : Sets the calendar system to use with `x` date data. - static member Candlestick - ( - ``open`` : #IConvertible seq, - high : #IConvertible seq, - low : #IConvertible seq, - close : #IConvertible seq, - x : #IConvertible seq, - ?Increasing : Line, - ?Decreasing : Line, - ?WhiskerWidth : float, - ?Line : Line, - ?XCalendar : StyleParam.Calendar - ) = - (fun (trace:('T :> Trace)) -> - DynObj.setValue trace "open" ``open`` - DynObj.setValue trace "high" high - DynObj.setValue trace "low" low - DynObj.setValue trace "close" close - DynObj.setValue trace "x" x - DynObj.setValue trace "xaxis" "x" - DynObj.setValue trace "yaxis" "y" - DynObj.setValueOpt trace "increasing" Increasing - DynObj.setValueOpt trace "decreasing" Decreasing - DynObj.setValueOpt trace "whiskerwidth"WhiskerWidth - DynObj.setValueOpt trace "line" Line - DynObj.setValueOpt trace "xcalendar" XCalendar - - trace - ) - - /// Applies the styles of candlestick plot to TraceObjects - /// - /// Parameters: - /// - /// x : Sets the x coordinates. - /// - /// y : Sets the y coordinates. - /// - /// Base : Sets where the bar base is drawn (in position axis units). - /// - /// Width : Sets the bar width (in position axis units). - /// - /// Measure : An array containing types of values. By default the values are considered as 'relative'. However; it is possible to use 'total' to compute the sums. Also 'absolute' could be applied to reset the computed total or to declare an initial value where needed. - /// - /// Orientation : Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). - /// - /// Connector : Sets the styling of the connector lines - /// - /// AlignmentGroup : 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. - /// - /// OffsetGroup : 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. - /// - /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. - static member Waterfall - ( - x : #IConvertible seq, - y : #IConvertible seq, - ?Base : #IConvertible, - ?Width : float, - ?Measure : StyleParam.WaterfallMeasure seq, - ?Orientation : StyleParam.Orientation, - ?Connector : WaterfallConnector, - ?AlignmentGroup : string, - ?OffsetGroup : string, - ?Offset - - ) = - (fun (trace:('T :> Trace)) -> - - x |> DynObj.setValue trace "x" - y |> DynObj.setValue trace "y" - Base |> DynObj.setValueOpt trace "base" - Width |> DynObj.setValueOpt trace "width" - Measure |> DynObj.setValueOptBy trace "measure" (Seq.map StyleParam.WaterfallMeasure.convert) - Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert - AlignmentGroup |> DynObj.setValueOpt trace "alignmentgroup" - Connector |> DynObj.setValueOpt trace "connector" - OffsetGroup |> DynObj.setValueOpt trace "offsetgroup" - Offset |> DynObj.setValueOpt trace "offset" - - trace - ) - - static member Funnel - ( - x : seq<#IConvertible>, - y : seq<#IConvertible>, - ?x0, - ?dX : float, - ?y0, - ?dY : float, - ?Width : float, - ?Offset : float, - ?Orientation : StyleParam.Orientation, - ?Alignmentgroup : string, - ?Offsetgroup : string, - ?Cliponaxis : bool, - ?Connector : FunnelConnector, - ?Insidetextfont : Font, - ?Outsidetextfont: Font - ) = - (fun (trace:('T :> Trace)) -> - - x |> DynObj.setValue trace "x" - y |> DynObj.setValue trace "y" - x0 |> DynObj.setValueOpt trace "x0" - dX |> DynObj.setValueOpt trace "dx" - y0 |> DynObj.setValueOpt trace "y0" - dY |> DynObj.setValueOpt trace "dy" - Width |> DynObj.setValueOpt trace "width" - Offset |> DynObj.setValueOpt trace "offset" - Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert - Alignmentgroup |> DynObj.setValueOpt trace "alignmentgroup" - Offsetgroup |> DynObj.setValueOpt trace "offsetgroup" - Cliponaxis |> DynObj.setValueOpt trace "cliponaxis" - Connector |> DynObj.setValueOpt trace "connector" - Insidetextfont |> DynObj.setValueOpt trace "insidetextfont" - Outsidetextfont |> DynObj.setValueOpt trace "outsidetextfont" - - trace - - ) - - static member FunnelArea - ( - ?Values : seq<#IConvertible>, - ?Labels : seq<#IConvertible>, - ?dLabel : float, - ?Label0 : float, - ?Aspectratio : float, - ?Baseratio : float, - ?Insidetextfont: Font, - ?Scalegroup : string - ) = - (fun (trace:('T :> Trace)) -> - - Values |> DynObj.setValueOpt trace "values" - Labels |> DynObj.setValueOpt trace "labels" - dLabel |> DynObj.setValueOpt trace "dlabel" - Label0 |> DynObj.setValueOpt trace "label0" - Aspectratio |> DynObj.setValueOpt trace "aspectratio" - Baseratio |> DynObj.setValueOpt trace "baseratio" - Insidetextfont |> DynObj.setValueOpt trace "insidetextfont" - Scalegroup |> DynObj.setValueOpt trace "scalegroup" - - trace - - ) - - static member ScatterGeo - ( - mode : StyleParam.Mode, - ?Longitudes : #IConvertible seq, - ?Latitudes : #IConvertible seq, - ?Locations : seq, - ?GeoJson , - ?FeatureIdKey:string, - ?Connectgaps : bool, - ?Fill : StyleParam.Fill, - ?Fillcolor - ) = - (fun (trace:('T :> Trace)) -> - - mode |> StyleParam.Mode.convert |> DynObj.setValue trace "mode" - Longitudes |> DynObj.setValueOpt trace "lon" - Latitudes |> DynObj.setValueOpt trace "lat" - Locations |> DynObj.setValueOpt trace "locations" - GeoJson |> DynObj.setValueOpt trace "geojson" - FeatureIdKey|> DynObj.setValueOpt trace "featureidkey" - Connectgaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - Fillcolor |> DynObj.setValueOpt trace "fillcolor" - - trace - - ) - - static member ScatterMapbox - ( - mode : StyleParam.Mode, - ?Longitudes : #IConvertible seq, - ?Latitudes : #IConvertible seq, - ?Below : string, - ?Connectgaps: bool, - ?Fill : StyleParam.Fill, - ?Fillcolor : string - ) = - (fun (trace:('T :> Trace)) -> - - mode |> StyleParam.Mode.convert |> DynObj.setValue trace "mode" - Longitudes |> DynObj.setValueOpt trace "lon" - Latitudes |> DynObj.setValueOpt trace "lat" - Below |> DynObj.setValueOpt trace "below" - Connectgaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - Fillcolor |> DynObj.setValueOpt trace "fillcolor" - - trace - ) - - static member ChoroplethMapbox - ( - ?Z : seq<#IConvertible>, - ?GeoJson, - ?FeatureIdKey : string, - ?Locations : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?Below : string, - ?Colorscale : StyleParam.Colorscale, - ?ColorBar : ColorBar, - ?Showscale : bool, - ?ZAuto : bool, - ?ZMin : float, - ?ZMid : float, - ?ZMax : float - ) = - (fun (trace:('T :> Trace)) -> - - Z |> DynObj.setValueOpt trace "z" - GeoJson |> DynObj.setValueOpt trace "geojson" - FeatureIdKey|> DynObj.setValueOpt trace "featureidkey" - Locations |> DynObj.setValueOpt trace "locations" - Text |> DynObj.setValueOpt trace "text" - Below |> DynObj.setValueOpt trace "below" - Colorscale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert - ColorBar |> DynObj.setValueOpt trace "colorbar" - Showscale |> DynObj.setValueOpt trace "showscale" - ZAuto |> DynObj.setValueOpt trace "zauto" - ZMin |> DynObj.setValueOpt trace "zmin" - ZMid |> DynObj.setValueOpt trace "zmid" - ZMax |> DynObj.setValueOpt trace "zmax" - - trace - ) - - static member DensityMapbox - ( - ?Z : seq<#IConvertible>, - ?Radius : float, - ?Longitudes : #IConvertible seq, - ?Latitudes : #IConvertible seq, - ?Opacity : float, - ?Text : seq<#IConvertible>, - ?Below : string, - ?Colorscale : StyleParam.Colorscale, - ?ColorBar : ColorBar, - ?Showscale : bool, - ?ZAuto : bool, - ?ZMin : float, - ?ZMid : float, - ?ZMax : float - - ) = - (fun (trace:('T :> Trace)) -> - - Z |> DynObj.setValueOpt trace "z" - Radius |> DynObj.setValueOpt trace "radius" - Longitudes |> DynObj.setValueOpt trace "lon" - Latitudes |> DynObj.setValueOpt trace "lat" - Opacity |> DynObj.setValueOpt trace "opacity" - Text |> DynObj.setValueOpt trace "text" - Below |> DynObj.setValueOpt trace "below" - Colorscale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert - ColorBar |> DynObj.setValueOpt trace "colorbar" - Showscale |> DynObj.setValueOpt trace "showscale" - ZAuto |> DynObj.setValueOpt trace "zauto" - ZMin |> DynObj.setValueOpt trace "zmin" - ZMid |> DynObj.setValueOpt trace "zmid" - ZMax |> DynObj.setValueOpt trace "zmax" - - trace - ) - - static member ScatterPolar - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Mode : StyleParam.Mode, - ?Ids : seq<#IConvertible>, - ?R : seq<#IConvertible>, - ?R0 : IConvertible, - ?DR : IConvertible, - ?Theta : seq<#IConvertible>, - ?Theta0 : #IConvertible, - ?DTheta : #IConvertible, - ?ThetaUnit : StyleParam.AngularUnit, - ?Text : seq<#IConvertible>, - ?TextPosition : StyleParam.TextInfoPosition, - ?TextTemplate : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : seq<#IConvertible>, - ?Meta : seq<#IConvertible>, - ?CustomData : seq<#IConvertible>, - ?Subplot : string, - ?Marker : Marker, - ?Line : Line, - ?TextFont : Font, - ?SelectedPoints : seq<#IConvertible>, - ?Selected : Selection, - ?Unselected : Selection, - ?ClipOnAxis : bool, - ?ConnectGaps : bool, - ?Fill : StyleParam.Fill, - ?FillColor : string, - ?HoverLabel : Hoverlabel, - ?HoverOn : string, - ?UIRevision : seq<#IConvertible> - ) = - (fun (trace:('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert - Ids |> DynObj.setValueOpt trace "ids" - R |> DynObj.setValueOpt trace "r" - R0 |> DynObj.setValueOpt trace "r0" - DR |> DynObj.setValueOpt trace "dr" - Theta |> DynObj.setValueOpt trace "theta" - Theta0 |> DynObj.setValueOpt trace "theta0" - DTheta |> DynObj.setValueOpt trace "dtheta" - ThetaUnit |> DynObj.setValueOptBy trace "thetaunit" StyleParam.AngularUnit.convert - Text |> DynObj.setValueOpt trace "text" - TextPosition |> DynObj.setValueOptBy trace "textposition" StyleParam.TextInfoPosition.convert - TextTemplate |> DynObj.setValueOpt trace "texttemplate" - HoverText |> DynObj.setValueOpt trace "hovertext" - HoverInfo |> DynObj.setValueOpt trace "hoverinfo" - HoverTemplate |> DynObj.setValueOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Subplot |> DynObj.setValueOpt trace "subplot" - Marker |> DynObj.setValueOpt trace "marker" - Line |> DynObj.setValueOpt trace "line" - TextFont |> DynObj.setValueOpt trace "textfont" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" - ConnectGaps |> DynObj.setValueOpt trace "connectgaps" - Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert - FillColor |> DynObj.setValueOpt trace "fillcolor" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - HoverOn |> DynObj.setValueOpt trace "hoveron" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace - ) - - - static member BarPolar - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?Base : #IConvertible, - ?R : seq<#IConvertible>, - ?R0 : IConvertible, - ?DR : IConvertible, - ?Theta : seq<#IConvertible>, - ?Theta0 : #IConvertible, - ?DTheta : #IConvertible, - ?ThetaUnit : StyleParam.AngularUnit, - ?Width : #IConvertible, - ?Offset : #IConvertible, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : seq<#IConvertible>, - ?Meta : seq<#IConvertible>, - ?CustomData : seq<#IConvertible>, - ?Subplot : string, - ?Marker : Marker, - ?SelectedPoints : seq<#IConvertible>, - ?Selected : Selection, - ?Unselected : Selection, - ?HoverLabel : Hoverlabel, - ?UIRevision : seq<#IConvertible> - ) = - (fun (trace:('T :> Trace)) -> - - Name |> DynObj.setValueOpt trace "name" - Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt trace "showlegend" - LegendRank |> DynObj.setValueOpt trace "legendrank" - LegendGroup |> DynObj.setValueOpt trace "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" - Opacity |> DynObj.setValueOpt trace "opacity" - Ids |> DynObj.setValueOpt trace "ids" - Base |> DynObj.setValueOpt trace "base" - R |> DynObj.setValueOpt trace "r" - R0 |> DynObj.setValueOpt trace "r0" - DR |> DynObj.setValueOpt trace "dr" - Theta |> DynObj.setValueOpt trace "theta" - Theta0 |> DynObj.setValueOpt trace "theta0" - DTheta |> DynObj.setValueOpt trace "dtheta" - ThetaUnit |> DynObj.setValueOptBy trace "thetaunit" StyleParam.AngularUnit.convert - Width |> DynObj.setValueOpt trace "width" - Offset |> DynObj.setValueOpt trace "offset" - Text |> DynObj.setValueOpt trace "text" - HoverText |> DynObj.setValueOpt trace "hovertext" - HoverInfo |> DynObj.setValueOpt trace "hoverinfo" - HoverTemplate |> DynObj.setValueOpt trace "hovertemplate" - Meta |> DynObj.setValueOpt trace "meta" - CustomData |> DynObj.setValueOpt trace "customdata" - Subplot |> DynObj.setValueOpt trace "subplot" - Marker |> DynObj.setValueOpt trace "marker" - SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" - Selected |> DynObj.setValueOpt trace "selected" - Unselected |> DynObj.setValueOpt trace "unselected" - HoverLabel |> DynObj.setValueOpt trace "hoverlabel" - UIRevision |> DynObj.setValueOpt trace "uirevision" - - trace - ) - - diff --git a/src/Plotly.NET/Trace3d.fs b/src/Plotly.NET/Trace3d.fs deleted file mode 100644 index e9e7ea11e..000000000 --- a/src/Plotly.NET/Trace3d.fs +++ /dev/null @@ -1,1078 +0,0 @@ -namespace Plotly.NET - -open DynamicObj -open System - -/// Trace type inherits from dynamic object -type Trace3d (traceTypeName) = - inherit Trace (traceTypeName) - - -[] -module Trace3d = - //TO-DO: we need to think about if all subgroups of traces should be seperate, e.g. also "TraceFinance" or leave it at the current separation - //------------------------------------------------------------------------------------------------------------------------------------------------- - //3D - - ///initializes a trace of type "scatter3d" applying the givin trace styling function - let initScatter3d (applyStyle:Trace3d->Trace3d) = - Trace3d("scatter3d") |> applyStyle - - ///initializes a trace of type "surface" applying the givin trace styling function - let initSurface (applyStyle:Trace3d->Trace3d) = - Trace3d("surface") |> applyStyle - - ///initializes a trace of type "mesh3d" applying the givin trace styling function - let initMesh3d (applyStyle:Trace3d->Trace3d) = - Trace3d("mesh3d") |> applyStyle - - ///initializes a trace of type "cone" applying the givin trace styling function - let initCone (applyStyle:Trace3d->Trace3d) = - Trace3d("cone") |> applyStyle - - ///initializes a trace of type "streamtube" applying the givin trace styling function - let initStreamTube (applyStyle:Trace3d->Trace3d) = - Trace3d("streamtube") |> applyStyle - - ///initializes a trace of type "volume" applying the givin trace styling function - let initVolume (applyStyle:Trace3d->Trace3d) = - Trace3d("volume") |> applyStyle - - ///initializes a trace of type "isosurface" applying the givin trace styling function - let initIsoSurface (applyStyle:Trace3d->Trace3d) = - Trace3d("isosurface") |> applyStyle - - - //------------------------------------------------------------------------------------------------------------------------------------------------- - /// Functions provide the styling of the Chart objects - type Trace3dStyle() = - - // ######################## 3d-Charts - - static member setScene - ( - ?SceneName:string - ) = - fun (trace:Trace3d) -> - SceneName |> DynObj.setValueOpt trace "scene" - trace - - /// - /// Applies the style parameters of the Scatter3d chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the legend group title - /// Sets the opacity of the trace. - /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is "lines+markers". Otherwise, "lines". - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the x coordinates. - /// Sets the y coordinates. - /// Sets the z coordinates. - /// Sets the surface fill color. - /// Sets text elements associated with each (x,y,z) triplet. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y,z) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. - /// Template string used for rendering the information text that appear on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. - /// Sets text elements associated with each (x,y,z) triplet. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y,z) coordinates. To be seen, trace `hoverinfo` must contain a "text" flag. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat`. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// Sets the marker of this trace. - /// Sets the line of this trace. - /// Sets the text font of this trace. - /// Sets the x Error of this trace. - /// Sets the y Error of this trace. - /// Sets the z Error of this trace. - /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. - /// Sets the hoverlabel of this trace. - /// Sets the projection of this trace. - /// If "-1", the scatter points are not fill with a surface If "0", "1", "2", the scatter points are filled with a Delaunay surface about the x, y, z respectively. - /// Sets the calendar system to use with `x` date data. - /// Sets the calendar system to use with `y` date data. - /// Sets the calendar system to use with `z` date data. - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member Scatter3d - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Mode : StyleParam.Mode, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#IConvertible>, - ?SurfaceColor : string, - ?Text : seq<#IConvertible>, - ?TextPosition : StyleParam.TextPosition, - ?TextTemplate : string, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?Meta : string, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?Marker : Marker, - ?Line : Line, - ?TextFont : Font, - ?ErrorX : Error, - ?ErrorY : Error, - ?ErrorZ : Error, - ?ConnectGaps : bool, - ?Hoverlabel : Hoverlabel, - ?Projection : Projection, - ?Surfaceaxis : StyleParam.SurfaceAxis, - ?XCalendar : StyleParam.Calendar, - ?YCalendar : StyleParam.Calendar, - ?ZCalendar : StyleParam.Calendar, - ?UIRevision : string - ) = - - (fun (scatter: #Trace) -> - - Name |> DynObj.setValueOpt scatter "name" - Visible |> DynObj.setValueOptBy scatter "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt scatter "showlegend" - LegendRank |> DynObj.setValueOpt scatter "legendrank" - LegendGroup |> DynObj.setValueOpt scatter "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt scatter "legendgrouptitle" - Mode |> DynObj.setValueOptBy scatter "mode" StyleParam.Mode.convert - Opacity |> DynObj.setValueOpt scatter "opacity" - Ids |> DynObj.setValueOpt scatter "ids" - X |> DynObj.setValueOpt scatter "x" - Y |> DynObj.setValueOpt scatter "y" - Z |> DynObj.setValueOpt scatter "z" - SurfaceColor |> DynObj.setValueOpt scatter "surfacecolor" - Text |> DynObj.setValueOpt scatter "text" - TextPosition |> DynObj.setValueOptBy scatter "textposition" StyleParam.TextPosition.convert - TextTemplate |> DynObj.setValueOpt scatter "texttemplate" - HoverText |> DynObj.setValueOpt scatter "hovertext" - HoverInfo |> DynObj.setValueOpt scatter "hoverinfo" - HoverTemplate |> DynObj.setValueOpt scatter "hovertemplate" - XHoverFormat |> DynObj.setValueOpt scatter "xhoverformat" - YHoverFormat |> DynObj.setValueOpt scatter "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt scatter "zhoverformat" - Meta |> DynObj.setValueOpt scatter "meta" - CustomData |> DynObj.setValueOpt scatter "customdata" - Scene |> DynObj.setValueOptBy scatter "scene" StyleParam.SubPlotId.convert - Marker |> DynObj.setValueOpt scatter "marker" - Line |> DynObj.setValueOpt scatter "line" - TextFont |> DynObj.setValueOpt scatter "textfont" - ErrorX |> DynObj.setValueOpt scatter "errorx" - ErrorY |> DynObj.setValueOpt scatter "errory" - ErrorZ |> DynObj.setValueOpt scatter "errorz" - ConnectGaps |> DynObj.setValueOpt scatter "connectgaps" - Hoverlabel |> DynObj.setValueOpt scatter "hoverlabel" - Projection |> DynObj.setValueOpt scatter "projection" - Surfaceaxis |> DynObj.setValueOptBy scatter "surfaceaxis" StyleParam.SurfaceAxis.convert - XCalendar |> DynObj.setValueOptBy scatter "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy scatter "ycalendar" StyleParam.Calendar.convert - ZCalendar |> DynObj.setValueOptBy scatter "zcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt scatter "uirevision" - - scatter - ) - - - - /// - /// Applies the style parameters of the surface chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the legend group title for this trace. - /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the x coordinates. - /// Sets the y coordinates. - /// Sets the z coordinates. - /// Sets the surface color values, used for setting a color scale independent of `z`. - /// Sets the text elements associated with each z value. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Same as `text`. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat`. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// 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. - /// Sets the colorbar of this trace. - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not the color domain is computed with respect to the input data (here z or surfacecolor) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as z or surfacecolor. Has no effect when `cauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmin` must be set as well. - /// Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data are filled in. - /// Sets the contours of this trace. - /// Determines whether or not a surface is drawn. For example, set `hidesurface` to "false" `contours.x.show` to "true" and `contours.y.show` to "true" to draw a wire frame plot. - /// Sets the hoverlabel style of this trace. - /// Sets the Lighting style of this trace. - /// Sets the LightPosition style of this trace. - /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. - /// Sets the calendar system to use with `x` date data. - /// Sets the calendar system to use with `y` date data. - /// Sets the calendar system to use with `z` date data. - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member Surface - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#seq<#IConvertible>>, - ?SurfaceColor : string, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?Meta : string, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?ColorAxis : StyleParam.SubPlotId, - ?ColorBar : ColorBar, - ?AutoColorScale : bool, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool, - ?CAuto : bool, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?ConnectGaps : bool, - ?Contours : Contours, - ?HideSurface : bool, - ?Hoverlabel : Hoverlabel, - ?Lighting : Lighting, - ?LightPosition : LightPosition, - ?OpacityScale : seq<#seq<#IConvertible>>, - ?XCalendar : StyleParam.Calendar, - ?YCalendar : StyleParam.Calendar, - ?ZCalendar : StyleParam.Calendar, - ?UIRevision : string - ) = - (fun (surface: #Trace) -> - - Name |> DynObj.setValueOpt surface "name" - Visible |> DynObj.setValueOptBy surface "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt surface "showlegend" - LegendRank |> DynObj.setValueOpt surface "legendrank" - LegendGroup |> DynObj.setValueOpt surface "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt surface "legendgrouptitle" - Opacity |> DynObj.setValueOpt surface "opacity" - Ids |> DynObj.setValueOpt surface "ids" - X |> DynObj.setValueOpt surface "x" - Y |> DynObj.setValueOpt surface "y" - Z |> DynObj.setValueOpt surface "z" - SurfaceColor |> DynObj.setValueOpt surface "surfacecolor" - Text |> DynObj.setValueOpt surface "text" - HoverText |> DynObj.setValueOpt surface "hovertext" - HoverInfo |> DynObj.setValueOpt surface "hoverinfo" - HoverTemplate |> DynObj.setValueOpt surface "hovertemplate" - XHoverFormat |> DynObj.setValueOpt surface "xhoverformat" - YHoverFormat |> DynObj.setValueOpt surface "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt surface "zhoverformat" - Meta |> DynObj.setValueOpt surface "meta" - CustomData |> DynObj.setValueOpt surface "customdata" - Scene |> DynObj.setValueOptBy surface "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy surface "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt surface "colorbar" - AutoColorScale |> DynObj.setValueOpt surface "autocolorscale" - ColorScale |> DynObj.setValueOptBy surface "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt surface "showscale" - ReverseScale |> DynObj.setValueOpt surface "reversescale" - CAuto |> DynObj.setValueOpt surface "cauto" - CMin |> DynObj.setValueOpt surface "cmin" - CMid |> DynObj.setValueOpt surface "cmid" - CMax |> DynObj.setValueOpt surface "cmax" - ConnectGaps |> DynObj.setValueOpt surface "connectgaps" - Contours |> DynObj.setValueOpt surface "contours" - HideSurface |> DynObj.setValueOpt surface "hidesurface" - Hoverlabel |> DynObj.setValueOpt surface "hoverlabel" - Lighting |> DynObj.setValueOpt surface "lighting" - LightPosition |> DynObj.setValueOpt surface "lightposition" - OpacityScale |> DynObj.setValueOpt surface "opacityscale" - XCalendar |> DynObj.setValueOptBy surface "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy surface "ycalendar" StyleParam.Calendar.convert - ZCalendar |> DynObj.setValueOptBy surface "zcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt surface "uirevision" - - surface - ) - - - /// - /// Applies the style parameters of the mesh3d chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the legend group title for this trace. - /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. - /// Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. - /// Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. - /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "first" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle. - /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "second" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle. - /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "third" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle. - /// Sets the color of each face Overrides "color" and "vertexcolor". - /// Sets the intensity values for vertices or cells as defined by `intensitymode`. It can be used for plotting fields on meshes. - /// Determines the source of `intensity` values. - /// Sets the color of each vertex Overrides "color". While Red, green and blue colors are in the range of 0 and 255; in the case of having vertex color data in RGBA format, the alpha color should be normalized to be between 0 and 1. - /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Same as `text`. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat`. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// 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. - /// Sets the colorbar of this trace. - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not the color domain is computed with respect to the input data (here z or surfacecolor) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as z or surfacecolor. Has no effect when `cauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmin` must be set as well. - /// Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied. For general use of `mesh3d` it is preferred that `i`, `j`, `k` are supplied. If "-1", Delaunay triangulation is used, which is mainly suitable if the mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`. In case the `delaunayaxis` intersects the mesh surface at more than one point it will result triangles that are very long in the dimension of `delaunayaxis`. If ">0", the alpha-shape algorithm is used. In this case, the positive `alphahull` value signals the use of the alpha-shape algorithm, _and_ its value acts as the parameter for the mesh fitting. If "0", the convex-hull algorithm is used. It is suitable for convex bodies or if the intention is to enclose the `x`, `y` and `z` point set into a convex hull. - /// Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the Delaunay triangulation. It has an effect if `i`, `j`, `k` are not provided and `alphahull` is set to indicate Delaunay triangulation. - /// Sets the contour of this trace - /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. - /// Sets the hoverlabel style of this trace. - /// Sets the Lighting style of this trace. - /// Sets the LightPosition style of this trace. - /// Sets the calendar system to use with `x` date data. - /// Sets the calendar system to use with `y` date data. - /// Sets the calendar system to use with `z` date data. - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member Mesh3d - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#IConvertible>, - ?I : seq<#IConvertible>, - ?J : seq<#IConvertible>, - ?K : seq<#IConvertible>, - ?FaceColor : seq<#IConvertible>, - ?Intensity : seq<#IConvertible>, - ?IntensityMode : StyleParam.IntensityMode, - ?VertexColor : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?Meta : string, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?ColorAxis : StyleParam.SubPlotId, - ?ColorBar : ColorBar, - ?AutoColorScale : bool, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool, - ?CAuto : bool, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?AlphaHull : float, - ?Delaunayaxis : StyleParam.Delaunayaxis, - ?Contour : Contour, - ?FlatShading : bool, - ?Hoverlabel : Hoverlabel, - ?Lighting : Lighting, - ?LightPosition : LightPosition, - ?XCalendar : StyleParam.Calendar, - ?YCalendar : StyleParam.Calendar, - ?ZCalendar : StyleParam.Calendar, - ?UIRevision : string - ) = - - fun (mesh3d: #Trace) -> - - Name |> DynObj.setValueOpt mesh3d "name" - Visible |> DynObj.setValueOptBy mesh3d "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt mesh3d "showlegend" - LegendRank |> DynObj.setValueOpt mesh3d "legendrank" - LegendGroup |> DynObj.setValueOpt mesh3d "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt mesh3d "legendgrouptitle" - Opacity |> DynObj.setValueOpt mesh3d "opacity" - Ids |> DynObj.setValueOpt mesh3d "ids" - X |> DynObj.setValueOpt mesh3d "x" - Y |> DynObj.setValueOpt mesh3d "y" - Z |> DynObj.setValueOpt mesh3d "z" - I |> DynObj.setValueOpt mesh3d "i" - J |> DynObj.setValueOpt mesh3d "j" - K |> DynObj.setValueOpt mesh3d "k" - FaceColor |> DynObj.setValueOpt mesh3d "facecolor" - Intensity |> DynObj.setValueOpt mesh3d "intensity" - IntensityMode |> DynObj.setValueOptBy mesh3d "intensitymode" StyleParam.IntensityMode.convert - VertexColor |> DynObj.setValueOpt mesh3d "vertexcolor" - Text |> DynObj.setValueOpt mesh3d "text" - HoverText |> DynObj.setValueOpt mesh3d "hovertext" - HoverInfo |> DynObj.setValueOpt mesh3d "hoverinfo" - HoverTemplate |> DynObj.setValueOpt mesh3d "hovertemplate" - XHoverFormat |> DynObj.setValueOpt mesh3d "xhoverformat" - YHoverFormat |> DynObj.setValueOpt mesh3d "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt mesh3d "zhoverformat" - Meta |> DynObj.setValueOpt mesh3d "meta" - CustomData |> DynObj.setValueOpt mesh3d "customdata" - Scene |> DynObj.setValueOptBy mesh3d "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy mesh3d "coloraxis" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt mesh3d "colorbar" - AutoColorScale |> DynObj.setValueOpt mesh3d "autocolorscale" - ColorScale |> DynObj.setValueOptBy mesh3d "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt mesh3d "showscale" - ReverseScale |> DynObj.setValueOpt mesh3d "reversescale" - CAuto |> DynObj.setValueOpt mesh3d "cauto" - CMin |> DynObj.setValueOpt mesh3d "cmin" - CMid |> DynObj.setValueOpt mesh3d "cmid" - CMax |> DynObj.setValueOpt mesh3d "cmax" - AlphaHull |> DynObj.setValueOpt mesh3d "alphahull" - Delaunayaxis |> DynObj.setValueOptBy mesh3d "delaunayaxis" StyleParam.Delaunayaxis.convert - Contour |> DynObj.setValueOpt mesh3d "contour" - FlatShading |> DynObj.setValueOpt mesh3d "flatshading" - Hoverlabel |> DynObj.setValueOpt mesh3d "hoverlabel" - Lighting |> DynObj.setValueOpt mesh3d "lighting" - LightPosition |> DynObj.setValueOpt mesh3d "lightposition" - XCalendar |> DynObj.setValueOptBy mesh3d "xcalendar" StyleParam.Calendar.convert - YCalendar |> DynObj.setValueOptBy mesh3d "ycalendar" StyleParam.Calendar.convert - ZCalendar |> DynObj.setValueOptBy mesh3d "zcalendar" StyleParam.Calendar.convert - UIRevision |> DynObj.setValueOpt mesh3d "uirevision" - - mesh3d - - - /// - /// Applies the style parameters of the cone chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the legend group title for this trace. - /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the x coordinates of the vector field and of the displayed cones. - /// Sets the y coordinates of the vector field and of the displayed cones. - /// Sets the z coordinates of the vector field and of the displayed cones. - /// Sets the x components of the vector field. - /// Sets the y components of the vector field. - /// Sets the z components of the vector field. - /// Sets the text elements associated with the cones. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Same as `text`. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` - /// Sets the hover text formatting rulefor `u` 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.By default the values are formatted using generic number format. - /// Sets the hover text formatting rulefor `v` 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.By default the values are formatted using generic number format. - /// Sets the hover text formatting rulefor `w` 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.By default the values are formatted using generic number format. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// 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. - /// Sets the ColorBar object associated with the color scale of the cones - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not the color domain is computed with respect to the input data (here u/v/w norm) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the upper bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmin` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as u/v/w norm. Has no effect when `cauto` is `false`. - /// Sets the lower bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmax` must be set as well. - /// Sets the cones' anchor with respect to their x/y/z positions. Note that "cm" denote the cone's center of mass which corresponds to 1/4 from the tail to tip. - /// Sets the hover labels of this cone trace. - /// Sets the Lighting of this cone trace. - /// Sets the LightPosition of this cone trace. - /// Determines whether `sizeref` is set as a "scaled" (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as "absolute" value (in the same units as the vector field). - /// Adjusts the cone size scaling. The size of the cones is determined by their u/v/w norm multiplied a factor and `sizeref`. This factor (computed internally) corresponds to the minimum "time" to travel across two successive x/y/z positions at the average velocity of those two successive positions. All cones in a given trace use the same factor. With `sizemode` set to "scaled", `sizeref` is unitless, its default value is "0.5" With `sizemode` set to "absolute", `sizeref` has the same units as the u/v/w vector field, its the default value is half the sample's maximum vector norm. - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member Cone - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#IConvertible>, - ?U : seq<#IConvertible>, - ?V : seq<#IConvertible>, - ?W : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?UHoverFormat : string, - ?VHoverFormat : string, - ?WHoverFormat : string, - ?Meta : seq<#IConvertible>, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?ColorAxis : StyleParam.SubPlotId, - ?ColorBar : ColorBar, - ?AutoColorScale : bool, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool, - ?CAuto : bool, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?Anchor : StyleParam.ConeAnchor, - ?HoverLabel : Hoverlabel, - ?Lighting : Lighting, - ?LightPosition : LightPosition, - ?SizeMode : StyleParam.ConeSizeMode, - ?SizeRef : float, - ?UIRevision : seq<#IConvertible> - - ) = - (fun (cone: #Trace) -> - Name |> DynObj.setValueOpt cone "name" - Visible |> DynObj.setValueOptBy cone "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt cone "showlegend" - LegendRank |> DynObj.setValueOpt cone "legendrank" - LegendGroup |> DynObj.setValueOpt cone "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt cone "legendgrouptitle" - Opacity |> DynObj.setValueOpt cone "opacity" - Ids |> DynObj.setValueOpt cone "ids" - X |> DynObj.setValueOpt cone "x" - Y |> DynObj.setValueOpt cone "y" - Z |> DynObj.setValueOpt cone "z" - U |> DynObj.setValueOpt cone "u" - V |> DynObj.setValueOpt cone "v" - W |> DynObj.setValueOpt cone "w" - Text |> DynObj.setValueOpt cone "text" - HoverText |> DynObj.setValueOpt cone "hovertext" - HoverInfo |> DynObj.setValueOpt cone "hoverinfo" - HoverTemplate |> DynObj.setValueOpt cone "hovertemplate" - XHoverFormat |> DynObj.setValueOpt cone "xhoverformat" - YHoverFormat |> DynObj.setValueOpt cone "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt cone "zhoverformat" - UHoverFormat |> DynObj.setValueOpt cone "uhoverformat" - VHoverFormat |> DynObj.setValueOpt cone "vhoverformat" - WHoverFormat |> DynObj.setValueOpt cone "whoverformat" - Meta |> DynObj.setValueOpt cone "meta" - CustomData |> DynObj.setValueOpt cone "customdata" - Scene |> DynObj.setValueOptBy cone "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy cone "scene" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt cone "colorbar" - AutoColorScale |> DynObj.setValueOpt cone "autocolorscale" - ColorScale |> DynObj.setValueOptBy cone "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt cone "showscale" - ReverseScale |> DynObj.setValueOpt cone "reversescale" - CAuto |> DynObj.setValueOpt cone "cauto" - CMin |> DynObj.setValueOpt cone "cmin" - CMid |> DynObj.setValueOpt cone "cmid" - CMax |> DynObj.setValueOpt cone "cmax" - Anchor |> DynObj.setValueOptBy cone "anchor" StyleParam.ConeAnchor.convert - HoverLabel |> DynObj.setValueOpt cone "hoverlabel" - Lighting |> DynObj.setValueOpt cone "lighting" - LightPosition |> DynObj.setValueOpt cone "lightposition" - SizeMode |> DynObj.setValueOptBy cone "sizemode" StyleParam.ConeSizeMode.convert - SizeRef |> DynObj.setValueOpt cone "sizeref" - UIRevision |> DynObj.setValueOpt cone "uirevision" - - cone - ) - - /// - /// Applies the style parameters of the streamtube chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the legend group title for this trace. - /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the x coordinates of the vector field. - /// Sets the y coordinates of the vector field. - /// Sets the z coordinates of the vector field. - /// Sets the x components of the vector field. - /// Sets the y components of the vector field. - /// Sets the z components of the vector field. - /// Sets a text element associated with this trace. If trace `hoverinfo` contains a "text" flag, this text element will be seen in all hover labels. Note that streamtube traces do not support array `text` values. - /// Same as `text`. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` - /// Sets the hover text formatting rulefor `u` 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.By default the values are formatted using generic number format. - /// Sets the hover text formatting rulefor `v` 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.By default the values are formatted using generic number format. - /// Sets the hover text formatting rulefor `w` 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.By default the values are formatted using generic number format. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// 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. - /// Sets the ColorBar object associated with the color scale of the streamtubes - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not the color domain is computed with respect to the input data (here u/v/w norm) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the upper bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmin` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as u/v/w norm. Has no effect when `cauto` is `false`. - /// Sets the lower bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmax` must be set as well. - /// Sets the hover labels of this trace. - /// Sets the Lighting of this trace. - /// Sets the LightPosition of this trace. - /// The maximum number of displayed segments in a streamtube. - /// The scaling factor for the streamtubes. The default is 1, which avoids two max divergence tubes from touching at adjacent starting positions. - /// Sets the streamtube starting positions - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member StreamTube - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#IConvertible>, - ?U : seq<#IConvertible>, - ?V : seq<#IConvertible>, - ?W : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?UHoverFormat : string, - ?VHoverFormat : string, - ?WHoverFormat : string, - ?Meta : seq<#IConvertible>, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?ColorAxis : StyleParam.SubPlotId, - ?ColorBar : ColorBar, - ?AutoColorScale : bool, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool, - ?CAuto : bool, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?HoverLabel : Hoverlabel, - ?Lighting : Lighting, - ?LightPosition : LightPosition, - ?MaxDisplayed : int, - ?SizeRef : float, - ?Starts : StreamTubeStarts, - ?UIRevision : seq<#IConvertible> - - ) = - (fun (streamTube: #Trace) -> - Name |> DynObj.setValueOpt streamTube "name" - Visible |> DynObj.setValueOptBy streamTube "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt streamTube "showlegend" - LegendRank |> DynObj.setValueOpt streamTube "legendrank" - LegendGroup |> DynObj.setValueOpt streamTube "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt streamTube "legendgrouptitle" - Opacity |> DynObj.setValueOpt streamTube "opacity" - Ids |> DynObj.setValueOpt streamTube "ids" - X |> DynObj.setValueOpt streamTube "x" - Y |> DynObj.setValueOpt streamTube "y" - Z |> DynObj.setValueOpt streamTube "z" - U |> DynObj.setValueOpt streamTube "u" - V |> DynObj.setValueOpt streamTube "v" - W |> DynObj.setValueOpt streamTube "w" - Text |> DynObj.setValueOpt streamTube "text" - HoverText |> DynObj.setValueOpt streamTube "hovertext" - HoverInfo |> DynObj.setValueOpt streamTube "hoverinfo" - HoverTemplate |> DynObj.setValueOpt streamTube "hovertemplate" - XHoverFormat |> DynObj.setValueOpt streamTube "xhoverformat" - YHoverFormat |> DynObj.setValueOpt streamTube "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt streamTube "zhoverformat" - UHoverFormat |> DynObj.setValueOpt streamTube "uhoverformat" - VHoverFormat |> DynObj.setValueOpt streamTube "vhoverformat" - WHoverFormat |> DynObj.setValueOpt streamTube "whoverformat" - Meta |> DynObj.setValueOpt streamTube "meta" - CustomData |> DynObj.setValueOpt streamTube "customdata" - Scene |> DynObj.setValueOptBy streamTube "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy streamTube "scene" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt streamTube "colorbar" - AutoColorScale |> DynObj.setValueOpt streamTube "autocolorscale" - ColorScale |> DynObj.setValueOptBy streamTube "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt streamTube "showscale" - ReverseScale |> DynObj.setValueOpt streamTube "reversescale" - CAuto |> DynObj.setValueOpt streamTube "cauto" - CMin |> DynObj.setValueOpt streamTube "cmin" - CMid |> DynObj.setValueOpt streamTube "cmid" - CMax |> DynObj.setValueOpt streamTube "cmax" - HoverLabel |> DynObj.setValueOpt streamTube "hoverlabel" - Lighting |> DynObj.setValueOpt streamTube "lighting" - LightPosition |> DynObj.setValueOpt streamTube "lightposition" - MaxDisplayed |> DynObj.setValueOpt streamTube "maxdisplayed" - SizeRef |> DynObj.setValueOpt streamTube "sizeref" - Starts |> DynObj.setValueOpt streamTube "starts" - UIRevision |> DynObj.setValueOpt streamTube "uirevision" - - streamTube - ) - - /// - /// Applies the style parameters of the volume chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the title of the legendgroup - /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the X coordinates of the vertices on X axis. - /// Sets the Y coordinates of the vertices on Y axis. - /// Sets the Z coordinates of the vertices on Z axis. - /// Sets the 4th dimension (value) of the vertices. - /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Same as `text`. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` - /// Sets the hover text formatting rulefor `value` 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.By default the values are formatted using generic number format. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// 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. - /// Sets the colorbar of this trace - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not the color domain is computed with respect to the input data (here `value`) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as `value` and if set, `cmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as `value`. Has no effect when `cauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as `value` and if set, `cmin` must be set as well. - /// Sets the caps of this trace caps (color-coded surfaces on the sides of the visualization domain) - /// Sets the contour of this trace. - /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. - /// Sets the hover labels of this trace. - /// Sets the maximum boundary for iso-surface plot. - /// Sets the minimum boundary for iso-surface plot. - /// Sets the Lighting of this trace. - /// Sets the LightPosition of this trace. - /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. - /// Sets slices through the volume - /// Sets the SpaceFrame of this trace. - /// Sets the Surface of this trace. - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member Volume - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#IConvertible>, - ?Value : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?ValueHoverFormat : string, - ?Meta : seq<#IConvertible>, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?ColorAxis : StyleParam.SubPlotId, - ?ColorBar : ColorBar, - ?AutoColorScale : bool, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool, - ?CAuto : bool, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?Caps : Caps, - ?Contour : Contour, - ?FlatShading : bool, - ?HoverLabel : Hoverlabel, - ?IsoMax : float, - ?IsoMin : float, - ?Lighting : Lighting, - ?LightPosition : LightPosition, - ?OpacityScale : seq<#seq<#IConvertible>>, - ?Slices : Slices, - ?SpaceFrame : Spaceframe, - ?Surface : Surface, - ?UIRevision : seq<#IConvertible> - ) = - fun (volume: #Trace) -> - - Name |> DynObj.setValueOpt volume "name" - Visible |> DynObj.setValueOptBy volume "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt volume "showlegend" - LegendRank |> DynObj.setValueOpt volume "legendrank" - LegendGroup |> DynObj.setValueOpt volume "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt volume "legendgrouptitle" - Opacity |> DynObj.setValueOpt volume "opacity" - Ids |> DynObj.setValueOpt volume "ids" - X |> DynObj.setValueOpt volume "x" - Y |> DynObj.setValueOpt volume "y" - Z |> DynObj.setValueOpt volume "z" - Value |> DynObj.setValueOpt volume "value" - Text |> DynObj.setValueOpt volume "text" - HoverText |> DynObj.setValueOpt volume "hovertext" - HoverInfo |> DynObj.setValueOpt volume "hoverinfo" - HoverTemplate |> DynObj.setValueOpt volume "hovertemplate" - XHoverFormat |> DynObj.setValueOpt volume "xhoverformat" - YHoverFormat |> DynObj.setValueOpt volume "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt volume "zhoverformat" - ValueHoverFormat |> DynObj.setValueOpt volume "valuehoverformat" - Meta |> DynObj.setValueOpt volume "meta" - CustomData |> DynObj.setValueOpt volume "customdata" - Scene |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt volume "colorbar" - AutoColorScale |> DynObj.setValueOpt volume "autocolorscale" - ColorScale |> DynObj.setValueOptBy volume "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt volume "showscale" - ReverseScale |> DynObj.setValueOpt volume "reversescale" - CAuto |> DynObj.setValueOpt volume "cauto" - CMin |> DynObj.setValueOpt volume "cmin" - CMid |> DynObj.setValueOpt volume "cmid" - CMax |> DynObj.setValueOpt volume "cmax" - Caps |> DynObj.setValueOpt volume "caps" - Contour |> DynObj.setValueOpt volume "contour" - FlatShading |> DynObj.setValueOpt volume "flatshading" - HoverLabel |> DynObj.setValueOpt volume "hoverlabel" - IsoMax |> DynObj.setValueOpt volume "isomax" - IsoMin |> DynObj.setValueOpt volume "isomin" - Lighting |> DynObj.setValueOpt volume "lighting" - LightPosition |> DynObj.setValueOpt volume "lightposition" - OpacityScale |> DynObj.setValueOpt volume "opacityscale" - Slices |> DynObj.setValueOpt volume "slices" - SpaceFrame |> DynObj.setValueOpt volume "spaceframe" - Surface |> DynObj.setValueOpt volume "surface" - UIRevision |> DynObj.setValueOpt volume "uirevision" - - volume - - /// - /// Applies the style parameters of the isosurface chart to the given trace - /// - /// Sets the trace name. The trace name appear as the legend item and on hover. - /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). - /// Determines whether or not an item corresponding to this trace is shown in the legend. - /// Sets the legend rank for this trace. 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. - /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. - /// Sets the title of the legendgroup - /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. - /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. - /// Sets the X coordinates of the vertices on X axis. - /// Sets the Y coordinates of the vertices on Y axis. - /// Sets the Z coordinates of the vertices on Z axis. - /// Sets the 4th dimension (value) of the vertices. - /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. - /// Same as `text`. - /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. - /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. - /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. - /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. - /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` - /// Sets the hover text formatting rulefor `value` 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.By default the values are formatted using generic number format. - /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. - /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements - /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. - /// 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. - /// Sets the colorbar of this trace - /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. - /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. - /// Determines whether or not a colorbar is displayed for this trace. - /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. - /// Determines whether or not the color domain is computed with respect to the input data (here `value`) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. - /// Sets the lower bound of the color domain. Value should have the same units as `value` and if set, `cmax` must be set as well. - /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as `value`. Has no effect when `cauto` is `false`. - /// Sets the upper bound of the color domain. Value should have the same units as `value` and if set, `cmin` must be set as well. - /// Sets the caps of this trace caps (color-coded surfaces on the sides of the visualization domain) - /// Sets the contour of this trace. - /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. - /// Sets the hover labels of this trace. - /// Sets the maximum boundary for iso-surface plot. - /// Sets the minimum boundary for iso-surface plot. - /// Sets the Lighting of this trace. - /// Sets the LightPosition of this trace. - /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. - /// Sets slices through the volume - /// Sets the SpaceFrame of this trace. - /// Sets the Surface of this trace. - /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. - static member IsoSurface - ( - ?Name : string, - ?Visible : StyleParam.Visible, - ?ShowLegend : bool, - ?LegendRank : int, - ?LegendGroup : string, - ?LegendGroupTitle : Title, - ?Opacity : float, - ?Ids : seq<#IConvertible>, - ?X : seq<#IConvertible>, - ?Y : seq<#IConvertible>, - ?Z : seq<#IConvertible>, - ?Value : seq<#IConvertible>, - ?Text : seq<#IConvertible>, - ?HoverText : seq<#IConvertible>, - ?HoverInfo : string, - ?HoverTemplate : string, - ?XHoverFormat : string, - ?YHoverFormat : string, - ?ZHoverFormat : string, - ?ValueHoverFormat : string, - ?Meta : seq<#IConvertible>, - ?CustomData : seq<#IConvertible>, - ?Scene : StyleParam.SubPlotId, - ?ColorAxis : StyleParam.SubPlotId, - ?ColorBar : ColorBar, - ?AutoColorScale : bool, - ?ColorScale : StyleParam.Colorscale, - ?ShowScale : bool, - ?ReverseScale : bool, - ?CAuto : bool, - ?CMin : float, - ?CMid : float, - ?CMax : float, - ?Caps : Caps, - ?Contour : Contour, - ?FlatShading : bool, - ?HoverLabel : Hoverlabel, - ?IsoMax : float, - ?IsoMin : float, - ?Lighting : Lighting, - ?LightPosition : LightPosition, - ?OpacityScale : seq<#seq<#IConvertible>>, - ?Slices : Slices, - ?SpaceFrame : Spaceframe, - ?Surface : Surface, - ?UIRevision : seq<#IConvertible> - ) = - fun (volume: #Trace) -> - - Name |> DynObj.setValueOpt volume "name" - Visible |> DynObj.setValueOptBy volume "visible" StyleParam.Visible.convert - ShowLegend |> DynObj.setValueOpt volume "showlegend" - LegendRank |> DynObj.setValueOpt volume "legendrank" - LegendGroup |> DynObj.setValueOpt volume "legendgroup" - LegendGroupTitle |> DynObj.setValueOpt volume "legendgrouptitle" - Opacity |> DynObj.setValueOpt volume "opacity" - Ids |> DynObj.setValueOpt volume "ids" - X |> DynObj.setValueOpt volume "x" - Y |> DynObj.setValueOpt volume "y" - Z |> DynObj.setValueOpt volume "z" - Value |> DynObj.setValueOpt volume "value" - Text |> DynObj.setValueOpt volume "text" - HoverText |> DynObj.setValueOpt volume "hovertext" - HoverInfo |> DynObj.setValueOpt volume "hoverinfo" - HoverTemplate |> DynObj.setValueOpt volume "hovertemplate" - XHoverFormat |> DynObj.setValueOpt volume "xhoverformat" - YHoverFormat |> DynObj.setValueOpt volume "yhoverformat" - ZHoverFormat |> DynObj.setValueOpt volume "zhoverformat" - ValueHoverFormat |> DynObj.setValueOpt volume "valuehoverformat" - Meta |> DynObj.setValueOpt volume "meta" - CustomData |> DynObj.setValueOpt volume "customdata" - Scene |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert - ColorAxis |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert - ColorBar |> DynObj.setValueOpt volume "colorbar" - AutoColorScale |> DynObj.setValueOpt volume "autocolorscale" - ColorScale |> DynObj.setValueOptBy volume "colorscale" StyleParam.Colorscale.convert - ShowScale |> DynObj.setValueOpt volume "showscale" - ReverseScale |> DynObj.setValueOpt volume "reversescale" - CAuto |> DynObj.setValueOpt volume "cauto" - CMin |> DynObj.setValueOpt volume "cmin" - CMid |> DynObj.setValueOpt volume "cmid" - CMax |> DynObj.setValueOpt volume "cmax" - Caps |> DynObj.setValueOpt volume "caps" - Contour |> DynObj.setValueOpt volume "contour" - FlatShading |> DynObj.setValueOpt volume "flatshading" - HoverLabel |> DynObj.setValueOpt volume "hoverlabel" - IsoMax |> DynObj.setValueOpt volume "isomax" - IsoMin |> DynObj.setValueOpt volume "isomin" - Lighting |> DynObj.setValueOpt volume "lighting" - LightPosition |> DynObj.setValueOpt volume "lightposition" - OpacityScale |> DynObj.setValueOpt volume "opacityscale" - Slices |> DynObj.setValueOpt volume "slices" - SpaceFrame |> DynObj.setValueOpt volume "spaceframe" - Surface |> DynObj.setValueOpt volume "surface" - UIRevision |> DynObj.setValueOpt volume "uirevision" - - volume diff --git a/src/Plotly.NET/Bins.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs similarity index 90% rename from src/Plotly.NET/Bins.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs index e2eeef14f..862af6a18 100644 --- a/src/Plotly.NET/Bins.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Bins.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System /// Bin type inherits from dynamic object type Bins () = diff --git a/src/Plotly.NET/Box.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Box.fs similarity index 93% rename from src/Plotly.NET/Box.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Box.fs index a6f2705d0..7bf4f68cb 100644 --- a/src/Plotly.NET/Box.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Box.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Caps.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs similarity index 93% rename from src/Plotly.NET/Caps.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs index c1d1eaeb3..94f3d22c4 100644 --- a/src/Plotly.NET/Caps.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Caps.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Contours.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs similarity index 98% rename from src/Plotly.NET/Contours.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs index bdb60ab2e..a55eb5ddd 100644 --- a/src/Plotly.NET/Contours.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Contours.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System type ContourProject () = inherit DynamicObj () diff --git a/src/Plotly.NET/Cumulative.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs similarity index 96% rename from src/Plotly.NET/Cumulative.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs index 0b91838c5..7df59fd8f 100644 --- a/src/Plotly.NET/Cumulative.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Cumulative.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System //enabled (boolean) //If true, display the cumulative distribution by summing the binned values. Use the `direction` and `centralbin` attributes to tune the accumulation method. Note: in this mode, the "density" `histnorm` settings behave the same as their equivalents without "density": "" and "density" both rise to the number of data points, and "probability" and "probability density" both rise to the number of sample points. diff --git a/src/Plotly.NET/Dimensions.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs similarity index 96% rename from src/Plotly.NET/Dimensions.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs index fbb4a5527..6d344b715 100644 --- a/src/Plotly.NET/Dimensions.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Dimensions.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Error.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Error.fs similarity index 98% rename from src/Plotly.NET/Error.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Error.fs index 345103ed8..e15489606 100644 --- a/src/Plotly.NET/Error.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Error.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/FunnelConnector.fs b/src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs similarity index 92% rename from src/Plotly.NET/FunnelConnector.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs index 541cfa485..00536df13 100644 --- a/src/Plotly.NET/FunnelConnector.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/FunnelConnector.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System /// Styles for connector lines in Funnel Charts. /// diff --git a/src/Plotly.NET/Lighting.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs similarity index 98% rename from src/Plotly.NET/Lighting.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs index 1547e454e..a4f742ac5 100644 --- a/src/Plotly.NET/Lighting.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Lighting.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Marker.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs similarity index 98% rename from src/Plotly.NET/Marker.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs index 07dd90de4..351c8f4d7 100644 --- a/src/Plotly.NET/Marker.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Marker.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Meanline.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Meanline.fs similarity index 92% rename from src/Plotly.NET/Meanline.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Meanline.fs index bd4bca512..85e91a2d9 100644 --- a/src/Plotly.NET/Meanline.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Meanline.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Pathbar.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs similarity index 96% rename from src/Plotly.NET/Pathbar.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs index 0e4dce767..d70e489a0 100644 --- a/src/Plotly.NET/Pathbar.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Pathbar.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Projection.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs similarity index 95% rename from src/Plotly.NET/Projection.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs index 4c3e592e1..f7bec886b 100644 --- a/src/Plotly.NET/Projection.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Projection.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Selection.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Selection.fs similarity index 96% rename from src/Plotly.NET/Selection.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Selection.fs index e1862a499..c3080f81d 100644 --- a/src/Plotly.NET/Selection.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Selection.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System type MarkerSelectionStyle() = inherit DynamicObj () diff --git a/src/Plotly.NET/Slices.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs similarity index 95% rename from src/Plotly.NET/Slices.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs index b6932e319..f31a2ed0f 100644 --- a/src/Plotly.NET/Slices.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Slices.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/SpaceFrame.fs b/src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs similarity index 88% rename from src/Plotly.NET/SpaceFrame.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs index 61121d408..766d3187a 100644 --- a/src/Plotly.NET/SpaceFrame.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/SpaceFrame.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/StockData.fs b/src/Plotly.NET/Traces/ObjectAbstractions/StockData.fs similarity index 85% rename from src/Plotly.NET/StockData.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/StockData.fs index cbb3ddc44..f24a14f4a 100644 --- a/src/Plotly.NET/StockData.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/StockData.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System type StockData = { diff --git a/src/Plotly.NET/StreamTubeStarts.fs b/src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs similarity index 95% rename from src/Plotly.NET/StreamTubeStarts.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs index 56f31a47d..cef3053fa 100644 --- a/src/Plotly.NET/StreamTubeStarts.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/StreamTubeStarts.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Surface.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs similarity index 92% rename from src/Plotly.NET/Surface.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs index 54939d219..d3723b77a 100644 --- a/src/Plotly.NET/Surface.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Surface.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/Table.fs b/src/Plotly.NET/Traces/ObjectAbstractions/Table.fs similarity index 97% rename from src/Plotly.NET/Table.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/Table.fs index 499036203..625fa976c 100644 --- a/src/Plotly.NET/Table.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/Table.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/TreemapTiling.fs b/src/Plotly.NET/Traces/ObjectAbstractions/TreemapTiling.fs similarity index 97% rename from src/Plotly.NET/TreemapTiling.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/TreemapTiling.fs index 913f6a1be..fd4e26ebc 100644 --- a/src/Plotly.NET/TreemapTiling.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/TreemapTiling.fs @@ -1,5 +1,7 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj open System diff --git a/src/Plotly.NET/WaterfallConnector.fs b/src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs similarity index 93% rename from src/Plotly.NET/WaterfallConnector.fs rename to src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs index be524d1e9..4dab3c767 100644 --- a/src/Plotly.NET/WaterfallConnector.fs +++ b/src/Plotly.NET/Traces/ObjectAbstractions/WaterfallConnector.fs @@ -1,6 +1,9 @@ -namespace Plotly.NET +namespace Plotly.NET.TraceObjects +open Plotly.NET +open Plotly.NET.LayoutObjects open DynamicObj +open System /// Styles for connector lines in Waterfall Charts. /// diff --git a/src/Plotly.NET/Traces/Trace.fs b/src/Plotly.NET/Traces/Trace.fs new file mode 100644 index 000000000..4d9db255a --- /dev/null +++ b/src/Plotly.NET/Traces/Trace.fs @@ -0,0 +1,268 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + +/// Trace type inherits from dynamic object +type Trace (traceTypeName) = + inherit DynamicObj () + //interface ITrace with + // Implictit ITrace + member val ``type`` = traceTypeName with get,set + +//------------------------------------------------------------------------------------------------------------------------------------------------- +/// Functions provide the styling of the Chart objects +/// These functions are used internally to style traces of Chart objects. Users are usually pointed +/// to the API layer provided by the `Chart` module/object +type TraceStyle() = + /// Applies the given TraceInfo style parameters to a Trace object. + static member TraceInfo + ( + ?Name: string, + ?Visible: StyleParam.Visible, + ?Showlegend: bool, + ?Legendgroup:string, + ?Opacity: float, + ?Uid: string, + ?Hoverinfo: string + //?Stream: Stream + + ) = + (fun (trace:('T :> Trace)) -> + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.toString + Showlegend |> DynObj.setValueOpt trace "showlegend" + Legendgroup |> DynObj.setValueOpt trace "legendgroup" + Opacity |> DynObj.setValueOpt trace "opacity" + Uid |> DynObj.setValueOpt trace "uid" + Hoverinfo |> DynObj.setValueOpt trace "hoverinfo" + // Update + //Stream: Stream + + // out -> + trace + ) + + /// Sets the given axis anchor id(s) on a Trace object. + static member SetAxisAnchor + ( + ?X:StyleParam.LinearAxisId, + ?Y:StyleParam.LinearAxisId + ) = + (fun (trace:('T :> Trace)) -> + + X |> DynObj.setValueOptBy trace "xaxis" StyleParam.LinearAxisId.toString + Y |> DynObj.setValueOptBy trace "yaxis" StyleParam.LinearAxisId.toString + + trace + ) + + /// Sets selection of data points on a Trace object. + static member SetSelection + ( + ?Selectedpoints, + ?Selected, + ?UnSelected + ) = + (fun (trace:('T :> Trace)) -> + + Selectedpoints |> DynObj.setValueOpt trace "Selectedpoints" + Selected |> DynObj.setValueOpt trace "Selected" + UnSelected |> DynObj.setValueOpt trace "UnSelected" + + trace + ) + + + /// Sets the given text label styles on a Trace object. + static member TextLabel + ( + ?Text : seq<#IConvertible>, + ?Textposition: StyleParam.TextPosition, + ?Textfont: Font, + ?Textsrc : string, + ?Textpositionsrc : string + + ) = + (fun (trace:('T :> Trace)) -> + Text |> DynObj.setValueOpt trace "text" + Textposition |> DynObj.setValueOptBy trace "textposition" StyleParam.TextPosition.toString + Textsrc |> DynObj.setValueOpt trace "textsrc" + Textpositionsrc |> DynObj.setValueOpt trace "textpositionsrc" + Textfont |> DynObj.setValueOpt trace "textfont" + + // out -> + trace + ) + + + /// Sets the given line on a Trace object. + static member SetLine + ( + line:Line + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("line", line) + trace + ) + + + /// Sets the given Line styles on the line property of a Trace object + static member Line + ( + ?Width: float, + ?Color: string, + ?Shape: StyleParam.Shape, + ?Dash: StyleParam.DrawingStyle, + ?Smoothing: float, + ?Colorscale : StyleParam.Colorscale + ) = + (fun (trace:('T :> Trace)) -> + let line = + match (trace.TryGetValue "line") with + | Some line -> line :?> Line + | None -> Line.init() + |> Line.style(?Width=Width,?Color=Color,?Shape=Shape,?Dash=Dash,?Smoothing=Smoothing,?Colorscale=Colorscale) + + trace.SetValue("line", line) + trace + ) + + + /// Sets the given marker on a Trace object. + static member SetMarker + ( + marker:Marker + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("marker", marker) + trace + ) + + + /// Sets the given Marker styles on the marker property of a Trace object + static member Marker + ( + ?Size: int, + ?Opacity: float, + ?Color: string, + ?Symbol: StyleParam.Symbol, + ?MultiSizes: seq<#IConvertible>, + ?Line: Line, + ?ColorBar: ColorBar, + ?Colorscale : StyleParam.Colorscale, + ?Colors: seq, + ?OutlierColor:string, + ?Maxdisplayed: int, + ?Sizeref: float, + ?Sizemin: float, + ?Sizemode: StyleParam.MarkerSizeMode, + ?Cauto: bool, + ?Cmax: float, + ?Cmin: float, + ?Cmid: float, + ?Autocolorscale: bool, + ?Reversescale: bool, + ?Showscale: bool + + ) = + (fun (trace:('T :> Trace)) -> + let marker = + match (trace.TryGetValue "marker") with + | Some m -> m :?> Marker + | None -> Marker () + + |> Marker.style(?Size=Size,?Color=Color,?Symbol=Symbol, + ?Opacity=Opacity,?MultiSizes=MultiSizes,?Line=Line, + ?ColorBar=ColorBar,?Colorscale=Colorscale,?Colors=Colors,?OutlierColor=OutlierColor, + ?Maxdisplayed=Maxdisplayed,?Sizeref=Sizeref,?Sizemin=Sizemin, + ?Sizemode=Sizemode,?Cauto=Cauto,?Cmax=Cmax,?Cmin=Cmin,?Cmid=Cmid, + ?Autocolorscale=Autocolorscale,?Reversescale=Reversescale,?Showscale=Showscale + ) + + trace.SetValue("marker", marker) + trace + + ) + + + + + /// Sets the given domain on a Trace object. + static member SetDomain + ( + domain:Domain + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("domain", domain) + trace + ) + + /// Sets the given Domain styles on the domain property of a Trace object + static member Domain + ( + ?X : StyleParam.Range, + ?Y : StyleParam.Range, + ?Row : int, + ?Column: int + ) = + (fun (trace:('T :> Trace)) -> + let domain = + match (trace.TryGetValue "domain") with + | Some m -> m :?> Domain + | None -> Domain () + + |> Domain.style(?X=X,?Y=Y,?Row=Row,?Column=Column) + + trace.SetValue("domain", domain) + trace + ) + + // Sets the X-Error an a Trace object. + static member SetErrorX + ( + error:Error + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("error_x", error) + trace + ) + + // Sets Y-Error() to TraceObjects + static member SetErrorY + ( + error:Error + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("error_y", error) + trace + ) + + // Sets Z-Error() to TraceObjects + static member SetErrorZ + ( + error:Error + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("error_z", error) + trace + ) + + // Sets Stackgroup() to TraceObjects + static member SetStackGroup + ( + stackgroup: string + ) = + (fun (trace:('T :> Trace)) -> + + trace.SetValue("stackgroup", stackgroup) + trace + ) \ No newline at end of file diff --git a/src/Plotly.NET/Traces/Trace2D.fs b/src/Plotly.NET/Traces/Trace2D.fs new file mode 100644 index 000000000..25646fd1f --- /dev/null +++ b/src/Plotly.NET/Traces/Trace2D.fs @@ -0,0 +1,922 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + +/// The most commonly-used kind of subplot is a two-dimensional Cartesian subplot. Traces compatible with these subplots +/// support xaxis and yaxis attributes whose values must refer to corresponding objects in the layout portion of the figure. +/// For example, if xaxis="x", and yaxis="y" (which is the default) then this trace is drawn on the subplot at the intersection +/// of the axes configured under layout.xaxis and layout.yaxis, but if xaxis="x2" and yaxis="y3" then the trace is drawn at the +/// intersection of the axes configured under layout.xaxis2 and layout.yaxis3. Note that attributes such as layout.xaxis and +/// layout.xaxis2 etc do not have to be explicitly defined, in which case default values will be inferred. Multiple traces of +/// different types can be drawn on the same subplot. +/// +/// X- and Y-axes support the type attribute, which enables them to represent continuous values (type="linear", type="log"), +/// temporal values (type="date") or categorical values (type="category", type="multicategory). Axes can also be overlaid on +/// top of one another to create dual-axis or multiple-axis charts. 2-d cartesian subplots lend themselves very well to creating +/// "small multiples" figures, also known as facet or trellis plots. +/// +/// The following trace types are compatible with 2d-cartesian subplots via the xaxis and yaxis attributes: +/// +/// - scatter-like trace types: scatter and scattergl can be used to draw scatter plots, line plots and curves, time-series plots, +/// bubble charts, dot plots and filled areas and also support error bars +/// +/// - bar, funnel, waterfall: bar-like trace types which can also be used to draw timelines and Gantt charts +/// +/// - histogram: an aggregating bar-like trace type +/// +/// - box and violin: 1-dimensional distribution-like trace types +/// +/// - histogram2d and histogram2dcontour: 2-dimensional distribution-like density trace types +/// +/// - image, heatmap and contour: matrix trace types +/// +/// - ohlc and candlestick: stock-like trace types +/// +/// - splom: multi-dimensional scatter plots which implicitly refer to many 2-d cartesian subplots at once. + + +type Trace2D(traceTypeName) = + + inherit Trace (traceTypeName) + + ///initializes a trace of type "scatter" applying the given trace styling function + static member initScatter (applyStyle: Trace2D -> Trace2D) = + Trace2D("scatter") |> applyStyle + + ///initializes a trace of type "scattergl" applying the given trace styling function + static member initScatterGL (applyStyle: Trace2D -> Trace2D) = + Trace2D("scattergl") |> applyStyle + + ///initializes a trace of type "bar" applying the given trace styling function + static member initBar (applyStyle: Trace2D -> Trace2D) = + Trace2D("bar") |> applyStyle + + ///initializes a trace of type "funnel" applying the given trace styling function + static member initFunnel (applyStyle: Trace2D -> Trace2D) = + Trace2D("funnel") |> applyStyle + + ///initializes a trace of type "waterfall" applying the given trace styling function + static member initWaterfall (applyStyle: Trace2D -> Trace2D) = + Trace2D("waterfall") |> applyStyle + + ///initializes a trace of type "histogram" applying the given trace styling function + static member initHistogram (applyStyle: Trace2D -> Trace2D) = + Trace2D("histogram") |> applyStyle + + ///initializes a trace of type "box" applying the given trace styling function + static member initBoxPlot (applyStyle: Trace2D -> Trace2D) = + Trace2D("box") |> applyStyle + + ///initializes a trace of type "violin" applying the given trace styling function + static member initViolin (applyStyle: Trace2D -> Trace2D) = + Trace2D("violin") |> applyStyle + + ///initializes a trace of type "histogram2d" applying the given trace styling function + static member initHistogram2d (applyStyle: Trace2D -> Trace2D) = + Trace2D("histogram2d") |> applyStyle + + ///initializes a trace of type "histogram2dcontour" applying the given trace styling function + static member initHistogram2dContour (applyStyle: Trace2D -> Trace2D) = + Trace2D("histogram2dcontour") |> applyStyle + + ///initializes a trace of type "image" applying the given trace styling function + static member initImage (applyStyle: Trace2D -> Trace2D) = + Trace2D("image") |> applyStyle + + ///initializes a trace of type "heatmap" applying the given trace styling function + static member initHeatmap (applyStyle: Trace2D -> Trace2D) = + Trace2D("heatmap") |> applyStyle + + ///initializes a trace of type "heatmapgl" applying the given trace styling function + static member initHeatmapGL (applyStyle: Trace2D -> Trace2D) = + Trace2D("heatmapgl") |> applyStyle + + ///initializes a trace of type "contour" applying the given trace styling function + static member initContour (applyStyle: Trace2D -> Trace2D) = + Trace2D("contour") |> applyStyle + + ///initializes a trace of type "ohlc" applying the given trace styling function + static member initOHLC (applyStyle: Trace2D -> Trace2D) = + Trace2D("ohlc") |> applyStyle + + ///initializes a trace of type "candlestick" applying the given trace styling function + static member initCandlestick (applyStyle: Trace2D -> Trace2D) = + Trace2D("candlestick") |> applyStyle + + ///initializes a trace of type "SPLOM" applying the given trace styling function + static member initSplom (applyStyle: Trace2D -> Trace2D) = + Trace2D("splom") |> applyStyle + + +type Trace2DStyle() = + + /// Create a function that applies the styles of a scatter plot to a Trace object + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Determines the drawing mode for this scatter trace. + /// Sets the area to fill with a solid color + /// Sets the color applied to the fill area + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// 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 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 + /// Sets vertical error bars for this this scatter trace. + /// Sets horizontal error bars for this this scatter trace. + static member Scatter + ( + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Mode : StyleParam.Mode, + ?Fill : StyleParam.Fill, + ?Fillcolor : string, + ?Connectgaps: bool, + ?StackGroup : string, + ?Orientation: StyleParam.Orientation, + ?GroupNorm : StyleParam.GroupNorm, + ?Error_y : Error, + ?Error_x : Error + ) = + (fun (trace:('T :> Trace)) -> + + X |> DynObj.setValueOpt trace "x" + Y |> DynObj.setValueOpt trace "y" + Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.toString + Connectgaps |> DynObj.setValueOpt trace "connectgaps" + StackGroup |> DynObj.setValueOpt trace "stackgroup" + Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert + GroupNorm |> DynObj.setValueOptBy trace "groupnorm" StyleParam.GroupNorm.convert + Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.toString + Fillcolor |> DynObj.setValueOpt trace "fillcolor" + Error_x |> DynObj.setValueOpt trace "error_x" + Error_y |> DynObj.setValueOpt trace "error_y" + + trace + ) + + /// Create a function that applies the styles of a bar plot to a Trace object + /// Sets the x coordinates of the plotted data. + /// Sets the y coordinates of the plotted data. + /// Sets Marker + /// Sets the stacking direction. Only relevant when `stackgroup` is used, and only the first `orientation` found in the `stackgroup` will be used. + /// [Legacy] used for polar charts. Will be removed when adding the new polar charts. + /// [Legacy] used for polar charts. Will be removed when adding the new polar charts. + /// Sets vertical error bars for this this scatter trace. + /// Sets horizontal error bars for this this scatter trace. + static member Bar + ( + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Marker : Marker, + ?R : seq<#IConvertible>, + ?T : seq<#IConvertible>, + ?Error_y: Error, + ?Error_x: Error, + ?Orientation + ) = + (fun (bar:('T :> Trace)) -> + X |> DynObj.setValueOpt bar "x" + Y |> DynObj.setValueOpt bar "y" + R |> DynObj.setValueOpt bar "r" + T |> DynObj.setValueOpt bar "t" + Orientation |> DynObj.setValueOptBy bar "orientation" StyleParam.Orientation.convert + + // Update + Marker |> DynObj.setValueOpt bar "marker" + Error_x |> DynObj.setValueOpt bar "error_x" + Error_y |> DynObj.setValueOpt bar "error_y" + + // out -> + bar + + ) + + static member Funnel + ( + x : seq<#IConvertible>, + y : seq<#IConvertible>, + ?x0, + ?dX : float, + ?y0, + ?dY : float, + ?Width : float, + ?Offset : float, + ?Orientation : StyleParam.Orientation, + ?Alignmentgroup : string, + ?Offsetgroup : string, + ?Cliponaxis : bool, + ?Connector : FunnelConnector, + ?Insidetextfont : Font, + ?Outsidetextfont: Font + ) = + (fun (trace:('T :> Trace)) -> + + x |> DynObj.setValue trace "x" + y |> DynObj.setValue trace "y" + x0 |> DynObj.setValueOpt trace "x0" + dX |> DynObj.setValueOpt trace "dx" + y0 |> DynObj.setValueOpt trace "y0" + dY |> DynObj.setValueOpt trace "dy" + Width |> DynObj.setValueOpt trace "width" + Offset |> DynObj.setValueOpt trace "offset" + Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert + Alignmentgroup |> DynObj.setValueOpt trace "alignmentgroup" + Offsetgroup |> DynObj.setValueOpt trace "offsetgroup" + Cliponaxis |> DynObj.setValueOpt trace "cliponaxis" + Connector |> DynObj.setValueOpt trace "connector" + Insidetextfont |> DynObj.setValueOpt trace "insidetextfont" + Outsidetextfont |> DynObj.setValueOpt trace "outsidetextfont" + + trace + + ) + + + /// Applies the styles of candlestick plot to TraceObjects + /// + /// Parameters: + /// + /// x : Sets the x coordinates. + /// + /// y : Sets the y coordinates. + /// + /// Base : Sets where the bar base is drawn (in position axis units). + /// + /// Width : Sets the bar width (in position axis units). + /// + /// Measure : An array containing types of values. By default the values are considered as 'relative'. However; it is possible to use 'total' to compute the sums. Also 'absolute' could be applied to reset the computed total or to declare an initial value where needed. + /// + /// Orientation : Sets the orientation of the bars. With "v" ("h"), the value of the each bar spans along the vertical (horizontal). + /// + /// Connector : Sets the styling of the connector lines + /// + /// AlignmentGroup : 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. + /// + /// OffsetGroup : 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. + /// + /// Offset : Shifts the position where the bar is drawn (in position axis units). In "group" barmode, traces that set "offset" will be excluded and drawn in "overlay" mode instead. + static member Waterfall + ( + x : #IConvertible seq, + y : #IConvertible seq, + ?Base : #IConvertible, + ?Width : float, + ?Measure : StyleParam.WaterfallMeasure seq, + ?Orientation : StyleParam.Orientation, + ?Connector : WaterfallConnector, + ?AlignmentGroup : string, + ?OffsetGroup : string, + ?Offset + + ) = + (fun (trace:('T :> Trace)) -> + + x |> DynObj.setValue trace "x" + y |> DynObj.setValue trace "y" + Base |> DynObj.setValueOpt trace "base" + Width |> DynObj.setValueOpt trace "width" + Measure |> DynObj.setValueOptBy trace "measure" (Seq.map StyleParam.WaterfallMeasure.convert) + Orientation |> DynObj.setValueOptBy trace "orientation" StyleParam.Orientation.convert + AlignmentGroup |> DynObj.setValueOpt trace "alignmentgroup" + Connector |> DynObj.setValueOpt trace "connector" + OffsetGroup |> DynObj.setValueOpt trace "offsetgroup" + Offset |> DynObj.setValueOpt trace "offset" + + trace + ) + + + // Applies the styles of histogram to TraceObjects + static member Histogram + ( + ?X : seq<#IConvertible> , + ?Y : seq<#IConvertible> , + ?Text : seq , + ?xAxis , + ?yAxis , + ?Xsrc , + ?Ysrc , + ?Orientation , + ?HistFunc , + ?HistNorm , + ?Cumulative : Cumulative , + + + ?Autobinx : bool , + ?nBinsx : int , + ?xBins : Bins , + ?Autobiny : bool , + ?nBinsy : int , + ?yBins : Bins , + ?Marker : Marker , + + ?xError : Error , + ?yError : Error + + + + ) = + (fun (histogram:('T :> Trace)) -> + + X |> DynObj.setValueOpt histogram "x" + Y |> DynObj.setValueOpt histogram "y" + Text |> DynObj.setValueOpt histogram "text" + xAxis |> DynObj.setValueOpt histogram "xaxis" + yAxis |> DynObj.setValueOpt histogram "yaxis" + Xsrc |> DynObj.setValueOpt histogram "xsrc" + Ysrc |> DynObj.setValueOpt histogram "ysrc" + + Orientation |> DynObj.setValueOptBy histogram "orientation" StyleParam.Orientation.convert + HistFunc |> DynObj.setValueOptBy histogram "histfunc" StyleParam.HistFunc.convert + HistNorm |> DynObj.setValueOptBy histogram "histnorm" StyleParam.HistNorm.convert + Cumulative |> DynObj.setValueOpt histogram "cumulative" + + Autobinx |> DynObj.setValueOpt histogram "autobinx" + nBinsx |> DynObj.setValueOpt histogram "nbinsx" + xBins |> DynObj.setValueOpt histogram "xbins" + Autobiny |> DynObj.setValueOpt histogram "autobiny" + nBinsy |> DynObj.setValueOpt histogram "nbinsy" + yBins |> DynObj.setValueOpt histogram "ybins" + + // Update + Marker |> DynObj.setValueOpt histogram "marker" + xError |> DynObj.setValueOpt histogram "error_x" + yError |> DynObj.setValueOpt histogram "error_y" + + // out -> + histogram + ) + + // Applies the styles of box plot plot to TraceObjects + static member BoxPlot + ( + ?Y, + ?X, + ?X0, + ?Y0, + ?Whiskerwidth, + ?Boxpoints, + ?Boxmean, + ?Jitter, + ?Pointpos, + ?Orientation, + ?Fillcolor, + ?Marker:Marker, + ?Line:Line, + ?Alignmentgroup, + ?Offsetgroup, + ?Notched:bool, + ?NotchWidth:float, + ?QuartileMethod:StyleParam.QuartileMethod, + ?xAxis, + ?yAxis, + ?Ysrc, + ?Xsrc + + ) = + (fun (boxPlot:('T :> Trace)) -> + + Y |> DynObj.setValueOpt boxPlot "y" + X |> DynObj.setValueOpt boxPlot "x" + X0 |> DynObj.setValueOpt boxPlot "x0" + Y0 |> DynObj.setValueOpt boxPlot "y0" + Whiskerwidth |> DynObj.setValueOpt boxPlot "whiskerwidth" + Boxpoints |> DynObj.setValueOptBy boxPlot "boxpoints" StyleParam.Boxpoints.convert + Boxmean |> DynObj.setValueOptBy boxPlot "boxmean" StyleParam.BoxMean.convert + Jitter |> DynObj.setValueOpt boxPlot "jitter" + Pointpos |> DynObj.setValueOpt boxPlot "pointpos" + Orientation |> DynObj.setValueOptBy boxPlot "orientation" StyleParam.Orientation.convert + Fillcolor |> DynObj.setValueOpt boxPlot "fillcolor" + Marker |> DynObj.setValueOpt boxPlot "marker" + Line |> DynObj.setValueOpt boxPlot "line" + Alignmentgroup |> DynObj.setValueOpt boxPlot "alignmentgroup" + Offsetgroup |> DynObj.setValueOpt boxPlot "offsetgroup" + Notched |> DynObj.setValueOpt boxPlot "notched" + NotchWidth |> DynObj.setValueOpt boxPlot "notchwidth" + QuartileMethod |> DynObj.setValueOptBy boxPlot "quartilemethod" StyleParam.QuartileMethod.convert + + xAxis |> DynObj.setValueOpt boxPlot "xaxis" + yAxis |> DynObj.setValueOpt boxPlot "yaxis" + Ysrc |> DynObj.setValueOpt boxPlot "ysrc" + Xsrc |> DynObj.setValueOpt boxPlot "xsrc" + + // out -> + boxPlot + ) + + + // Applies the styles of violin plot plot to TraceObjects + static member Violin + ( + ?Y, + ?X, + ?X0, + ?Y0, + + ?Width, + ?Marker:Marker, + ?Line:Line, + ?Alignmentgroup, + ?Offsetgroup, + + ?Box:Box, + ?Bandwidth, + ?Meanline:Meanline, + ?Scalegroup, + ?Scalemode, + ?Side, + ?Span, + ?SpanMode, + ?Uirevision, + + + ?Points, + ?Jitter, + ?Pointpos, + ?Orientation, + ?Fillcolor, + ?xAxis, + ?yAxis, + ?Ysrc, + ?Xsrc + + ) = + (fun (boxPlot:('T :> Trace)) -> + + Y |> DynObj.setValueOpt boxPlot "y" + X |> DynObj.setValueOpt boxPlot "x" + X0 |> DynObj.setValueOpt boxPlot "x0" + Y0 |> DynObj.setValueOpt boxPlot "y0" + Points |> DynObj.setValueOptBy boxPlot "points" StyleParam.Jitterpoints.convert + Jitter |> DynObj.setValueOpt boxPlot "jitter" + Pointpos |> DynObj.setValueOpt boxPlot "pointpos" + Orientation |> DynObj.setValueOptBy boxPlot "orientation" StyleParam.Orientation.convert + Fillcolor |> DynObj.setValueOpt boxPlot "fillcolor" + + Width |> DynObj.setValueOpt boxPlot "width" + Marker |> DynObj.setValueOpt boxPlot "marker" + Line |> DynObj.setValueOpt boxPlot "line" + Alignmentgroup |> DynObj.setValueOpt boxPlot "alignmentgroup" + Offsetgroup |> DynObj.setValueOpt boxPlot "offsetgroup" + + Box |> DynObj.setValueOpt boxPlot "box" + Bandwidth |> DynObj.setValueOpt boxPlot "bandwidth" + Meanline |> DynObj.setValueOpt boxPlot "meanline" + Scalegroup |> DynObj.setValueOpt boxPlot "scalegroup" + Scalemode |> DynObj.setValueOpt boxPlot "scalemode" + Side |> DynObj.setValueOpt boxPlot "side" + Span |> DynObj.setValueOpt boxPlot "span" + SpanMode |> DynObj.setValueOpt boxPlot "spanmode" + Uirevision |> DynObj.setValueOpt boxPlot "uirevision" + + + xAxis |> DynObj.setValueOpt boxPlot "xaxis" + yAxis |> DynObj.setValueOpt boxPlot "yaxis" + Ysrc |> DynObj.setValueOpt boxPlot "ysrc" + Xsrc |> DynObj.setValueOpt boxPlot "xsrc" + + // out -> + boxPlot + ) + + + static member Histogram2d + ( + ?X : seq<#IConvertible> , + ?Y : seq<#IConvertible> , + ?Z : seq<#seq<#IConvertible>> , + ?X0 , + ?dX , + ?Y0 , + ?dY , + ?xType , + ?yType , + ?xAxis , + ?yAxis , + ?Zsrc , + ?Xsrc , + ?Ysrc , + + ?Marker : Marker , + ?Orientation , + //?Connectgaps : bool , + ?HistFunc , + ?HistNorm , + ?Autobinx : bool , + ?nBinsx : int , + ?xBins : Bins , + ?Autobiny : bool , + ?nBinsy : int , + ?yBins : Bins , + + ?Xgap , + ?Ygap , + ?Transpose , + ?zAuto , + ?zMin , + ?zMax , + ?Colorscale , + ?Autocolorscale , + ?Reversescale , + ?Showscale , + ?zSmooth , + ?ColorBar + + ) = + (fun (histogram2d:('T :> Trace)) -> + + Z |> DynObj.setValueOpt histogram2d "z" + X |> DynObj.setValueOpt histogram2d "x" + Y |> DynObj.setValueOpt histogram2d "y" + X0 |> DynObj.setValueOpt histogram2d "x0" + dX |> DynObj.setValueOpt histogram2d "dx" + Y0 |> DynObj.setValueOpt histogram2d "y0" + dY |> DynObj.setValueOpt histogram2d "dy" + xType |> DynObj.setValueOpt histogram2d "xtype" + yType |> DynObj.setValueOpt histogram2d "ytype" + xAxis |> DynObj.setValueOpt histogram2d "xaxis" + yAxis |> DynObj.setValueOpt histogram2d "yaxis" + Zsrc |> DynObj.setValueOpt histogram2d "zsrc" + Xsrc |> DynObj.setValueOpt histogram2d "xsrc" + Ysrc |> DynObj.setValueOpt histogram2d "ysrc" + + Orientation |> DynObj.setValueOptBy histogram2d "orientation" StyleParam.Orientation.convert + //Connectgaps |> DynObj.setValueOptBy histogram2d "connectgaps" StyleParam.Orientation.convert + HistFunc |> DynObj.setValueOptBy histogram2d "histfunc " StyleParam.HistFunc.convert + HistNorm |> DynObj.setValueOptBy histogram2d "histnorm " StyleParam.HistNorm.convert + Autobinx |> DynObj.setValueOpt histogram2d "autobinx" + nBinsx |> DynObj.setValueOpt histogram2d "nbinsx" + xBins |> DynObj.setValueOpt histogram2d "xbins" + Autobiny |> DynObj.setValueOpt histogram2d "autobiny" + nBinsy |> DynObj.setValueOpt histogram2d "nbinsy" + yBins |> DynObj.setValueOpt histogram2d "ybins" + + Xgap |> DynObj.setValueOpt histogram2d "xgap" + Ygap |> DynObj.setValueOpt histogram2d "ygap" + Transpose |> DynObj.setValueOpt histogram2d "transpose" + zAuto |> DynObj.setValueOpt histogram2d "zauto" + zMin |> DynObj.setValueOpt histogram2d "zmin" + zMax |> DynObj.setValueOpt histogram2d "zmax" + Colorscale |> DynObj.setValueOptBy histogram2d "colorscale" StyleParam.Colorscale.convert + Autocolorscale |> DynObj.setValueOpt histogram2d "autocolorscale" + Reversescale |> DynObj.setValueOpt histogram2d "reversescale" + Showscale |> DynObj.setValueOpt histogram2d "showscale" + zSmooth |> DynObj.setValueOptBy histogram2d "zsmooth" StyleParam.SmoothAlg.convert + ColorBar |> DynObj.setValueOpt histogram2d "colorbar" + + // Update + Marker |> DynObj.setValueOpt histogram2d "marker" + + // out -> + histogram2d + ) + + + static member Histogram2dContour + ( + ?X : seq<#IConvertible> , + ?Y : seq<#IConvertible> , + ?Z : seq<#seq<#IConvertible>> , + ?X0 , + ?dX , + ?Y0 , + ?dY , + ?xType , + ?yType , + ?xAxis , + ?yAxis , + ?Zsrc , + ?Xsrc , + ?Ysrc , + + ?Marker : Marker , + ?Orientation , + //?Connectgaps : bool , + ?HistFunc , + ?HistNorm , + ?Autobinx : bool , + ?nBinsx : int , + ?xBins : Bins , + ?Autobiny : bool , + ?nBinsy : int , + ?yBins : Bins , + + ?nContours : int , + ?Contours : Contour , + ?Line : Line , + + + ?Xgap , + ?Ygap , + ?Transpose , + ?zAuto , + ?zMin , + ?zMax , + ?Colorscale , + ?Autocolorscale , + ?Reversescale , + ?Showscale , + ?zSmooth , + ?ColorBar + + ) = + (fun (histogram2dContour:('T :> Trace)) -> + + Z |> DynObj.setValueOpt histogram2dContour "z" + X |> DynObj.setValueOpt histogram2dContour "x" + Y |> DynObj.setValueOpt histogram2dContour "y" + X0 |> DynObj.setValueOpt histogram2dContour "x0" + dX |> DynObj.setValueOpt histogram2dContour "dx" + Y0 |> DynObj.setValueOpt histogram2dContour "y0" + dY |> DynObj.setValueOpt histogram2dContour "dy" + xType |> DynObj.setValueOpt histogram2dContour "xtype" + yType |> DynObj.setValueOpt histogram2dContour "ytype" + xAxis |> DynObj.setValueOpt histogram2dContour "xaxis" + yAxis |> DynObj.setValueOpt histogram2dContour "yaxis" + Zsrc |> DynObj.setValueOpt histogram2dContour "zsrc" + Xsrc |> DynObj.setValueOpt histogram2dContour "xsrc" + Ysrc |> DynObj.setValueOpt histogram2dContour "ysrc" + + Orientation |> DynObj.setValueOptBy histogram2dContour "orientation" StyleParam.Orientation.convert + //Connectgaps |> DynObj.setValueOptBy histogram2dContour< "connectgaps" StyleParam.Orientation.convert + HistFunc |> DynObj.setValueOptBy histogram2dContour "histfunc " StyleParam.HistFunc.convert + HistNorm |> DynObj.setValueOptBy histogram2dContour "histnorm " StyleParam.HistNorm.convert + Autobinx |> DynObj.setValueOpt histogram2dContour "autobinx" + nBinsx |> DynObj.setValueOpt histogram2dContour "nbinsx" + xBins |> DynObj.setValueOpt histogram2dContour "xbins" + Autobiny |> DynObj.setValueOpt histogram2dContour "autobiny" + nBinsy |> DynObj.setValueOpt histogram2dContour "nbinsy" + yBins |> DynObj.setValueOpt histogram2dContour "ybins" + + nContours |> DynObj.setValueOpt histogram2dContour "ncontours" + Contours |> DynObj.setValueOpt histogram2dContour "contours" + Line |> DynObj.setValueOpt histogram2dContour "line" + Xgap |> DynObj.setValueOpt histogram2dContour "xgap" + Ygap |> DynObj.setValueOpt histogram2dContour "ygap" + Transpose |> DynObj.setValueOpt histogram2dContour "transpose" + zAuto |> DynObj.setValueOpt histogram2dContour "zauto" + zMin |> DynObj.setValueOpt histogram2dContour "zmin" + zMax |> DynObj.setValueOpt histogram2dContour "zmax" + Colorscale |> DynObj.setValueOptBy histogram2dContour "colorscale" StyleParam.Colorscale.convert + Autocolorscale |> DynObj.setValueOpt histogram2dContour "autocolorscale" + Reversescale |> DynObj.setValueOpt histogram2dContour "reversescale" + Showscale |> DynObj.setValueOpt histogram2dContour "showscale" + zSmooth |> DynObj.setValueOptBy histogram2dContour "zsmooth" StyleParam.SmoothAlg.convert + ColorBar |> DynObj.setValueOpt histogram2dContour "colorbar" + + // Update + Marker |> DynObj.setValueOpt histogram2dContour "marker" + + // out -> + histogram2dContour + ) + + + // Applies the styles of heatmap to TraceObjects + static member Heatmap + ( + ?Z : seq<#seq<#IConvertible>>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?X0 , + ?dX , + ?Y0 , + ?dY , + ?xType , + ?yType , + ?xAxis , + ?yAxis , + ?Zsrc , + ?Xsrc , + ?Ysrc , + + ?Xgap , + ?Ygap , + ?Transpose , + ?zAuto , + ?zMin , + ?zMax , + ?Colorscale , + ?Autocolorscale , + ?Reversescale , + ?Showscale , + ?zSmooth , + ?ColorBar + ) = + (fun (heatmap:('T :> Trace)) -> + + Z |> DynObj.setValueOpt heatmap "z" + X |> DynObj.setValueOpt heatmap "x" + Y |> DynObj.setValueOpt heatmap "y" + X0 |> DynObj.setValueOpt heatmap "x0" + dX |> DynObj.setValueOpt heatmap "dx" + Y0 |> DynObj.setValueOpt heatmap "y0" + dY |> DynObj.setValueOpt heatmap "dy" + xType |> DynObj.setValueOpt heatmap "xtype" + yType |> DynObj.setValueOpt heatmap "ytype" + xAxis |> DynObj.setValueOpt heatmap "xaxis" + yAxis |> DynObj.setValueOpt heatmap "yaxis" + Zsrc |> DynObj.setValueOpt heatmap "zsrc" + Xsrc |> DynObj.setValueOpt heatmap "xsrc" + Ysrc |> DynObj.setValueOpt heatmap "ysrc" + + Xgap |> DynObj.setValueOpt heatmap "xgap" + Ygap |> DynObj.setValueOpt heatmap "ygap" + Transpose |> DynObj.setValueOpt heatmap "transpose" + zAuto |> DynObj.setValueOpt heatmap "zauto" + zMin |> DynObj.setValueOpt heatmap "zmin" + zMax |> DynObj.setValueOpt heatmap "zmax" + Colorscale |> DynObj.setValueOptBy heatmap "colorscale" StyleParam.Colorscale.convert + Autocolorscale |> DynObj.setValueOpt heatmap "autocolorscale" + Reversescale |> DynObj.setValueOpt heatmap "reversescale" + Showscale |> DynObj.setValueOpt heatmap "showscale" + zSmooth |> DynObj.setValueOptBy heatmap "zsmooth" StyleParam.SmoothAlg.convert + ColorBar |> DynObj.setValueOpt heatmap "colorbar" + + // out -> + heatmap + ) + + + static member Contour + ( + ?Z : seq<#seq<#IConvertible>>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?X0 , + ?dX , + ?Y0 , + ?dY , + ?xType , + ?yType , + ?xAxis , + ?yAxis , + ?Zsrc , + ?Xsrc , + ?Ysrc , + + ?Xgap , + ?Ygap , + ?Transpose , + ?zAuto , + ?zMin , + ?zMax , + ?Colorscale , + ?Autocolorscale , + ?Reversescale , + ?Showscale , + ?zSmooth , + ?ColorBar + ) = + (fun (contour:('T :> Trace)) -> + + Z |> DynObj.setValueOpt contour "z" + X |> DynObj.setValueOpt contour "x" + Y |> DynObj.setValueOpt contour "y" + X0 |> DynObj.setValueOpt contour "x0" + dX |> DynObj.setValueOpt contour "dx" + Y0 |> DynObj.setValueOpt contour "y0" + dY |> DynObj.setValueOpt contour "dy" + xType |> DynObj.setValueOpt contour "xtype" + yType |> DynObj.setValueOpt contour "ytype" + xAxis |> DynObj.setValueOpt contour "xaxis" + yAxis |> DynObj.setValueOpt contour "yaxis" + Zsrc |> DynObj.setValueOpt contour "zsrc" + Xsrc |> DynObj.setValueOpt contour "xsrc" + Ysrc |> DynObj.setValueOpt contour "ysrc" + + Xgap |> DynObj.setValueOpt contour "xgap" + Ygap |> DynObj.setValueOpt contour "ygap" + Transpose |> DynObj.setValueOpt contour "transpose" + zAuto |> DynObj.setValueOpt contour "zauto" + zMin |> DynObj.setValueOpt contour "zmin" + zMax |> DynObj.setValueOpt contour "zmax" + Colorscale |> DynObj.setValueOptBy contour "colorscale" StyleParam.Colorscale.convert + Autocolorscale |> DynObj.setValueOpt contour "autocolorscale" + Reversescale |> DynObj.setValueOpt contour "reversescale" + Showscale |> DynObj.setValueOpt contour "showscale" + zSmooth |> DynObj.setValueOptBy contour "zsmooth" StyleParam.SmoothAlg.convert + ColorBar |> DynObj.setValueOpt contour "colorbar" + + // out -> + contour + ) + + + + /// Applies the styles of ohlc plot to TraceObjects + /// + /// ``open`` : Sets the open values. + /// + /// high : Sets the high values. + /// + /// low : Sets the low values. + /// + /// close : Sets the close values. + /// + /// x : Sets the x coordinates. If absent, linear coordinate will be generated. + /// + /// ?Increasing : Sets the Line style of the Increasing part of the chart + /// + /// ?Decreasing : Sets the Line style of the Decreasing part of the chart + /// + /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart + /// + /// ?Tickwidth : Sets the width of the open/close tick marks relative to the "x" minimal interval. + /// + /// ?XCalendar : Sets the calendar system to use with `x` date data. + static member OHLC + ( + ``open`` : #IConvertible seq, + high : #IConvertible seq, + low : #IConvertible seq, + close : #IConvertible seq, + x : #IConvertible seq, + ?Increasing : Line, + ?Decreasing : Line, + ?Line : Line, + ?Tickwidth : float, + ?XCalendar : StyleParam.Calendar + ) = + (fun (trace:('T :> Trace)) -> + DynObj.setValue trace "open" ``open`` + DynObj.setValue trace "high" high + DynObj.setValue trace "low" low + DynObj.setValue trace "close" close + DynObj.setValue trace "x" x + DynObj.setValue trace "xaxis" "x" + DynObj.setValue trace "yaxis" "y" + DynObj.setValueOpt trace "increasing" Increasing + DynObj.setValueOpt trace "decreasing" Decreasing + DynObj.setValueOpt trace "tickwidth" Tickwidth + DynObj.setValueOpt trace "line" Line + DynObj.setValueOpt trace "xcalendar" XCalendar + + trace + ) + + + /// Applies the styles of candlestick plot to TraceObjects + /// + /// ``open`` : Sets the open values. + /// + /// high : Sets the high values. + /// + /// low : Sets the low values. + /// + /// close : Sets the close values. + /// + /// x : Sets the x coordinates. If absent, linear coordinate will be generated. + /// + /// ?Increasing : Sets the Line style of the Increasing part of the chart + /// + /// ?Decreasing : Sets the Line style of the Decreasing part of the chart + /// + /// ?Line : Sets the Line style of both the Decreasing and Increasing part of the chart + /// + /// ?WhiskerWidth : Sets the width of the whiskers relative to the box' width. For example, with 1, the whiskers are as wide as the box(es). + /// + /// ?XCalendar : Sets the calendar system to use with `x` date data. + static member Candlestick + ( + ``open`` : #IConvertible seq, + high : #IConvertible seq, + low : #IConvertible seq, + close : #IConvertible seq, + x : #IConvertible seq, + ?Increasing : Line, + ?Decreasing : Line, + ?WhiskerWidth : float, + ?Line : Line, + ?XCalendar : StyleParam.Calendar + ) = + (fun (trace:('T :> Trace)) -> + DynObj.setValue trace "open" ``open`` + DynObj.setValue trace "high" high + DynObj.setValue trace "low" low + DynObj.setValue trace "close" close + DynObj.setValue trace "x" x + DynObj.setValue trace "xaxis" "x" + DynObj.setValue trace "yaxis" "y" + DynObj.setValueOpt trace "increasing" Increasing + DynObj.setValueOpt trace "decreasing" Decreasing + DynObj.setValueOpt trace "whiskerwidth"WhiskerWidth + DynObj.setValueOpt trace "line" Line + DynObj.setValueOpt trace "xcalendar" XCalendar + + trace + ) + + // Applies the styles of Splom plot to TraceObjects + static member Splom + ( + ?Dimensions : seq + ) = + (fun (trace:('T :> Trace)) -> + Dimensions |> DynObj.setValueOpt trace "dimensions" + + // out -> + trace + ) \ No newline at end of file diff --git a/src/Plotly.NET/Traces/Trace3D.fs b/src/Plotly.NET/Traces/Trace3D.fs new file mode 100644 index 000000000..2a4c44dcb --- /dev/null +++ b/src/Plotly.NET/Traces/Trace3D.fs @@ -0,0 +1,1084 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + +/// Traces for 3D subplots, using layout.scene as anchors. +/// +/// These trace types are compatible with 3D subplots via the scene attribute, which contains special camera controls: +/// +///- scatter3d, which can be used to draw individual markers, 3d bubble charts and lines and curves +/// +///- surface and mesh: 3d surface trace types +/// +///- cone and streamtube: 3d vector field trace types +/// +///- volume and isosurface: 3d volume trace types + +type Trace3D (traceTypeName) = + inherit Trace (traceTypeName) + + ///initializes a trace of type "scatter3d" applying the givin trace styling function + static member initScatter3d (applyStyle:Trace3D -> Trace3D) = + Trace3D("scatter3d") |> applyStyle + + ///initializes a trace of type "surface" applying the givin trace styling function + static member initSurface (applyStyle:Trace3D -> Trace3D) = + Trace3D("surface") |> applyStyle + + ///initializes a trace of type "mesh3d" applying the givin trace styling function + static member initMesh3d (applyStyle:Trace3D -> Trace3D) = + Trace3D("mesh3d") |> applyStyle + + ///initializes a trace of type "cone" applying the givin trace styling function + static member initCone (applyStyle:Trace3D -> Trace3D) = + Trace3D("cone") |> applyStyle + + ///initializes a trace of type "streamtube" applying the givin trace styling function + static member initStreamTube (applyStyle:Trace3D -> Trace3D) = + Trace3D("streamtube") |> applyStyle + + ///initializes a trace of type "volume" applying the givin trace styling function + static member initVolume (applyStyle:Trace3D -> Trace3D) = + Trace3D("volume") |> applyStyle + + ///initializes a trace of type "isosurface" applying the givin trace styling function + static member initIsoSurface (applyStyle:Trace3D -> Trace3D) = + Trace3D("isosurface") |> applyStyle + + +//------------------------------------------------------------------------------------------------------------------------------------------------- +/// Functions provide the styling of the Chart objects +type Trace3DStyle() = + + // ######################## 3d-Charts + + static member setScene + ( + ?SceneName:string + ) = + fun (trace:#Trace) -> + SceneName |> DynObj.setValueOpt trace "scene" + trace + + /// + /// Applies the style parameters of the Scatter3d chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title + /// Sets the opacity of the trace. + /// Determines the drawing mode for this scatter trace. If the provided `mode` includes "text" then the `text` elements appear at the coordinates. Otherwise, the `text` elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is "lines+markers". Otherwise, "lines". + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the x coordinates. + /// Sets the y coordinates. + /// Sets the z coordinates. + /// Sets the surface fill color. + /// Sets text elements associated with each (x,y,z) triplet. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y,z) coordinates. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Sets the positions of the `text` elements with respects to the (x,y) coordinates. + /// Template string used for rendering the information text that appear on points. Note that this will override `textinfo`. Variables are inserted using %{variable}, for example "y: %{y}". Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. + /// Sets text elements associated with each (x,y,z) triplet. If a single string, the same string appears over all the data points. If an array of string, the items are mapped in order to the this trace's (x,y,z) coordinates. To be seen, trace `hoverinfo` must contain a "text" flag. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat`. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// Sets the marker of this trace. + /// Sets the line of this trace. + /// Sets the text font of this trace. + /// Sets the x Error of this trace. + /// Sets the y Error of this trace. + /// Sets the z Error of this trace. + /// Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected. + /// Sets the hoverlabel of this trace. + /// Sets the projection of this trace. + /// If "-1", the scatter points are not fill with a surface If "0", "1", "2", the scatter points are filled with a Delaunay surface about the x, y, z respectively. + /// Sets the calendar system to use with `x` date data. + /// Sets the calendar system to use with `y` date data. + /// Sets the calendar system to use with `z` date data. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member Scatter3d + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Mode : StyleParam.Mode, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#IConvertible>, + ?SurfaceColor : string, + ?Text : seq<#IConvertible>, + ?TextPosition : StyleParam.TextPosition, + ?TextTemplate : string, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?Meta : string, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?Marker : Marker, + ?Line : Line, + ?TextFont : Font, + ?ErrorX : Error, + ?ErrorY : Error, + ?ErrorZ : Error, + ?ConnectGaps : bool, + ?Hoverlabel : Hoverlabel, + ?Projection : Projection, + ?Surfaceaxis : StyleParam.SurfaceAxis, + ?XCalendar : StyleParam.Calendar, + ?YCalendar : StyleParam.Calendar, + ?ZCalendar : StyleParam.Calendar, + ?UIRevision : string + ) = + + (fun (scatter: #Trace) -> + + Name |> DynObj.setValueOpt scatter "name" + Visible |> DynObj.setValueOptBy scatter "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt scatter "showlegend" + LegendRank |> DynObj.setValueOpt scatter "legendrank" + LegendGroup |> DynObj.setValueOpt scatter "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt scatter "legendgrouptitle" + Mode |> DynObj.setValueOptBy scatter "mode" StyleParam.Mode.convert + Opacity |> DynObj.setValueOpt scatter "opacity" + Ids |> DynObj.setValueOpt scatter "ids" + X |> DynObj.setValueOpt scatter "x" + Y |> DynObj.setValueOpt scatter "y" + Z |> DynObj.setValueOpt scatter "z" + SurfaceColor |> DynObj.setValueOpt scatter "surfacecolor" + Text |> DynObj.setValueOpt scatter "text" + TextPosition |> DynObj.setValueOptBy scatter "textposition" StyleParam.TextPosition.convert + TextTemplate |> DynObj.setValueOpt scatter "texttemplate" + HoverText |> DynObj.setValueOpt scatter "hovertext" + HoverInfo |> DynObj.setValueOpt scatter "hoverinfo" + HoverTemplate |> DynObj.setValueOpt scatter "hovertemplate" + XHoverFormat |> DynObj.setValueOpt scatter "xhoverformat" + YHoverFormat |> DynObj.setValueOpt scatter "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt scatter "zhoverformat" + Meta |> DynObj.setValueOpt scatter "meta" + CustomData |> DynObj.setValueOpt scatter "customdata" + Scene |> DynObj.setValueOptBy scatter "scene" StyleParam.SubPlotId.convert + Marker |> DynObj.setValueOpt scatter "marker" + Line |> DynObj.setValueOpt scatter "line" + TextFont |> DynObj.setValueOpt scatter "textfont" + ErrorX |> DynObj.setValueOpt scatter "errorx" + ErrorY |> DynObj.setValueOpt scatter "errory" + ErrorZ |> DynObj.setValueOpt scatter "errorz" + ConnectGaps |> DynObj.setValueOpt scatter "connectgaps" + Hoverlabel |> DynObj.setValueOpt scatter "hoverlabel" + Projection |> DynObj.setValueOpt scatter "projection" + Surfaceaxis |> DynObj.setValueOptBy scatter "surfaceaxis" StyleParam.SurfaceAxis.convert + XCalendar |> DynObj.setValueOptBy scatter "xcalendar" StyleParam.Calendar.convert + YCalendar |> DynObj.setValueOptBy scatter "ycalendar" StyleParam.Calendar.convert + ZCalendar |> DynObj.setValueOptBy scatter "zcalendar" StyleParam.Calendar.convert + UIRevision |> DynObj.setValueOpt scatter "uirevision" + + scatter + ) + + + + /// + /// Applies the style parameters of the surface chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title for this trace. + /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the x coordinates. + /// Sets the y coordinates. + /// Sets the z coordinates. + /// Sets the surface color values, used for setting a color scale independent of `z`. + /// Sets the text elements associated with each z value. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Same as `text`. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat`. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// 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. + /// Sets the colorbar of this trace. + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not the color domain is computed with respect to the input data (here z or surfacecolor) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as z or surfacecolor. Has no effect when `cauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmin` must be set as well. + /// Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data are filled in. + /// Sets the contours of this trace. + /// Determines whether or not a surface is drawn. For example, set `hidesurface` to "false" `contours.x.show` to "true" and `contours.y.show` to "true" to draw a wire frame plot. + /// Sets the hoverlabel style of this trace. + /// Sets the Lighting style of this trace. + /// Sets the LightPosition style of this trace. + /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. + /// Sets the calendar system to use with `x` date data. + /// Sets the calendar system to use with `y` date data. + /// Sets the calendar system to use with `z` date data. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member Surface + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#seq<#IConvertible>>, + ?SurfaceColor : string, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?Meta : string, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?ColorAxis : StyleParam.SubPlotId, + ?ColorBar : ColorBar, + ?AutoColorScale : bool, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool, + ?CAuto : bool, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?ConnectGaps : bool, + ?Contours : Contours, + ?HideSurface : bool, + ?Hoverlabel : Hoverlabel, + ?Lighting : Lighting, + ?LightPosition : LightPosition, + ?OpacityScale : seq<#seq<#IConvertible>>, + ?XCalendar : StyleParam.Calendar, + ?YCalendar : StyleParam.Calendar, + ?ZCalendar : StyleParam.Calendar, + ?UIRevision : string + ) = + (fun (surface: #Trace) -> + + Name |> DynObj.setValueOpt surface "name" + Visible |> DynObj.setValueOptBy surface "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt surface "showlegend" + LegendRank |> DynObj.setValueOpt surface "legendrank" + LegendGroup |> DynObj.setValueOpt surface "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt surface "legendgrouptitle" + Opacity |> DynObj.setValueOpt surface "opacity" + Ids |> DynObj.setValueOpt surface "ids" + X |> DynObj.setValueOpt surface "x" + Y |> DynObj.setValueOpt surface "y" + Z |> DynObj.setValueOpt surface "z" + SurfaceColor |> DynObj.setValueOpt surface "surfacecolor" + Text |> DynObj.setValueOpt surface "text" + HoverText |> DynObj.setValueOpt surface "hovertext" + HoverInfo |> DynObj.setValueOpt surface "hoverinfo" + HoverTemplate |> DynObj.setValueOpt surface "hovertemplate" + XHoverFormat |> DynObj.setValueOpt surface "xhoverformat" + YHoverFormat |> DynObj.setValueOpt surface "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt surface "zhoverformat" + Meta |> DynObj.setValueOpt surface "meta" + CustomData |> DynObj.setValueOpt surface "customdata" + Scene |> DynObj.setValueOptBy surface "scene" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy surface "coloraxis" StyleParam.SubPlotId.convert + ColorBar |> DynObj.setValueOpt surface "colorbar" + AutoColorScale |> DynObj.setValueOpt surface "autocolorscale" + ColorScale |> DynObj.setValueOptBy surface "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt surface "showscale" + ReverseScale |> DynObj.setValueOpt surface "reversescale" + CAuto |> DynObj.setValueOpt surface "cauto" + CMin |> DynObj.setValueOpt surface "cmin" + CMid |> DynObj.setValueOpt surface "cmid" + CMax |> DynObj.setValueOpt surface "cmax" + ConnectGaps |> DynObj.setValueOpt surface "connectgaps" + Contours |> DynObj.setValueOpt surface "contours" + HideSurface |> DynObj.setValueOpt surface "hidesurface" + Hoverlabel |> DynObj.setValueOpt surface "hoverlabel" + Lighting |> DynObj.setValueOpt surface "lighting" + LightPosition |> DynObj.setValueOpt surface "lightposition" + OpacityScale |> DynObj.setValueOpt surface "opacityscale" + XCalendar |> DynObj.setValueOptBy surface "xcalendar" StyleParam.Calendar.convert + YCalendar |> DynObj.setValueOptBy surface "ycalendar" StyleParam.Calendar.convert + ZCalendar |> DynObj.setValueOptBy surface "zcalendar" StyleParam.Calendar.convert + UIRevision |> DynObj.setValueOpt surface "uirevision" + + surface + ) + + + /// + /// Applies the style parameters of the mesh3d chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title for this trace. + /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "first" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "second" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle. + /// A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the "third" vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle. + /// Sets the color of each face Overrides "color" and "vertexcolor". + /// Sets the intensity values for vertices or cells as defined by `intensitymode`. It can be used for plotting fields on meshes. + /// Determines the source of `intensity` values. + /// Sets the color of each vertex Overrides "color". While Red, green and blue colors are in the range of 0 and 255; in the case of having vertex color data in RGBA format, the alpha color should be normalized to be between 0 and 1. + /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Same as `text`. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat`. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// 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. + /// Sets the colorbar of this trace. + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not the color domain is computed with respect to the input data (here z or surfacecolor) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as z or surfacecolor. Has no effect when `cauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as z or surfacecolor and if set, `cmin` must be set as well. + /// Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied. For general use of `mesh3d` it is preferred that `i`, `j`, `k` are supplied. If "-1", Delaunay triangulation is used, which is mainly suitable if the mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`. In case the `delaunayaxis` intersects the mesh surface at more than one point it will result triangles that are very long in the dimension of `delaunayaxis`. If ">0", the alpha-shape algorithm is used. In this case, the positive `alphahull` value signals the use of the alpha-shape algorithm, _and_ its value acts as the parameter for the mesh fitting. If "0", the convex-hull algorithm is used. It is suitable for convex bodies or if the intention is to enclose the `x`, `y` and `z` point set into a convex hull. + /// Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the Delaunay triangulation. It has an effect if `i`, `j`, `k` are not provided and `alphahull` is set to indicate Delaunay triangulation. + /// Sets the contour of this trace + /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. + /// Sets the hoverlabel style of this trace. + /// Sets the Lighting style of this trace. + /// Sets the LightPosition style of this trace. + /// Sets the calendar system to use with `x` date data. + /// Sets the calendar system to use with `y` date data. + /// Sets the calendar system to use with `z` date data. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member Mesh3d + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#IConvertible>, + ?I : seq<#IConvertible>, + ?J : seq<#IConvertible>, + ?K : seq<#IConvertible>, + ?FaceColor : seq<#IConvertible>, + ?Intensity : seq<#IConvertible>, + ?IntensityMode : StyleParam.IntensityMode, + ?VertexColor : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?Meta : string, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?ColorAxis : StyleParam.SubPlotId, + ?ColorBar : ColorBar, + ?AutoColorScale : bool, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool, + ?CAuto : bool, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?AlphaHull : float, + ?Delaunayaxis : StyleParam.Delaunayaxis, + ?Contour : Contour, + ?FlatShading : bool, + ?Hoverlabel : Hoverlabel, + ?Lighting : Lighting, + ?LightPosition : LightPosition, + ?XCalendar : StyleParam.Calendar, + ?YCalendar : StyleParam.Calendar, + ?ZCalendar : StyleParam.Calendar, + ?UIRevision : string + ) = + + fun (mesh3d: #Trace) -> + + Name |> DynObj.setValueOpt mesh3d "name" + Visible |> DynObj.setValueOptBy mesh3d "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt mesh3d "showlegend" + LegendRank |> DynObj.setValueOpt mesh3d "legendrank" + LegendGroup |> DynObj.setValueOpt mesh3d "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt mesh3d "legendgrouptitle" + Opacity |> DynObj.setValueOpt mesh3d "opacity" + Ids |> DynObj.setValueOpt mesh3d "ids" + X |> DynObj.setValueOpt mesh3d "x" + Y |> DynObj.setValueOpt mesh3d "y" + Z |> DynObj.setValueOpt mesh3d "z" + I |> DynObj.setValueOpt mesh3d "i" + J |> DynObj.setValueOpt mesh3d "j" + K |> DynObj.setValueOpt mesh3d "k" + FaceColor |> DynObj.setValueOpt mesh3d "facecolor" + Intensity |> DynObj.setValueOpt mesh3d "intensity" + IntensityMode |> DynObj.setValueOptBy mesh3d "intensitymode" StyleParam.IntensityMode.convert + VertexColor |> DynObj.setValueOpt mesh3d "vertexcolor" + Text |> DynObj.setValueOpt mesh3d "text" + HoverText |> DynObj.setValueOpt mesh3d "hovertext" + HoverInfo |> DynObj.setValueOpt mesh3d "hoverinfo" + HoverTemplate |> DynObj.setValueOpt mesh3d "hovertemplate" + XHoverFormat |> DynObj.setValueOpt mesh3d "xhoverformat" + YHoverFormat |> DynObj.setValueOpt mesh3d "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt mesh3d "zhoverformat" + Meta |> DynObj.setValueOpt mesh3d "meta" + CustomData |> DynObj.setValueOpt mesh3d "customdata" + Scene |> DynObj.setValueOptBy mesh3d "scene" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy mesh3d "coloraxis" StyleParam.SubPlotId.convert + ColorBar |> DynObj.setValueOpt mesh3d "colorbar" + AutoColorScale |> DynObj.setValueOpt mesh3d "autocolorscale" + ColorScale |> DynObj.setValueOptBy mesh3d "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt mesh3d "showscale" + ReverseScale |> DynObj.setValueOpt mesh3d "reversescale" + CAuto |> DynObj.setValueOpt mesh3d "cauto" + CMin |> DynObj.setValueOpt mesh3d "cmin" + CMid |> DynObj.setValueOpt mesh3d "cmid" + CMax |> DynObj.setValueOpt mesh3d "cmax" + AlphaHull |> DynObj.setValueOpt mesh3d "alphahull" + Delaunayaxis |> DynObj.setValueOptBy mesh3d "delaunayaxis" StyleParam.Delaunayaxis.convert + Contour |> DynObj.setValueOpt mesh3d "contour" + FlatShading |> DynObj.setValueOpt mesh3d "flatshading" + Hoverlabel |> DynObj.setValueOpt mesh3d "hoverlabel" + Lighting |> DynObj.setValueOpt mesh3d "lighting" + LightPosition |> DynObj.setValueOpt mesh3d "lightposition" + XCalendar |> DynObj.setValueOptBy mesh3d "xcalendar" StyleParam.Calendar.convert + YCalendar |> DynObj.setValueOptBy mesh3d "ycalendar" StyleParam.Calendar.convert + ZCalendar |> DynObj.setValueOptBy mesh3d "zcalendar" StyleParam.Calendar.convert + UIRevision |> DynObj.setValueOpt mesh3d "uirevision" + + mesh3d + + + /// + /// Applies the style parameters of the cone chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title for this trace. + /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the x coordinates of the vector field and of the displayed cones. + /// Sets the y coordinates of the vector field and of the displayed cones. + /// Sets the z coordinates of the vector field and of the displayed cones. + /// Sets the x components of the vector field. + /// Sets the y components of the vector field. + /// Sets the z components of the vector field. + /// Sets the text elements associated with the cones. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Same as `text`. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` + /// Sets the hover text formatting rulefor `u` 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.By default the values are formatted using generic number format. + /// Sets the hover text formatting rulefor `v` 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.By default the values are formatted using generic number format. + /// Sets the hover text formatting rulefor `w` 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.By default the values are formatted using generic number format. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// 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. + /// Sets the ColorBar object associated with the color scale of the cones + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not the color domain is computed with respect to the input data (here u/v/w norm) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the upper bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmin` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as u/v/w norm. Has no effect when `cauto` is `false`. + /// Sets the lower bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmax` must be set as well. + /// Sets the cones' anchor with respect to their x/y/z positions. Note that "cm" denote the cone's center of mass which corresponds to 1/4 from the tail to tip. + /// Sets the hover labels of this cone trace. + /// Sets the Lighting of this cone trace. + /// Sets the LightPosition of this cone trace. + /// Determines whether `sizeref` is set as a "scaled" (i.e unitless) scalar (normalized by the max u/v/w norm in the vector field) or as "absolute" value (in the same units as the vector field). + /// Adjusts the cone size scaling. The size of the cones is determined by their u/v/w norm multiplied a factor and `sizeref`. This factor (computed internally) corresponds to the minimum "time" to travel across two successive x/y/z positions at the average velocity of those two successive positions. All cones in a given trace use the same factor. With `sizemode` set to "scaled", `sizeref` is unitless, its default value is "0.5" With `sizemode` set to "absolute", `sizeref` has the same units as the u/v/w vector field, its the default value is half the sample's maximum vector norm. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member Cone + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#IConvertible>, + ?U : seq<#IConvertible>, + ?V : seq<#IConvertible>, + ?W : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?UHoverFormat : string, + ?VHoverFormat : string, + ?WHoverFormat : string, + ?Meta : seq<#IConvertible>, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?ColorAxis : StyleParam.SubPlotId, + ?ColorBar : ColorBar, + ?AutoColorScale : bool, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool, + ?CAuto : bool, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?Anchor : StyleParam.ConeAnchor, + ?HoverLabel : Hoverlabel, + ?Lighting : Lighting, + ?LightPosition : LightPosition, + ?SizeMode : StyleParam.ConeSizeMode, + ?SizeRef : float, + ?UIRevision : seq<#IConvertible> + + ) = + (fun (cone: #Trace) -> + Name |> DynObj.setValueOpt cone "name" + Visible |> DynObj.setValueOptBy cone "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt cone "showlegend" + LegendRank |> DynObj.setValueOpt cone "legendrank" + LegendGroup |> DynObj.setValueOpt cone "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt cone "legendgrouptitle" + Opacity |> DynObj.setValueOpt cone "opacity" + Ids |> DynObj.setValueOpt cone "ids" + X |> DynObj.setValueOpt cone "x" + Y |> DynObj.setValueOpt cone "y" + Z |> DynObj.setValueOpt cone "z" + U |> DynObj.setValueOpt cone "u" + V |> DynObj.setValueOpt cone "v" + W |> DynObj.setValueOpt cone "w" + Text |> DynObj.setValueOpt cone "text" + HoverText |> DynObj.setValueOpt cone "hovertext" + HoverInfo |> DynObj.setValueOpt cone "hoverinfo" + HoverTemplate |> DynObj.setValueOpt cone "hovertemplate" + XHoverFormat |> DynObj.setValueOpt cone "xhoverformat" + YHoverFormat |> DynObj.setValueOpt cone "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt cone "zhoverformat" + UHoverFormat |> DynObj.setValueOpt cone "uhoverformat" + VHoverFormat |> DynObj.setValueOpt cone "vhoverformat" + WHoverFormat |> DynObj.setValueOpt cone "whoverformat" + Meta |> DynObj.setValueOpt cone "meta" + CustomData |> DynObj.setValueOpt cone "customdata" + Scene |> DynObj.setValueOptBy cone "scene" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy cone "scene" StyleParam.SubPlotId.convert + ColorBar |> DynObj.setValueOpt cone "colorbar" + AutoColorScale |> DynObj.setValueOpt cone "autocolorscale" + ColorScale |> DynObj.setValueOptBy cone "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt cone "showscale" + ReverseScale |> DynObj.setValueOpt cone "reversescale" + CAuto |> DynObj.setValueOpt cone "cauto" + CMin |> DynObj.setValueOpt cone "cmin" + CMid |> DynObj.setValueOpt cone "cmid" + CMax |> DynObj.setValueOpt cone "cmax" + Anchor |> DynObj.setValueOptBy cone "anchor" StyleParam.ConeAnchor.convert + HoverLabel |> DynObj.setValueOpt cone "hoverlabel" + Lighting |> DynObj.setValueOpt cone "lighting" + LightPosition |> DynObj.setValueOpt cone "lightposition" + SizeMode |> DynObj.setValueOptBy cone "sizemode" StyleParam.ConeSizeMode.convert + SizeRef |> DynObj.setValueOpt cone "sizeref" + UIRevision |> DynObj.setValueOpt cone "uirevision" + + cone + ) + + /// + /// Applies the style parameters of the streamtube chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the legend group title for this trace. + /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the x coordinates of the vector field. + /// Sets the y coordinates of the vector field. + /// Sets the z coordinates of the vector field. + /// Sets the x components of the vector field. + /// Sets the y components of the vector field. + /// Sets the z components of the vector field. + /// Sets a text element associated with this trace. If trace `hoverinfo` contains a "text" flag, this text element will be seen in all hover labels. Note that streamtube traces do not support array `text` values. + /// Same as `text`. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` + /// Sets the hover text formatting rulefor `u` 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.By default the values are formatted using generic number format. + /// Sets the hover text formatting rulefor `v` 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.By default the values are formatted using generic number format. + /// Sets the hover text formatting rulefor `w` 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.By default the values are formatted using generic number format. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// 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. + /// Sets the ColorBar object associated with the color scale of the streamtubes + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not the color domain is computed with respect to the input data (here u/v/w norm) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the upper bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmin` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as u/v/w norm. Has no effect when `cauto` is `false`. + /// Sets the lower bound of the color domain. Value should have the same units as u/v/w norm and if set, `cmax` must be set as well. + /// Sets the hover labels of this trace. + /// Sets the Lighting of this trace. + /// Sets the LightPosition of this trace. + /// The maximum number of displayed segments in a streamtube. + /// The scaling factor for the streamtubes. The default is 1, which avoids two max divergence tubes from touching at adjacent starting positions. + /// Sets the streamtube starting positions + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member StreamTube + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#IConvertible>, + ?U : seq<#IConvertible>, + ?V : seq<#IConvertible>, + ?W : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?UHoverFormat : string, + ?VHoverFormat : string, + ?WHoverFormat : string, + ?Meta : seq<#IConvertible>, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?ColorAxis : StyleParam.SubPlotId, + ?ColorBar : ColorBar, + ?AutoColorScale : bool, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool, + ?CAuto : bool, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?HoverLabel : Hoverlabel, + ?Lighting : Lighting, + ?LightPosition : LightPosition, + ?MaxDisplayed : int, + ?SizeRef : float, + ?Starts : StreamTubeStarts, + ?UIRevision : seq<#IConvertible> + + ) = + (fun (streamTube: #Trace) -> + Name |> DynObj.setValueOpt streamTube "name" + Visible |> DynObj.setValueOptBy streamTube "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt streamTube "showlegend" + LegendRank |> DynObj.setValueOpt streamTube "legendrank" + LegendGroup |> DynObj.setValueOpt streamTube "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt streamTube "legendgrouptitle" + Opacity |> DynObj.setValueOpt streamTube "opacity" + Ids |> DynObj.setValueOpt streamTube "ids" + X |> DynObj.setValueOpt streamTube "x" + Y |> DynObj.setValueOpt streamTube "y" + Z |> DynObj.setValueOpt streamTube "z" + U |> DynObj.setValueOpt streamTube "u" + V |> DynObj.setValueOpt streamTube "v" + W |> DynObj.setValueOpt streamTube "w" + Text |> DynObj.setValueOpt streamTube "text" + HoverText |> DynObj.setValueOpt streamTube "hovertext" + HoverInfo |> DynObj.setValueOpt streamTube "hoverinfo" + HoverTemplate |> DynObj.setValueOpt streamTube "hovertemplate" + XHoverFormat |> DynObj.setValueOpt streamTube "xhoverformat" + YHoverFormat |> DynObj.setValueOpt streamTube "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt streamTube "zhoverformat" + UHoverFormat |> DynObj.setValueOpt streamTube "uhoverformat" + VHoverFormat |> DynObj.setValueOpt streamTube "vhoverformat" + WHoverFormat |> DynObj.setValueOpt streamTube "whoverformat" + Meta |> DynObj.setValueOpt streamTube "meta" + CustomData |> DynObj.setValueOpt streamTube "customdata" + Scene |> DynObj.setValueOptBy streamTube "scene" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy streamTube "scene" StyleParam.SubPlotId.convert + ColorBar |> DynObj.setValueOpt streamTube "colorbar" + AutoColorScale |> DynObj.setValueOpt streamTube "autocolorscale" + ColorScale |> DynObj.setValueOptBy streamTube "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt streamTube "showscale" + ReverseScale |> DynObj.setValueOpt streamTube "reversescale" + CAuto |> DynObj.setValueOpt streamTube "cauto" + CMin |> DynObj.setValueOpt streamTube "cmin" + CMid |> DynObj.setValueOpt streamTube "cmid" + CMax |> DynObj.setValueOpt streamTube "cmax" + HoverLabel |> DynObj.setValueOpt streamTube "hoverlabel" + Lighting |> DynObj.setValueOpt streamTube "lighting" + LightPosition |> DynObj.setValueOpt streamTube "lightposition" + MaxDisplayed |> DynObj.setValueOpt streamTube "maxdisplayed" + SizeRef |> DynObj.setValueOpt streamTube "sizeref" + Starts |> DynObj.setValueOpt streamTube "starts" + UIRevision |> DynObj.setValueOpt streamTube "uirevision" + + streamTube + ) + + /// + /// Applies the style parameters of the volume chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the title of the legendgroup + /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the X coordinates of the vertices on X axis. + /// Sets the Y coordinates of the vertices on Y axis. + /// Sets the Z coordinates of the vertices on Z axis. + /// Sets the 4th dimension (value) of the vertices. + /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Same as `text`. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` + /// Sets the hover text formatting rulefor `value` 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.By default the values are formatted using generic number format. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// 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. + /// Sets the colorbar of this trace + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not the color domain is computed with respect to the input data (here `value`) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as `value` and if set, `cmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as `value`. Has no effect when `cauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as `value` and if set, `cmin` must be set as well. + /// Sets the caps of this trace caps (color-coded surfaces on the sides of the visualization domain) + /// Sets the contour of this trace. + /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. + /// Sets the hover labels of this trace. + /// Sets the maximum boundary for iso-surface plot. + /// Sets the minimum boundary for iso-surface plot. + /// Sets the Lighting of this trace. + /// Sets the LightPosition of this trace. + /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. + /// Sets slices through the volume + /// Sets the SpaceFrame of this trace. + /// Sets the Surface of this trace. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member Volume + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#IConvertible>, + ?Value : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?ValueHoverFormat : string, + ?Meta : seq<#IConvertible>, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?ColorAxis : StyleParam.SubPlotId, + ?ColorBar : ColorBar, + ?AutoColorScale : bool, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool, + ?CAuto : bool, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?Caps : Caps, + ?Contour : Contour, + ?FlatShading : bool, + ?HoverLabel : Hoverlabel, + ?IsoMax : float, + ?IsoMin : float, + ?Lighting : Lighting, + ?LightPosition : LightPosition, + ?OpacityScale : seq<#seq<#IConvertible>>, + ?Slices : Slices, + ?SpaceFrame : Spaceframe, + ?Surface : Surface, + ?UIRevision : seq<#IConvertible> + ) = + fun (volume: #Trace) -> + + Name |> DynObj.setValueOpt volume "name" + Visible |> DynObj.setValueOptBy volume "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt volume "showlegend" + LegendRank |> DynObj.setValueOpt volume "legendrank" + LegendGroup |> DynObj.setValueOpt volume "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt volume "legendgrouptitle" + Opacity |> DynObj.setValueOpt volume "opacity" + Ids |> DynObj.setValueOpt volume "ids" + X |> DynObj.setValueOpt volume "x" + Y |> DynObj.setValueOpt volume "y" + Z |> DynObj.setValueOpt volume "z" + Value |> DynObj.setValueOpt volume "value" + Text |> DynObj.setValueOpt volume "text" + HoverText |> DynObj.setValueOpt volume "hovertext" + HoverInfo |> DynObj.setValueOpt volume "hoverinfo" + HoverTemplate |> DynObj.setValueOpt volume "hovertemplate" + XHoverFormat |> DynObj.setValueOpt volume "xhoverformat" + YHoverFormat |> DynObj.setValueOpt volume "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt volume "zhoverformat" + ValueHoverFormat |> DynObj.setValueOpt volume "valuehoverformat" + Meta |> DynObj.setValueOpt volume "meta" + CustomData |> DynObj.setValueOpt volume "customdata" + Scene |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert + ColorBar |> DynObj.setValueOpt volume "colorbar" + AutoColorScale |> DynObj.setValueOpt volume "autocolorscale" + ColorScale |> DynObj.setValueOptBy volume "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt volume "showscale" + ReverseScale |> DynObj.setValueOpt volume "reversescale" + CAuto |> DynObj.setValueOpt volume "cauto" + CMin |> DynObj.setValueOpt volume "cmin" + CMid |> DynObj.setValueOpt volume "cmid" + CMax |> DynObj.setValueOpt volume "cmax" + Caps |> DynObj.setValueOpt volume "caps" + Contour |> DynObj.setValueOpt volume "contour" + FlatShading |> DynObj.setValueOpt volume "flatshading" + HoverLabel |> DynObj.setValueOpt volume "hoverlabel" + IsoMax |> DynObj.setValueOpt volume "isomax" + IsoMin |> DynObj.setValueOpt volume "isomin" + Lighting |> DynObj.setValueOpt volume "lighting" + LightPosition |> DynObj.setValueOpt volume "lightposition" + OpacityScale |> DynObj.setValueOpt volume "opacityscale" + Slices |> DynObj.setValueOpt volume "slices" + SpaceFrame |> DynObj.setValueOpt volume "spaceframe" + Surface |> DynObj.setValueOpt volume "surface" + UIRevision |> DynObj.setValueOpt volume "uirevision" + + volume + + /// + /// Applies the style parameters of the isosurface chart to the given trace + /// + /// Sets the trace name. The trace name appear as the legend item and on hover. + /// Determines whether or not this trace is visible. If "legendonly", the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible). + /// Determines whether or not an item corresponding to this trace is shown in the legend. + /// Sets the legend rank for this trace. 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. + /// Sets the legend group for this trace. Traces part of the same legend group hide/show at the same time when toggling legend items. + /// Sets the title of the legendgroup + /// Sets the opacity of the surface. Please note that in the case of using high `opacity` values for example a value greater than or equal to 0.5 on two surfaces (and 0.25 with four surfaces), an overlay of multiple transparent surfaces may not perfectly be sorted in depth by the webgl API. This behavior may be improved in the near future and is subject to change. + /// Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type. + /// Sets the X coordinates of the vertices on X axis. + /// Sets the Y coordinates of the vertices on Y axis. + /// Sets the Z coordinates of the vertices on Z axis. + /// Sets the 4th dimension (value) of the vertices. + /// Sets the text elements associated with the vertices. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// Same as `text`. + /// Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired. + /// Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example "y: %{y}" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, "xother" will be added to those with different x positions from the first point. An underscore before or after "(x|y)other" will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example "Price: %{y:$.2f}". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. variable `norm` Anything contained in tag `<extra>` is displayed in the secondary box, for example "<extra>{fullData.name}</extra>". To hide the secondary box completely, use an empty tag `<extra></extra>`. + /// Sets the hover text formatting rulefor `x` 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"By default the values are formatted using `xaxis.hoverformat`. + /// Sets the hover text formatting rulefor `y` 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"By default the values are formatted using `yaxis.hoverformat`. + /// Sets the hover text formatting rulefor `z` 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"By default the values are formatted using `zaxis.hoverformat` + /// Sets the hover text formatting rulefor `value` 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.By default the values are formatted using generic number format. + /// Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace `name`, graph, axis and colorbar `title.text`, annotation `text` `rangeselector`, `updatemenues` and `sliders` `label` text all support `meta`. To access the trace `meta` values in an attribute in the same trace, simply use `%{meta[i]}` where `i` is the index or key of the `meta` item in question. To access trace `meta` in layout attributes, use `%{data[n[.meta[i]}` where `i` is the index or key of the `meta` and `n` is the trace index. + /// Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, "scatter" traces also appends customdata items in the markers DOM elements + /// Sets a reference between this trace's 3D coordinate system and a 3D scene. If "scene" (the default value), the (x,y,z) coordinates refer to `layout.scene`. If "scene2", the (x,y,z) coordinates refer to `layout.scene2`, and so on. + /// 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. + /// Sets the colorbar of this trace + /// Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. 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. + /// Sets the colorscale. The colorscale must be an array containing arrays mapping a normalized value to an rgb, rgba, hex, hsl, hsv, or named color string. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the bounds of the colorscale in color space, use`cmin` and `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. + /// Determines whether or not a colorbar is displayed for this trace. + /// Reverses the color mapping if true. If true, `cmin` will correspond to the last color in the array and `cmax` will correspond to the first color. + /// Determines whether or not the color domain is computed with respect to the input data (here `value`) or the bounds set in `cmin` and `cmax` Defaults to `false` when `cmin` and `cmax` are set by the user. + /// Sets the lower bound of the color domain. Value should have the same units as `value` and if set, `cmax` must be set as well. + /// Sets the mid-point of the color domain by scaling `cmin` and/or `cmax` to be equidistant to this point. Value should have the same units as `value`. Has no effect when `cauto` is `false`. + /// Sets the upper bound of the color domain. Value should have the same units as `value` and if set, `cmin` must be set as well. + /// Sets the caps of this trace caps (color-coded surfaces on the sides of the visualization domain) + /// Sets the contour of this trace. + /// Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections. + /// Sets the hover labels of this trace. + /// Sets the maximum boundary for iso-surface plot. + /// Sets the minimum boundary for iso-surface plot. + /// Sets the Lighting of this trace. + /// Sets the LightPosition of this trace. + /// Sets the opacityscale. The opacityscale must be an array containing arrays mapping a normalized value to an opacity value. At minimum, a mapping for the lowest (0) and highest (1) values are required. For example, `[[0, 1], [0.5, 0.2], [1, 1]]` means that higher/lower values would have higher opacity values and those in the middle would be more transparent Alternatively, `opacityscale` may be a palette name string of the following list: 'min', 'max', 'extremes' and 'uniform'. The default is 'uniform'. + /// Sets slices through the volume + /// Sets the SpaceFrame of this trace. + /// Sets the Surface of this trace. + /// Controls persistence of some user-driven changes to the trace: `constraintrange` in `parcoords` traces, as well as some `editable: true` modifications such as `name` and `colorbar.title`. Defaults to `layout.uirevision`. Note that other user-driven trace attribute changes are controlled by `layout` attributes: `trace.visible` is controlled by `layout.legend.uirevision`, `selectedpoints` is controlled by `layout.selectionrevision`, and `colorbar.(x|y)` (accessible with `config: {editable: true}`) is controlled by `layout.editrevision`. Trace changes are tracked by `uid`, which only falls back on trace index if no `uid` is provided. So if your app can add/remove traces before the end of the `data` array, such that the same trace has a different index, you can still preserve user-driven changes if you give each trace a `uid` that stays with it as it moves. + static member IsoSurface + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?X : seq<#IConvertible>, + ?Y : seq<#IConvertible>, + ?Z : seq<#IConvertible>, + ?Value : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : string, + ?XHoverFormat : string, + ?YHoverFormat : string, + ?ZHoverFormat : string, + ?ValueHoverFormat : string, + ?Meta : seq<#IConvertible>, + ?CustomData : seq<#IConvertible>, + ?Scene : StyleParam.SubPlotId, + ?ColorAxis : StyleParam.SubPlotId, + ?ColorBar : ColorBar, + ?AutoColorScale : bool, + ?ColorScale : StyleParam.Colorscale, + ?ShowScale : bool, + ?ReverseScale : bool, + ?CAuto : bool, + ?CMin : float, + ?CMid : float, + ?CMax : float, + ?Caps : Caps, + ?Contour : Contour, + ?FlatShading : bool, + ?HoverLabel : Hoverlabel, + ?IsoMax : float, + ?IsoMin : float, + ?Lighting : Lighting, + ?LightPosition : LightPosition, + ?OpacityScale : seq<#seq<#IConvertible>>, + ?Slices : Slices, + ?SpaceFrame : Spaceframe, + ?Surface : Surface, + ?UIRevision : seq<#IConvertible> + ) = + fun (volume: #Trace) -> + + Name |> DynObj.setValueOpt volume "name" + Visible |> DynObj.setValueOptBy volume "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt volume "showlegend" + LegendRank |> DynObj.setValueOpt volume "legendrank" + LegendGroup |> DynObj.setValueOpt volume "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt volume "legendgrouptitle" + Opacity |> DynObj.setValueOpt volume "opacity" + Ids |> DynObj.setValueOpt volume "ids" + X |> DynObj.setValueOpt volume "x" + Y |> DynObj.setValueOpt volume "y" + Z |> DynObj.setValueOpt volume "z" + Value |> DynObj.setValueOpt volume "value" + Text |> DynObj.setValueOpt volume "text" + HoverText |> DynObj.setValueOpt volume "hovertext" + HoverInfo |> DynObj.setValueOpt volume "hoverinfo" + HoverTemplate |> DynObj.setValueOpt volume "hovertemplate" + XHoverFormat |> DynObj.setValueOpt volume "xhoverformat" + YHoverFormat |> DynObj.setValueOpt volume "yhoverformat" + ZHoverFormat |> DynObj.setValueOpt volume "zhoverformat" + ValueHoverFormat |> DynObj.setValueOpt volume "valuehoverformat" + Meta |> DynObj.setValueOpt volume "meta" + CustomData |> DynObj.setValueOpt volume "customdata" + Scene |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert + ColorAxis |> DynObj.setValueOptBy volume "scene" StyleParam.SubPlotId.convert + ColorBar |> DynObj.setValueOpt volume "colorbar" + AutoColorScale |> DynObj.setValueOpt volume "autocolorscale" + ColorScale |> DynObj.setValueOptBy volume "colorscale" StyleParam.Colorscale.convert + ShowScale |> DynObj.setValueOpt volume "showscale" + ReverseScale |> DynObj.setValueOpt volume "reversescale" + CAuto |> DynObj.setValueOpt volume "cauto" + CMin |> DynObj.setValueOpt volume "cmin" + CMid |> DynObj.setValueOpt volume "cmid" + CMax |> DynObj.setValueOpt volume "cmax" + Caps |> DynObj.setValueOpt volume "caps" + Contour |> DynObj.setValueOpt volume "contour" + FlatShading |> DynObj.setValueOpt volume "flatshading" + HoverLabel |> DynObj.setValueOpt volume "hoverlabel" + IsoMax |> DynObj.setValueOpt volume "isomax" + IsoMin |> DynObj.setValueOpt volume "isomin" + Lighting |> DynObj.setValueOpt volume "lighting" + LightPosition |> DynObj.setValueOpt volume "lightposition" + OpacityScale |> DynObj.setValueOpt volume "opacityscale" + Slices |> DynObj.setValueOpt volume "slices" + SpaceFrame |> DynObj.setValueOpt volume "spaceframe" + Surface |> DynObj.setValueOpt volume "surface" + UIRevision |> DynObj.setValueOpt volume "uirevision" + + volume diff --git a/src/Plotly.NET/Traces/TraceCarpet.fs b/src/Plotly.NET/Traces/TraceCarpet.fs new file mode 100644 index 000000000..fa01c5d11 --- /dev/null +++ b/src/Plotly.NET/Traces/TraceCarpet.fs @@ -0,0 +1,22 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + +type TraceCarpet(traceTypeName) = + + inherit Trace (traceTypeName) + + ///initializes a trace of type "carpet" applying the given trace styling function + static member initCarpet (applyStyle: TraceCarpet -> TraceCarpet) = + TraceCarpet("carpet") |> applyStyle + + ///initializes a trace of type "scattercarpet" applying the given trace styling function + static member initScatterCarpet (applyStyle: TraceCarpet -> TraceCarpet) = + TraceCarpet("scattercarpet") |> applyStyle + + ///initializes a trace of type "contourcarpet" applying the given trace styling function + static member initContourCarpet (applyStyle: TraceCarpet -> TraceCarpet) = + TraceCarpet("contourcarpet") |> applyStyle \ No newline at end of file diff --git a/src/Plotly.NET/Traces/TraceDomain.fs b/src/Plotly.NET/Traces/TraceDomain.fs new file mode 100644 index 000000000..a7731ff1f --- /dev/null +++ b/src/Plotly.NET/Traces/TraceDomain.fs @@ -0,0 +1,286 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + +type TraceDomain(traceTypeName) = + + inherit Trace (traceTypeName) + + ///initializes a trace of type "pie" applying the given trace styling function + static member initPie (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("pie") |> applyStyle + + ///initializes a trace of type "funnelarea" applying the given trace styling function + static member initFunnelArea (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("funnelarea") |> applyStyle + + ///initializes a trace of type "sunburst" applying the given trace styling function + static member initSunburst (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("sunburst") |> applyStyle + + ///initializes a trace of type "treemap" applying the given trace styling function + static member initTreemap (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("treemap") |> applyStyle + + ///initializes a trace of type "parcoords" applying the given trace styling function + static member initParallelCoord (applyStyle: TraceDomain -> TraceDomain)= + TraceDomain("parcoords") |> applyStyle + + ///initializes a trace of type "parcats" applying the given trace styling function + static member initParallelCategories (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("parcats") |> applyStyle + + ///initializes a trace of type "sankey" applying the given trace styling function + static member initSankey (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("sankey") |> applyStyle + + ///initializes a trace of type "Table" applying the given trace styling function + static member initTable (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("table") |> applyStyle + + ///initializes a trace of type "indicator" applying the given trace styling function + static member initIndicator (applyStyle: TraceDomain -> TraceDomain) = + TraceDomain("indicator") |> applyStyle + +type TraceDomainStyle() = + + // Applies the styles of pie plot to TraceObjects + static member Pie + ( + ?Values: seq<#IConvertible>, + ?Labels: seq<#IConvertible>, + ?Label0: #IConvertible, + ?dLabel: #IConvertible, + ?Scalegroup, + ?Textinfo, + //?Textfont: FontOptions, + ?Insidetextfont: Font, + ?Outsidetextfont: Font, + ?Domain, // TODO + ?Hole: float, + ?Sort: bool, + ?Direction, // TODO + ?Rotation: float, + ?Pull: float, + ?Labelssrc: string, + ?Valuessrc: string, + ?Pullsrc + + ) = + (fun (pie:('T :> Trace)) -> + + Values |> DynObj.setValueOpt pie "values" + Labels |> DynObj.setValueOpt pie "labels" + Label0 |> DynObj.setValueOpt pie "label0" + dLabel |> DynObj.setValueOpt pie "dlabel" //-- temporarily + Scalegroup |> DynObj.setValueOpt pie "scalegroup" + Textinfo |> DynObj.setValueOpt pie "textinfo" + + Domain |> DynObj.setValueOpt pie "domain" + Hole |> DynObj.setValueOpt pie "hole" + Sort |> DynObj.setValueOpt pie "sort" + Direction |> DynObj.setValueOpt pie "direction" + Rotation |> DynObj.setValueOpt pie "rotation" + Pull |> DynObj.setValueOpt pie "pull" + Labelssrc |> DynObj.setValueOpt pie "labelssrc" + Valuessrc |> DynObj.setValueOpt pie "valuessrc" + Pullsrc |> DynObj.setValueOpt pie "pullsrc" + + // Update + //Marker |> Option.iter (updatePropertyValueAndIgnore pie <@ pie.marker @>) + //Textfont |> Option.iter (updatePropertyValueAndIgnore pie <@ pie.textfont @>) + Insidetextfont |> DynObj.setValueOpt pie "insidetextfont" + Outsidetextfont |> DynObj.setValueOpt pie "outsidetextfont" + + // out -> + pie + ) + + + static member FunnelArea + ( + ?Values : seq<#IConvertible>, + ?Labels : seq<#IConvertible>, + ?dLabel : float, + ?Label0 : float, + ?Aspectratio : float, + ?Baseratio : float, + ?Insidetextfont: Font, + ?Scalegroup : string + ) = + (fun (trace:('T :> Trace)) -> + + Values |> DynObj.setValueOpt trace "values" + Labels |> DynObj.setValueOpt trace "labels" + dLabel |> DynObj.setValueOpt trace "dlabel" + Label0 |> DynObj.setValueOpt trace "label0" + Aspectratio |> DynObj.setValueOpt trace "aspectratio" + Baseratio |> DynObj.setValueOpt trace "baseratio" + Insidetextfont |> DynObj.setValueOpt trace "insidetextfont" + Scalegroup |> DynObj.setValueOpt trace "scalegroup" + + trace + + ) + + /// Applies the styles of sundburst plot to TraceObjects + /// + /// Parameters: + /// + /// labels: Sets the labels of each of the sectors. + /// + /// parents: Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// + /// Ids: Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// + /// Values: Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. + /// + /// Text: Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// + /// Level: Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// + /// Maxdepth: Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + static member Sunburst + ( + labels : seq<#IConvertible>, + parents : seq<#IConvertible>, + ?Ids : seq, + ?Values : seq, + ?Text : seq, + ?Branchvalues : StyleParam.BranchValues, + ?Level , + ?Maxdepth : int + ) = + (fun (trace:('T :> Trace)) -> + labels |> DynObj.setValue trace "labels" + parents |> DynObj.setValue trace "parents" + Ids |> DynObj.setValueOpt trace "ids" + Values |> DynObj.setValueOpt trace "values" + Text |> DynObj.setValueOpt trace "text" + Branchvalues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert + Level |> DynObj.setValueOpt trace "level" + Maxdepth |> DynObj.setValueOpt trace "maxdepth" + trace + ) + + /// Applies the styles of treemap plot to TraceObjects + /// + /// Parameters: + /// + /// labels : Sets the labels of each of the sectors. + /// + /// parents : Sets the parent sectors for each of the sectors. Empty string items '' are understood to reference the root node in the hierarchy. If `ids` is filled, `parents` items are understood to be "ids" themselves. When `ids` is not set, plotly attempts to find matching items in `labels`, but beware they must be unique. + /// + /// Ids : Assigns id labels to each datum. These ids for object constancy of data points during animation. + /// + /// Values : Sets the values associated with each of the sectors. Use with `branchvalues` to determine how the values are summed. + /// + /// Text : Sets text elements associated with each sector. If trace `textinfo` contains a "text" flag, these elements will be seen on the chart. If trace `hoverinfo` contains a "text" flag and "hovertext" is not set, these elements will be seen in the hover labels. + /// + /// Branchvalues: Determines how the items in `values` are summed. When set to "total", items in `values` are taken to be value of all its descendants. When set to "remainder", items in `values` corresponding to the root and the branches sectors are taken to be the extra part not part of the sum of the values at their leaves. + /// + /// Tiling : Sets Tiling algorithm options + /// + /// PathBar : Sets the Pathbar used to navigate zooming + /// + /// Level : Sets the level from which this trace hierarchy is rendered. Set `level` to `''` to start from the root node in the hierarchy. Must be an "id" if `ids` is filled in, otherwise plotly attempts to find a matching item in `labels`. + /// + /// Maxdepth : Sets the number of rendered sectors from any given `level`. Set `maxdepth` to "-1" to render all the levels in the hierarchy. + static member Treemap + ( + labels : seq<#IConvertible>, + parents : seq<#IConvertible>, + ?Ids : seq, + ?Values : seq, + ?Text : seq, + ?Branchvalues : StyleParam.BranchValues, + ?Tiling : TreemapTiling, + ?PathBar : Pathbar, + ?Level , + ?Maxdepth : int + ) = + (fun (trace:('T :> Trace)) -> + labels |> DynObj.setValue trace "labels" + parents |> DynObj.setValue trace "parents" + Ids |> DynObj.setValueOpt trace "ids" + Values |> DynObj.setValueOpt trace "values" + Text |> DynObj.setValueOpt trace "text" + Branchvalues |> DynObj.setValueOptBy trace "branchvalues" StyleParam.BranchValues.convert + Tiling |> DynObj.setValueOpt trace "tiling" + PathBar |> DynObj.setValueOpt trace "pathbar" + Level |> DynObj.setValueOpt trace "level" + Maxdepth |> DynObj.setValueOpt trace "maxdepth" + trace + ) + + + + // Applies the styles of parallel coordinates plot to TraceObjects + static member ParallelCoord + ( + ?Dimensions : seq, + ?Line , + ?Domain , + ?Labelfont , + ?Tickfont : Font, + ?Rangefont : Font + ) = + (fun (parcoords:('T :> Trace)) -> + + Dimensions |> DynObj.setValueOpt parcoords "dimensions" + Line |> DynObj.setValueOpt parcoords "line" + Domain |> DynObj.setValueOpt parcoords "domain" + Labelfont |> DynObj.setValueOpt parcoords "labelfont" + Tickfont |> DynObj.setValueOpt parcoords "tickfont" + Rangefont |> DynObj.setValueOpt parcoords "rangefont" + + // out -> + parcoords + ) + + static member ParallelCategories + ( + ?Dimensions : seq, + ?Line , + ?Domain , + ?Color : seq<#IConvertible>, + ?Labelfont , + ?Tickfont : Font, + ?Rangefont : Font + ) = + (fun (parcats:('T :> Trace)) -> + + Dimensions |> DynObj.setValueOpt parcats "dimensions" + Line |> DynObj.setValueOpt parcats "line" + Domain |> DynObj.setValueOpt parcats "domain" + Color |> DynObj.setValueOpt parcats "color" + Labelfont |> DynObj.setValueOpt parcats "labelfont" + Tickfont |> DynObj.setValueOpt parcats "tickfont" + Rangefont |> DynObj.setValueOpt parcats "rangefont" + + // out -> + parcats + ) + + // Applies the styles of table plot to TraceObjects + static member Table + ( + header : TableHeader , + cells : TableCells , + ?ColumnWidth : seq, + ?ColumnOrder : seq + ) = + (fun (trace:('T :> Trace)) -> + header |> DynObj.setValue trace "header" + cells |> DynObj.setValue trace "cells" + ColumnWidth |> DynObj.setValueOpt trace "columnwidth" + ColumnOrder |> DynObj.setValueOpt trace "columnorder" + // out -> + trace + ) + diff --git a/src/Plotly.NET/Traces/TraceMap.fs b/src/Plotly.NET/Traces/TraceMap.fs new file mode 100644 index 000000000..622a6b850 --- /dev/null +++ b/src/Plotly.NET/Traces/TraceMap.fs @@ -0,0 +1,214 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + + +//Figures can include two different types of map subplots: geo subplots for outline maps and mapbox subplots for tile maps. +///The following trace types support attributes named geo or mapbox, whose values must refer to corresponding objects in the layout +///i.e. geo="geo2" etc. Note that attributes such as layout.geo2 and layout.mapbox etc do not have to be explicitly defined, in which +///case default values will be inferred. Multiple traces of a compatible type can be placed on the same subplot. +/// +/// The following trace types are compatible with geo subplots via the geo attribute: +/// +/// - scattergeo, which can be used to draw individual markers, line and curves and filled areas on outline maps +/// +/// - choropleth: colored polygons on outline maps +/// +/// The following trace types are compatible with mapbox subplots via the mapbox attribute: +/// +/// - scattermapbox, which can be used to draw individual markers, lines and curves and filled areas on tile maps +/// +/// - choroplethmapbox: colored polygons on tile maps +/// +/// - densitymapbox: density heatmaps on tile maps + +type TraceMap(traceTypeName) = + + inherit Trace (traceTypeName) + + ///initializes a trace of type "scattergeo" applying the given trace styling function + static member initScatterGeo (applyStyle: TraceMap -> TraceMap) = + TraceMap("scattergeo") |> applyStyle + + ///initializes a trace of type "choropleth" applying the given trace styling function + static member initChoroplethMap (applyStyle: TraceMap -> TraceMap) = + TraceMap("choropleth") |> applyStyle + + ///initializes a trace of type "scattermapbox" applying the given trace styling function + static member initScatterMapbox (applyStyle: TraceMap -> TraceMap) = + TraceMap("scattermapbox") |> applyStyle + + ///initializes a trace of type "choroplethmapbox" applying the given trace styling function + static member initChoroplethMapbox (applyStyle: TraceMap -> TraceMap) = + TraceMap("choroplethmapbox") |> applyStyle + + ///initializes a trace of type "densitymapbox" applying the given trace styling function + static member initDensityMapbox (applyStyle: TraceMap -> TraceMap) = + TraceMap("densitymapbox") |> applyStyle + +type TraceMapStyle() = + + // Applies the styles of choropleth map plot to TraceObjects + static member ChoroplethMap + ( + ?Locations : seq, + ?Z : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?Locationmode : StyleParam.LocationFormat, + ?Autocolorscale : bool, + ?Colorscale : StyleParam.Colorscale, + ?ColorBar : ColorBar, + ?Marker : Marker, + ?GeoJson, + ?FeatureIdKey : string, + ?Zmin : float, + ?Zmid : float, + ?Zmax : float + ) = + (fun (choropleth: #Trace) -> + + Locations |> DynObj.setValueOpt choropleth "locations" + Z |> DynObj.setValueOpt choropleth "z" + Text |> DynObj.setValueOpt choropleth "text" + Locationmode |> DynObj.setValueOptBy choropleth "locationmode" StyleParam.LocationFormat.convert + Autocolorscale |> DynObj.setValueOpt choropleth "autocolorscale" + + Colorscale |> DynObj.setValueOptBy choropleth "colorscale" StyleParam.Colorscale.convert + ColorBar |> DynObj.setValueOpt choropleth "colorbar" + Marker |> DynObj.setValueOpt choropleth "marker" + GeoJson |> DynObj.setValueOpt choropleth "geojson" + FeatureIdKey |> DynObj.setValueOpt choropleth "featureidkey" + Zmin |> DynObj.setValueOpt choropleth "zmin" + Zmid |> DynObj.setValueOpt choropleth "zmid" + Zmax |> DynObj.setValueOpt choropleth "zmax" + + choropleth + ) + + + static member ScatterGeo + ( + mode : StyleParam.Mode, + ?Longitudes : #IConvertible seq, + ?Latitudes : #IConvertible seq, + ?Locations : seq, + ?GeoJson , + ?FeatureIdKey:string, + ?Connectgaps : bool, + ?Fill : StyleParam.Fill, + ?Fillcolor + ) = + (fun (trace: #Trace) -> + + mode |> StyleParam.Mode.convert |> DynObj.setValue trace "mode" + Longitudes |> DynObj.setValueOpt trace "lon" + Latitudes |> DynObj.setValueOpt trace "lat" + Locations |> DynObj.setValueOpt trace "locations" + GeoJson |> DynObj.setValueOpt trace "geojson" + FeatureIdKey|> DynObj.setValueOpt trace "featureidkey" + Connectgaps |> DynObj.setValueOpt trace "connectgaps" + Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert + Fillcolor |> DynObj.setValueOpt trace "fillcolor" + + trace + + ) + + static member ScatterMapbox + ( + mode : StyleParam.Mode, + ?Longitudes : #IConvertible seq, + ?Latitudes : #IConvertible seq, + ?Below : string, + ?Connectgaps: bool, + ?Fill : StyleParam.Fill, + ?Fillcolor : string + ) = + (fun (trace:#Trace) -> + + mode |> StyleParam.Mode.convert |> DynObj.setValue trace "mode" + Longitudes |> DynObj.setValueOpt trace "lon" + Latitudes |> DynObj.setValueOpt trace "lat" + Below |> DynObj.setValueOpt trace "below" + Connectgaps |> DynObj.setValueOpt trace "connectgaps" + Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert + Fillcolor |> DynObj.setValueOpt trace "fillcolor" + + trace + ) + + static member ChoroplethMapbox + ( + ?Z : seq<#IConvertible>, + ?GeoJson, + ?FeatureIdKey : string, + ?Locations : seq<#IConvertible>, + ?Text : seq<#IConvertible>, + ?Below : string, + ?Colorscale : StyleParam.Colorscale, + ?ColorBar : ColorBar, + ?Showscale : bool, + ?ZAuto : bool, + ?ZMin : float, + ?ZMid : float, + ?ZMax : float + ) = + (fun (trace: #Trace) -> + + Z |> DynObj.setValueOpt trace "z" + GeoJson |> DynObj.setValueOpt trace "geojson" + FeatureIdKey|> DynObj.setValueOpt trace "featureidkey" + Locations |> DynObj.setValueOpt trace "locations" + Text |> DynObj.setValueOpt trace "text" + Below |> DynObj.setValueOpt trace "below" + Colorscale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert + ColorBar |> DynObj.setValueOpt trace "colorbar" + Showscale |> DynObj.setValueOpt trace "showscale" + ZAuto |> DynObj.setValueOpt trace "zauto" + ZMin |> DynObj.setValueOpt trace "zmin" + ZMid |> DynObj.setValueOpt trace "zmid" + ZMax |> DynObj.setValueOpt trace "zmax" + + trace + ) + + static member DensityMapbox + ( + ?Z : seq<#IConvertible>, + ?Radius : float, + ?Longitudes : #IConvertible seq, + ?Latitudes : #IConvertible seq, + ?Opacity : float, + ?Text : seq<#IConvertible>, + ?Below : string, + ?Colorscale : StyleParam.Colorscale, + ?ColorBar : ColorBar, + ?Showscale : bool, + ?ZAuto : bool, + ?ZMin : float, + ?ZMid : float, + ?ZMax : float + + ) = + (fun (trace: #Trace) -> + + Z |> DynObj.setValueOpt trace "z" + Radius |> DynObj.setValueOpt trace "radius" + Longitudes |> DynObj.setValueOpt trace "lon" + Latitudes |> DynObj.setValueOpt trace "lat" + Opacity |> DynObj.setValueOpt trace "opacity" + Text |> DynObj.setValueOpt trace "text" + Below |> DynObj.setValueOpt trace "below" + Colorscale |> DynObj.setValueOptBy trace "colorscale" StyleParam.Colorscale.convert + ColorBar |> DynObj.setValueOpt trace "colorbar" + Showscale |> DynObj.setValueOpt trace "showscale" + ZAuto |> DynObj.setValueOpt trace "zauto" + ZMin |> DynObj.setValueOpt trace "zmin" + ZMid |> DynObj.setValueOpt trace "zmid" + ZMax |> DynObj.setValueOpt trace "zmax" + + trace + ) \ No newline at end of file diff --git a/src/Plotly.NET/Traces/TracePolar.fs b/src/Plotly.NET/Traces/TracePolar.fs new file mode 100644 index 000000000..268c857bd --- /dev/null +++ b/src/Plotly.NET/Traces/TracePolar.fs @@ -0,0 +1,189 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + + +/// Traces for polar subplots, using layout.polar as anchors. +/// +/// The following trace types are compatible with polar subplots via the polar attribute: +/// +/// - scatter-like trace types: scatterpolar and scatterpolargl, which can be used to draw individual markers, curves and filled areas (i.e. radar or spider charts) +/// +/// - barpolar: useful for wind roses and other polar bar charts + +type TracePolar(traceTypeName) = + + inherit Trace (traceTypeName) + + ///initializes a trace of type "scatterpolar" applying the given trace styling function + static member initScatterPolar (applyStyle: TracePolar -> TracePolar) = + TracePolar("scatterpolar") |> applyStyle + + ///initializes a trace of type "scatterpolargl" applying the given trace styling function + static member initScatterPolarGL (applyStyle: TracePolar -> TracePolar) = + TracePolar("scatterpolargl") |> applyStyle + + ///initializes a trace of type "barpolar" applying the given trace styling function + static member initBarPolar (applyStyle: TracePolar -> TracePolar) = + TracePolar("barpolar") |> applyStyle + +type TracePolarStyle() = + + static member ScatterPolar + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Mode : StyleParam.Mode, + ?Ids : seq<#IConvertible>, + ?R : seq<#IConvertible>, + ?R0 : IConvertible, + ?DR : IConvertible, + ?Theta : seq<#IConvertible>, + ?Theta0 : #IConvertible, + ?DTheta : #IConvertible, + ?ThetaUnit : StyleParam.AngularUnit, + ?Text : seq<#IConvertible>, + ?TextPosition : StyleParam.TextInfoPosition, + ?TextTemplate : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : seq<#IConvertible>, + ?Meta : seq<#IConvertible>, + ?CustomData : seq<#IConvertible>, + ?Subplot : string, + ?Marker : Marker, + ?Line : Line, + ?TextFont : Font, + ?SelectedPoints : seq<#IConvertible>, + ?Selected : Selection, + ?Unselected : Selection, + ?ClipOnAxis : bool, + ?ConnectGaps : bool, + ?Fill : StyleParam.Fill, + ?FillColor : string, + ?HoverLabel : Hoverlabel, + ?HoverOn : string, + ?UIRevision : seq<#IConvertible> + ) = + (fun (trace:('T :> Trace)) -> + + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendRank |> DynObj.setValueOpt trace "legendrank" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" + Opacity |> DynObj.setValueOpt trace "opacity" + Mode |> DynObj.setValueOptBy trace "mode" StyleParam.Mode.convert + Ids |> DynObj.setValueOpt trace "ids" + R |> DynObj.setValueOpt trace "r" + R0 |> DynObj.setValueOpt trace "r0" + DR |> DynObj.setValueOpt trace "dr" + Theta |> DynObj.setValueOpt trace "theta" + Theta0 |> DynObj.setValueOpt trace "theta0" + DTheta |> DynObj.setValueOpt trace "dtheta" + ThetaUnit |> DynObj.setValueOptBy trace "thetaunit" StyleParam.AngularUnit.convert + Text |> DynObj.setValueOpt trace "text" + TextPosition |> DynObj.setValueOptBy trace "textposition" StyleParam.TextInfoPosition.convert + TextTemplate |> DynObj.setValueOpt trace "texttemplate" + HoverText |> DynObj.setValueOpt trace "hovertext" + HoverInfo |> DynObj.setValueOpt trace "hoverinfo" + HoverTemplate |> DynObj.setValueOpt trace "hovertemplate" + Meta |> DynObj.setValueOpt trace "meta" + CustomData |> DynObj.setValueOpt trace "customdata" + Subplot |> DynObj.setValueOpt trace "subplot" + Marker |> DynObj.setValueOpt trace "marker" + Line |> DynObj.setValueOpt trace "line" + TextFont |> DynObj.setValueOpt trace "textfont" + SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" + Selected |> DynObj.setValueOpt trace "selected" + Unselected |> DynObj.setValueOpt trace "unselected" + ClipOnAxis |> DynObj.setValueOpt trace "cliponaxis" + ConnectGaps |> DynObj.setValueOpt trace "connectgaps" + Fill |> DynObj.setValueOptBy trace "fill" StyleParam.Fill.convert + FillColor |> DynObj.setValueOpt trace "fillcolor" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + HoverOn |> DynObj.setValueOpt trace "hoveron" + UIRevision |> DynObj.setValueOpt trace "uirevision" + + trace + ) + + static member BarPolar + ( + ?Name : string, + ?Visible : StyleParam.Visible, + ?ShowLegend : bool, + ?LegendRank : int, + ?LegendGroup : string, + ?LegendGroupTitle : Title, + ?Opacity : float, + ?Ids : seq<#IConvertible>, + ?Base : #IConvertible, + ?R : seq<#IConvertible>, + ?R0 : IConvertible, + ?DR : IConvertible, + ?Theta : seq<#IConvertible>, + ?Theta0 : #IConvertible, + ?DTheta : #IConvertible, + ?ThetaUnit : StyleParam.AngularUnit, + ?Width : #IConvertible, + ?Offset : #IConvertible, + ?Text : seq<#IConvertible>, + ?HoverText : seq<#IConvertible>, + ?HoverInfo : string, + ?HoverTemplate : seq<#IConvertible>, + ?Meta : seq<#IConvertible>, + ?CustomData : seq<#IConvertible>, + ?Subplot : string, + ?Marker : Marker, + ?SelectedPoints : seq<#IConvertible>, + ?Selected : Selection, + ?Unselected : Selection, + ?HoverLabel : Hoverlabel, + ?UIRevision : seq<#IConvertible> + ) = + (fun (trace:('T :> Trace)) -> + + Name |> DynObj.setValueOpt trace "name" + Visible |> DynObj.setValueOptBy trace "visible" StyleParam.Visible.convert + ShowLegend |> DynObj.setValueOpt trace "showlegend" + LegendRank |> DynObj.setValueOpt trace "legendrank" + LegendGroup |> DynObj.setValueOpt trace "legendgroup" + LegendGroupTitle |> DynObj.setValueOpt trace "legendgrouptitle" + Opacity |> DynObj.setValueOpt trace "opacity" + Ids |> DynObj.setValueOpt trace "ids" + Base |> DynObj.setValueOpt trace "base" + R |> DynObj.setValueOpt trace "r" + R0 |> DynObj.setValueOpt trace "r0" + DR |> DynObj.setValueOpt trace "dr" + Theta |> DynObj.setValueOpt trace "theta" + Theta0 |> DynObj.setValueOpt trace "theta0" + DTheta |> DynObj.setValueOpt trace "dtheta" + ThetaUnit |> DynObj.setValueOptBy trace "thetaunit" StyleParam.AngularUnit.convert + Width |> DynObj.setValueOpt trace "width" + Offset |> DynObj.setValueOpt trace "offset" + Text |> DynObj.setValueOpt trace "text" + HoverText |> DynObj.setValueOpt trace "hovertext" + HoverInfo |> DynObj.setValueOpt trace "hoverinfo" + HoverTemplate |> DynObj.setValueOpt trace "hovertemplate" + Meta |> DynObj.setValueOpt trace "meta" + CustomData |> DynObj.setValueOpt trace "customdata" + Subplot |> DynObj.setValueOpt trace "subplot" + Marker |> DynObj.setValueOpt trace "marker" + SelectedPoints |> DynObj.setValueOpt trace "selectedpoints" + Selected |> DynObj.setValueOpt trace "selected" + Unselected |> DynObj.setValueOpt trace "unselected" + HoverLabel |> DynObj.setValueOpt trace "hoverlabel" + UIRevision |> DynObj.setValueOpt trace "uirevision" + + trace + ) \ No newline at end of file diff --git a/src/Plotly.NET/Traces/TraceTernary.fs b/src/Plotly.NET/Traces/TraceTernary.fs new file mode 100644 index 000000000..32645973a --- /dev/null +++ b/src/Plotly.NET/Traces/TraceTernary.fs @@ -0,0 +1,14 @@ +namespace Plotly.NET + +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj +open System + +type TraceTernary(traceTypeName) = + + inherit Trace (traceTypeName) + + ///initializes a trace of type "scatterternary" applying the given trace styling function + static member initScatterTernary (applyStyle:TraceTernary -> TraceTernary) = + TraceTernary("scatterternary") |> applyStyle \ No newline at end of file diff --git a/tests/Plotly.NET.Tests.CSharp/Plotly.NET.Tests.CSharp.csproj b/tests/Plotly.NET.Tests.CSharp/Plotly.NET.Tests.CSharp.csproj new file mode 100644 index 000000000..1495a6e36 --- /dev/null +++ b/tests/Plotly.NET.Tests.CSharp/Plotly.NET.Tests.CSharp.csproj @@ -0,0 +1,12 @@ + + + + + + + + Exe + net5.0 + + + diff --git a/tests/Plotly.NET.Tests.CSharp/Program.cs b/tests/Plotly.NET.Tests.CSharp/Program.cs new file mode 100644 index 000000000..b1d5482b7 --- /dev/null +++ b/tests/Plotly.NET.Tests.CSharp/Program.cs @@ -0,0 +1,13 @@ +using System; +using Plotly.NET; + +namespace Plotly.NET.Tests.CSharp +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello World!"); + } + } +} diff --git a/tests/Plotly.NET.Tests.FSharpConsole/Plotly.NET.Tests.FSharpConsole.fsproj b/tests/Plotly.NET.Tests.FSharpConsole/Plotly.NET.Tests.FSharpConsole.fsproj new file mode 100644 index 000000000..1a9dc5aa6 --- /dev/null +++ b/tests/Plotly.NET.Tests.FSharpConsole/Plotly.NET.Tests.FSharpConsole.fsproj @@ -0,0 +1,17 @@ + + + + Exe + net5.0 + 3390;$(WarnOn) + + + + + + + + + + + diff --git a/tests/Plotly.NET.Tests.FSharpConsole/Program.fs b/tests/Plotly.NET.Tests.FSharpConsole/Program.fs new file mode 100644 index 000000000..dc61d7043 --- /dev/null +++ b/tests/Plotly.NET.Tests.FSharpConsole/Program.fs @@ -0,0 +1,59 @@ +// Learn more about F# at http://docs.microsoft.com/dotnet/fsharp + +open System +open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects +open DynamicObj + +// Define a function to construct a message to print +let from whom = + sprintf "from %s" whom + +[] +let main argv = + + let scatterChart = + let x = [19; 26; 55;] + let y = [19; 26; 55;] + let z = [19; 26; 55;] + + Chart.Scatter3d(x,y,z,StyleParam.Mode.Markers) + |> Chart.withXAxisStyle("my x-axis", Id=StyleParam.SubPlotId.Scene 1) + |> Chart.withYAxisStyle("my y-axis", Id=StyleParam.SubPlotId.Scene 1) + |> Chart.withZAxisStyle("my z-axis") + |> Chart.withMarker(Marker.init(Size=5)) + |> Chart.withLine(Line.init(Color="red")) + |> Chart.withSize(800,800) + + let rec printObj (d:DynamicObj) = + + let members = d.GetDynamicMemberNames() |> Seq.cast |> List.ofSeq + + let rec loop (object:DynamicObj) (identationLevel:int) (membersLeft:string list) (acc:string list) = + let ident = [for i in 0 .. identationLevel do yield " "] |> String.concat "" + match membersLeft with + | [] -> acc |> List.rev |> String.concat "\r\n" + | m::rest -> + let item = object?(``m``) + match item with + | :? DynamicObj as item -> + let innerMembers = item.GetDynamicMemberNames() |> Seq.cast |> List.ofSeq + let innerPrint = (loop item (identationLevel + 1) innerMembers []) + loop object identationLevel rest ($"{ident}{m}:\r\n{innerPrint}" :: acc) + | _ -> + loop d identationLevel rest ($"{ident}{m}: {item}"::acc) + + loop d 0 members [] + + + scatterChart + |> GenericChart.getTraces + |> Seq.exactlyOne + |> printObj + |> printfn "%s" + + scatterChart + |> Chart.show + + 0 \ No newline at end of file diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/CategoricalCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/CategoricalCharts.fs index 9ce622019..434ed2663 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/CategoricalCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/CategoricalCharts.fs @@ -2,6 +2,8 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart open System diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs b/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs index d6203939a..ae0869396 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/ChartLayout.fs @@ -2,6 +2,8 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs b/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs index f9d02ea84..f372d00a7 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/Charts3D.fs @@ -2,8 +2,11 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart +open Plotly.NET.LayoutObjects open System //---------------------- Generate linearly spaced vector ---------------------- @@ -32,7 +35,7 @@ let scatterChart = |> Chart.withXAxisStyle("my x-axis", Id=StyleParam.SubPlotId.Scene 1) |> Chart.withYAxisStyle("my y-axis", Id=StyleParam.SubPlotId.Scene 1) |> Chart.withZAxisStyle("my z-axis") - |> Chart.withSize(800.,800.) + |> Chart.withSize(800,800) [] let ``3D Scatter charts`` = @@ -42,7 +45,7 @@ let ``3D Scatter charts`` = |> chartGeneratedContains scatterChart ); testCase "3D Scatter charts layout" ( fun () -> - """var layout = {"scene":{"xaxis":{"title":{"text":"my x-axis"}},"yaxis":{"title":{"text":"my y-axis"}},"zaxis":{"title":{"text":"my z-axis"}}},"width":800.0,"height":800.0};""" + """var layout = {"scene":{"xaxis":{"title":{"text":"my x-axis"}},"yaxis":{"title":{"text":"my y-axis"}},"zaxis":{"title":{"text":"my z-axis"}}},"width":800,"height":800};""" |> chartGeneratedContains scatterChart ); ] @@ -56,7 +59,7 @@ let pointChart = |> Chart.withXAxisStyle("my x-axis", Id=StyleParam.SubPlotId.Scene 1) |> Chart.withYAxisStyle("my y-axis", Id=StyleParam.SubPlotId.Scene 1) |> Chart.withZAxisStyle("my z-axis") - |> Chart.withSize(800.,800.) + |> Chart.withSize(800,800) [] let ``3D Point charts`` = @@ -66,7 +69,7 @@ let ``3D Point charts`` = |> chartGeneratedContains pointChart ); testCase "3D Point charts layout" ( fun () -> - """var layout = {"scene":{"xaxis":{"title":{"text":"my x-axis"}},"yaxis":{"title":{"text":"my y-axis"}},"zaxis":{"title":{"text":"my z-axis"}}},"width":800.0,"height":800.0};""" + """var layout = {"scene":{"xaxis":{"title":{"text":"my x-axis"}},"yaxis":{"title":{"text":"my y-axis"}},"zaxis":{"title":{"text":"my z-axis"}}},"width":800,"height":800};""" |> chartGeneratedContains pointChart ); ] @@ -91,7 +94,7 @@ let lineChart = |> Chart.withXAxisStyle("x-axis", Id=StyleParam.SubPlotId.Scene 1) |> Chart.withYAxisStyle("y-axis", Id=StyleParam.SubPlotId.Scene 1) |> Chart.withZAxisStyle("z-axis") - |> Chart.withSize(800., 800.) + |> Chart.withSize(800, 800) [] let ``Line charts`` = @@ -101,7 +104,7 @@ let ``Line charts`` = |> chartGeneratedContains lineChart ); testCase "Line layout" ( fun () -> - """var layout = {"scene":{"xaxis":{"title":{"text":"x-axis"}},"yaxis":{"title":{"text":"y-axis"}},"zaxis":{"title":{"text":"z-axis"}}},"width":800.0,"height":800.0};""" + """var layout = {"scene":{"xaxis":{"title":{"text":"x-axis"}},"yaxis":{"title":{"text":"y-axis"}},"zaxis":{"title":{"text":"z-axis"}}},"width":800,"height":800};""" |> chartGeneratedContains lineChart ); ] @@ -205,7 +208,7 @@ let meshChart = let b = Array.init 50 (fun _ -> rnd.NextDouble()) let c = Array.init 50 (fun _ -> rnd.NextDouble()) - Trace3d.initMesh3d + Trace3D.initMesh3d (fun mesh3d -> mesh3d?x <- a mesh3d?y <- b diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs index 59a9a3807..5ba2726ce 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/DistributionCharts.fs @@ -2,6 +2,8 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart open System @@ -11,7 +13,7 @@ let histoChart = let x = [for i=0 to 500 do yield rnd.NextDouble() ] x |> Chart.Histogram - |> Chart.withSize(500., 500.) + |> Chart.withSize(500, 500) [] let ``Histogram charts`` = @@ -25,7 +27,7 @@ let ``Histogram charts`` = |> chartGeneratedContainsList histoChart ); testCase "Histo layout" ( fun () -> - "var layout = {\"width\":500.0,\"height\":500.0};" + "var layout = {\"width\":500,\"height\":500};" |> chartGeneratedContains histoChart ); ] @@ -163,7 +165,7 @@ let ``Contour charts`` = |> chartGeneratedContains contourChart ); testCase "Contour layout" ( fun () -> - "var layout = {\"width\":600.0,\"height\":600.0};" + "var layout = {\"width\":600,\"height\":600};" |> chartGeneratedContains contourChart ); ] diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs index 22cbff569..5d0124495 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/FinanceCharts.fs @@ -2,6 +2,8 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart open System diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs index 32d9f7be7..4c8ecf858 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/GeoMapCharts.fs @@ -2,8 +2,11 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart +open Plotly.NET.LayoutObjects open System let basemapChart = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs index 447d1777f..a4ec53bf9 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/MapboxMapCharts.fs @@ -2,8 +2,11 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart +open Plotly.NET.LayoutObjects open System let baseLayerOnlyChart = diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs index 8fc96c6a6..f5b3f66e9 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/PolarCharts.fs @@ -2,6 +2,8 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart open System diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs index 2a959a21d..048674ea9 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleCharts.fs @@ -2,6 +2,8 @@ open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart open Plotly.NET.StyleParam @@ -389,7 +391,7 @@ let sequencePresentationTableChart = let font = Font.init(FontFamily.Consolas,Size=14.) let line = Line.init(0.,"white") - let chartwidth = 50. + 10. * float elementsPerRow + let chartwidth = 50 + 10 * elementsPerRow Chart.Table( headers, @@ -403,7 +405,7 @@ let sequencePresentationTableChart = AlignCells = [HorizontalAlign.Right;HorizontalAlign.Center], ColorCells = cellcolors ) - |> Chart.withSize(chartwidth,nan) + |> Chart.withSize(Width=chartwidth) |> Chart.withTitle "Sequence A" @@ -436,7 +438,7 @@ let ``Table charts`` = |> chartGeneratedContains sequencePresentationTableChart ); testCase "Sequence presentation table layout" ( fun () -> - "var layout = {\"width\":650.0,\"height\":\"NaN\",\"title\":{\"text\":\"Sequence A\"}};" + "var layout = {\"width\":650,\"title\":{\"text\":\"Sequence A\"}};" |> chartGeneratedContains sequencePresentationTableChart ); ] @@ -459,7 +461,7 @@ let heatmap1Chart = Colorscale=colorscaleValue, Showscale=true ) - |> Chart.withSize(700.,500.) + |> Chart.withSize(700,500) |> Chart.withMarginSize(Left=200.) let heatmapStyledChart = @@ -496,7 +498,7 @@ let ``Heatmap charts`` = |> chartGeneratedContains heatmap1Chart ); testCase "Heatmap layout" ( fun () -> - "var layout = {\"width\":700.0,\"height\":500.0,\"margin\":{\"l\":200.0}};" + "var layout = {\"width\":700,\"height\":500,\"margin\":{\"l\":200.0}};" |> chartGeneratedContains heatmap1Chart ); testCase "Heatmap styled data" ( fun () -> @@ -504,7 +506,7 @@ let ``Heatmap charts`` = |> chartGeneratedContains heatmapStyledChart ); testCase "Heatmap styled layout" ( fun () -> - "var layout = {\"width\":700.0,\"height\":500.0,\"margin\":{\"l\":200.0}};" + "var layout = {\"width\":700,\"height\":500,\"margin\":{\"l\":200.0}};" |> chartGeneratedContains heatmapStyledChart ); ] \ No newline at end of file diff --git a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs index 3bd36492f..aea1468b6 100644 --- a/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs +++ b/tests/Plotly.NET.Tests/HtmlCodegen/SimpleTests.fs @@ -2,6 +2,8 @@ module Tests.SimpleTests open Expecto open Plotly.NET +open Plotly.NET.LayoutObjects +open Plotly.NET.TraceObjects open TestUtils open Plotly.NET.GenericChart