Skip to content

Commit 12cd473

Browse files
committed
#299: add missing Config params
1 parent b42ed8d commit 12cd473

File tree

3 files changed

+431
-406
lines changed

3 files changed

+431
-406
lines changed

src/Plotly.NET/ChartAPI/Chart.fs

+128-23
Original file line numberDiff line numberDiff line change
@@ -2809,46 +2809,151 @@ type Chart =
28092809
/// <summary>
28102810
/// Applies the given styles to the chart's Config object. Overwrites attributes with the same name that are already set.
28112811
/// </summary>
2812-
/// <param name="StaticPlot">Determines whether the plot is interactive or not. (default: false)</param>
2813-
/// <param name="PlotlyServerUrl">When set it determines base URL for the 'Edit in Chart Studio'/`showEditInChartStudio`/`showSendToCloud` mode bar button', and the showLink/sendData on-graph link. To enable sending your data to Chart Studio Cloud, you need to' set both `plotlyServerURL` to \'https://chart-studio.plotly.com\' and also set `showSendToCloud` to true.</param>
2812+
/// <param name="StaticPlot">Determines whether the graphs are interactive or not. If *false*, no interactivity, for export or image generation.</param>
2813+
/// <param name="TypesetMath">Determines whether math should be typeset or not, when MathJax (either v2 or v3) is present on the page.</param>
2814+
/// <param name="PlotlyServerUrl">When set it determines base URL form the \'Edit in Chart Studio\' `showEditInChartStudio`/`showSendToCloud` mode bar button and the showLink/sendData on-graph link. To enable sending your data to Chart Studio Cloud, you need to set both `plotlyServerURL` to \'https://chart-studio.plotly.com\' and also set `showSendToCloud` to true.</param>
28142815
/// <param name="Editable">Determines whether the graph is editable or not. Sets all pieces of `edits` unless a separate `edits` config item overrides individual parts.</param>
2815-
/// <param name="Edits">Object holding individual editable pieces of the graph.</param>
2816-
/// <param name="Autosizable">Determines whether the graphs are plotted with respect to layout.autosize:true and infer its container size. (default: false)</param>
2817-
/// <param name="Responsive">Determines whether to change the layout size when window is resized.</param>
2818-
/// <param name="ShowSendToCloud">Should we include a ModeBar button, labeled "Edit in Chart Studio",that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server as specified by `plotlyServerURL` for editing, export, etc? Note that this button can (depending on `plotlyServerURL` being set) send your data to an external server. However that server does not persist your data until you arrive at the Chart Studio and explicitly click "Save".</param>
2819-
/// <param name="ShowEditInChartStudio">Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk. Note that if both `showSendToCloud` and `showEditInChartStudio` are turned, only `showEditInChartStudio` will be honored.</param>
2820-
/// <param name="ToImageButtonOptions">Statically override options for toImage modebar button</param>
2821-
/// <param name="ModeBarButtonsToAdd">ModeBar buttons to add to the graph.</param>
2816+
/// <param name="Edits">Determines if the main anchor of the annotation is editable. The main anchor corresponds to the text (if no arrow) or the arrow (which drags the whole thing leaving the arrow length & direction unchanged).</param>
2817+
/// <param name="EditSelection">Enables moving selections.</param>
2818+
/// <param name="Autosizable">Determines whether the graphs are plotted with respect to layout.autosize:true and infer its container size.</param>
2819+
/// <param name="Responsive">Determines whether to change the layout size when window is resized. In v3, this option will be removed and will always be true.</param>
2820+
/// <param name="FillFrame"When `layout.autosize` is turned on, determines whether the grap fills the container (the default) or the screen (if set to *true*).></param>
2821+
/// <param name="FrameMargins">When `layout.autosize` is turned on, set the frame margins in fraction of the graph size.'</param>
2822+
/// <param name="ScrollZoom">Determines whether mouse wheel or two-finger scroll zooms is enable. Turned on by default for gl3d, geo and mapbox subplots (as these subplot types do not have zoombox via pan, but turned off by default for cartesian subplots. Set `scrollZoom` to *false* to disable scrolling for all subplots.</param>
2823+
/// <param name="DoubleClick">Sets the double click interaction mode. Has an effect only in cartesian plots. If *false*, double click is disable. If *reset*, double click resets the axis ranges to their initial values. If *autosize*, double click set the axis ranges to their autorange values. If *reset+autosize*, the odd double clicks resets the axis ranges to their initial values and even double clicks set the axis ranges to their autorange values.</param>
2824+
/// <param name="DoubleClickDelay">Sets the delay for registering a double-click in ms. This is the time interval (in ms) between first mousedown and 2nd mouseup to constitute a double-click. This setting propagates to all on-subplot double clicks (except for geo and mapbox) and on-legend double clicks.</param>
2825+
/// <param name="ShowAxisDragHandles">Set to *false* to omit cartesian axis pan/zoom drag handles.</param>
2826+
/// <param name="ShowAxisRangeEntryBoxes">Set to *false* to omit direct range entry at the pan/zoom drag points, note that `showAxisDragHandles` must be enabled to have an effect.</param>
2827+
/// <param name="ShowTips">Determines whether or not tips are shown while interacting with the resulting graphs.</param>
2828+
/// <param name="ShowLink">Determines whether a link to Chart Studio Cloud is displayed at the bottom right corner of resulting graphs. Use with `sendData` and `linkText`.</param>
2829+
/// <param name="LinkText">Sets the text appearing in the `showLink` link.</param>
2830+
/// <param name="SendData">If *showLink* is true, does it contain data just link to a Chart Studio Cloud file?</param>
2831+
/// <param name="ShowSources">Adds a source-displaying function to show sources on the resulting graphs.</param>
2832+
/// <param name="DisplayModeBar">Determines the mode bar display mode. If *true*, the mode bar is always visible. If *false*, the mode bar is always hidden. If *hover*, the mode bar is visible while the mouse cursor is on the graph container.</param>
2833+
/// <param name="ShowSendToCloud">Should we include a ModeBar button, labeled "Edit in Chart Studio that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0 this button was included by default, now it is opt-in using this flag. Note that this button can (depending on `plotlyServerURL` being set) send your data to an external server. However that server does not persist your data until you arrive at the Chart Studio and explicitly click "Save".</param>
2834+
/// <param name="ShowEditInChartStudio">Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk. Note that if both `showSendToCloud` and `showEditInChartStudio` are turned only `showEditInChartStudio` will be honored.</param>
2835+
/// <param name="ModeBarButtonsToRemove">Remove mode bar buttons by name. See ./components/modebar/buttons.js for the list of names.</param>
2836+
/// <param name="ModeBarButtonsToAdd">Add mode bar button using config objects. See ./components/modebar/buttons.js for list of arguments. To enable predefined modebar buttons e.g. shape drawing, hover and spikelines simply provide their string name(s). This could include: *v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*, *drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect* and *eraseshape*. Please note that these predefined buttons will only be shown if they are compatible with all trace types used in a graph.</param>
2837+
/// <param name="ModeBarButtons">Define fully custom mode bar buttons as nested array where the outer arrays represents button groups, and the inner arrays have buttons config objects or names of default buttons. See ./components/modebar/buttons.js for more info.'</param>
2838+
/// <param name="ToImageButtonOptions">Statically override options for toImage modebar button allowed keys are format, filename, width, height, scale', see ../components/modebar/buttons.js</param>
2839+
/// <param name="Displaylogo">Determines whether or not the plotly logo is displayed on the end of the mode bar.</param>
2840+
/// <param name="Watermark">watermark the images with the company\'s logo</param>
2841+
/// <param name="plotGlPixelRatio">Set the pixel ratio during WebGL image export. This config option was formerly named `plot3dPixelRatio` which is now deprecated.</param>
2842+
/// <param name="SetBackground">Set function to add the background color (i.e. `layout.paper_color`) to a different container. This function take the graph div as first argument and the current background color as second argument. Alternatively, set to string *opaque* to ensure there is white behind it.</param>
2843+
/// <param name="TopojsonURL">Set the URL to topojson used in geo charts. By default, the topojson files are fetched from cdn.plot.ly. For example, set this option to: &lt;path-to-plotly.js&GlobalTransforms;/dist/topojson to render geographical feature using the topojson files that ship with the plotly.js module.</param>
2844+
/// <param name="MapboxAccessToken">Mapbox access token (required to plot mapbox trace types). If using an Mapbox Atlas server, set this option to \'\' so that plotly.js won\'t attempt to authenticate to the public Mapbox server.</param>
2845+
/// <param name="Logging">Turn all console logging on or off (errors will be thrown). This should ONLY be set via Plotly.setPlotConfig Available levels: 0: no logs 1: warnings and errors, but not informational messages 2: verbose logs</param>
2846+
/// <param name="NotifyOnLogging">Turn all console logging on or off (errors will be thrown). This should ONLY be set via Plotly.setPlotConfig Available levels: 0: no logs 1: warnings and errors, but not informational messages 2: verbose logs</param>
2847+
/// <param name="QueueLength">Sets the length of the undo/redo queue.</param>
2848+
/// <param name="GlobalTransforms">Set global transform to be applied to all traces with no specification needed</param>
2849+
/// <param name="Locale">Which localization should we use? Should be a string like \'en\' or \'en-US\'.</param>
2850+
/// <param name="Locales">
2851+
/// Localization definitions
2852+
/// Locales can be provided either here (specific to one chart) or globally
2853+
/// by registering them as modules.
2854+
/// Should be an object of objects {locale: {dictionary: {...}, format: {...}}}'
2855+
/// {
2856+
/// da: {
2857+
/// dictionary: {\'Reset axes\': \'Nulstil aksler\', ...},
2858+
/// format: {months: [...], shortMonths: [...]}',
2859+
/// },
2860+
/// ...
2861+
/// }
2862+
/// All parts are optional. When looking for translation or format fields, we
2863+
/// look first for an exact match in a config locale, then in a registered
2864+
/// module. If those fail, we strip off any regionalization (\'en-US\' -> \'en\')
2865+
/// and try each (config, registry) again. The final fallback for translation
2866+
/// is untranslated (which is US English) and for formats is the base English
2867+
/// (the only consequence being the last fallback date format %x is DD/MM/YYYY
2868+
/// instead of MM/DD/YYYY). Currently `grouping` and `currency` are ignored
2869+
/// for our automatic number formatting, but can be used in custom formats.
2870+
/// </param>
28222871
[<CompiledName("WithConfigStyle")>]
28232872
static member withConfigStyle
28242873
(
28252874
[<Optional; DefaultParameterValue(null)>] ?StaticPlot: bool,
28262875
[<Optional; DefaultParameterValue(null)>] ?TypesetMath: bool,
28272876
[<Optional; DefaultParameterValue(null)>] ?PlotlyServerUrl: string,
2828-
[<Optional; DefaultParameterValue(null)>] ?Autosizable: bool,
28292877
[<Optional; DefaultParameterValue(null)>] ?Editable: bool,
28302878
[<Optional; DefaultParameterValue(null)>] ?Edits: Edits,
2879+
[<Optional; DefaultParameterValue(null)>] ?EditSelection: bool,
2880+
[<Optional; DefaultParameterValue(null)>] ?Autosizable: bool,
2881+
[<Optional; DefaultParameterValue(null)>] ?Responsive: bool,
2882+
[<Optional; DefaultParameterValue(null)>] ?FillFrame: bool,
2883+
[<Optional; DefaultParameterValue(null)>] ?FrameMargins: float,
2884+
[<Optional; DefaultParameterValue(null)>] ?ScrollZoom: StyleParam.ScrollZoom,
2885+
[<Optional; DefaultParameterValue(null)>] ?DoubleClick: StyleParam.DoubleClick,
2886+
[<Optional; DefaultParameterValue(null)>] ?DoubleClickDelay: int,
2887+
[<Optional; DefaultParameterValue(null)>] ?ShowAxisDragHandles: bool,
2888+
[<Optional; DefaultParameterValue(null)>] ?ShowAxisRangeEntryBoxes: bool,
2889+
[<Optional; DefaultParameterValue(null)>] ?ShowTips: bool,
2890+
[<Optional; DefaultParameterValue(null)>] ?ShowLink: bool,
2891+
[<Optional; DefaultParameterValue(null)>] ?LinkText: string,
2892+
[<Optional; DefaultParameterValue(null)>] ?SendData: bool,
2893+
[<Optional; DefaultParameterValue(null)>] ?ShowSources: obj,
2894+
[<Optional; DefaultParameterValue(null)>] ?DisplayModeBar: bool,
28312895
[<Optional; DefaultParameterValue(null)>] ?ShowSendToCloud: bool,
28322896
[<Optional; DefaultParameterValue(null)>] ?ShowEditInChartStudio: bool,
2833-
[<Optional; DefaultParameterValue(null)>] ?Responsive: bool,
2897+
[<Optional; DefaultParameterValue(null)>] ?ModeBarButtonsToRemove: seq<StyleParam.ModeBarButton>,
2898+
[<Optional; DefaultParameterValue(null)>] ?ModeBarButtonsToAdd: seq<StyleParam.ModeBarButton>,
2899+
[<Optional; DefaultParameterValue(null)>] ?ModeBarButtons: seq<seq<StyleParam.ModeBarButton>>,
28342900
[<Optional; DefaultParameterValue(null)>] ?ToImageButtonOptions: ToImageButtonOptions,
2835-
[<Optional; DefaultParameterValue(null)>] ?ModeBarButtonsToAdd: seq<StyleParam.ModeBarButton>
2901+
[<Optional; DefaultParameterValue(null)>] ?Displaylogo: bool,
2902+
[<Optional; DefaultParameterValue(null)>] ?Watermark: bool,
2903+
[<Optional; DefaultParameterValue(null)>] ?plotGlPixelRatio: float,
2904+
[<Optional; DefaultParameterValue(null)>] ?SetBackground: obj,
2905+
[<Optional; DefaultParameterValue(null)>] ?TopojsonURL: string,
2906+
[<Optional; DefaultParameterValue(null)>] ?MapboxAccessToken: string,
2907+
[<Optional; DefaultParameterValue(null)>] ?Logging: int,
2908+
[<Optional; DefaultParameterValue(null)>] ?NotifyOnLogging: int,
2909+
[<Optional; DefaultParameterValue(null)>] ?QueueLength: int,
2910+
[<Optional; DefaultParameterValue(null)>] ?GlobalTransforms: obj,
2911+
[<Optional; DefaultParameterValue(null)>] ?Locale: string,
2912+
[<Optional; DefaultParameterValue(null)>] ?Locales: obj
28362913
) =
28372914
(fun (ch: GenericChart) ->
28382915

28392916
let config =
28402917
Config.init (
2841-
?StaticPlot = StaticPlot,
2842-
?TypesetMath = TypesetMath,
2843-
?PlotlyServerUrl = PlotlyServerUrl,
2844-
?Autosizable = Autosizable,
2845-
?Responsive = Responsive,
2846-
?ToImageButtonOptions = ToImageButtonOptions,
2847-
?ShowSendToCloud = ShowSendToCloud,
2848-
?ShowEditInChartStudio = ShowEditInChartStudio,
2849-
?Editable = Editable,
2850-
?Edits = Edits,
2851-
?ModeBarButtonsToAdd = ModeBarButtonsToAdd
2918+
?StaticPlot = StaticPlot,
2919+
?TypesetMath = TypesetMath,
2920+
?PlotlyServerUrl = PlotlyServerUrl,
2921+
?Editable = Editable,
2922+
?Edits = Edits,
2923+
?EditSelection = EditSelection,
2924+
?Autosizable = Autosizable,
2925+
?Responsive = Responsive,
2926+
?FillFrame = FillFrame,
2927+
?FrameMargins = FrameMargins,
2928+
?ScrollZoom = ScrollZoom,
2929+
?DoubleClick = DoubleClick,
2930+
?DoubleClickDelay = DoubleClickDelay,
2931+
?ShowAxisDragHandles = ShowAxisDragHandles,
2932+
?ShowAxisRangeEntryBoxes = ShowAxisRangeEntryBoxes,
2933+
?ShowTips = ShowTips,
2934+
?ShowLink = ShowLink,
2935+
?LinkText = LinkText,
2936+
?SendData = SendData,
2937+
?ShowSources = ShowSources,
2938+
?DisplayModeBar = DisplayModeBar,
2939+
?ShowSendToCloud = ShowSendToCloud,
2940+
?ShowEditInChartStudio = ShowEditInChartStudio,
2941+
?ModeBarButtonsToRemove = ModeBarButtonsToRemove,
2942+
?ModeBarButtonsToAdd = ModeBarButtonsToAdd,
2943+
?ModeBarButtons = ModeBarButtons,
2944+
?ToImageButtonOptions = ToImageButtonOptions,
2945+
?Displaylogo = Displaylogo,
2946+
?Watermark = Watermark,
2947+
?plotGlPixelRatio = plotGlPixelRatio,
2948+
?SetBackground = SetBackground,
2949+
?TopojsonURL = TopojsonURL,
2950+
?MapboxAccessToken = MapboxAccessToken,
2951+
?Logging = Logging,
2952+
?NotifyOnLogging = NotifyOnLogging,
2953+
?QueueLength = QueueLength,
2954+
?GlobalTransforms = GlobalTransforms,
2955+
?Locale = Locale,
2956+
?Locales = Locales
28522957
)
28532958

28542959
ch |> Chart.withConfig config)

