Struct Layout

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

Implementations§

Source§

impl<'a> Layout<'a>

Source

pub fn font(&mut self) -> &mut Font<'a>

Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.

Source

pub fn title(&mut self) -> &mut Title<'a>

Source

pub fn uniformtext(&mut self) -> &mut Uniformtext

Source

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

Determines whether or not a layout width or height that has been left undefined by the user is initialized on each relayout. Note that, regardless of this attribute, an undefined layout width or height is always initialized on the first call to plot.

default: false

Source

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

Sets the plot’s width (in px).

default: 700

Source

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

Sets the plot’s height (in px).

default: 450

Source

pub fn margin(&mut self) -> &mut Margin

Source

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

Sets the background color of the paper where the graph is drawn.

default: #fff

Source

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

Sets the background color of the plotting area in-between x and y axes.

default: #fff

Source

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

Sets the decimal and thousand separators. For example, *. * puts a ‘.’ before decimals and a space between thousands. In English locales, dflt is ., but other locales may alter this default.

Source

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

Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the Chart Studio Cloud (at https://chart-studio.plotly.com or on-premise).

default: false

Source

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

Determines whether or not a legend is drawn. Default is true if there is a trace to show and any of these: a) Two or more traces would by default be shown in the legend. b) One pie trace is shown in the legend. c) One trace is explicitly given with showlegend: true.

Source

pub fn colorway(&mut self, colorway: &'a [&'a str]) -> &mut Self

Sets the default trace colors.

default: ["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"]

Source

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

If provided, a changed value tells Plotly.react that one or more data arrays has changed. This way you can modify arrays in-place rather than making a complete new copy for an incremental change. If NOT provided, Plotly.react assumes that data arrays are being treated as immutable, thus any data array with a different identity from its predecessor contains new data.

Source

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

Used to allow user interactions with the plot to persist after Plotly.react calls that are unaware of these interactions. If uirevision is omitted, or if it is given and it changed from the previous Plotly.react call, the exact new figure is used. If uirevision is truthy and did NOT change, any attribute that has been affected by user interactions and did not receive a different value in the new figure will keep the interaction value. layout.uirevision attribute serves as the default for uirevision attributes in various sub-containers. For finer control you can set these sub-attributes directly. For example, if your app separately controls the data on the x and y axes you might set xaxis.uirevision=*time* and yaxis.uirevision=*cost*. Then if only the y data is changed, you can update yaxis.uirevision=*quantity* and the y axis range will reset but the x axis range will retain any user-driven zoom.

Source

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

Controls persistence of user-driven changes in editable: true configuration, other than trace names and axis titles. Defaults to layout.uirevision.

Source

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

Controls persistence of user-driven changes in selected points from all traces.

Source

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

Default attributes to be applied to the plot. Templates can be created from existing plots using Plotly.makeTemplate, or created manually. They should be objects with format: {layout: layoutTemplate, data: {[type]: [traceTemplate, ...]}, ...} layoutTemplate and traceTemplate are objects matching the attribute structure of layout and a data trace. Trace templates are applied cyclically to traces of each type. Container arrays (eg annotations) have special handling: An object ending in defaults (eg annotationdefaults) is applied to each array item. But if an item has a templateitemname key we look in the template array for an item with matching name and apply that instead. If no matching name is found we mark the item invisible. Any named template item not referenced is appended to the end of the array, so you can use this for a watermark annotation or a logo image, for example. To omit one of these items on the plot, make an item with matching templateitemname and visible: false.

Source

pub fn modebar(&mut self) -> &mut Modebar<'a>

Source

pub fn newshape(&mut self) -> &mut Newshape<'a>

Source

pub fn activeshape(&mut self) -> &mut Activeshape<'a>

Source

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

Assigns extra meta information that can be used in various text attributes. Attributes such as the graph, axis and colorbar title.text, annotation text trace.name in legend items, rangeselector, updatemenus and sliders label text all support meta. One can access meta fields using template strings: %{meta[i]} where i is the index of the meta item in question. meta can also be an object for example {key: value} which can be accessed %{meta[key]}.

Source

pub fn transition(&mut self) -> &mut Transition

Sets transition options used during Plotly.react updates.

Source

pub fn clickmode(&mut self) -> &mut Clickmode

