@@ -1529,7 +1529,7 @@ type Chart =
1529
1529
ch |> Chart.withScene ( scene, ?Id = Id))
1530
1530
1531
1531
/// <summary>
1532
- /// Sets the given Polar object with the given id on the input chart's layout.
1532
+ /// Sets the given Smith object with the given id on the input chart's layout.
1533
1533
/// </summary>
1534
1534
/// <param name="polar">The Polar object to set on the chart's layout</param>
1535
1535
/// <param name="id">The target polar id with which the Polar object should be set.</param>
@@ -1723,6 +1723,180 @@ type Chart =
1723
1723
1724
1724
( fun ( ch : GenericChart ) -> ch |> Chart.setRadialAxis ( radialAxis, id, true ))
1725
1725
1726
+ /// <summary>
1727
+ /// Sets the given Smith object with the given id on the input chart's layout.
1728
+ /// </summary>
1729
+ /// <param name="smith">The Smith object to set on the chart's layout</param>
1730
+ /// <param name="id">The target smith id with which the Smith object should be set.</param>
1731
+ /// <param name="Combine">Wether or not to combine the objects if there is already an Smith set (default is false)</param>
1732
+ [<CompiledName( " SetSmith" ) >]
1733
+ static member setSmith
1734
+ (
1735
+ smith : Smith ,
1736
+ id : StyleParam.SubPlotId ,
1737
+ [<Optional; DefaultParameterValue( null ) >] ? Combine : bool
1738
+ ) =
1739
+
1740
+ let combine = defaultArg Combine false
1741
+
1742
+ ( fun ( ch : GenericChart ) ->
1743
+ if combine then
1744
+ ch |> GenericChart.mapLayout ( Layout.updateSmithById ( id, smith))
1745
+ else
1746
+ ch |> GenericChart.mapLayout ( Layout.setSmith ( id, smith)))
1747
+
1748
+ /// <summary>
1749
+ /// Sets the Smith for the chart's layout
1750
+ ///
1751
+ /// If there is already a Smith set, the objects are combined.
1752
+ /// </summary>
1753
+ /// <param name="smith">The new Smith for the chart's layout</param>
1754
+ /// <param name="Id">The target smith id on which the smith object should be set. Default is 1.</param>
1755
+ [<CompiledName( " WithSmith" ) >]
1756
+ static member withSmith ( smith : Smith , [<Optional; DefaultParameterValue( null ) >] ? Id : int ) =
1757
+ let id =
1758
+ Id |> Option.defaultValue 1 |> StyleParam.SubPlotId.Smith
1759
+
1760
+ ( fun ( ch : GenericChart ) -> ch |> Chart.setSmith ( smith, id, true ))
1761
+
1762
+ /// <summary>
1763
+ /// Sets the given Smith styles on the target Smith object on the input chart's layout.
1764
+ ///
1765
+ /// 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.
1766
+ /// </summary>
1767
+
1768
+ [<CompiledName( " WithSmithStyle" ) >]
1769
+ static member withSmithStyle
1770
+ (
1771
+ [<Optional; DefaultParameterValue( null ) >] ? BGColor : Color ,
1772
+ [<Optional; DefaultParameterValue( null ) >] ? Domain : Domain ,
1773
+ [<Optional; DefaultParameterValue( null ) >] ? ImaginaryAxis : ImaginaryAxis ,
1774
+ [<Optional; DefaultParameterValue( null ) >] ? RealAxis : RealAxis ,
1775
+ [<Optional; DefaultParameterValue( null ) >] ? Id : int
1776
+ ) =
1777
+ ( fun ( ch : GenericChart ) ->
1778
+ let smith =
1779
+ Smith.init ( ?BGColor = BGColor, ?Domain = Domain, ?ImaginaryAxis = ImaginaryAxis, ?RealAxis = RealAxis)
1780
+
1781
+ ch |> Chart.withSmith ( smith, ?Id = Id))
1782
+
1783
+ /// <summary>
1784
+ /// Sets the imaginary Axis on the polar object with the given id on the input chart's layout.
1785
+ /// </summary>
1786
+ /// <param name="angularAxis">The ImaginaryAxis to set on the target polar object on the chart's layout</param>
1787
+ /// <param name="id">The target polar id with which the ImaginaryAxis should be set.(default is 1)</param>
1788
+ /// <param name="Combine">Wether or not to combine the objects if there is already an axis set (default is false)</param>
1789
+ [<CompiledName( " SetImaginaryAxis" ) >]
1790
+ static member setImaginaryAxis
1791
+ (
1792
+ imaginaryAxis : ImaginaryAxis ,
1793
+ id : StyleParam.SubPlotId ,
1794
+ [<Optional; DefaultParameterValue( null ) >] ? Combine : bool
1795
+ ) =
1796
+
1797
+ fun ( ch : GenericChart ) ->
1798
+
1799
+ let combine = defaultArg Combine false
1800
+
1801
+ match id with
1802
+ | StyleParam.SubPlotId.Smith _ ->
1803
+
1804
+ ch
1805
+ |> GenericChart.mapLayout
1806
+ ( fun layout ->
1807
+ let smith = layout |> Layout.getSmithById id
1808
+
1809
+ if combine then
1810
+ let currentAxis = smith |> Smith.getImaginaryAxis
1811
+
1812
+ let updatedAxis =
1813
+ ( DynObj.combine currentAxis imaginaryAxis) :?> ImaginaryAxis
1814
+
1815
+ let updatedSmith =
1816
+ smith |> Smith.setImaginaryAxis updatedAxis
1817
+
1818
+ layout |> Layout.updateSmithById ( id, updatedSmith)
1819
+
1820
+ else
1821
+ let updatedSmith =
1822
+ layout |> Layout.getSmithById id |> Smith.setImaginaryAxis imaginaryAxis
1823
+
1824
+ layout |> Layout.updateSmithById ( id, updatedSmith))
1825
+
1826
+ | _ -> failwith $" {StyleParam.SubPlotId.toString id} is an invalid subplot id for setting an imaginary Axis"
1827
+
1828
+ /// <summary>
1829
+ /// Sets the ImaginaryAxis on the smith object with the given id on the input chart's layout.
1830
+ ///
1831
+ /// If there is already a ImaginaryAxis set on the smith object, the ImaginaryAxis objects are combined.
1832
+ /// </summary>
1833
+ /// <param name="imaginaryAxis">The new ImaginaryAxis for the chart layout's smith object</param>
1834
+ /// <param name="Id">The target smith id on which the ImaginaryAxis should be set. Default is 1.</param>
1835
+ [<CompiledName( " WithImaginaryAxis" ) >]
1836
+ static member withImaginaryAxis ( imaginaryAxis : ImaginaryAxis , [<Optional; DefaultParameterValue( null ) >] ? Id : int ) =
1837
+ let id =
1838
+ Id |> Option.defaultValue 1 |> StyleParam.SubPlotId.Smith
1839
+
1840
+ ( fun ( ch : GenericChart ) -> ch |> Chart.setImaginaryAxis ( imaginaryAxis, id, true ))
1841
+
1842
+ /// <summary>
1843
+ /// Sets the RealAxis on the smith object with the given id on the input chart's layout.
1844
+ /// </summary>
1845
+ /// <param name="realAxis">The RealAxis to set on the target smith object on the chart's layout</param>
1846
+ /// <param name="id">The target smith id with which the RealAxis should be set.(default is 1)</param>
1847
+ /// <param name="Combine">Wether or not to combine the objects if there is already an axis set (default is false)</param>
1848
+ [<CompiledName( " SetRealAxis" ) >]
1849
+ static member setRealAxis
1850
+ (
1851
+ realAxis : RealAxis ,
1852
+ id : StyleParam.SubPlotId ,
1853
+ [<Optional; DefaultParameterValue( null ) >] ? Combine : bool
1854
+ ) =
1855
+
1856
+ fun ( ch : GenericChart ) ->
1857
+
1858
+ let combine = defaultArg Combine false
1859
+
1860
+ match id with
1861
+ | StyleParam.SubPlotId.Smith _ ->
1862
+
1863
+ ch
1864
+ |> GenericChart.mapLayout
1865
+ ( fun layout ->
1866
+ let smith = layout |> Layout.getSmithById id
1867
+
1868
+ if combine then
1869
+ let currentAxis = smith |> Smith.getRealAxis
1870
+
1871
+ let updatedAxis =
1872
+ ( DynObj.combine currentAxis realAxis) :?> RealAxis
1873
+
1874
+ let updatedSmith = smith |> Smith.setRealAxis updatedAxis
1875
+
1876
+ layout |> Layout.updateSmithById ( id, updatedSmith)
1877
+
1878
+ else
1879
+ let updatedSmith =
1880
+ layout |> Layout.getSmithById id |> Smith.setRealAxis realAxis
1881
+
1882
+ layout |> Layout.updateSmithById ( id, updatedSmith))
1883
+
1884
+ | _ -> failwith $" {StyleParam.SubPlotId.toString id} is an invalid subplot id for setting an real axis"
1885
+
1886
+ /// <summary>
1887
+ /// Sets the RealAxis on the smith object with the given id on the input chart's layout.
1888
+ ///
1889
+ /// If there is already a RealAxis set on the smith object, the RealAxis objects are combined.
1890
+ /// </summary>
1891
+ /// <param name="realAxis">The new RealAxis for the chart layout's smith object</param>
1892
+ /// <param name="Id">The target smith id on which the RealAxis should be set. Default is 1.</param>
1893
+ [<CompiledName( " WithRealAxis" ) >]
1894
+ static member withRealAxis ( realAxis : RealAxis , [<Optional; DefaultParameterValue( null ) >] ? Id : int ) =
1895
+ let id =
1896
+ Id |> Option.defaultValue 1 |> StyleParam.SubPlotId.Smith
1897
+
1898
+ ( fun ( ch : GenericChart ) -> ch |> Chart.setRealAxis ( realAxis, id, true ))
1899
+
1726
1900
/// <summary>
1727
1901
/// Sets the given Geo object with the given id on the input chart's layout.
1728
1902
/// </summary>
@@ -2070,15 +2244,15 @@ type Chart =
2070
2244
ch
2071
2245
|> GenericChart.mapLayout
2072
2246
( fun layout ->
2073
- let polar = layout |> Layout.getTernaryById id
2247
+ let ternary = layout |> Layout.getTernaryById id
2074
2248
2075
2249
if combine then
2076
- let currentAxis = polar |> Ternary.getAAxis
2250
+ let currentAxis = ternary |> Ternary.getAAxis
2077
2251
2078
2252
let updatedAxis =
2079
2253
( DynObj.combine currentAxis aAxis) :?> LinearAxis
2080
2254
2081
- let updatedTernary = polar |> Ternary.setAAxis updatedAxis
2255
+ let updatedTernary = ternary |> Ternary.setAAxis updatedAxis
2082
2256
2083
2257
layout |> Layout.updateTernaryById ( id, updatedTernary)
2084
2258
@@ -2128,15 +2302,15 @@ type Chart =
2128
2302
ch
2129
2303
|> GenericChart.mapLayout
2130
2304
( fun layout ->
2131
- let polar = layout |> Layout.getTernaryById id
2305
+ let ternary = layout |> Layout.getTernaryById id
2132
2306
2133
2307
if combine then
2134
- let currentAxis = polar |> Ternary.getBAxis
2308
+ let currentAxis = ternary |> Ternary.getBAxis
2135
2309
2136
2310
let updatedAxis =
2137
2311
( DynObj.combine currentAxis bAxis) :?> LinearAxis
2138
2312
2139
- let updatedTernary = polar |> Ternary.setBAxis updatedAxis
2313
+ let updatedTernary = ternary |> Ternary.setBAxis updatedAxis
2140
2314
2141
2315
layout |> Layout.updateTernaryById ( id, updatedTernary)
2142
2316
@@ -2186,15 +2360,15 @@ type Chart =
2186
2360
ch
2187
2361
|> GenericChart.mapLayout
2188
2362
( fun layout ->
2189
- let polar = layout |> Layout.getTernaryById id
2363
+ let ternary = layout |> Layout.getTernaryById id
2190
2364
2191
2365
if combine then
2192
- let currentAxis = polar |> Ternary.getCAxis
2366
+ let currentAxis = ternary |> Ternary.getCAxis
2193
2367
2194
2368
let updatedAxis =
2195
2369
( DynObj.combine currentAxis cAxis) :?> LinearAxis
2196
2370
2197
- let updatedTernary = polar |> Ternary.setCAxis updatedAxis
2371
+ let updatedTernary = ternary |> Ternary.setCAxis updatedAxis
2198
2372
2199
2373
layout |> Layout.updateTernaryById ( id, updatedTernary)
2200
2374
@@ -2737,6 +2911,23 @@ type Chart =
2737
2911
|> GenericChart.mapTrace
2738
2912
( fun t -> t :?> TracePolar |> TracePolarStyle.SetPolar polarAnchor :> Trace)
2739
2913
|> Chart.withPolar ( polar, ( i + 1 ))
2914
+
2915
+ | TraceID.Smith ->
2916
+
2917
+ let smith =
2918
+ layout.TryGetTypedValue< Smith> " smith"
2919
+ |> Option.defaultValue ( Smith.init ())
2920
+ |> Smith.style (
2921
+ Domain = LayoutObjects.Domain.init ( Row = rowIndex - 1 , Column = colIndex - 1 )
2922
+ )
2923
+
2924
+ let polarAnchor = StyleParam.SubPlotId.Smith( i + 1 )
2925
+
2926
+ gChart
2927
+ |> GenericChart.mapTrace
2928
+ ( fun t -> t :?> TraceSmith |> TraceSmithStyle.SetSmith polarAnchor :> Trace)
2929
+ |> Chart.withSmith ( smith, ( i + 1 ))
2930
+
2740
2931
| TraceID.Geo ->
2741
2932
let geo =
2742
2933
layout.TryGetTypedValue< Geo> " geo"
0 commit comments