Config
public struct Config : Encodable
Set of choices that affect user interface, toolbar and backend interactions.
-
Determines whether the graphs are interactive or not.
If false, no interactivity, for export or image generation.
Declaration
Swift
public var staticPlot: Bool? -
When set it determines base URL for the ‘Edit in Chart Studio’
showEditInChartStudio/showSendToCloudmode bar button and the showLink/sendData on-graph link.To enable sending your data to Chart Studio Cloud, you need to set both
plotlyServerURLto ‘https://chart-studio.plotly.com’ and also setshowSendToCloudto true.Declaration
Swift
public var plotlyServerURL: String? -
Undocumented
See moreDeclaration
Swift
public struct Edits : Encodable -
Undocumented
Declaration
Swift
public var edits: Edits? -
Determines whether the graphs are plotted with respect to layout.autosize:true and infer its container size.
Declaration
Swift
public var autosizable: Bool? -
Determines whether to change the layout size when window is resized.
In v2, this option will be removed and will always be true.
Declaration
Swift
public var responsive: Bool? -
When
layout.autosizeis turned on, determines whether the graph fills the container (the default) or the screen (if set to true).Declaration
Swift
public var fillFrame: Bool? -
When
layout.autosizeis turned on, set the frame margins in fraction of the graph size.Declaration
Swift
public var frameMargins: Double? -
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
See morescrollZoomto false to disable scrolling for all subplots.Declaration
Swift
public struct ScrollZoom : OptionSet, Encodable -
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
scrollZoomto false to disable scrolling for all subplots.Declaration
Swift
public var scrollZoom: ScrollZoom? -
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.
See moreDeclaration
Swift
public enum DoubleClick : Encodable -
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.
Declaration
Swift
public var doubleClick: DoubleClick? -
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.
Declaration
Swift
public var doubleClickDelay: Double? -
Set to false to omit cartesian axis pan/zoom drag handles.
Declaration
Swift
public var showAxisDragHandles: Bool? -
Set to false to omit direct range entry at the pan/zoom drag points, note that
showAxisDragHandlesmust be enabled to have an effect.Declaration
Swift
public var showAxisRangeEntryBoxes: Bool? -
Determines whether or not tips are shown while interacting with the resulting graphs.
Declaration
Swift
public var showTips: Bool? -
Sets the text appearing in the
showLinklink.Declaration
Swift
public var linkText: String? -
If showLink is true, does it contain data just link to a Chart Studio Cloud file?
Declaration
Swift
public var sendData: Bool? -
Adds a source-displaying function to show sources on the resulting graphs.
Declaration
Swift
public var showSources: Anything? -
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.
See moreDeclaration
Swift
public enum DisplayModeBar : Encodable -
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.
Declaration
Swift
public var displayModeBar: DisplayModeBar? -
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
plotlyServerURLfor 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
plotlyServerURLbeing 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”.Declaration
Swift
public var showSendToCloud: Bool? -
Same as
showSendToCloud, but use a pencil icon instead of a floppy-disk.Note that if both
showSendToCloudandshowEditInChartStudioare turned, onlyshowEditInChartStudiowill be honored.Declaration
Swift
public var showEditInChartStudio: Bool? -
Remove mode bar buttons by name.
See ./components/modebar/buttons.js for the list of names.
Declaration
Swift
public var modeBarButtonsToRemove: Anything? -
Add mode bar button using config objects See ./components/modebar/buttons.js for list of arguments.
Declaration
Swift
public var modeBarButtonsToAdd: Anything? -
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.
Declaration
Swift
public var modeBarButtons: Anything? -
Statically override options for toImage modebar button allowed keys are format, filename, width, height, scale see ../components/modebar/buttons.js
Declaration
Swift
public var toImageButtonOptions: Anything? -
Determines whether or not the plotly logo is displayed on the end of the mode bar.
Declaration
Swift
public var displayLogo: Bool? -
watermark the images with the company’s logo
Declaration
Swift
public var watermark: Bool? -
Set the pixel ratio during WebGL image export.
This config option was formerly named
plot3dPixelRatiowhich is now deprecated.Declaration
Swift
public var plotGlPixelRatio: Double? -
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.Declaration
Swift
public var setBackground: Anything? -
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:
/dist/topojson/ to render geographical feature using the topojson files that ship with the plotly.js module. Declaration
Swift
public var topoJsonURL: String? -
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.
Declaration
Swift
public var mapboxAccessToken: String? -
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
Declaration
Swift
public var logging: Int? -
Set on-graph logging (notifier) level This should ONLY be set via Plotly.setPlotConfig Available levels: 0: no on-graph logs 1: warnings and errors, but not informational messages 2: verbose logs
Declaration
Swift
public var notifyOnLogging: Int? -
Sets the length of the undo/redo queue.
Declaration
Swift
public var queueLength: Int? -
Set global transform to be applied to all traces with no specification needed
Declaration
Swift
public var globalTransforms: Anything? -
Which localization should we use? Should be a string like ‘en’ or ‘en-US’.
Declaration
Swift
public var locale: String? -
Localization definitions Locales can be provided either here (specific to one chart) or globally by registering them as modules.
Should be an object of objects {locale: {dictionary: {…}, format: {…}}} { da: { dictionary: {‘Reset axes’: ‘Nulstil aksler’, …}, format: {months: […], shortMonths: […]} }, … } All parts are optional. When looking for translation or format fields, we look first for an exact match in a config locale, then in a registered module. If those fail, we strip off any regionalization (‘en-US’ -> ‘en’) and try each (config, registry) again. The final fallback for translation is untranslated (which is US English) and for formats is the base English (the only consequence being the last fallback date format %x is DD/MM/YYYY instead of MM/DD/YYYY). Currently
groupingandcurrencyare ignored for our automatic number formatting, but can be used in custom formats.Declaration
Swift
public var locales: Anything? -
init(staticPlot:plotlyServerURL: editable: edits: autosizable: responsive: fillFrame: frameMargins: scrollZoom: doubleClick: doubleClickDelay: showAxisDragHandles: showAxisRangeEntryBoxes: showTips: showLink: linkText: sendData: showSources: displayModeBar: showSendToCloud: showEditInChartStudio: modeBarButtonsToRemove: modeBarButtonsToAdd: modeBarButtons: toImageButtonOptions: displayLogo: watermark: plotGlPixelRatio: setBackground: topoJsonURL: mapboxAccessToken: logging: notifyOnLogging: queueLength: globalTransforms: locale: locales: ) Creates
Configobject with specified properties.Declaration
Swift
public init(staticPlot: Bool? = nil, plotlyServerURL: String? = nil, editable: Bool? = nil, edits: Edits? = nil, autosizable: Bool? = nil, responsive: Bool? = nil, fillFrame: Bool? = nil, frameMargins: Double? = nil, scrollZoom: ScrollZoom? = nil, doubleClick: DoubleClick? = nil, doubleClickDelay: Double? = nil, showAxisDragHandles: Bool? = nil, showAxisRangeEntryBoxes: Bool? = nil, showTips: Bool? = nil, showLink: Bool? = nil, linkText: String? = nil, sendData: Bool? = nil, showSources: Anything? = nil, displayModeBar: DisplayModeBar? = nil, showSendToCloud: Bool? = nil, showEditInChartStudio: Bool? = nil, modeBarButtonsToRemove: Anything? = nil, modeBarButtonsToAdd: Anything? = nil, modeBarButtons: Anything? = nil, toImageButtonOptions: Anything? = nil, displayLogo: Bool? = nil, watermark: Bool? = nil, plotGlPixelRatio: Double? = nil, setBackground: Anything? = nil, topoJsonURL: String? = nil, mapboxAccessToken: String? = nil, logging: Int? = nil, notifyOnLogging: Int? = nil, queueLength: Int? = nil, globalTransforms: Anything? = nil, locale: String? = nil, locales: Anything? = nil)Parameters
staticPlotDetermines whether the graphs are interactive or not.
plotlyServerURLWhen set it determines base URL for the ‘Edit in Chart Studio’
showEditInChartStudio/showSendToCloudmode bar button and the showLink/sendData on-graph link.editableDetermines whether the graph is editable or not.
editsautosizableDetermines whether the graphs are plotted with respect to layout.autosize:true and infer its container size.
responsiveDetermines whether to change the layout size when window is resized.
fillFrameWhen
layout.autosizeis turned on, determines whether the graph fills the container (the default) or the screen (if set to true).frameMarginsWhen
layout.autosizeis turned on, set the frame margins in fraction of the graph size.scrollZoomDetermines whether mouse wheel or two-finger scroll zooms is enable.
doubleClickSets the double click interaction mode.
doubleClickDelaySets the delay for registering a double-click in ms.
showAxisDragHandlesSet to false to omit cartesian axis pan/zoom drag handles.
showAxisRangeEntryBoxesSet to false to omit direct range entry at the pan/zoom drag points, note that
showAxisDragHandlesmust be enabled to have an effect.showTipsDetermines whether or not tips are shown while interacting with the resulting graphs.
showLinkDetermines whether a link to Chart Studio Cloud is displayed at the bottom right corner of resulting graphs.
linkTextSets the text appearing in the
showLinklink.sendDataIf showLink is true, does it contain data just link to a Chart Studio Cloud file?
showSourcesAdds a source-displaying function to show sources on the resulting graphs.
displayModeBarDetermines the mode bar display mode.
showSendToCloudShould 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
plotlyServerURLfor editing, export, etc? Prior to version 1.43.0 this button was included by default, now it is opt-in using this flag.showEditInChartStudioSame as
showSendToCloud, but use a pencil icon instead of a floppy-disk.modeBarButtonsToRemoveRemove mode bar buttons by name.
modeBarButtonsToAddAdd mode bar button using config objects See ./components/modebar/buttons.js for list of arguments.
modeBarButtonsDefine 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.
toImageButtonOptionsStatically override options for toImage modebar button allowed keys are format, filename, width, height, scale see ../components/modebar/buttons.js
displayLogoDetermines whether or not the plotly logo is displayed on the end of the mode bar.
watermarkwatermark the images with the company’s logo
plotGlPixelRatioSet the pixel ratio during WebGL image export.
setBackgroundSet function to add the background color (i.e.
topoJsonURLSet the URL to topojson used in geo charts.
mapboxAccessTokenMapbox 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.
loggingTurn 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
notifyOnLoggingSet on-graph logging (notifier) level This should ONLY be set via Plotly.setPlotConfig Available levels: 0: no on-graph logs 1: warnings and errors, but not informational messages 2: verbose logs
queueLengthSets the length of the undo/redo queue.
globalTransformsSet global transform to be applied to all traces with no specification needed
localeWhich localization should we use? Should be a string like ‘en’ or ‘en-US’.
localesLocalization definitions Locales can be provided either here (specific to one chart) or globally by registering them as modules.
View on GitHub
Install in Dash
Config Structure Reference