Determines the mode of single click interactions. event is the default value and emits the plotly_click event. In addition this mode emits the plotly_selected event in drag modes lasso and select, but with no event data attached (kept for compatibility reasons). The select flag enables selecting single data points via click. This mode also supports persistent selections, meaning that pressing Shift while clicking, adds to / subtracts from an existing selection. select with hovermode: x can be confusing, consider explicitly setting hovermode: closest when using this feature. Selection events are sent accordingly as long as event flag is set as well. When the event flag is missing, plotly_click and plotly_selected events are not fired.

default: event

Source

pub fn dragmode(&mut self, dragmode: Dragmode) -> &mut Self

Determines the mode of drag interactions. select and lasso apply only to scatter traces with markers or text. orbit and turntable apply only to 3D scenes.

default: zoom

Source

pub fn hovermode(&mut self, hovermode: Hovermode) -> &mut Self

Determines the mode of hover interactions. If closest, a single hoverlabel will appear for the closest point within the hoverdistance. If x (or y), multiple hoverlabels will appear for multiple points at the closest x- (or y-) coordinate within the hoverdistance, with the caveat that no more than one hoverlabel will appear per trace. If x unified (or y unified), a single hoverlabel will appear multiple points at the closest x- (or y-) coordinate within the hoverdistance with the caveat that no more than one hoverlabel will appear per trace. In this mode, spikelines are enabled by default perpendicular to the specified axis. If false, hover interactions are disabled. If clickmode includes the select flag, hovermode defaults to closest. If clickmode lacks the select flag, it defaults to x or y (depending on the trace’s orientation value) for plots based on cartesian coordinates. For anything else the default value is closest.

Source

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

Sets the default distance (in pixels) to look for data to add hover labels (-1 means no cutoff, 0 means no looking for data). This is only a real distance for hovering on point-like objects, like scatter points. For area-like objects (bars, scatter fills, etc) hovering is on inside the area and off outside, but these objects will not supersede hover on point-like objects in case of conflict.

default: 20

Source

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

Sets the default distance (in pixels) to look for data to draw spikelines to (-1 means no cutoff, 0 means no looking for data). As with hoverdistance, distance does not apply to area-like objects. In addition, some objects can be hovered on but will not generate spikelines, such as scatter fills.

default: 20

Source

pub fn hoverlabel(&mut self) -> &mut Hoverlabel<'a>

Source

pub fn selectdirection(&mut self, selectdirection: Selectdirection) -> &mut Self

When dragmode is set to select, this limits the selection of the drag to horizontal, vertical or diagonal. h only allows horizontal selection, v only vertical, d only diagonal and any sets no limit.

default: any

Source

pub fn grid(&mut self) -> &mut Grid<'a>

Source

pub fn calendar(&mut self, calendar: Calendar) -> &mut Self

Sets the default calendar system to use for interpreting and displaying dates throughout the plot.

default: gregorian

Source

pub fn xaxis(&mut self) -> &mut Xaxis<'a>

Source

pub fn yaxis(&mut self) -> &mut Yaxis<'a>

Source

pub fn ternary(&mut self) -> &mut Ternary<'a>

Source

pub fn scene(&mut self) -> &mut Scene<'a>

Source

pub fn geo(&mut self) -> &mut Geo<'a>

Source

pub fn mapbox(&mut self) -> &mut Mapbox<'a>

Source

pub fn polar(&mut self) -> &mut Polar<'a>

Source

pub fn radialaxis(&mut self) -> &mut Radialaxis<'a>

Source

pub fn angularaxis(&mut self) -> &mut Angularaxis<'a>

Source

pub fn legend(&mut self) -> &mut Legend<'a>

Source

pub fn colorscale(&mut self) -> &mut Colorscale<'a>

Source

pub fn coloraxis(&mut self) -> &mut Coloraxis<'a>

Source

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

Sets the source reference on Chart Studio Cloud for meta .

Trait Implementations§

Source§

impl<'a> Default for Layout<'a>

Source§

fn default() -> Layout<'a>

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

impl<'a> Serialize for Layout<'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 Layout<'a>

§

impl<'a> RefUnwindSafe for Layout<'a>

§

impl<'a> Send for Layout<'a>

§

impl<'a> Sync for Layout<'a>

§

impl<'a> Unpin for Layout<'a>

§

impl<'a> UnwindSafe for Layout<'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.