Struct Config

Source
pub struct Config<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Config<'a>

Source

pub fn static_plot(&mut self, static_plot: bool) -> &mut Self

Determines whether the graphs are interactive or not. If false, no interactivity, for export or image generation.

default: false

Source

pub fn plotly_server_url(&mut self, plotly_server_url: &'a str) -> &mut Self

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.

default: ``

Source

pub fn editable(&mut self, editable: bool) -> &mut Self

Determines whether the graph is editable or not. Sets all pieces of edits unless a separate edits config item overrides individual parts.

default: false

Source

pub fn edits(&mut self) -> &mut Edits

Source

pub fn autosizable(&mut self, autosizable: bool) -> &mut Self

Determines whether the graphs are plotted with respect to layout.autosize:true and infer its container size.

default: false

Source

pub fn responsive(&mut self, responsive: bool) -> &mut Self

Determines whether to change the layout size when window is resized. In v2, this option will be removed and will always be true.

default: false

Source

pub fn fill_frame(&mut self, fill_frame: bool) -> &mut Self

When layout.autosize is turned on, determines whether the graph fills the container (the default) or the screen (if set to true).

default: false

Source

pub fn frame_margins(&mut self, frame_margins: f64) -> &mut Self

When layout.autosize is turned on, set the frame margins in fraction of the graph size.

default: 0

Source

pub fn scroll_zoom(&mut self) -> &mut 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.

default: gl3d+geo+mapbox

Source

pub fn double_click(&mut self, double_click: DoubleClick) -> &mut Self

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.

default: reset+autosize

Source

pub fn double_click_delay(&mut self, double_click_delay: f64) -> &mut Self

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.

default: 300

Source

pub fn show_axis_drag_handles( &mut self, show_axis_drag_handles: bool, ) -> &mut Self

Set to false to omit cartesian axis pan/zoom drag handles.

default: true

Source

pub fn show_axis_range_entry_boxes( &mut self, show_axis_range_entry_boxes: bool, ) -> &mut Self

Set to false to omit direct range entry at the pan/zoom drag points, note that showAxisDragHandles must be enabled to have an effect.

default: true

Source

pub fn show_tips(&mut self, show_tips: bool) -> &mut Self

Determines whether or not tips are shown while interacting with the resulting graphs.

default: true

Determines whether a link to Chart Studio Cloud is displayed at the bottom right corner of resulting graphs. Use with sendData and linkText.

default: false

Sets the text appearing in the showLink link.

default: Edit chart

Source

pub fn send_data(&mut self, send_data: bool) -> &mut Self

If showLink is true, does it contain data just link to a Chart Studio Cloud file?

default: true

Source

pub fn show_sources(&mut self, show_sources: Any) -> &mut Self

Adds a source-displaying function to show sources on the resulting graphs.

default: false

Source

pub fn display_mode_bar( &mut self, display_mode_bar: DisplayModeBar, ) -> &mut Self

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.

default: hover

Source

pub fn show_send_to_cloud(&mut self, show_send_to_cloud: bool) -> &mut Self

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”.

default: false

Source

pub fn show_edit_in_chart_studio( &mut self, show_edit_in_chart_studio: bool, ) -> &mut Self

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.

default: false

Source

pub fn mode_bar_buttons_to_remove( &mut self, mode_bar_buttons_to_remove: Any, ) -> &mut Self

Remove mode bar buttons by name. See ./components/modebar/buttons.js for the list of names.

default: []

Source

pub fn mode_bar_buttons_to_add( &mut self, mode_bar_buttons_to_add: Any, ) -> &mut Self

Add mode bar button using config objects See ./components/modebar/buttons.js for list of arguments.

default: []

Source

pub fn mode_bar_buttons(&mut self, mode_bar_buttons: Any) -> &mut Self

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.

default: false

Source

pub fn to_image_button_options( &mut self, to_image_button_options: Any, ) -> &mut Self

Statically override options for toImage modebar button allowed keys are format, filename, width, height, scale see ../components/modebar/buttons.js

default: {}

Determines whether or not the plotly logo is displayed on the end of the mode bar.

default: true

Source

pub fn watermark(&mut self, watermark: bool) -> &mut Self

watermark the images with the company’s logo

default: false

Source

pub fn plot_gl_pixel_ratio(&mut self, plot_gl_pixel_ratio: f64) -> &mut Self

Set the pixel ratio during WebGL image export. This config option was formerly named plot3dPixelRatio which is now deprecated.

default: 2

Source

pub fn set_background(&mut self, set_background: Any) -> &mut Self

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.

default: transparent

Source

pub fn topojson_url(&mut self, topojson_url: &'a str) -> &mut Self

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: <path-to-plotly.js>/dist/topojson/ to render geographical feature using the topojson files that ship with the plotly.js module.

default: https://cdn.plot.ly/

Source

pub fn mapbox_access_token(&mut self, mapbox_access_token: &'a str) -> &mut Self

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.

default: null

Source

pub fn logging(&mut self, logging: u64) -> &mut Self

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

default: 1

Source

pub fn notify_on_logging(&mut self, notify_on_logging: u64) -> &mut Self

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

default: 0

Source

pub fn queue_length(&mut self, queue_length: u64) -> &mut Self

Sets the length of the undo/redo queue.

default: 0

Source

pub fn global_transforms(&mut self, global_transforms: Any) -> &mut Self

Set global transform to be applied to all traces with no specification needed

default: []

Source

pub fn locale(&mut self, locale: &'a str) -> &mut Self

Which localization should we use? Should be a string like ‘en’ or ‘en-US’.

default: en-US

Source

pub fn locales(&mut self, locales: Any) -> &mut Self

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 grouping and currency are ignored for our automatic number formatting, but can be used in custom formats.

default: {}

Trait Implementations§

Source§

impl<'a> Default for Config<'a>

Source§

fn default() -> Config<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Serialize for Config<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Config<'a>

§

impl<'a> RefUnwindSafe for Config<'a>

§

impl<'a> Send for Config<'a>

§

impl<'a> Sync for Config<'a>

§

impl<'a> Unpin for Config<'a>

§

impl<'a> UnwindSafe for Config<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.