Skip to content

Commit e56f52e

Browse files
committed
Add Edit in Chart Studio option to Config
1 parent 70998ed commit e56f52e

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

src/FSharp.Plotly/Config.fs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,17 @@ type Config() =
466466
?StaticPlot : bool,
467467
?Autosizable : bool,
468468
?Responsive : bool,
469+
?ShowEditInChartStudio : bool,
469470
?ToImageButtonOptions : ToImageButtonOptions
470471
) =
471472
Config()
472473
|> Config.style
473474
(
475+
?StaticPlot = StaticPlot,
476+
?Autosizable = Autosizable,
477+
?Responsive = Responsive,
474478
?ToImageButtonOptions = ToImageButtonOptions,
475-
?StaticPlot = StaticPlot
479+
?ShowEditInChartStudio = ShowEditInChartStudio
476480
)
477481

478482

@@ -484,12 +488,14 @@ type Config() =
484488
?StaticPlot : bool,
485489
?Autosizable : bool,
486490
?Responsive : bool,
487-
?ToImageButtonOptions : ToImageButtonOptions
491+
?ToImageButtonOptions : ToImageButtonOptions,
492+
?ShowEditInChartStudio : bool
488493

489494
) =
490495
fun (config:Config) ->
491496
StaticPlot |> DynObj.setValueOpt config "staticPlot"
492497
Autosizable |> DynObj.setValueOpt config "autosizable"
493498
Responsive |> DynObj.setValueOpt config "responsive"
494499
ToImageButtonOptions |> DynObj.setValueOpt config "toImageButtonOptions"
500+
ShowEditInChartStudio |> DynObj.setValueOpt config "showEditInChartStudio"
495501
config

src/FSharp.Plotly/TestScript.fsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//#I "./bin/Debug"
2+
//#r "./bin/Debug/netstandard2.0/Newtonsoft.Json.dll"
3+
#r @"..\..\bin\FSharp.Plotly\netstandard2.0\FSharp.Plotly.dll"
4+
#r "netstandard"
5+
6+
open FSharp.Plotly
7+
8+
9+
let x = seq [1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ] // 9.; 8.; 7.; 6.; 5.; 4.; 3.; 2.; 1.]
10+
let y = seq [5.; 2.5; 5.; 7.5; 5.; 2.5; 7.5; 4.5; 5.5; 5.]
11+
let y' = seq [2.; 1.5; 5.; 1.5; 3.; 2.5; 2.5; 1.5; 3.5; 1.]
12+
13+
Chart.Spline(x,y',Name="spline")
14+
|> Chart.withConfig
15+
(Config.init
16+
(
17+
Autosizable = true,
18+
ShowEditInChartStudio = true,
19+
ToImageButtonOptions =
20+
ToImageButtonOptions.init
21+
(
22+
Format = StyleParam.ImageFormat.SVG,
23+
Filename = "SOOOOS"
24+
)
25+
)
26+
)
27+
|> Chart.Show
28+
//|> Chart.withYError(Options.Error(Array=[1.; 2.; 3.; 4.; 5.; 6.; 7.; 8.; 9.; 10.; ]))
29+
30+
31+
//|> Chart.withLineStyle(Width=2,Dash=StyleParam.DrawingStyle.Dot)
32+
//|> Chart.withLineOption(Options.Line(Width=10))
33+
//|> Chart.withX_AxisStyle("x axis title")
34+
//|> Chart.withY_AxisStyle("y axis title")
35+
//|> layoutJson
36+
//|> GenericChart.toChartHtmlWithSize 500 500
37+
38+
//|> Chart.ShowAsImage StyleParam.ImageFormat.SVG
39+
|> Chart.ShowAsImage StyleParam.ImageFormat.SVG
40+
41+
42+
43+
44+
45+
46+
47+

0 commit comments

Comments
 (0)