Struct plotly::Scatter3D

source ·
pub struct Scatter3D<X, Y, Z>where
    X: Serialize + Clone,
    Y: Serialize + Clone,
    Z: Serialize + Clone,
{ /* private fields */ }
Expand description

Construct a scatter3D trace.

Examples

use plotly::Scatter3D;

let trace = Scatter3D::new(
    vec![0.0, 1.0],
    vec![2.0, 3.0],
    vec![4.0, 5.0],
);

let expected = serde_json::json!({
    "type": "scatter3d",
    "x": [0.0, 1.0],
    "y": [2.0, 3.0],
    "z": [4.0, 5.0],

});

assert_eq!(serde_json::to_value(trace).unwrap(), expected);

Implementations

Sets the trace name. The trace name is used as the label for the trace in the legend, as well as when the trace is hovered hover.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Determines whether or not this trace is visible. If Visible::LegendOnly, the trace is not drawn, but can appear as a legend item (provided that the legend itself is visible).

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Determines whether or not an item corresponding to this trace is shown in the legend.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the legend group for this trace. Traces part of the same legend group show/hide at the same time when toggling legend items.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the legend rank for this trace. Items and groups with smaller ranks are presented on top/left side while with "reversed" legend.traceorder` they are on bottom/right side. The default legendrank is 1000, so that you can use ranks less than 1000 to place certain items before all unranked items, and ranks greater than 1000 to go after all unranked items.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the LegendGroupTitle object for the trace.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the opacity of the trace.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Determines the drawing mode for this scatter trace. If the provided Mode includes “Text” then the text elements appear at the coordinates. Otherwise, the text elements appear on hover. If there are less than 20 points and the trace is not stacked then the default is Mode::LinesMarkers, otherwise it is Mode::Lines.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Assigns id labels to each datum. These ids for object constancy of data points during animation. Should be an array of strings, not numbers or any other type.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the surface fill color.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets text element associated with each (x, y, z) triplet. The same tet will be applied to each data point. If the trace HoverInfo contains a “text” flag and hover_text is not set, these elements will be seen in the hover labels.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets text element associated with each (x, y, z) triplet. The same tet will be applied to each data point. If the trace HoverInfo contains a “text” flag and hover_text is not set, these elements will be seen in the hover labels.

Sets the positions of the text elements with respects to the (x, y) coordinates.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the positions of the text elements with respects to the (x, y) coordinates.

Template string used for rendering the information text that appear on points. Note that this will override textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. See format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. See format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are arrayOk: true) are available.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Template string used for rendering the information text that appear on points. Note that this will override textinfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. See format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. See format for details on the date formatting syntax. Every attributes that can be specified per-point (the ones that are arrayOk: true) are available.

Sets hover text elements associated with each (x, y, z) triplet. The same text will be associated with all datas points. To be seen, the trace hover_info must contain a “Text” flag.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets hover text elements associated with each (x, y, z) triplet. The same text will be associated with all datas points. To be seen, the trace hover_info must contain a “Text” flag.

Determines which trace information appears on hover. If HoverInfo::None or HoverInfo::Skip are set, no information is displayed upon hovering. But, if HoverInfo::None is set, click and hover events are still fired.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Template string used for rendering the information that appear on hover box. Note that this will override HoverInfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Anything contained in tag <extra> is displayed in the secondary box, for example “{fullData.name}”. To hide the secondary box completely, use an empty tag <extra></extra>.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Template string used for rendering the information that appear on hover box. Note that this will override HoverInfo. Variables are inserted using %{variable}, for example “y: %{y}”. Numbers are formatted using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details on the formatting syntax. Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details on the date formatting syntax. The variables available in hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are arrayOk: true) are available. Anything contained in tag <extra> is displayed in the secondary box, for example “{fullData.name}”. To hide the secondary box completely, use an empty tag <extra></extra>.

Sets the hover text formatting rulefor x using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3’s date formatter: “%h” for half of the year as a decimal number as well as “%{n}f” for fractional seconds with n digits. For example, “2016-10-13 09:15:23.456” with tickformat “%H~%M~%S.%2f” would display “09~15~23.46”. By default the values are formatted using x_axis.hover_format.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the hover text formatting rulefor y using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3’s date formatter: “%h” for half of the year as a decimal number as well as “%{n}f” for fractional seconds with n digits. For example, “2016-10-13 09:15:23.456” with tickformat “%H~%M~%S.%2f” would display “09~15~23.46”. By default the values are formatted using y_axis.hover_format.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the hover text formatting rulefor z using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format. And for dates see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3’s date formatter: “%h” for half of the year as a decimal number as well as “%{n}f” for fractional seconds with n digits. For example, “2016-10-13 09:15:23.456” with tickformat “%H~%M~%S.%2f” would display “09~15~23.46”. By default the values are formatted using z_axis.hover_format.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Assigns extra meta information associated with this trace that can be used in various text attributes. Attributes such as trace name, graph, axis and colorbar title.text, annotation text rangeselector, updatemenues and sliders label text all support meta. To access the trace meta values in an attribute in the same trace, simply use %{meta[i]} where i is the index or key of the meta item in question. To access trace meta in layout attributes, use %{data[n[.meta[i]} where i is the index or key of the meta and n is the trace index.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, “scatter” traces also appends customdata items in the markers DOM elements.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets a reference between this trace’s 3D coordinate system and a 3D scene. If “scene” (the default value), the (x,y,z) coordinates refer to layout.scene. If “scene2”, the (x, y, z) coordinates refer to layout.scene2, and so on.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Determines how points are displayed and joined.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Line display properties.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

x-axis error display properties.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

y-axis error display properties.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

z-axis error display properties.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Properties of label displayed on mouse hover.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Configure the projection for each axis.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

If SurfaceAxis::MinusOne, the scatter points are not filled with a surface. If one of the remaining three variants, the scatter points are filled with a Delaunay surface about the x, y, z respectively.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the calendar system to use with x date data.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the calendar system to use with y date data.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Sets the calendar system to use with z date data.

Apply the same restyling to all the traces

Apply the restyling individually to each trace. Caller is responsible to set the length of the vector to be equal to the number of traces

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.