Struct plotly::configuration::Configuration
source · pub struct Configuration { /* private fields */ }
Implementations§
source§impl Configuration
impl Configuration
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new default Configuration
object. Options can be configured
using the provided setter methods.
sourcepub fn static_plot(self, static_plot: bool) -> Self
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.
sourcepub fn typeset_math(self, typeset_math: bool) -> Self
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.
sourcepub fn plotly_server_url(self, plotly_server_url: &str) -> Self
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
.
sourcepub fn editable(self, editable: bool) -> Self
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.
sourcepub fn autosizable(self, autosizable: bool) -> Self
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.
sourcepub fn responsive(self, responsive: bool) -> Self
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.
sourcepub fn fill_frame(self, fill_frame: bool) -> Self
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
).
sourcepub fn frame_margins(self, frame_margins: f64) -> Self
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.
sourcepub fn scroll_zoom(self, scroll_zoom: bool) -> Self
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.
sourcepub fn double_click(self, double_click: DoubleClick) -> Self
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.
sourcepub fn double_click_delay(self, double_click_delay: usize) -> Self
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.
sourcepub fn show_axis_drag_handles(self, show_axis_drag_handles: bool) -> Self
pub fn show_axis_drag_handles(self, show_axis_drag_handles: bool) -> Self
Set to false
to omit cartesian axis pan/zoom drag handles.
sourcepub fn show_axis_range_entry_boxes(
self,
show_axis_range_entry_boxes: bool
) -> Self
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.
sourcepub fn show_tips(self, show_tips: bool) -> Self
pub fn show_tips(self, show_tips: bool) -> Self
Determines whether or not tips are shown while interacting with the resulting graphs.
sourcepub fn show_link(self, show_link: bool) -> Self
pub fn show_link(self, show_link: bool) -> Self
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
.
sourcepub fn send_data(self, send_data: bool) -> Self
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?
sourcepub fn display_mode_bar(self, display_mode_bar: DisplayModeBar) -> Self
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.
sourcepub fn show_send_to_cloud(self, show_send_to_cloud: bool) -> Self
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”.
sourcepub fn show_edit_in_chart_studio(self, show_edit_in_chart_studio: bool) -> Self
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.
Remove mode bar buttons by name.
Statically override options for toImage modebar button.
sourcepub fn display_logo(self, display_logo: bool) -> Self
pub fn display_logo(self, display_logo: bool) -> Self
Determines whether or not the plotly logo is displayed on the end of the mode bar.
sourcepub fn plot_gl_pixel_ratio(self, plot_gl_pixel_ratio: PlotGLPixelRatio) -> Self
pub fn plot_gl_pixel_ratio(self, plot_gl_pixel_ratio: PlotGLPixelRatio) -> Self
Set the pixel ratio during WebGL image export.
sourcepub fn topojson_url(self, topojson_url: &str) -> Self
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.
sourcepub fn mapbox_access_token(self, mapbox_access_token: &str) -> Self
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.
sourcepub fn queue_length(self, queue_length: usize) -> Self
pub fn queue_length(self, queue_length: usize) -> Self
Sets the length of the undo/redo queue.
Trait Implementations§
source§impl Clone for Configuration
impl Clone for Configuration
source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more