Skip to content

Commit f09ce38

Browse files
committed
Document default values and add a function to reset them to initial values
1 parent 6b32a64 commit f09ce38

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Plotly.NET/Templates/Defaults.fs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,31 @@ open DynamicObj
77
open DynamicObj.Operators
88
open System.Runtime.InteropServices
99

10+
11+
/// Contains mutable global default values.
12+
///
13+
/// Changing these values will apply the default values to all consecutive Chart generations.
1014
module Defaults =
1115

16+
/// The default width of the chart container in generated html files. Default: 600 (px)
1217
let mutable DefaultWidth = 600
1318

19+
/// The default height of the chart container in generated html files. Default: 600 (px)
1420
let mutable DefaultHeight = 600
1521

22+
/// The default chart config. Default: Config.init (Responsive = true)
1623
let mutable DefaultConfig = Config.init (Responsive = true)
1724

25+
/// The display options used for generating html. Default: DisplayOptions.init ()
1826
let mutable DefaultDisplayOptions = DisplayOptions.init ()
1927

28+
/// The default chart template. Default: ChartTemplates.plotly
2029
let mutable DefaultTemplate = ChartTemplates.plotly
30+
31+
/// reset global defaults to the initial values
32+
let reset () =
33+
DefaultWidth <- 600
34+
DefaultHeight <- 600
35+
DefaultConfig <- Config.init (Responsive = true)
36+
DefaultDisplayOptions <- DisplayOptions.init ()
37+
DefaultTemplate <- ChartTemplates.plotly

0 commit comments

Comments
 (0)