diff --git a/Plotly.NET.sln b/Plotly.NET.sln index c61a4a92e..a18272523 100644 --- a/Plotly.NET.sln +++ b/Plotly.NET.sln @@ -87,8 +87,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{60FB docs\7_0_candlestick.fsx = docs\7_0_candlestick.fsx docs\7_1_funnel.fsx = docs\7_1_funnel.fsx docs\7_2_funnel_area.fsx = docs\7_2_funnel_area.fsx - docs\8_0_polar-charts.fsx = docs\8_0_polar-charts.fsx - docs\8_1_windrose-charts.fsx = docs\8_1_windrose-charts.fsx + docs\8_0_polar_line-scatter-plots.fsx = docs\8_0_polar_line-scatter-plots.fsx + docs\8_1_polar_bar_charts.fsx = docs\8_1_polar_bar_charts.fsx + docs\8_2_styling_polar_layouts.fsx = docs\8_2_styling_polar_layouts.fsx docs\9_0_parallel-categories.fsx = docs\9_0_parallel-categories.fsx docs\9_1_parallel-coords.fsx = docs\9_1_parallel-coords.fsx docs\9_2_sankey.fsx = docs\9_2_sankey.fsx diff --git a/docs/1_0_axis-styling.fsx b/docs/1_0_axis-styling.fsx index 9cb52d9fc..2de6bfd58 100644 --- a/docs/1_0_axis-styling.fsx +++ b/docs/1_0_axis-styling.fsx @@ -64,20 +64,20 @@ The following example creates two mirrored axes with inside ticks, one of them w let mirroredXAxis = Axis.LinearAxis.init( - Title ="Log axis", - Showline = true, + Title = Title.init(Text="Mirrored axis"), + ShowLine = true, Mirror = StyleParam.Mirror.AllTicks, - Showgrid = false, + ShowGrid = false, Ticks = StyleParam.TickOptions.Inside ) let mirroredLogYAxis = Axis.LinearAxis.init( - Title ="Log axis", + Title = Title.init(Text="Log axis"), AxisType = StyleParam.AxisType.Log, - Showline = true, + ShowLine = true, Mirror = StyleParam.Mirror.AllTicks, - Showgrid = false, + ShowGrid = false, Ticks = StyleParam.TickOptions.Inside ) @@ -159,7 +159,7 @@ let twoXAxes2 = |> Chart.Combine |> Chart.withY_AxisStyle( "first y-axis", - Showline=true + ShowLine=true ) |> Chart.withX_AxisStyle( "x-axis", @@ -172,7 +172,7 @@ let twoXAxes2 = Overlaying=StyleParam.AxisAnchorId.Y 1, Position=0.10, // position the axis beteen the leftmost edge and the firt axis at 0.3 Anchor=StyleParam.AxisAnchorId.Free, - Showline=true + ShowLine=true ) (*** condition: ipynb ***) diff --git a/docs/8_0_polar-charts.fsx b/docs/8_0_polar-charts.fsx deleted file mode 100644 index 41a1648ab..000000000 --- a/docs/8_0_polar-charts.fsx +++ /dev/null @@ -1,64 +0,0 @@ -(** ---- -title: Polar charts -category: Polar Charts -categoryindex: 8 -index: 1 ---- -*) - -(*** hide ***) - -(*** condition: prepare ***) -#r "nuget: Newtonsoft.JSON, 12.0.3" -#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll" - -(*** condition: ipynb ***) -#if IPYNB -#r "nuget: Plotly.NET, {{fsdocs-package-version}}" -#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}" -#endif // IPYNB - -(** -# Polar charts - -[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)  -[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx)  -[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb) - -*Summary:* This example shows how to create polar charts in F#. - -let's first create some data for the purpose of creating example charts: - -*) - -open Plotly.NET - -let r = [ 1; 2; 3; 4; 5; 6; 7;] -let r2 = [ 5; 6; 7; 1; 2; 3; 4;] -let r3 = [ 3; 1; 5; 2; 8; 7; 5;] - -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. -*) - -let polar1 = - [ - Chart.Polar(r,t,StyleParam.Mode.Markers,Name="1") - Chart.Polar(r2,t,StyleParam.Mode.Markers,Name="2") - Chart.Polar(r3,t,StyleParam.Mode.Markers,Name="3") - ] - |> Chart.Combine - -(*** condition: ipynb ***) -#if IPYNB -polar1 -#endif // IPYNB - -(***hide***) -polar1 |> GenericChart.toChartHTML -(***include-it-raw***) diff --git a/docs/8_0_polar_line-scatter-plots.fsx b/docs/8_0_polar_line-scatter-plots.fsx new file mode 100644 index 000000000..7ebf22c3e --- /dev/null +++ b/docs/8_0_polar_line-scatter-plots.fsx @@ -0,0 +1,112 @@ +(** +--- +title: Polar line and scatter plots +category: Polar Charts +categoryindex: 8 +index: 1 +--- +*) + +(*** hide ***) + +(*** condition: prepare ***) +#r "nuget: Newtonsoft.JSON, 12.0.3" +#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll" + +(*** condition: ipynb ***) +#if IPYNB +#r "nuget: Plotly.NET, {{fsdocs-package-version}}" +#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}" +#endif // IPYNB + +(** +# Polar charts + +[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)  +[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx)  +[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb) + +*Summary:* This example shows how to create polar charts in F#. + +let's first create some data for the purpose of creating example charts: + +*) + +open Plotly.NET + +// radial coordinates +let radial = [ 1; 2; 3; 4; 5; 6; 7;] + +// angular coordinates +let theta = [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. + +In Polar Charts, a series is represented by a closed curve that connects points in the polar coordinate system. +Each data point is determined by the distance from the pole (the radial coordinate) and the angle from the fixed direction (the angular coordinate). + +## Polar point charts + +use `Chart.PointPolar` to create a polar plot that displays points on a polar coordinate system: +*) + +let pointPolar = Chart.PointPolar(radial,theta) +(*** condition: ipynb ***) +#if IPYNB +pointPolar +#endif // IPYNB + +(***hide***) +pointPolar |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Polar line charts + +use `Chart.LinePolar` to create a polar plot that displays a line connecting input the data on a polar coordinate system. + +You can for example change the line style using `Chart.withLineStyle` +*) + +let linePolar = + Chart.LinePolar(radial,theta) + |> Chart.withLineStyle(Color="purple",Dash=StyleParam.DrawingStyle.DashDot) + +(*** condition: ipynb ***) +#if IPYNB +linePolar +#endif // IPYNB + +(***hide***) +linePolar |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Polar Spline charts + +use `Chart.SpinePolar` to create a polar plot that displays a smoothed line connecting input the data on a polar coordinate system. + +As for all other plots above, You can for example add labels to each datum: +*) + +let splinePolar = + Chart.SplinePolar( + radial, + theta, + Labels=["one";"two";"three";"four";"five";"six";"seven"], + TextPosition=StyleParam.TextPosition.TopCenter, + ShowMarkers=true + ) + +(*** condition: ipynb ***) +#if IPYNB +splinePolar +#endif // IPYNB + +(***hide***) +splinePolar |> GenericChart.toChartHTML +(***include-it-raw***) diff --git a/docs/8_1_windrose-charts.fsx b/docs/8_1_polar_bar_charts.fsx similarity index 57% rename from docs/8_1_windrose-charts.fsx rename to docs/8_1_polar_bar_charts.fsx index 42656e1bc..f3a489064 100644 --- a/docs/8_1_windrose-charts.fsx +++ b/docs/8_1_polar_bar_charts.fsx @@ -1,6 +1,6 @@ (** --- -title: Windrose charts +title: Polar bar charts category: Polar Charts categoryindex: 9 index: 2 @@ -20,13 +20,13 @@ index: 2 #endif // IPYNB (** -# Wind rose charts +# Polar bar charts [![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)  [![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx)  [![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb) -*Summary:* This example shows how to create wind rose charts in F#. +*Summary:* This example shows how to create polar bar charts in F#. let's first create some data for the purpose of creating example charts: @@ -34,26 +34,36 @@ let's first create some data for the purpose of creating example charts: open Plotly.NET -let r = [77.5; 72.5; 70.0; 45.0; 22.5; 42.5; 40.0; 62.5] -let r' = [57.5; 50.0; 45.0; 35.0; 20.0; 22.5; 37.5; 55.0] -let r'' = [40.0; 30.0; 30.0; 35.0; 7.5; 7.5; 32.5; 40.0] -let r''' = [20.0; 7.5; 15.0; 22.5; 2.5; 2.5; 12.5; 22.5] +let r = [77.5; 72.5; 70.0; 45.0; 22.5; 42.5; 40.0; 62.5] +let r2 = [57.5; 50.0; 45.0; 35.0; 20.0; 22.5; 37.5; 55.0] +let r3 = [40.0; 30.0; 30.0; 35.0; 7.5; 7.5; 32.5; 40.0] +let r4 = [20.0; 7.5; 15.0; 22.5; 2.5; 2.5; 12.5; 22.5] let t = ["North"; "N-E"; "East"; "S-E"; "South"; "S-W"; "West"; "N-W"] (** +Polar bar charts plot data on a radial axis and a categorical angular axis. + +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. *) let windrose1 = [ - Chart.WindRose (r ,t,Name="11-14 m/s") - Chart.WindRose (r' ,t,Name="8-11 m/s") - Chart.WindRose (r'' ,t,Name="5-8 m/s") - Chart.WindRose (r''',t,Name="< 5 m/s") + Chart.BarPolar (r , t, Name="11-14 m/s") + Chart.BarPolar (r2, t, Name="8-11 m/s") + Chart.BarPolar (r3, t, Name="5-8 m/s") + Chart.BarPolar (r4, t, Name="< 5 m/s") ] |> Chart.Combine + |> Chart.withAngularAxis( + Axis.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 + ) + ) (*** condition: ipynb ***) #if IPYNB diff --git a/docs/8_2_styling_polar_layouts.fsx b/docs/8_2_styling_polar_layouts.fsx new file mode 100644 index 000000000..1a5d969e4 --- /dev/null +++ b/docs/8_2_styling_polar_layouts.fsx @@ -0,0 +1,116 @@ +(** +--- +title: Styling polar layouts +category: Polar Charts +categoryindex: 9 +index: 3 +--- +*) + +(*** hide ***) + +(*** condition: prepare ***) +#r "nuget: Newtonsoft.JSON, 12.0.3" +#r "../bin/Plotly.NET/netstandard2.0/Plotly.NET.dll" + +(*** condition: ipynb ***) +#if IPYNB +#r "nuget: Plotly.NET, {{fsdocs-package-version}}" +#r "nuget: Plotly.NET.Interactive, {{fsdocs-package-version}}" +#endif // IPYNB + +(** +# Styling polar layouts + +[![Binder]({{root}}img/badge-binder.svg)](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)  +[![Script]({{root}}img/badge-script.svg)]({{root}}{{fsdocs-source-basename}}.fsx)  +[![Notebook]({{root}}img/badge-notebook.svg)]({{root}}{{fsdocs-source-basename}}.ipynb) + +*Summary:* This example shows how to style polar layouts in F#. + +let's first create some data for the purpose of creating example charts: +*) +open Plotly.NET + +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;] + +(** +Consider this combined polar chart: +*) + +let combinedPolar = + [ + Chart.PointPolar(r,t,Name="PointPolar") + Chart.LinePolar(r2,t,Name="LinePolar", ShowMarkers = true) + Chart.SplinePolar(r3,t,Name="SplinePolar", ShowMarkers = true) + ] + |> Chart.Combine + +(*** condition: ipynb ***) +#if IPYNB +combinedPolar +#endif // IPYNB + +(***hide***) +combinedPolar |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Styling the polar layout + +Use the `Chart.withPolar` function and initialize a Polar layout with the desired looks +*) + +let styledPolar = + combinedPolar + |> Chart.withPolar( + Polar.init( + Sector= (0., 270.), + Hole=0.1 + ) + ) + + +(*** condition: ipynb ***) +#if IPYNB +styledPolar +#endif // IPYNB + +(***hide***) +styledPolar |> GenericChart.toChartHTML +(***include-it-raw***) + +(** +## Styling radial and angular axes + +You could pass these axes to `Chart.withPolar`, but for the case where you want to specifically set the angular or radial axis, there are the `Chart.withAngularAxis` and `Chart.withRadialAxis` functions: +*) + +let styledPolar2 = + styledPolar + |> 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 + ) + ) + + +(*** condition: ipynb ***) +#if IPYNB +styledPolar2 +#endif // IPYNB + +(***hide***) +styledPolar2 |> GenericChart.toChartHTML +(***include-it-raw***) \ No newline at end of file diff --git a/src/Plotly.NET/Axis.fs b/src/Plotly.NET/Axis.fs index b6ba0c3ab..e67d7e214 100644 --- a/src/Plotly.NET/Axis.fs +++ b/src/Plotly.NET/Axis.fs @@ -1,381 +1,1292 @@ namespace Plotly.NET open System -/// Module containing plotly axis + +/// Various axes that can be used to add scales to your plots. module Axis = - /// LinearAxis type inherits from dynamic object + /// 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 () - /// Init Generic LinearAxis type + /// + /// 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 ( - ?AxisType: StyleParam.AxisType, - ?Title: string, - ?Titlefont: Font, - ?Autorange: StyleParam.AutoRange, - ?Rangemode: StyleParam.RangeMode, - ?Range: StyleParam.Range, - ?RangeSlider: RangeSlider, - ?Fixedrange:bool, - ?Tickmode: StyleParam.TickMode, - ?nTicks: int, - ?Tick0: #IConvertible, - ?dTick: #IConvertible, - ?Tickvals: seq<#IConvertible>, - ?Ticktext: seq<#IConvertible>, - ?Ticks: StyleParam.TickOptions, - ?Mirror: StyleParam.Mirror, - ?Ticklen: float, - ?Tickwidth: float, - ?Tickcolor: string, - ?Showticklabels: bool, - ?Tickfont: Font, - ?Tickangle: int, - ?Tickprefix: string, - ?Showtickprefix: StyleParam.ShowTickOption, - ?Ticksuffix: string, - ?Showticksuffix: StyleParam.ShowTickOption, - ?Showexponent: StyleParam.ShowExponent, - ?Exponentformat: StyleParam.ExponentFormat, - ?Tickformat: string, - ?Hoverformat: string, - ?Showline: bool, - ?Linecolor: string, - ?Linewidth: float, - ?Showgrid: bool, - ?Gridcolor: string, - ?Gridwidth: float, - ?Zeroline : bool, - ?Zerolinecolor: string, - ?Zerolinewidth: float, - ?Anchor: StyleParam.AxisAnchorId, - ?Side: StyleParam.Side, - ?Overlaying: StyleParam.AxisAnchorId, - ?Domain: StyleParam.Range, - ?Position: float, - ?IsSubplotObj: bool, - ?Showspikes: bool, - ?Spikethickness: float, - ?Spikecolor: string, - ?Showbackground: bool, - ?Backgroundcolor: string, - ?Showaxeslabels: bool, - ?Visible: bool, - ?CategoryOrder: StyleParam.CategoryOrder, - ?CategoryArray: seq<#IConvertible> + ?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.AxisAnchorId, + ?ScaleRatio : float, + ?Constrain : StyleParam.AxisConstraint, + ?ConstrainToward : StyleParam.AxisConstraintDirection, + ?Matches : StyleParam.AxisAnchorId, + ?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.AxisAnchorId, + ?Side : StyleParam.Side, + ?Overlaying : StyleParam.AxisAnchorId, + ?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 ( - ?AxisType = AxisType , - ?Title = Title , - ?Titlefont = Titlefont , - ?Autorange = Autorange , - ?Rangemode = Rangemode , - ?Range = Range , - ?RangeSlider = RangeSlider , - ?Fixedrange = Fixedrange , - ?Tickmode = Tickmode , - ?nTicks = nTicks , - ?Tick0 = Tick0 , - ?dTick = dTick , - ?Tickvals = Tickvals , - ?Ticktext = Ticktext , - ?Ticks = Ticks , - ?Mirror = Mirror , - ?Ticklen = Ticklen , - ?Tickwidth = Tickwidth , - ?Tickcolor = Tickcolor , - ?Showticklabels = Showticklabels , - ?Tickfont = Tickfont , - ?Tickangle = Tickangle , - ?Tickprefix = Tickprefix , - ?Showtickprefix = Showtickprefix , - ?Ticksuffix = Ticksuffix , - ?Showticksuffix = Showticksuffix , - ?Showexponent = Showexponent , - ?Exponentformat = Exponentformat , - ?Tickformat = Tickformat , - ?Hoverformat = Hoverformat , - ?Showline = Showline , - ?Linecolor = Linecolor , - ?Linewidth = Linewidth , - ?Showgrid = Showgrid , - ?Gridcolor = Gridcolor , - ?Gridwidth = Gridwidth , - ?Zeroline = Zeroline , - ?Zerolinecolor = Zerolinecolor , - ?Zerolinewidth = Zerolinewidth , - ?Anchor = Anchor , - ?Side = Side , - ?Overlaying = Overlaying , - ?Domain = Domain , - ?Position = Position , - ?IsSubplotObj = IsSubplotObj , - ?Showspikes = Showspikes , - ?Spikethickness = Spikethickness , - ?Spikecolor = Spikecolor , - ?Showbackground = Showbackground , - ?Backgroundcolor = Backgroundcolor, - ?Showaxeslabels = Showaxeslabels, - ?Visible = Visible, - ?CategoryOrder = CategoryOrder, - ?CategoryArray = CategoryArray + ?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, - ?Title: string, - ?Titlefont: Font, - ?Autorange: StyleParam.AutoRange, - ?Rangemode: StyleParam.RangeMode, - ?Range: StyleParam.Range, - ?RangeSlider: RangeSlider, - ?Fixedrange:bool, - ?Tickmode: StyleParam.TickMode, - ?nTicks: int, - ?Tick0: #IConvertible, - ?dTick: #IConvertible, - ?Tickvals: seq<#IConvertible>, - ?Ticktext: seq<#IConvertible>, - ?Ticks: StyleParam.TickOptions, - ?Mirror: StyleParam.Mirror, - ?Ticklen: float, - ?Tickwidth: float, - ?Tickcolor: string, - ?Showticklabels: bool, - ?Tickfont: Font, - ?Tickangle: int, - ?Tickprefix: string, - ?Showtickprefix: StyleParam.ShowTickOption, - ?Ticksuffix: string, - ?Showticksuffix: StyleParam.ShowTickOption, - ?Showexponent: StyleParam.ShowExponent, - ?Exponentformat: StyleParam.ExponentFormat, - ?Tickformat: string, - ?Hoverformat: string, - ?Showline: bool, - ?Linecolor: string, - ?Linewidth: float, - ?Showgrid: bool, - ?Gridcolor: string, - ?Gridwidth: float, - ?Zeroline : bool, - ?Zerolinecolor: string, - ?Zerolinewidth: float, - ?Anchor: StyleParam.AxisAnchorId, - ?Side: StyleParam.Side, - ?Overlaying: StyleParam.AxisAnchorId, - ?Domain: StyleParam.Range, - ?Position: float, - ?IsSubplotObj: bool, - ?Showspikes: bool, - ?Spikethickness: float, - ?Spikecolor: string, - ?Showbackground: bool, - ?Backgroundcolor: string, - ?Showaxeslabels: bool, - ?Visible: bool, - ?CategoryArray: seq<#IConvertible> + 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.AxisAnchorId, + ?ScaleRatio : float, + ?Constrain : StyleParam.AxisConstraint, + ?ConstrainToward : StyleParam.AxisConstraintDirection, + ?Matches : StyleParam.AxisAnchorId, + ?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.AxisAnchorId, + ?Side : StyleParam.Side, + ?Overlaying : StyleParam.AxisAnchorId, + ?Layer : StyleParam.Layer, + ?Domain : StyleParam.Range, + ?Position : float, + ?CategoryArray : seq<#IConvertible>, + ?UIRevision : #IConvertible, + ?RangeSlider : RangeSlider, + ?RangeSelector : RangeSelector, + ?Calendar : StyleParam.Calendar ) = LinearAxis() |> LinearAxis.style ( - AxisType = StyleParam.AxisType.Category , - ?Title = Title , - ?Titlefont = Titlefont , - ?Autorange = Autorange , - ?Rangemode = Rangemode , - ?Range = Range , - ?RangeSlider = RangeSlider , - ?Fixedrange = Fixedrange , - ?Tickmode = Tickmode , - ?nTicks = nTicks , - ?Tick0 = Tick0 , - ?dTick = dTick , - ?Tickvals = Tickvals , - ?Ticktext = Ticktext , - ?Ticks = Ticks , - ?Mirror = Mirror , - ?Ticklen = Ticklen , - ?Tickwidth = Tickwidth , - ?Tickcolor = Tickcolor , - ?Showticklabels = Showticklabels , - ?Tickfont = Tickfont , - ?Tickangle = Tickangle , - ?Tickprefix = Tickprefix , - ?Showtickprefix = Showtickprefix , - ?Ticksuffix = Ticksuffix , - ?Showticksuffix = Showticksuffix , - ?Showexponent = Showexponent , - ?Exponentformat = Exponentformat , - ?Tickformat = Tickformat , - ?Hoverformat = Hoverformat , - ?Showline = Showline , - ?Linecolor = Linecolor , - ?Linewidth = Linewidth , - ?Showgrid = Showgrid , - ?Gridcolor = Gridcolor , - ?Gridwidth = Gridwidth , - ?Zeroline = Zeroline , - ?Zerolinecolor = Zerolinecolor , - ?Zerolinewidth = Zerolinewidth , - ?Anchor = Anchor , - ?Side = Side , - ?Overlaying = Overlaying , - ?Domain = Domain , - ?Position = Position , - ?IsSubplotObj = IsSubplotObj , - ?Showspikes = Showspikes , - ?Spikethickness = Spikethickness , - ?Spikecolor = Spikecolor , - ?Showbackground = Showbackground , - ?Backgroundcolor = Backgroundcolor, - ?Showaxeslabels = Showaxeslabels, - ?Visible = Visible, - CategoryOrder = categoryOrder, - ?CategoryArray = CategoryArray + 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 ) - // Applies the styles to LinearAxis() + /// + /// 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 ( - ?AxisType: StyleParam.AxisType, - ?Title: string, - ?Titlefont: Font, - ?Autorange: StyleParam.AutoRange, - ?Rangemode: StyleParam.RangeMode, - ?Range: StyleParam.Range, - ?RangeSlider: RangeSlider, - ?Fixedrange:bool, - ?Tickmode: StyleParam.TickMode, - ?nTicks: int, - ?Tick0: #IConvertible, - ?dTick: #IConvertible, - ?Tickvals: seq<#IConvertible>, - ?Ticktext: seq<#IConvertible>, - ?Ticks: StyleParam.TickOptions, - ?Mirror: StyleParam.Mirror, - ?Ticklen: float, - ?Tickwidth: float, - ?Tickcolor: string, - ?Showticklabels: bool, - ?Tickfont: Font, - ?Tickangle: int, - ?Tickprefix: string, - ?Showtickprefix: StyleParam.ShowTickOption, - ?Ticksuffix: string, - ?Showticksuffix: StyleParam.ShowTickOption, - ?Showexponent: StyleParam.ShowExponent, - ?Exponentformat: StyleParam.ExponentFormat, - ?Tickformat: string, - ?Hoverformat: string, - ?Showline: bool, - ?Linecolor: string, - ?Linewidth: float, - ?Showgrid: bool, - ?Gridcolor: string, - ?Gridwidth: float, - ?Zeroline : bool, - ?Zerolinecolor: string, - ?Zerolinewidth: float, - ?Anchor: StyleParam.AxisAnchorId, - ?Side: StyleParam.Side, - ?Overlaying: StyleParam.AxisAnchorId, - ?Domain: StyleParam.Range, - ?Position: float, - ?IsSubplotObj: bool, - ?Showspikes: bool, - ?Spikethickness: float, - ?Spikecolor: string, - ?Showbackground: bool, - ?Backgroundcolor: string, - ?Showaxeslabels: bool, - ?Visible: bool, - ?CategoryOrder: StyleParam.CategoryOrder, - ?CategoryArray: seq<#IConvertible> + ?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.AxisAnchorId, + ?ScaleRatio : float, + ?Constrain : StyleParam.AxisConstraint, + ?ConstrainToward : StyleParam.AxisConstraintDirection, + ?Matches : StyleParam.AxisAnchorId, + ?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.AxisAnchorId, + ?Side : StyleParam.Side, + ?Overlaying : StyleParam.AxisAnchorId, + ?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) -> - AxisType |> DynObj.setValueOptBy axis "type" StyleParam.AxisType.convert - Title |> DynObj.setValueOpt axis "title" - Autorange |> DynObj.setValueOptBy axis "autorange" StyleParam.AutoRange.convert - Rangemode |> DynObj.setValueOptBy axis "rangemode" StyleParam.RangeMode.convert - Range |> DynObj.setValueOptBy axis "range" StyleParam.Range.convert - RangeSlider |> DynObj.setValueOpt axis "rangeslider" - Fixedrange |> DynObj.setValueOpt axis "fixedrange" - 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 - 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" - - Tickangle |> DynObj.setValueOpt axis "tickangle" - Tickprefix |> DynObj.setValueOpt axis "tickprefix" - Showtickprefix |> DynObj.setValueOptBy axis "showtickprefix" StyleParam.ShowTickOption.convert - Ticksuffix |> DynObj.setValueOpt axis "ticksuffix" - Showticksuffix |> DynObj.setValueOptBy axis "showticksuffix" StyleParam.ShowTickOption.convert - Showexponent |> DynObj.setValueOptBy axis "showexponent" StyleParam.ShowExponent.convert - Exponentformat |> DynObj.setValueOptBy axis "exponentformat" StyleParam.ExponentFormat.convert - Tickformat |> DynObj.setValueOpt axis "tickformat" - 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" - Anchor |> DynObj.setValueOptBy axis "anchor" StyleParam.AxisAnchorId.convert - Side |> DynObj.setValueOptBy axis "side" StyleParam.Side.convert - Overlaying |> DynObj.setValueOptBy axis "overlaying" StyleParam.AxisAnchorId.convert - Domain |> DynObj.setValueOptBy axis "domain" StyleParam.Range.convert - Position |> DynObj.setValueOpt axis "position" - IsSubplotObj |> DynObj.setValueOpt axis "_isSubplotObj" - Showspikes |> DynObj.setValueOpt axis "showspikes" - Spikethickness |> DynObj.setValueOpt axis "spikethickness" - Spikecolor |> DynObj.setValueOpt axis "spikecolor" - Showbackground |> DynObj.setValueOpt axis "showbackground" - Backgroundcolor |> DynObj.setValueOpt axis "backgroundcolor" - Showaxeslabels |> DynObj.setValueOpt axis "showaxeslabels" - Visible |> DynObj.setValueOpt axis "visible" - //Update - Titlefont |> DynObj.setValueOpt axis "titlefont" - Tickfont |> DynObj.setValueOpt axis "tickfont" - CategoryOrder |> DynObj.setValueOptBy axis "categoryorder" StyleParam.CategoryOrder.convert - CategoryArray |> DynObj.setValueOpt axis "categoryarray" + 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.AxisAnchorId.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.AxisAnchorId.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.AxisAnchorId.convert + Side |> DynObj.setValueOptBy axis "side" StyleParam.Side.convert + Overlaying |> DynObj.setValueOptBy axis "overlaying" StyleParam.AxisAnchorId.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 ) - - /// Radialaxis type inherits from dynamic object + /// Radial axes can be used as a scale for the radial coordinates in polar plots. type RadialAxis () = inherit DynamicObj () - /// Init Radialaxis type - static member init (applyStyle:RadialAxis->RadialAxis) = - RadialAxis() |> applyStyle + /// + /// 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 + ) - /// Angularaxis type inherits from dynamic object - type AngularAxis () = - inherit DynamicObj () + /// + /// 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 - /// Init Angularaxis type - static member init (applyStyle:AngularAxis->AngularAxis) = - AngularAxis() |> applyStyle + 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 diff --git a/src/Plotly.NET/Button.fs b/src/Plotly.NET/Button.fs new file mode 100644 index 000000000..6df438af1 --- /dev/null +++ b/src/Plotly.NET/Button.fs @@ -0,0 +1,50 @@ +namespace Plotly.NET + +/// Dimensions type inherits from dynamic object +type Button () = + inherit DynamicObj () + + static member init + ( + ?Visible : bool, + ?Step : StyleParam.TimeStep, + ?StepMode : StyleParam.TimeStepMode, + ?Count : int, + ?Label : string, + ?Name : string, + ?TemplateItemName : string + ) = + Button () + |> Button.style + ( + ?Visible = Visible , + ?Step = Step , + ?StepMode = StepMode , + ?Count = Count , + ?Label = Label , + ?Name = Name , + ?TemplateItemName = TemplateItemName + ) + + static member style + ( + ?Visible : bool, + ?Step : StyleParam.TimeStep, + ?StepMode : StyleParam.TimeStepMode, + ?Count : int, + ?Label : string, + ?Name : string, + ?TemplateItemName : string + ) = + (fun (button:Button) -> + + Visible |> DynObj.setValueOpt button "visible" + Step |> DynObj.setValueOptBy button "step" StyleParam.TimeStep.convert + StepMode |> DynObj.setValueOptBy button "stepmode" StyleParam.TimeStepMode.convert + Count |> DynObj.setValueOpt button "count" + Label |> DynObj.setValueOpt button "label" + Name |> DynObj.setValueOpt button "name" + TemplateItemName |> DynObj.setValueOpt button "templateitemname" + + button + ) \ No newline at end of file diff --git a/src/Plotly.NET/Chart.fs b/src/Plotly.NET/Chart.fs index eb607b1a9..6fd08a186 100644 --- a/src/Plotly.NET/Chart.fs +++ b/src/Plotly.NET/Chart.fs @@ -41,15 +41,22 @@ type Chart = 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, - Showbackground = false, - Showticklabels = false, - Zeroline = false + ShowGrid = false, + ShowLine = false, + ShowTickLabels = false, + ZeroLine = false ) let trace = Trace("scatter") @@ -1234,7 +1241,9 @@ type Chart = /// Uses points, line or both depending on the mode to represent data points in a polar chart - static member Polar(r, t,mode, + static member ScatterPolar + ( + r, theta, mode, [] ?Name, [] ?Showlegend, [] ?MarkerSymbol, @@ -1244,18 +1253,29 @@ type Chart = [] ?TextPosition, [] ?TextFont, [] ?Dash, - [] ?Width) = - Trace.initScatter ( - TraceStyle.Scatter(R = r,T = t, 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 + [] ?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 Polar(rt,mode, + static member ScatterPolar + ( + rtheta, mode, [] ?Name, [] ?Showlegend, [] ?MarkerSymbol, @@ -1265,29 +1285,323 @@ type Chart = [] ?TextPosition, [] ?TextFont, [] ?Dash, - [] ?Width) = - let r,t = Seq.unzip rt - Chart.Polar(r, t, mode,?Name=Name,?Showlegend=Showlegend,?MarkerSymbol=MarkerSymbol,?Color=Color,?Opacity=Opacity,?Labels=Labels,?TextPosition=TextPosition,?TextFont=TextFont,?Dash=Dash,?Width=Width) + [] ?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 WindRose(r, t, + /// + static member LinePolar + ( + rTheta, [] ?Name, [] ?Showlegend, + [] ?ShowMarkers, + [] ?MarkerSymbol, [] ?Color, [] ?Opacity, [] ?Labels, [] ?TextPosition, [] ?TextFont, [] ?Dash, - [] ?Width) = - Trace.initWindRose ( - TraceStyle.Scatter(R = r,T = t) ) - |> TraceStyle.TraceInfo(?Name=Name,?Showlegend=Showlegend,?Opacity=Opacity) - |> TraceStyle.Line(?Color=Color,?Dash=Dash,?Width=Width) - |> TraceStyle.Marker(?Color=Color) - |> TraceStyle.TextLabel(?Text=Labels,?Textposition=TextPosition,?Textfont=TextFont) - |> GenericChart.ofTraceObject + [] ?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, diff --git a/src/Plotly.NET/ChartExtensions.fs b/src/Plotly.NET/ChartExtensions.fs index e47ca0750..7987f6f41 100644 --- a/src/Plotly.NET/ChartExtensions.fs +++ b/src/Plotly.NET/ChartExtensions.fs @@ -217,9 +217,10 @@ module ChartExtensions = // Sets x-Axis of 2d and 3d- Charts [] static member withX_AxisStyle(title, + [] ?TitleFont, [] ?MinMax, - [] ?Showgrid, - [] ?Showline, + [] ?ShowGrid, + [] ?ShowLine, [] ?Side, [] ?Overlaying, [] ?Id, @@ -229,8 +230,8 @@ module ChartExtensions = [] ?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, - ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?Zeroline=Zeroline) + 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.withX_Axis(xaxis,?Id=Id) /// Sets the range slider for the xAxis @@ -269,20 +270,21 @@ module ChartExtensions = // Sets y-Axis of 3d- Charts [] static member withY_AxisStyle(title, + [] ?TitleFont, [] ?MinMax, - [] ?Showgrid, - [] ?Showline, + [] ?ShowGrid, + [] ?ShowLine, [] ?Side, [] ?Overlaying, [] ?Id, [] ?Domain, [] ?Position, - [] ?Zeroline, + [] ?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,?Range=range,?Showgrid=Showgrid, - ?Showline=Showline,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?Zeroline=Zeroline) + 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.withY_Axis(yaxis,?Id=Id) @@ -300,14 +302,15 @@ module ChartExtensions = // Sets z-Axis style with ... [] static member withZ_AxisStyle(title, + [] ?TitleFont, [] ?MinMax, - [] ?Showgrid, - [] ?Showline, + [] ?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,?Range=range,?Showgrid=Showgrid,?Showline=Showline,?Anchor=Anchor,?Domain=domain) + 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) [] @@ -638,11 +641,17 @@ module ChartExtensions = // Set the title of a Chart [] - static member withTitle(title,[] ?Titlefont) = + static member withTitle(title,[] ?TitleFont) = (fun (ch:GenericChart) -> let layout = Layout() - |> Layout.style(Title=title,?Titlefont=Titlefont) + |> Layout.style( + Title= + Title.init( + Text = title, + ?Font = TitleFont + ) + ) GenericChart.addLayout layout ch ) @@ -1135,4 +1144,59 @@ module ChartExtensions = let file = sprintf "%s.html" guid let path = Path.Combine(tempPath, file) File.WriteAllText(path, html) - path |> openOsSpecificFile \ No newline at end of file + 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 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 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 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 + ) + + diff --git a/src/Plotly.NET/GenericChartExtensions.fs b/src/Plotly.NET/GenericChartExtensions.fs index 4a394ce75..2ca45b664 100644 --- a/src/Plotly.NET/GenericChartExtensions.fs +++ b/src/Plotly.NET/GenericChartExtensions.fs @@ -187,19 +187,19 @@ module GenericChartExtensions = [] member this.WithX_AxisStyle(title, [] ?MinMax, - [] ?Showgrid, - [] ?Showline, + [] ?ShowGrid, + [] ?ShowLine, [] ?Side, [] ?Overlaying, [] ?Id, [] ?Domain, [] ?Position, - [] ?Zeroline, + [] ?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,?Range=range,?Showgrid=Showgrid,?Showline=Showline, - ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?Zeroline=Zeroline) + let xaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine, + ?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) this |> Chart.withX_Axis(xaxis,?Id=Id) /// Sets the range slider for the xAxis @@ -240,19 +240,19 @@ module GenericChartExtensions = [] member this.WithY_AxisStyle(title, [] ?MinMax, - [] ?Showgrid, - [] ?Showline, + [] ?ShowGrid, + [] ?ShowLine, [] ?Side, [] ?Overlaying, [] ?Id, [] ?Domain, [] ?Position, - [] ?Zeroline, + [] ?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,?Range=range,?Showgrid=Showgrid, - ?Showline=Showline,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?Zeroline=Zeroline) + let yaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid, + ?ShowLine=ShowLine,?Anchor=Anchor,?Side=Side,?Domain=domain,?Overlaying=Overlaying,?Position=Position,?ZeroLine=ZeroLine) this |> Chart.withY_Axis(yaxis,?Id=Id) @@ -272,13 +272,13 @@ module GenericChartExtensions = [] member this.WithZ_AxisStyle(title, [] ?MinMax, - [] ?Showgrid, - [] ?Showline, + [] ?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,?Range=range,?Showgrid=Showgrid,?Showline=Showline,?Anchor=Anchor,?Domain=domain) + let zaxis = Axis.LinearAxis.init(Title=title,?Range=range,?ShowGrid=ShowGrid,?ShowLine=ShowLine,?Anchor=Anchor,?Domain=domain) this |> Chart.withZ_Axis(zaxis) [] @@ -560,10 +560,16 @@ module GenericChartExtensions = // Set the title of a Chart [] [] - member this.WithTitle(title,[] ?Titlefont) = + member this.WithTitle(title,[] ?TitleFont) = let layout = Layout() - |> Layout.style(Title=title,?Titlefont=Titlefont) + |> Layout.style( + Title= + Title.init( + Text = title, + ?Font = TitleFont + ) + ) GenericChart.addLayout layout this // Set showLegend of a Chart diff --git a/src/Plotly.NET/Layout.fs b/src/Plotly.NET/Layout.fs index 34fe3e0ed..fe8a41067 100644 --- a/src/Plotly.NET/Layout.fs +++ b/src/Plotly.NET/Layout.fs @@ -56,8 +56,7 @@ type Layout() = /// Init Layout type static member init ( - ?Title : string , - ?Titlefont : Font , + ?Title : Title, ?Font : Font , ?Showlegend : bool , ?Autosize , @@ -86,14 +85,14 @@ type Layout() = ?Hidesources , ?Smith , - ?Geo : Geo + ?Geo : Geo, + ?Polar : Polar ) = Layout() |> Layout.style ( ?Title = Title , - ?Titlefont = Titlefont , ?Font = Font , ?Showlegend = Showlegend , ?Autosize = Autosize , @@ -122,14 +121,14 @@ type Layout() = ?Hidesources = Hidesources , ?Smith = Smith , - ?Geo = Geo + ?Geo = Geo , + ?Polar = Polar ) // Applies the styles to Layout() static member style ( - ?Title, - ?Titlefont:Font, + ?Title: Title, ?Font:Font, ?Showlegend:bool, ?Autosize:bool, @@ -161,7 +160,8 @@ type Layout() = ?Hidesources, ?Smith, - ?Geo:Geo + ?Geo:Geo, + ?Polar : Polar ) = (fun (layout:Layout) -> @@ -180,6 +180,7 @@ type Layout() = Dragmode |> DynObj.setValueOptBy layout "dragmode" StyleParam.Dragmode.toString Geo |> DynObj.setValueOpt layout "geo" + Polar |> DynObj.setValueOpt layout "polar" Annotations |> DynObj.setValueOpt layout "annotations" @@ -192,7 +193,6 @@ type Layout() = // Update Font |> DynObj.setValueOpt layout "font" - Titlefont |> DynObj.setValueOpt layout "titlefont" Margin |> DynObj.setValueOpt layout "margin" //xAxis |> DynObj.setValueOpt layout "xaxis" //xAxis2 |> DynObj.setValueOpt layout "xaxis2" @@ -336,6 +336,34 @@ type Layout() = layout ) + static member tryGetPolarById (id:int) = + (fun (layout:Layout) -> + let key = if id < 2 then "polar" else sprintf "polar%i" id + layout.TryGetTypedValue(key) + ) + + /// 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 : int, + polar : Polar + ) = + (fun (layout:Layout) -> + + let key = if id < 2 then "polar" else sprintf "polar%i" id + + let polar' = + match layout |> Layout.tryGetPolarById(id) with + | Some a -> DynObj.combine (unbox a) polar + | None -> polar :> DynamicObj + + polar' |> DynObj.setValue layout key + + layout + ) + + static member setLegend(legend:Legend) = (fun (layout:Layout) -> legend |> DynObj.setValue layout "legend" diff --git a/src/Plotly.NET/Legend.fs b/src/Plotly.NET/Legend.fs index 17831850a..66c4eb4e6 100644 --- a/src/Plotly.NET/Legend.fs +++ b/src/Plotly.NET/Legend.fs @@ -18,9 +18,9 @@ type Legend() = ?ItemClick: StyleParam.TraceItemClickOptions, ?ItemDoubleClick: StyleParam.TraceItemClickOptions, ?X: float, - ?XAnchor: StyleParam.LegendXAnchorPosition, + ?XAnchor: StyleParam.XAnchorPosition, ?Y: float, - ?YAnchor: StyleParam.LegendYAnchorPosition, + ?YAnchor: StyleParam.YAnchorPosition, ?VerticalAlign : StyleParam.VerticalAlign, ?Title: string ) = @@ -57,9 +57,9 @@ type Legend() = ?ItemClick: StyleParam.TraceItemClickOptions, ?ItemDoubleClick: StyleParam.TraceItemClickOptions, ?X: float, - ?XAnchor: StyleParam.LegendXAnchorPosition, + ?XAnchor: StyleParam.XAnchorPosition, ?Y: float, - ?YAnchor: StyleParam.LegendYAnchorPosition, + ?YAnchor: StyleParam.YAnchorPosition, ?VerticalAlign : StyleParam.VerticalAlign, ?Title: string ) = @@ -78,8 +78,8 @@ type Legend() = ItemSizing |> DynObj.setValueOptBy legend "itemsizing" StyleParam.TraceItemSizing.convert ItemClick |> DynObj.setValueOptBy legend "itemclick" StyleParam.TraceItemClickOptions.convert ItemDoubleClick |> DynObj.setValueOptBy legend "itemdoubleclick" StyleParam.TraceItemClickOptions.convert - XAnchor |> DynObj.setValueOptBy legend "yanchor" StyleParam.LegendXAnchorPosition.convert - YAnchor |> DynObj.setValueOptBy legend "yanchor" StyleParam.LegendYAnchorPosition.convert + XAnchor |> DynObj.setValueOptBy legend "yanchor" StyleParam.XAnchorPosition.convert + YAnchor |> DynObj.setValueOptBy legend "yanchor" StyleParam.YAnchorPosition.convert VerticalAlign |> DynObj.setValueOptBy legend "valign" StyleParam.VerticalAlign.convert legend diff --git a/src/Plotly.NET/Playground.fsx b/src/Plotly.NET/Playground.fsx index 1326d0d6a..1d205e316 100644 --- a/src/Plotly.NET/Playground.fsx +++ b/src/Plotly.NET/Playground.fsx @@ -1,20 +1,23 @@ -open Plotly.NET.StyleParam - - -#r "nuget: FSharp.Data" +#r "nuget: FSharp.Data" #r "nuget: Deedle" #r "nuget: FSharpAux" #load "StyleParams.fs" #load "DynamicObj.fs" -#load "Frame.fs" #load "Colors.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 "Light.fs" #load "Legend.fs" #load "Contours.fs" @@ -28,6 +31,7 @@ #load "Marker.fs" #load "Hoverlabel.fs" #load "Axis.fs" +#load "Polar.fs" #load "Bins.fs" #load "Cumulative.fs" #load "Scene.fs" @@ -66,23 +70,53 @@ open System.IO open Deedle open FSharpAux -[ - Chart.Point([1,2;1,3]) - |> Chart.withY_AxisStyle("This title must") +open System - Chart.Line([1,2;1,3]) - |> Chart.withY_AxisStyle("be set on the",Zeroline=false) - - Chart.Spline([1,2;1,3]) - |> Chart.withY_AxisStyle("respective subplots",Zeroline=false) -] -|> Chart.SingleStack(Pattern= StyleParam.LayoutGridPattern.Coupled) -//move xAxis to bottom and increase spacing between plots by using the withLayoutGridStyle function -|> Chart.withLayoutGridStyle(YGap= 0.1) -|> Chart.withTitle("Hi i am the new SingleStackChart") -|> Chart.withX_AxisStyle("im the shared xAxis") -|> 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") @@ -359,11 +393,11 @@ let funnelArea2 = let yAxis = Axis.LinearAxis.init( - Title = "Y", - Showline = true, + Title = Title.init(Text="Y"), + ShowLine = true, Range = StyleParam.Range.MinMax (0.0, 2.0), - Tickvals = [0.0 .. 2.0], - Ticktext = [ "zero"; "one"; "two" ] + TickVals = [0.0 .. 2.0], + TickText = [ "zero"; "one"; "two" ] ) Chart.Range( @@ -749,11 +783,11 @@ generateDomainRanges 8 1 [ Chart.Point([(0,1)]) |> Chart.withY_AxisStyle("This title") Chart.Point([(0,1)]) - |> Chart.withY_AxisStyle("Must be set",Zeroline=false) + |> Chart.withY_AxisStyle("Must be set",ZeroLine=false) Chart.Point([(0,1)]) - |> Chart.withY_AxisStyle("on the respective charts",Zeroline=false) + |> Chart.withY_AxisStyle("on the respective charts",ZeroLine=false) ] -|> Chart.SingleStack +|> Chart.SingleStack() |> Chart.withLayoutGridStyle(XSide=StyleParam.LayoutGridXSide.Bottom) |> Chart.withTitle("Hi i am the new SingleStackChart") |> Chart.withX_AxisStyle("im the shared xAxis") diff --git a/src/Plotly.NET/Plotly.NET.fsproj b/src/Plotly.NET/Plotly.NET.fsproj index 5848525ee..63b297898 100644 --- a/src/Plotly.NET/Plotly.NET.fsproj +++ b/src/Plotly.NET/Plotly.NET.fsproj @@ -36,14 +36,20 @@ - + + + + + + + @@ -57,6 +63,7 @@ + diff --git a/src/Plotly.NET/Polar.fs b/src/Plotly.NET/Polar.fs new file mode 100644 index 000000000..2731b1d3c --- /dev/null +++ b/src/Plotly.NET/Polar.fs @@ -0,0 +1,83 @@ +namespace Plotly.NET + +type Polar () = + inherit DynamicObj () + + /// + /// Initialize a Polar object that contains layout options concerned with polar plots. + /// + /// Sets the domain of this polar subplot + /// Sets angular span of this polar subplot with two angles (in degrees). Sector are assumed to be spanned in the counterclockwise direction with "0" corresponding to rightmost limit of the polar subplot. + /// Sets the fraction of the radius to cut out of the polar subplot. + /// Set the background color of the subplot + /// Sets the radial axis of the polar subplot. + /// Sets the angular axis of the polar subplot. + /// Determines if the radial axis grid lines and angular axis line are drawn as "circular" sectors or as "linear" (polygon) sectors. Has an effect only when the angular axis has `type` "category". Note that `radialaxis.angle` is snapped to the angle of the closest vertex when `gridshape` is "circular" (so that radial axis scale is the same as the data scale). + /// Controls persistence of user-driven changes in axis attributes, if not overridden in the individual axes. Defaults to `layout.uirevision`. + static member init + ( + ?Domain : Domain, + ?Sector : float*float, + ?Hole : float, + ?BGColor : string, + ?RadialAxis : Axis.RadialAxis, + ?AngularAxis: Axis.AngularAxis, + ?GridShape : StyleParam.PolarGridShape, + ?UIRevision : string + ) = + Polar() + |> Polar.style + ( + ?Domain = Domain , + ?Sector = Sector , + ?Hole = Hole , + ?BGColor = BGColor , + ?RadialAxis = RadialAxis , + ?AngularAxis= AngularAxis, + ?GridShape = GridShape , + ?UIRevision = UIRevision + ) + + /// + /// Create a function that applies the given style parameters to a Polar object + /// + /// Sets the domain of this polar subplot + /// Sets angular span of this polar subplot with two angles (in degrees). Sector are assumed to be spanned in the counterclockwise direction with "0" corresponding to rightmost limit of the polar subplot. + /// Sets the fraction of the radius to cut out of the polar subplot. + /// Set the background color of the subplot + /// Sets the radial axis of the polar subplot. + /// Sets the angular axis of the polar subplot. + /// Determines if the radial axis grid lines and angular axis line are drawn as "circular" sectors or as "linear" (polygon) sectors. Has an effect only when the angular axis has `type` "category". Note that `radialaxis.angle` is snapped to the angle of the closest vertex when `gridshape` is "circular" (so that radial axis scale is the same as the data scale). + /// Controls persistence of user-driven changes in axis attributes, if not overridden in the individual axes. Defaults to `layout.uirevision`. + /// Determines how bars at the same location coordinate are displayed on the graph. With "stack", the bars are stacked on top of one another With "relative", the bars are stacked on top of one another, with negative values below the axis, positive values above With "group", the bars are plotted next to one another centered around the shared location. With "overlay", the bars are plotted over one another, you might need to an "opacity" to see multiple bars. + /// Sets the gap (in plot fraction) between bars of adjacent location coordinates. + static member style + ( + ?Domain : Domain, + ?Sector : float*float, + ?Hole : float, + ?BGColor : string, + ?RadialAxis : Axis.RadialAxis, + ?AngularAxis: Axis.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, + ?BarGap : float + + ) = + (fun (polar:Polar) -> + + Domain |> DynObj.setValueOpt polar "domain" + Sector |> DynObj.setValueOptBy polar "sector" (fun (a,b) -> [|a;b|]) + Hole |> DynObj.setValueOpt polar "hole" + BGColor |> DynObj.setValueOpt polar "bgcolor" + RadialAxis |> DynObj.setValueOpt polar "radialaxis" + 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 + BarGap |> DynObj.setValueOpt polar "bargap" + + polar + ) diff --git a/src/Plotly.NET/RangeSelector.fs b/src/Plotly.NET/RangeSelector.fs new file mode 100644 index 000000000..b4e19fe0f --- /dev/null +++ b/src/Plotly.NET/RangeSelector.fs @@ -0,0 +1,66 @@ +namespace Plotly.NET + +/// Dimensions type inherits from dynamic object +type RangeSelector () = + inherit DynamicObj () + + static member init + ( + ?Visible : bool, + ?Buttons : seq