pub struct Configuration { /* private fields */ }

Implementations§

source§

impl Configuration

source

pub fn new() -> Self

Create a new default Configuration object. Options can be configured using the provided setter methods.

source

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

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

source

pub fn typeset_math(self, typeset_math: bool) -> Self

Determines whether math should be typeset or not, when MathJax (either v2 or v3) is present on the page.

source

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

When set it determines base URL for the “Edit in Chart Studio” show_edit_in_chart_studio/show_send_to_cloud mode bar button and the show_link/send_data on-graph link. To enable sending your data to Chart Studio Cloud, you need to set both plotly_server_url to “https://chart-studio.plotly.com” and also set showSendToCloud to true.

source

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

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

source

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

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

source

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

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

source

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

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

source

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

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

source

pub fn scroll_zoom(self, scroll_zoom: bool) -> Self

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 scroll_zoom to false to disable scrolling for all subplots.

source

pub fn double_click(self, double_click: DoubleClick) -> 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.

source

pub fn double_click_delay(self, double_click_delay: usize) -> 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.

source

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

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

source

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

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

source

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

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

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

Sets the text appearing in the showLink link.

source

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

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

source

pub fn display_mode_bar(self, display_mode_bar: DisplayModeBar) -> 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.

source

pub fn show_send_to_cloud(self, show_send_to_cloud: bool) -> 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 plotly_server_url 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 plotly_server_url 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”.

source

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

Same as show_send_to_cloud, but use a pencil icon instead of a floppy-disk. Note that if both show_send_to_cloud and show_edit_in_chart_studio are turned on, only show_edit_in_chart_studio will be honored.

source

pub fn mode_bar_buttons_to_remove( self, mode_bar_buttons_to_remove: Vec<ModeBarButtonName> ) -> Self

Remove mode bar buttons by name.

source

pub fn to_image_button_options( self, to_image_button_options: ToImageButtonOptions ) -> Self

Statically override options for toImage modebar button.

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

source

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

Watermark the images with the company’s logo.

source

pub fn plot_gl_pixel_ratio(self, plot_gl_pixel_ratio: PlotGLPixelRatio) -> Self

Set the pixel ratio during WebGL image export.

source

pub fn topojson_url(self, topojson_url: &str) -> 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.

source

pub fn mapbox_access_token(self, mapbox_access_token: &str) -> 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.

source

pub fn queue_length(self, queue_length: usize) -> Self

Sets the length of the undo/redo queue.

source

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

Sets which localization to use. When using this setting, make sure that the appropriate locale is present in the HTML file. For example, to use the “fr” locale, must be present.

Trait Implementations§

source§

impl Clone for Configuration

source§

fn clone(&self) -> Configuration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Configuration

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Configuration

source§

fn default() -> Configuration

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

impl Serialize for Configuration

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§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> Serialize for Twhere T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V