diff --git a/Plotly.NET.sln b/Plotly.NET.sln
index f44672d13..a02a7574e 100644
--- a/Plotly.NET.sln
+++ b/Plotly.NET.sln
@@ -107,6 +107,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7B09CC0A-F
docs\10_1_styling_ternary_layouts.fsx = docs\10_1_styling_ternary_layouts.fsx
docs\11_1_carpet_line_scatter_plots.fsx = docs\11_1_carpet_line_scatter_plots.fsx
docs\11_2_contourcarpet_plots.fsx = docs\11_2_contourcarpet_plots.fsx
+ docs\12_1_smith_line_scatter_plots.fsx = docs\12_1_smith_line_scatter_plots.fsx
docs\_template.fsx = docs\_template.fsx
docs\_template.html = docs\_template.html
docs\_template.ipynb = docs\_template.ipynb
diff --git a/docs/01_2_multiple-charts.fsx b/docs/01_2_multiple-charts.fsx
index 3033eb66b..8b94cf830 100644
--- a/docs/01_2_multiple-charts.fsx
+++ b/docs/01_2_multiple-charts.fsx
@@ -252,20 +252,62 @@ open Plotly.NET.LayoutObjects
let multipleTraceTypesGrid =
[
- Chart.Point([1,2; 2,3])
- Chart.PointTernary([1,2,3; 2,3,4])
- Chart.Heatmap([[1; 2];[3; 4]], ShowScale=false)
- Chart.Point3D([1,3,2])
- Chart.PointMapbox([1,2]) |> Chart.withMapbox(Mapbox.init(Style = StyleParam.MapboxStyle.OpenStreetMap))
+ Chart.Point([1,2; 2,3], Name = "2D Cartesian")
+ Chart.Point3D([1,3,2], Name = "3D Cartesian")
+ Chart.PointPolar([10,20], Name = "Polar")
+ Chart.PointGeo([1,2], Name = "Geo")
+ Chart.PointMapbox([1,2], Name = "MapBox") |> Chart.withMapbox(Mapbox.init(Style = StyleParam.MapboxStyle.OpenStreetMap))
+ Chart.PointTernary([1,2,3; 2,3,4], Name = "Ternary")
+ [
+ Chart.Carpet(
+ "contour",
+ A = [0.; 1.; 2.; 3.; 0.; 1.; 2.; 3.; 0.; 1.; 2.; 3.],
+ B = [4.; 4.; 4.; 4.; 5.; 5.; 5.; 5.; 6.; 6.; 6.; 6.],
+ X = [2.; 3.; 4.; 5.; 2.2; 3.1; 4.1; 5.1; 1.5; 2.5; 3.5; 4.5],
+ Y = [1.; 1.4; 1.6; 1.75; 2.; 2.5; 2.7; 2.75; 3.; 3.5; 3.7; 3.75],
+ AAxis = LinearAxis.initCarpet(
+ TickPrefix = "a = ",
+ Smoothing = 0.,
+ MinorGridCount = 9,
+ AxisType = StyleParam.AxisType.Linear
+ ),
+ BAxis = LinearAxis.initCarpet(
+ TickPrefix = "b = ",
+ Smoothing = 0.,
+ MinorGridCount = 9,
+ AxisType = StyleParam.AxisType.Linear
+ ),
+ Opacity = 0.75
+ )
+ Chart.ContourCarpet(
+ [1.; 1.96; 2.56; 3.0625; 4.; 5.0625; 1.; 7.5625; 9.; 12.25; 15.21; 14.0625],
+ "contour",
+ A = [0; 1; 2; 3; 0; 1; 2; 3; 0; 1; 2; 3],
+ B = [4; 4; 4; 4; 5; 5; 5; 5; 6; 6; 6; 6],
+ ContourLineColor = Color.fromKeyword White,
+ ShowContourLabels = true,
+ ShowScale = false
+ )
+ ]
+ |> Chart.combine
+ Chart.Pie([10;40;50;], Name = "Domain")
+ Chart.BubbleSmith(
+ [0.5; 1.; 2.; 3.],
+ [0.5; 1.; 2.; 3.],
+ sizes = [10;20;30;40],
+ MultiText=["one";"two";"three";"four";"five";"six";"seven"],
+ TextPosition=StyleParam.TextPosition.TopCenter,
+ Name = "Smith"
+ )
[
// you can use nested combined charts, but they have to have the same trace type (Cartesian2D in this case)
let y = [2.; 1.5; 5.; 1.5; 2.; 2.5; 2.1; 2.5; 1.5; 1.;2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
- Chart.BoxPlot("y" ,y,Name="bin1",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All);
- Chart.BoxPlot("y'",y,Name="bin2",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All);
+ Chart.BoxPlot("y" ,y,Name="Combined 1",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All);
+ Chart.BoxPlot("y'",y,Name="Combined 2",Jitter=0.1,BoxPoints=StyleParam.BoxPoints.All);
]
|> Chart.combine
]
- |> Chart.Grid(2,3)
+ |> Chart.Grid(4,3)
|> Chart.withSize(1000,1000)
(*** condition: ipynb ***)
diff --git a/docs/12_1_smith_line_scatter_plots.fsx b/docs/12_1_smith_line_scatter_plots.fsx
new file mode 100644
index 000000000..e786018dd
--- /dev/null
+++ b/docs/12_1_smith_line_scatter_plots.fsx
@@ -0,0 +1,118 @@
+(**
+---
+title: Smith line and scatter plots
+category: Smith Plots
+categoryindex: 13
+index: 1
+---
+*)
+
+(*** hide ***)
+
+(*** condition: prepare ***)
+#r "nuget: Newtonsoft.JSON, 13.0.1"
+#r "nuget: DynamicObj, 1.0.1"
+#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
+
+(**
+# Smith charts
+
+[](https://mybinder.org/v2/gh/plotly/Plotly.NET/gh-pages?filepath={{fsdocs-source-basename}}.ipynb)
+[]({{root}}{{fsdocs-source-basename}}.fsx)
+[]({{root}}{{fsdocs-source-basename}}.ipynb)
+
+*Summary:* This example shows how to create smith charts in F#.
+
+let's first create some data for the purpose of creating example charts:
+
+*)
+
+open Plotly.NET
+
+// real coordinates
+let real = [0.5; 1.; 2.; 3.]
+
+// imaginary coordinates
+let imaginary = [0.5; 1.; 2.; 3.]
+
+(**
+The Smith chart, invented by Phillip H. Smith (1905�1987) and independently by Mizuhashi Tosaku, is a graphical calculator or nomogram designed for electrical and electronics engineers specializing in radio frequency (RF) engineering to assist in solving problems with transmission lines and matching circuits
+
+The Smith chart is a mathematical transformation of the two-dimensional Cartesian complex plane. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle. If we are dealing only with impedances with non-negative resistive components, our interest is focused on the area inside the circle.
+
+([Wikipedia](https://en.wikipedia.org/wiki/Smith_chart)).
+
+Still, you can plot any kind of imaginary numbers on this plane.
+
+## point smith charts
+
+use `Chart.PointSmith` to create a chart that displays points on a smith subplot:
+*)
+
+let pointSmith = Chart.PointSmith(real,imaginary)
+(*** condition: ipynb ***)
+#if IPYNB
+pointSmith
+#endif // IPYNB
+
+(***hide***)
+pointSmith |> GenericChart.toChartHTML
+(***include-it-raw***)
+
+(**
+## line smith charts
+
+use `Chart.LineSmith` to create a plot that displays a line connecting the data on a smith subplot.
+
+This example also changes the styles of the line.
+*)
+
+let lineSmith =
+ Chart.LineSmith(
+ real,
+ imaginary,
+ LineDash = StyleParam.DrawingStyle.DashDot,
+ LineColor = Color.fromKeyword Purple
+ )
+
+
+(*** condition: ipynb ***)
+#if IPYNB
+lineSmith
+#endif // IPYNB
+
+(***hide***)
+lineSmith |> GenericChart.toChartHTML
+(***include-it-raw***)
+
+(**
+## bubble smith charts
+
+use `Chart.BubbleSmith` to create a plot that displays datums on a smith subplot, with an additional 3rd dimension set as the marker size.
+
+As for all other plots above, You can for example add labels to each datum:
+*)
+
+let bubbleSmith =
+ Chart.BubbleSmith(
+ real,
+ imaginary,
+ sizes = [10;20;30;40],
+ MultiText=["one";"two";"three";"four";"five";"six";"seven"],
+ TextPosition=StyleParam.TextPosition.TopCenter
+ )
+
+(*** condition: ipynb ***)
+#if IPYNB
+bubbleSmith
+#endif // IPYNB
+
+(***hide***)
+bubbleSmith |> GenericChart.toChartHTML
+(***include-it-raw***)
diff --git a/src/Plotly.NET/ChartAPI/Chart.fs b/src/Plotly.NET/ChartAPI/Chart.fs
index 8e9122e82..b6caa9902 100644
--- a/src/Plotly.NET/ChartAPI/Chart.fs
+++ b/src/Plotly.NET/ChartAPI/Chart.fs
@@ -1723,6 +1723,180 @@ type Chart =
(fun (ch: GenericChart) -> ch |> Chart.setRadialAxis (radialAxis, id, true))
+ ///
+ /// Sets the given Smith object with the given id on the input chart's layout.
+ ///
+ /// The Smith object to set on the chart's layout
+ /// The target smith id with which the Smith object should be set.
+ /// Wether or not to combine the objects if there is already an Smith set (default is false)
+ []
+ static member setSmith
+ (
+ smith: Smith,
+ id: StyleParam.SubPlotId,
+ [] ?Combine: bool
+ ) =
+
+ let combine = defaultArg Combine false
+
+ (fun (ch: GenericChart) ->
+ if combine then
+ ch |> GenericChart.mapLayout (Layout.updateSmithById (id, smith))
+ else
+ ch |> GenericChart.mapLayout (Layout.setSmith (id, smith)))
+
+ ///
+ /// Sets the Smith for the chart's layout
+ ///
+ /// If there is already a Smith set, the objects are combined.
+ ///
+ /// The new Smith for the chart's layout
+ /// The target smith id on which the smith object should be set. Default is 1.
+ []
+ static member withSmith(smith: Smith, [] ?Id: int) =
+ let id =
+ Id |> Option.defaultValue 1 |> StyleParam.SubPlotId.Smith
+
+ (fun (ch: GenericChart) -> ch |> Chart.setSmith (smith, id, true))
+
+ ///
+ /// Sets the given Smith styles on the target Smith object on the input chart's layout.
+ ///
+ /// If there is already a Smith set, the styles are applied to it. If there is no Smith present, a new Smith object with the given styles will be set.
+ ///
+
+ []
+ static member withSmithStyle
+ (
+ [] ?BGColor: Color,
+ [] ?Domain: Domain,
+ [] ?ImaginaryAxis: ImaginaryAxis,
+ [] ?RealAxis: RealAxis,
+ [] ?Id: int
+ ) =
+ (fun (ch: GenericChart) ->
+ let smith =
+ Smith.init (?BGColor = BGColor, ?Domain = Domain, ?ImaginaryAxis = ImaginaryAxis, ?RealAxis = RealAxis)
+
+ ch |> Chart.withSmith (smith, ?Id = Id))
+
+ ///
+ /// Sets the imaginary Axis on the polar object with the given id on the input chart's layout.
+ ///
+ /// The ImaginaryAxis to set on the target polar object on the chart's layout
+ /// The target polar id with which the ImaginaryAxis should be set.(default is 1)
+ /// Wether or not to combine the objects if there is already an axis set (default is false)
+ []
+ static member setImaginaryAxis
+ (
+ imaginaryAxis: ImaginaryAxis,
+ id: StyleParam.SubPlotId,
+ [] ?Combine: bool
+ ) =
+
+ fun (ch: GenericChart) ->
+
+ let combine = defaultArg Combine false
+
+ match id with
+ | StyleParam.SubPlotId.Smith _ ->
+
+ ch
+ |> GenericChart.mapLayout
+ (fun layout ->
+ let smith = layout |> Layout.getSmithById id
+
+ if combine then
+ let currentAxis = smith |> Smith.getImaginaryAxis
+
+ let updatedAxis =
+ (DynObj.combine currentAxis imaginaryAxis) :?> ImaginaryAxis
+
+ let updatedSmith =
+ smith |> Smith.setImaginaryAxis updatedAxis
+
+ layout |> Layout.updateSmithById (id, updatedSmith)
+
+ else
+ let updatedSmith =
+ layout |> Layout.getSmithById id |> Smith.setImaginaryAxis imaginaryAxis
+
+ layout |> Layout.updateSmithById (id, updatedSmith))
+
+ | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting an imaginary Axis"
+
+ ///
+ /// Sets the ImaginaryAxis on the smith object with the given id on the input chart's layout.
+ ///
+ /// If there is already a ImaginaryAxis set on the smith object, the ImaginaryAxis objects are combined.
+ ///
+ /// The new ImaginaryAxis for the chart layout's smith object
+ /// The target smith id on which the ImaginaryAxis should be set. Default is 1.
+ []
+ static member withImaginaryAxis(imaginaryAxis: ImaginaryAxis, [] ?Id: int) =
+ let id =
+ Id |> Option.defaultValue 1 |> StyleParam.SubPlotId.Smith
+
+ (fun (ch: GenericChart) -> ch |> Chart.setImaginaryAxis (imaginaryAxis, id, true))
+
+ ///
+ /// Sets the RealAxis on the smith object with the given id on the input chart's layout.
+ ///
+ /// The RealAxis to set on the target smith object on the chart's layout
+ /// The target smith id with which the RealAxis should be set.(default is 1)
+ /// Wether or not to combine the objects if there is already an axis set (default is false)
+ []
+ static member setRealAxis
+ (
+ realAxis: RealAxis,
+ id: StyleParam.SubPlotId,
+ [] ?Combine: bool
+ ) =
+
+ fun (ch: GenericChart) ->
+
+ let combine = defaultArg Combine false
+
+ match id with
+ | StyleParam.SubPlotId.Smith _ ->
+
+ ch
+ |> GenericChart.mapLayout
+ (fun layout ->
+ let smith = layout |> Layout.getSmithById id
+
+ if combine then
+ let currentAxis = smith |> Smith.getRealAxis
+
+ let updatedAxis =
+ (DynObj.combine currentAxis realAxis) :?> RealAxis
+
+ let updatedSmith = smith |> Smith.setRealAxis updatedAxis
+
+ layout |> Layout.updateSmithById (id, updatedSmith)
+
+ else
+ let updatedSmith =
+ layout |> Layout.getSmithById id |> Smith.setRealAxis realAxis
+
+ layout |> Layout.updateSmithById (id, updatedSmith))
+
+ | _ -> failwith $"{StyleParam.SubPlotId.toString id} is an invalid subplot id for setting an real axis"
+
+ ///
+ /// Sets the RealAxis on the smith object with the given id on the input chart's layout.
+ ///
+ /// If there is already a RealAxis set on the smith object, the RealAxis objects are combined.
+ ///
+ /// The new RealAxis for the chart layout's smith object
+ /// The target smith id on which the RealAxis should be set. Default is 1.
+ []
+ static member withRealAxis(realAxis: RealAxis, [] ?Id: int) =
+ let id =
+ Id |> Option.defaultValue 1 |> StyleParam.SubPlotId.Smith
+
+ (fun (ch: GenericChart) -> ch |> Chart.setRealAxis (realAxis, id, true))
+
///
/// Sets the given Geo object with the given id on the input chart's layout.
///
@@ -2070,15 +2244,15 @@ type Chart =
ch
|> GenericChart.mapLayout
(fun layout ->
- let polar = layout |> Layout.getTernaryById id
+ let ternary = layout |> Layout.getTernaryById id
if combine then
- let currentAxis = polar |> Ternary.getAAxis
+ let currentAxis = ternary |> Ternary.getAAxis
let updatedAxis =
(DynObj.combine currentAxis aAxis) :?> LinearAxis
- let updatedTernary = polar |> Ternary.setAAxis updatedAxis
+ let updatedTernary = ternary |> Ternary.setAAxis updatedAxis
layout |> Layout.updateTernaryById (id, updatedTernary)
@@ -2128,15 +2302,15 @@ type Chart =
ch
|> GenericChart.mapLayout
(fun layout ->
- let polar = layout |> Layout.getTernaryById id
+ let ternary = layout |> Layout.getTernaryById id
if combine then
- let currentAxis = polar |> Ternary.getBAxis
+ let currentAxis = ternary |> Ternary.getBAxis
let updatedAxis =
(DynObj.combine currentAxis bAxis) :?> LinearAxis
- let updatedTernary = polar |> Ternary.setBAxis updatedAxis
+ let updatedTernary = ternary |> Ternary.setBAxis updatedAxis
layout |> Layout.updateTernaryById (id, updatedTernary)
@@ -2186,15 +2360,15 @@ type Chart =
ch
|> GenericChart.mapLayout
(fun layout ->
- let polar = layout |> Layout.getTernaryById id
+ let ternary = layout |> Layout.getTernaryById id
if combine then
- let currentAxis = polar |> Ternary.getCAxis
+ let currentAxis = ternary |> Ternary.getCAxis
let updatedAxis =
(DynObj.combine currentAxis cAxis) :?> LinearAxis
- let updatedTernary = polar |> Ternary.setCAxis updatedAxis
+ let updatedTernary = ternary |> Ternary.setCAxis updatedAxis
layout |> Layout.updateTernaryById (id, updatedTernary)
@@ -2737,6 +2911,23 @@ type Chart =
|> GenericChart.mapTrace
(fun t -> t :?> TracePolar |> TracePolarStyle.SetPolar polarAnchor :> Trace)
|> Chart.withPolar (polar, (i + 1))
+
+ | TraceID.Smith ->
+
+ let smith =
+ layout.TryGetTypedValue "smith"
+ |> Option.defaultValue (Smith.init ())
+ |> Smith.style (
+ Domain = LayoutObjects.Domain.init (Row = rowIndex - 1, Column = colIndex - 1)
+ )
+
+ let polarAnchor = StyleParam.SubPlotId.Smith(i + 1)
+
+ gChart
+ |> GenericChart.mapTrace
+ (fun t -> t :?> TraceSmith |> TraceSmithStyle.SetSmith polarAnchor :> Trace)
+ |> Chart.withSmith (smith, (i + 1))
+
| TraceID.Geo ->
let geo =
layout.TryGetTypedValue "geo"
diff --git a/src/Plotly.NET/ChartAPI/ChartSmith.fs b/src/Plotly.NET/ChartAPI/ChartSmith.fs
new file mode 100644
index 000000000..51b16d3e2
--- /dev/null
+++ b/src/Plotly.NET/ChartAPI/ChartSmith.fs
@@ -0,0 +1,706 @@
+namespace Plotly.NET
+
+open Plotly.NET.LayoutObjects
+open Plotly.NET.TraceObjects
+
+open DynamicObj
+open System
+open System.IO
+
+open GenericChart
+open StyleParam
+open System.Runtime.InteropServices
+open System.Runtime.CompilerServices
+
+[]
+module ChartSmith =
+
+ []
+ type Chart =
+
+ ///
+ /// Creates a Scatter plot on a smith coordinate system.
+ ///
+ /// In general, ScatterSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// ScatterSmith charts are the basis of PointSmith, LineSmith, and BubbleSmith Charts, and can be customized as such. We also provide abstractions for those: Chart.LineSmith, Chart.PointSmith, Chart.BubbleSmith
+ ///
+ /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Determines the drawing mode for this scatter trace.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// Sets the color of the line
+ /// Sets the colorscale of the line
+ /// Sets the width of the line
+ /// sets the drawing style of the line
+ /// Sets the line (use this for more finegrained control than the other line-associated arguments)
+ /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.
+ /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member ScatterSmith
+ (
+ real: seq<#IConvertible>,
+ imag: seq<#IConvertible>,
+ mode: StyleParam.Mode,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?LineColor: Color,
+ [] ?LineColorScale: StyleParam.Colorscale,
+ [] ?LineWidth: float,
+ [] ?LineDash: StyleParam.DrawingStyle,
+ [] ?Line: Line,
+ [] ?Fill: StyleParam.Fill,
+ [] ?FillColor: Color,
+ [] ?UseDefaults: bool
+ ) =
+ let useDefaults = defaultArg UseDefaults true
+
+ let marker =
+ Marker
+ |> Option.defaultValue (TraceObjects.Marker.init ())
+ |> TraceObjects.Marker.style (
+ ?Color = MarkerColor,
+ ?Outline = MarkerOutline,
+ ?Symbol = MarkerSymbol,
+ ?MultiSymbol = MultiMarkerSymbol,
+ ?Colorscale = MarkerColorScale,
+ ?MultiOpacity = MultiOpacity
+ )
+
+ let line =
+ Line
+ |> Option.defaultValue (Plotly.NET.Line.init ())
+ |> Plotly.NET.Line.style (
+ ?Color = LineColor,
+ ?Dash = LineDash,
+ ?Colorscale = LineColorScale,
+ ?Width = LineWidth
+ )
+
+ TraceSmith.initScatterSmith (
+ TraceSmithStyle.ScatterSmith(
+ Imag = imag,
+ Real = real,
+ Mode = mode,
+ Marker = marker,
+ Line = line,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?Fill = Fill,
+ ?FillColor = FillColor
+ )
+ )
+ |> GenericChart.ofTraceObject useDefaults
+
+ ///
+ /// Creates a Scatter plot on a smith coordinate system.
+ ///
+ /// In general, ScatterSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// ScatterSmith charts are the basis of PointSmith, LineSmith, and BubbleSmith Charts, and can be customized as such. We also provide abstractions for those: Chart.LineSmith, Chart.PointSmith, Chart.BubbleSmith
+ ///
+ /// Sets the real and imaginary components of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Determines the drawing mode for this scatter trace.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// Sets the color of the line
+ /// Sets the colorscale of the line
+ /// Sets the width of the line
+ /// sets the drawing style of the line
+ /// Sets the line (use this for more finegrained control than the other line-associated arguments)
+ /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.
+ /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member ScatterSmith
+ (
+ realImag: seq<#IConvertible * #IConvertible>,
+ mode: StyleParam.Mode,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?LineColor: Color,
+ [] ?LineColorScale: StyleParam.Colorscale,
+ [] ?LineWidth: float,
+ [] ?LineDash: StyleParam.DrawingStyle,
+ [] ?Line: Line,
+ [] ?Fill: StyleParam.Fill,
+ [] ?FillColor: Color,
+ [] ?UseDefaults: bool
+ ) =
+
+ let real, imag = Seq.unzip realImag
+
+ Chart.ScatterSmith(
+ real,
+ imag,
+ mode,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?MarkerColor = MarkerColor,
+ ?MarkerColorScale = MarkerColorScale,
+ ?MarkerOutline = MarkerOutline,
+ ?MarkerSymbol = MarkerSymbol,
+ ?MultiMarkerSymbol = MultiMarkerSymbol,
+ ?Marker = Marker,
+ ?LineColor = LineColor,
+ ?LineColorScale = LineColorScale,
+ ?LineWidth = LineWidth,
+ ?LineDash = LineDash,
+ ?Line = Line,
+ ?Fill = Fill,
+ ?FillColor = FillColor,
+ ?UseDefaults = UseDefaults
+ )
+
+ ///
+ /// Creates a Point plot on a smith coordinate system.
+ ///
+ /// In general, ScatterPoint charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member PointSmith
+ (
+ real: seq<#IConvertible>,
+ imag: seq<#IConvertible>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?UseDefaults: bool
+ ) =
+ // if text position or font is set, then show labels (not only when hovering)
+ let changeMode =
+ StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome)
+
+ Chart.ScatterSmith(
+ real,
+ imag,
+ mode = changeMode StyleParam.Mode.Markers,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?MarkerColor = MarkerColor,
+ ?MarkerColorScale = MarkerColorScale,
+ ?MarkerOutline = MarkerOutline,
+ ?MarkerSymbol = MarkerSymbol,
+ ?MultiMarkerSymbol = MultiMarkerSymbol,
+ ?Marker = Marker,
+ ?UseDefaults = UseDefaults
+ )
+
+ ///
+ /// Creates a Point plot on a smith coordinate system.
+ ///
+ /// In general, ScatterPoint charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// Sets the real and imaginary components of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member PointSmith
+ (
+ realImag: seq<#IConvertible * #IConvertible>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?UseDefaults: bool
+ ) =
+ let real, imag = Seq.unzip realImag
+
+ Chart.PointSmith(
+ real,
+ imag,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?MarkerColor = MarkerColor,
+ ?MarkerColorScale = MarkerColorScale,
+ ?MarkerOutline = MarkerOutline,
+ ?MarkerSymbol = MarkerSymbol,
+ ?MultiMarkerSymbol = MultiMarkerSymbol,
+ ?Marker = Marker,
+ ?UseDefaults = UseDefaults
+ )
+
+ ///
+ /// Creates a Line plot on a smith coordinate system.
+ ///
+ /// In general, LineSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as datums connected by a line. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// Sets the color of the line
+ /// Sets the colorscale of the line
+ /// Sets the width of the line
+ /// sets the drawing style of the line
+ /// Sets the line (use this for more finegrained control than the other line-associated arguments)
+ /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.
+ /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member LineSmith
+ (
+ real: seq<#IConvertible>,
+ imag: seq<#IConvertible>,
+ [] ?ShowMarkers: bool,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?LineColor: Color,
+ [] ?LineColorScale: StyleParam.Colorscale,
+ [] ?LineWidth: float,
+ [] ?LineDash: StyleParam.DrawingStyle,
+ [] ?Line: Line,
+ [] ?Fill: StyleParam.Fill,
+ [] ?FillColor: Color,
+ [] ?UseDefaults: bool
+ ) =
+ // if text position or font is set than show labels (not only when hovering)
+ let changeMode =
+ let isShowMarker =
+ match ShowMarkers with
+ | Some isShow -> isShow
+ | Option.None -> false
+
+ StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome)
+ >> StyleParam.ModeUtils.showMarker (isShowMarker)
+
+ Chart.ScatterSmith(
+ real,
+ imag,
+ mode = changeMode StyleParam.Mode.Lines,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?MarkerColor = MarkerColor,
+ ?MarkerColorScale = MarkerColorScale,
+ ?MarkerOutline = MarkerOutline,
+ ?MarkerSymbol = MarkerSymbol,
+ ?MultiMarkerSymbol = MultiMarkerSymbol,
+ ?Marker = Marker,
+ ?LineColor = LineColor,
+ ?LineColorScale = LineColorScale,
+ ?LineWidth = LineWidth,
+ ?LineDash = LineDash,
+ ?Line = Line,
+ ?Fill = Fill,
+ ?FillColor = FillColor,
+ ?UseDefaults = UseDefaults
+ )
+
+ ///
+ /// Creates a Line plot on a smith coordinate system.
+ ///
+ /// In general, LineSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as datums connected by a line. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// Sets the real and imaginary components of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// Sets the color of the line
+ /// Sets the colorscale of the line
+ /// Sets the width of the line
+ /// sets the drawing style of the line
+ /// Sets the line (use this for more finegrained control than the other line-associated arguments)
+ /// Sets the area to fill with a solid color. Defaults to "none" unless this trace is stacked, then it gets "tonexty" ("tonextx") if `orientation` is "v" ("h") Use with `FillColor` if not "none". "tozerox" and "tozeroy" fill to x=0 and y=0 respectively. "tonextx" and "tonexty" fill between the endpoints of this trace and the endpoints of the trace before it, connecting those endpoints with straight lines (to make a stacked area graph); if there is no trace before it, they behave like "tozerox" and "tozeroy". "toself" connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape. "tonext" fills the space between two traces if one completely encloses the other (eg consecutive contour lines), and behaves like "toself" if there is no trace before it. "tonext" should not be used if one trace does not enclose the other. Traces in a `stackgroup` will only fill to (or be filled to) other traces in the same group. With multiple `stackgroup`s or some traces stacked and some not, if fill-linked traces are not already consecutive, the later ones will be pushed down in the drawing order.
+ /// ets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member LineSmith
+ (
+ realImag: seq<#IConvertible * #IConvertible>,
+ [] ?ShowMarkers: bool,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?LineColor: Color,
+ [] ?LineColorScale: StyleParam.Colorscale,
+ [] ?LineWidth: float,
+ [] ?LineDash: StyleParam.DrawingStyle,
+ [] ?Line: Line,
+ [] ?Fill: StyleParam.Fill,
+ [] ?FillColor: Color,
+ [] ?UseDefaults: bool
+ ) =
+ let real, imag = Seq.unzip realImag
+
+ Chart.LineSmith(
+ real,
+ imag,
+ ?ShowMarkers = ShowMarkers,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?MarkerColor = MarkerColor,
+ ?MarkerColorScale = MarkerColorScale,
+ ?MarkerOutline = MarkerOutline,
+ ?MarkerSymbol = MarkerSymbol,
+ ?MultiMarkerSymbol = MultiMarkerSymbol,
+ ?Marker = Marker,
+ ?LineColor = LineColor,
+ ?LineColorScale = LineColorScale,
+ ?LineWidth = LineWidth,
+ ?LineDash = LineDash,
+ ?Line = Line,
+ ?Fill = Fill,
+ ?FillColor = FillColor,
+ ?UseDefaults = UseDefaults
+ )
+
+ ///
+ /// Creates a Bubble plot on a smith coordinate system. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes.
+ ///
+ /// In general, BubbleSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points of varying sizes. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// Sets the real component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the imaginary component of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart.
+ /// Sets the size of the points
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// Sets the color of the line
+ /// Sets the colorscale of the line
+ /// Sets the width of the line
+ /// sets the drawing style of the line
+ /// Sets the line (use this for more finegrained control than the other line-associated arguments)
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member BubbleSmith
+ (
+ real: seq<#IConvertible>,
+ imag: seq<#IConvertible>,
+ sizes: seq,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?LineColor: Color,
+ [] ?LineColorScale: StyleParam.Colorscale,
+ [] ?LineWidth: float,
+ [] ?LineDash: StyleParam.DrawingStyle,
+ [] ?Line: Line,
+ [] ?UseDefaults: bool
+ ) =
+
+ // if text position or font is set than show labels (not only when hovering)
+ let changeMode =
+ StyleParam.ModeUtils.showText (TextPosition.IsSome || MultiTextPosition.IsSome)
+
+ let marker =
+ Marker
+ |> Option.defaultValue (TraceObjects.Marker.init ())
+ |> TraceObjects.Marker.style (
+ ?Color = MarkerColor,
+ ?Outline = MarkerOutline,
+ ?Symbol = MarkerSymbol,
+ ?MultiSymbol = MultiMarkerSymbol,
+ ?Colorscale = MarkerColorScale,
+ ?MultiOpacity = MultiOpacity,
+ MultiSize = sizes
+ )
+
+ let line =
+ Line
+ |> Option.defaultValue (Plotly.NET.Line.init ())
+ |> Plotly.NET.Line.style (
+ ?Color = LineColor,
+ ?Dash = LineDash,
+ ?Colorscale = LineColorScale,
+ ?Width = LineWidth
+ )
+
+ Chart.ScatterSmith(
+ real,
+ imag,
+ mode = changeMode StyleParam.Mode.Markers,
+ Marker = marker,
+ Line = line,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?UseDefaults = UseDefaults
+ )
+
+ ///
+ /// Creates a Bubble plot on a smith coordinate system. A bubble chart is a variation of the Point chart, where the data points get an additional scale by being rendered as bubbles of different sizes.
+ ///
+ /// In general, BubbleSmith charts plot complex numbers on a transformed two-dimensional Cartesian complex plane as points of varying sizes. Complex numbers with positive real parts map inside the circle. Those with negative real parts map outside the circle.
+ ///
+ /// Sets the real components of the data, in units of normalized impedance such that real=1, imag=0 is the center of the chart, as well as the size of the points.
+ /// Sets the trace name. The trace name appear as the legend item and on hover
+ /// Determines whether or not an item corresponding to this trace is shown in the legend.
+ /// Sets the opactity of the trace
+ /// Sets the opactity of individual datum markers
+ /// Sets a text associated with each datum
+ /// Sets individual text for each datum
+ /// Sets the position of text associated with each datum
+ /// Sets the position of text associated with individual datum
+ /// Sets the color of the marker
+ /// Sets the colorscale of the marker
+ /// Sets the outline of the marker
+ /// Sets the marker symbol for each datum
+ /// Sets the marker symbol for each individual datum
+ /// Sets the marker (use this for more finegrained control than the other marker-associated arguments)
+ /// Sets the color of the line
+ /// Sets the colorscale of the line
+ /// Sets the width of the line
+ /// sets the drawing style of the line
+ /// Sets the line (use this for more finegrained control than the other line-associated arguments)
+ /// If set to false, ignore the global default settings set in `Defaults`
+ []
+ static member BubbleSmith
+ (
+ realImagSizes: seq<#IConvertible * #IConvertible * int>,
+ [] ?Name: string,
+ [] ?ShowLegend: bool,
+ [] ?Opacity: float,
+ [] ?MultiOpacity: seq,
+ [] ?Text: #IConvertible,
+ [] ?MultiText: seq<#IConvertible>,
+ [] ?TextPosition: StyleParam.TextPosition,
+ [] ?MultiTextPosition: seq,
+ [] ?MarkerColor: Color,
+ [] ?MarkerColorScale: StyleParam.Colorscale,
+ [] ?MarkerOutline: Line,
+ [] ?MarkerSymbol: StyleParam.MarkerSymbol,
+ [] ?MultiMarkerSymbol: seq,
+ [] ?Marker: Marker,
+ [] ?LineColor: Color,
+ [] ?LineColorScale: StyleParam.Colorscale,
+ [] ?LineWidth: float,
+ [] ?LineDash: StyleParam.DrawingStyle,
+ [] ?Line: Line,
+ [] ?UseDefaults: bool
+ ) =
+
+ let real, imag, sizes = Seq.unzip3 realImagSizes
+
+ Chart.BubbleSmith(
+ real,
+ imag,
+ sizes,
+ ?Name = Name,
+ ?ShowLegend = ShowLegend,
+ ?Opacity = Opacity,
+ ?MultiOpacity = MultiOpacity,
+ ?Text = Text,
+ ?MultiText = MultiText,
+ ?TextPosition = TextPosition,
+ ?MultiTextPosition = MultiTextPosition,
+ ?MarkerColor = MarkerColor,
+ ?MarkerColorScale = MarkerColorScale,
+ ?MarkerOutline = MarkerOutline,
+ ?MarkerSymbol = MarkerSymbol,
+ ?MultiMarkerSymbol = MultiMarkerSymbol,
+ ?Marker = Marker,
+ ?LineColor = LineColor,
+ ?LineColorScale = LineColorScale,
+ ?LineWidth = LineWidth,
+ ?LineDash = LineDash,
+ ?Line = Line,
+ ?UseDefaults = UseDefaults
+ )
diff --git a/src/Plotly.NET/CommonAbstractions/StyleParams.fs b/src/Plotly.NET/CommonAbstractions/StyleParams.fs
index fd09d6121..b3f4eab5d 100644
--- a/src/Plotly.NET/CommonAbstractions/StyleParams.fs
+++ b/src/Plotly.NET/CommonAbstractions/StyleParams.fs
@@ -172,6 +172,7 @@ module StyleParam =
| Ternary of int
| Scene of int
| Carpet of string
+ | Smith of int
static member toString =
function
@@ -216,6 +217,11 @@ module StyleParam =
"scene"
else
sprintf "scene%i" id
+ | Smith id ->
+ if id < 2 then
+ "smith"
+ else
+ sprintf "smith%i" id
| Carpet id -> id
static member convert = SubPlotId.toString >> box
diff --git a/src/Plotly.NET/Layout/Layout.fs b/src/Plotly.NET/Layout/Layout.fs
index 234e4166a..e8a625d48 100644
--- a/src/Plotly.NET/Layout/Layout.fs
+++ b/src/Plotly.NET/Layout/Layout.fs
@@ -676,6 +676,51 @@ type Layout() =
layout)
+ ///
+ /// Returns Some(smith) if there is a smith object set on the layout with the given id, and None otherwise.
+ ///
+ /// the target Smith id
+ static member tryGetSmithById(id: StyleParam.SubPlotId) =
+ (fun (layout: Layout) -> layout.TryGetTypedValue(StyleParam.SubPlotId.toString id))
+
+ ///
+ /// Combines the given Smith object with the one already present on the layout.
+ ///
+ /// The target smith id
+ /// The updated smith object.
+ static member updateSmithById(id: StyleParam.SubPlotId, smith: Smith) =
+ (fun (layout: Layout) ->
+
+ let smith' =
+ match layout |> Layout.tryGetPolarById (id) with
+ | Some a -> (DynObj.combine a smith) :?> Smith
+ | None -> smith
+
+ smith' |> DynObj.setValue layout (StyleParam.SubPlotId.toString id)
+
+ layout)
+
+ ///
+ /// Returns the Smith object of the layout with the given id.
+ ///
+ /// If there is no smith set, returns an empty Smith object.
+ ///
+ /// The target smith id
+ static member getSmithById(id: StyleParam.SubPlotId) =
+ (fun (layout: Layout) -> layout |> Layout.tryGetSmithById id |> Option.defaultValue (Smith.init ()))
+
+ ///
+ /// Sets a smith object on the layout as a dynamic property with the given smith id.
+ ///
+ /// The scene id of the new geo
+ /// The smith to add to the layout.
+ static member setSmith(id: StyleParam.SubPlotId, smith: Smith) =
+ (fun (layout: Layout) ->
+
+ smith |> DynObj.setValue layout (StyleParam.SubPlotId.toString id)
+
+ layout)
+
///
/// Returns Some(ColorAxis) if there is a ColorAxis object set on the layout with the given id, and None otherwise.
///
diff --git a/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs
new file mode 100644
index 000000000..470957f3a
--- /dev/null
+++ b/src/Plotly.NET/Layout/ObjectAbstractions/Smith/ImaginaryAxis.fs
@@ -0,0 +1,165 @@
+namespace Plotly.NET.LayoutObjects
+
+open Plotly.NET
+open DynamicObj
+open System
+open System.Runtime.InteropServices
+
+
+/// Angular axes can be used as a scale for the angular coordinates in polar plots.
+type ImaginaryAxis() =
+ inherit DynamicObj()
+
+ ///
+ /// Initialize an ImaginaryAxis object that can be used as a imaginary scale for smith coordinates.
+ ///
+ /// 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 color of the grid lines.
+ /// Sets the width (in px) of the grid lines.
+ /// 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-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: "%h" for half of the year as a decimal number as well as "%{n}f" for fractional seconds with n digits. For example, "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display "09~15~23.46"
+ /// 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 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.
+ /// Determines whether or not a line bounding this axis is drawn.
+ /// 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.
+ /// Same as `showtickprefix` but for tick suffixes.
+ /// Sets the tick color.
+ /// Sets the tick font.
+ /// Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: "%h" for half of the year as a decimal number as well as "%{n}f" for fractional seconds with n digits. For example, "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display "09~15~23.46"
+ /// Sets the tick length (in px).
+ /// Sets a tick label prefix.
+ /// 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 a tick label suffix.
+ /// Sets the values at which ticks on this axis appear. Defaults to `realaxis.tickvals` plus the same as negatives and zero.
+ /// Sets the tick width (in px).
+ /// 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
+ static member init
+ (
+ [] ?Color: Color,
+ [] ?GridColor: Color,
+ [] ?GridWidth: int,
+ [] ?HoverFormat: string,
+ [] ?Layer: StyleParam.Layer,
+ [] ?LineColor: Color,
+ [] ?LineWidth: int,
+ [] ?ShowGrid: bool,
+ [] ?ShowLine: bool,
+ [] ?ShowTickLabels: bool,
+ [] ?ShowTickSuffix: StyleParam.ShowTickOption,
+ [] ?ShowTickPrefix: StyleParam.ShowTickOption,
+ [] ?TickColor: Color,
+ [] ?TickFont: Font,
+ [] ?TickFormat: string,
+ [] ?TickLen: int,
+ [] ?TickPrefix: string,
+ [] ?Ticks: StyleParam.TickLabelPosition,
+ [] ?TickSuffix: string,
+ [] ?TickVals: seq<#IConvertible>,
+ [] ?TickWidth: int,
+ [] ?Visible: bool
+ ) =
+ ImaginaryAxis()
+ |> ImaginaryAxis.style (
+ ?Color = Color,
+ ?GridColor = GridColor,
+ ?GridWidth = GridWidth,
+ ?HoverFormat = HoverFormat,
+ ?Layer = Layer,
+ ?LineColor = LineColor,
+ ?LineWidth = LineWidth,
+ ?ShowGrid = ShowGrid,
+ ?ShowLine = ShowLine,
+ ?ShowTickLabels = ShowTickLabels,
+ ?ShowTickSuffix = ShowTickSuffix,
+ ?ShowTickPrefix = ShowTickPrefix,
+ ?TickColor = TickColor,
+ ?TickFont = TickFont,
+ ?TickFormat = TickFormat,
+ ?TickLen = TickLen,
+ ?TickPrefix = TickPrefix,
+ ?Ticks = Ticks,
+ ?TickSuffix = TickSuffix,
+ ?TickVals = TickVals,
+ ?TickWidth = TickWidth,
+ ?Visible = Visible
+
+ )
+
+ ///
+ /// Creates a function that applies the given style parameters to a ImaginaryAxis object
+ ///
+ /// 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 color of the grid lines.
+ /// Sets the width (in px) of the grid lines.
+ /// 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-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: "%h" for half of the year as a decimal number as well as "%{n}f" for fractional seconds with n digits. For example, "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display "09~15~23.46"
+ /// 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 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.
+ /// Determines whether or not a line bounding this axis is drawn.
+ /// 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.
+ /// Same as `showtickprefix` but for tick suffixes.
+ /// Sets the tick color.
+ /// Sets the tick font.
+ /// Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date formatter: "%h" for half of the year as a decimal number as well as "%{n}f" for fractional seconds with n digits. For example, "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display "09~15~23.46"
+ /// Sets the tick length (in px).
+ /// Sets a tick label prefix.
+ /// 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 a tick label suffix.
+ /// Sets the values at which ticks on this axis appear. Defaults to `realaxis.tickvals` plus the same as negatives and zero.
+ /// Sets the tick width (in px).
+ /// 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
+ static member style
+ (
+ [] ?Color: Color,
+ [] ?GridColor: Color,
+ [] ?GridWidth: int,
+ [] ?HoverFormat: string,
+ [] ?Layer: StyleParam.Layer,
+ [] ?LineColor: Color,
+ [] ?LineWidth: int,
+ [] ?ShowGrid: bool,
+ [] ?ShowLine: bool,
+ [] ?ShowTickLabels: bool,
+ [] ?ShowTickSuffix: StyleParam.ShowTickOption,
+ [] ?ShowTickPrefix: StyleParam.ShowTickOption,
+ [] ?TickColor: Color,
+ [] ?TickFont: Font,
+ [] ?TickFormat: string,
+ [] ?TickLen: int,
+ [