Skip to content

Commit 5bedd42

Browse files
committed
Add internal utils for multivalues, update deps
1 parent ac9664e commit 5bedd42

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

src/Plotly.NET.ImageExport/Plotly.NET.ImageExport.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</ItemGroup>
3838

3939
<ItemGroup>
40-
<PackageReference Include="DynamicObj" Version="0.0.3" />
40+
<PackageReference Include="DynamicObj" Version="0.2.0" />
4141
<PackageReference Include="PuppeteerSharp" Version="4.0.0" />
4242
</ItemGroup>
4343

src/Plotly.NET/InternalUtils.fs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[<AutoOpen>]
2+
module internal InternalUtils
3+
4+
open DynamicObj
5+
6+
[<AutoOpen>]
7+
module DynObj =
8+
9+
let setSingleOrMultiOpt (dyn:#DynamicObj) (propName:string) (single:'A option, multi:seq<'A> option) =
10+
if multi.IsSome then
11+
multi |> DynObj.setValueOpt dyn propName
12+
else
13+
single |> DynObj.setValueOpt dyn propName
14+
15+
let setSingleOrMultiOptBy (dyn:#DynamicObj) (propName:string) (f:'A -> 'B) (single:'A option, multi:seq<'A> option) =
16+
if multi.IsSome then
17+
multi |> DynObj.setValueOptBy dyn propName (Seq.map f)
18+
else
19+
single |> DynObj.setValueOptBy dyn propName f

src/Plotly.NET/Plotly.NET.fsproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<ItemGroup>
3535
<None Include="..\..\docs\img\logo.png" Pack="true" PackagePath="\" />
3636
<Compile Include="AssemblyInfo.fs" />
37+
<Compile Include="InternalUtils.fs" />
3738
<Compile Include="CommonAbstractions\StyleParams.fs" />
3839
<Compile Include="CommonAbstractions\ColorKeyword.fs" />
3940
<Compile Include="CommonAbstractions\Colors.fs" />
@@ -75,6 +76,7 @@
7576
<Compile Include="Layout\ObjectAbstractions\Polar\RadialAxis.fs" />
7677
<Compile Include="Layout\ObjectAbstractions\Polar\Polar.fs" />
7778
<Compile Include="Layout\Layout.fs" />
79+
<Compile Include="Traces\ObjectAbstractions\Gradient.fs" />
7880
<Compile Include="Traces\ObjectAbstractions\Marker.fs" />
7981
<Compile Include="Traces\ObjectAbstractions\Projection.fs" />
8082
<Compile Include="Traces\ObjectAbstractions\Surface.fs" />
@@ -126,8 +128,8 @@
126128
<None Include="Playground.fsx" />
127129
</ItemGroup>
128130
<ItemGroup>
129-
<PackageReference Include="DynamicObj" Version="0.0.3" />
130-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
131+
<PackageReference Include="DynamicObj" Version="0.2.0" />
132+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
131133
</ItemGroup>
132134
<ItemGroup>
133135
<Folder Include="DisplayOptions\ObjectAbstractions\" />

0 commit comments

Comments
 (0)