src/Plotly.NET/CommonAbstractions/StyleParams.fs

+37-1
Original file line numberDiff line numberDiff line change
@@ -949,10 +949,26 @@ module StyleParam =
949949
member this.Convert() = this |> ConeSizeMode.convert
950950

951951

952-
//--------------------------
952+
//--------------------------
953953
// #D#
954954
//--------------------------
955955

956+
[<RequireQualifiedAccess>]
957+
type DoubleClick =
958+
| Reset
959+
| Autosize
960+
| ResetAutosize
961+
| NoInteraction
962+
963+
static member convert =
964+
function
965+
| Reset -> box "reset"
966+
| Autosize -> box "autosize"
967+
| ResetAutosize -> box "reset+autosize"
968+
| NoInteraction -> box false
969+
970+
member this.Convert() = this |> DoubleClick.convert
971+
956972
/// Sets this figure's behavior when a user preforms a mouse 'drag' in the plot area. When set to 'zoom', a portion of the plot will be highlighted,
957973
/// when the viewer exits the drag, this highlighted section will be zoomed in on. When set to 'pan', data in the plot will move along with the viewers
958974
/// dragging motions. A user can always depress the 'shift' key to access the whatever functionality has not been set as the default. In 3D plots, the
@@ -2486,6 +2502,26 @@ module StyleParam =
24862502
// #S#
24872503
//--------------------------
24882504

2505+
[<RequireQualifiedAccess>]
2506+
type ScrollZoom =
2507+
| Cartesian
2508+
| GL3D
2509+
| Geo
2510+
| Mapbox
2511+
| All
2512+
| NoZoom
2513+
2514+
static member convert =
2515+
function
2516+
| Cartesian -> box "cartesian"
2517+
| GL3D -> box "gl3d"
2518+
| Geo -> box "geo"
2519+
| Mapbox -> box "mapbox"
2520+
| All -> box true
2521+
| NoZoom -> box false
2522+
2523+
member this.Convert() = this |> ScrollZoom.convert
2524+
24892525
[<RequireQualifiedAccess>]
24902526
type ScatterMode =
24912527
| Group

0 commit comments

Comments
 (0)