Skip to content

Commit 006dfcf

Browse files
committed
fix cargo doc warnings
Signed-off-by: Andrei Gherghescu <[email protected]>
1 parent 9dcc941 commit 006dfcf

File tree

11 files changed

+70
-71
lines changed

11 files changed

+70
-71
lines changed

plotly/src/common/color.rs

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
//! This module provides several user interfaces for describing a color to be
2-
//! used throughout the rest of the library. The easiest way of describing a
3-
//! colour is to use a `&str` or `String`, which is simply serialized as-is and
4-
//! passed on to the underlying `plotly.js` library. `plotly.js` supports [`CSS
5-
//! color formats`], and will fallback to some default color if the color string
6-
//! is malformed.
7-
//!
8-
//! For a more type-safe approach, the `RGB` or `RGBA` structs can be used to
9-
//! construct a valid color, which will then get serialized to an appropriate
10-
//! string representation. Cross-browser compatible [`predefined colors`] are
11-
//! supported via the `NamedColor` enum.
12-
//!
13-
//! The `Color` trait is public, and so can be implemented for custom colour
14-
//! types. The user can then implement a valid serialization function according
15-
//! to their own requirements. On the whole, that should be largely unnecessary
16-
//! given the functionality already provided within this module.
17-
//!
18-
//! [`CSS color formats`]: https://www.w3schools.com/cssref/css_colors_legal.asp
19-
//! [`predefined colors`]: https://www.w3schools.com/cssref/css_colors.asp
20-
1+
/// This module provides several user interfaces for describing a color to be
2+
/// used throughout the rest of the library. The easiest way of describing a
3+
/// colour is to use a `&str` or `String`, which is simply serialized as-is and
4+
/// passed on to the underlying `plotly.js` library. `plotly.js` supports [`CSS
5+
/// color formats`], and will fallback to some default color if the color string
6+
/// is malformed.
7+
///
8+
/// For a more type-safe approach, the `RGB` or `RGBA` structs can be used to
9+
/// construct a valid color, which will then get serialized to an appropriate
10+
/// string representation. Cross-browser compatible [`predefined colors`] are
11+
/// supported via the `NamedColor` enum.
12+
///
13+
/// The `Color` trait is public, and so can be implemented for custom colour
14+
/// types. The user can then implement a valid serialization function according
15+
/// to their own requirements. On the whole, that should be largely unnecessary
16+
/// given the functionality already provided within this module.
17+
///
18+
/// [`CSS color formats`]: <https://www.w3schools.com/cssref/css_colors_legal.asp>
19+
/// [`predefined colors`]: <https://www.w3schools.com/cssref/css_colors.asp>
2120
use dyn_clone::DynClone;
2221
use erased_serde::Serialize as ErasedSerialize;
2322
use serde::Serialize;
@@ -116,7 +115,7 @@ impl Serialize for Rgba {
116115

117116
/// Cross-browser compatible [`predefined colors`].
118117
///
119-
/// [`predefined colors`]: https://www.w3schools.com/cssref/css_colors.asp
118+
/// [`predefined colors`]: <https://www.w3schools.com/cssref/css_colors.asp>
120119
#[derive(Debug, Clone, Copy, Serialize)]
121120
#[serde(rename_all = "lowercase")]
122121
pub enum NamedColor {

plotly/src/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl Configuration {
212212
/// When set it determines base URL for the "Edit in Chart Studio"
213213
/// `show_edit_in_chart_studio`/`show_send_to_cloud` mode bar button and
214214
/// the show_link/send_data on-graph link. To enable sending your data to
215-
/// Chart Studio Cloud, you need to set both `plotly_server_url` to "https://chart-studio.plotly.com" and
215+
/// Chart Studio Cloud, you need to set both `plotly_server_url` to <https://chart-studio.plotly.com> and
216216
/// also set `showSendToCloud` to `true`.
217217
pub fn plotly_server_url(mut self, plotly_server_url: &str) -> Self {
218218
self.plotly_server_url = Some(plotly_server_url.to_string());

plotly/src/layout/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ pub struct Shape {
929929
#[serde(rename = "fillcolor")]
930930
fill_color: Option<Box<dyn Color>>,
931931
/// Determines which regions of complex paths constitute the interior. For
932-
/// more info please visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule
932+
/// more info please visit <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule>
933933
#[serde(rename = "fillrule")]
934934
fill_rule: Option<FillRule>,
935935
/// Determines whether the shape could be activated for edit or not. Has no
@@ -994,7 +994,7 @@ pub struct NewShape {
994994
#[serde(rename = "fillcolor")]
995995
fill_color: Option<Box<dyn Color>>,
996996
/// Determines the path's interior. For more info please
997-
/// visit https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule
997+
/// visit <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule>
998998
#[serde(rename = "fillrule")]
999999
fill_rule: Option<FillRule>,
10001000
/// Sets the opacity of new shapes. Number between or equal to 0 and 1.
@@ -1071,8 +1071,8 @@ pub struct Annotation {
10711071
visible: Option<bool>,
10721072
/// Sets the text associated with this annotation. Plotly uses a subset of
10731073
/// HTML tags to do things like newline (<br>), bold (<b></b>), italics
1074-
/// (<i></i>), hyperlinks (<a href='...'></a>). Tags <em>, <sup>, <sub>
1075-
/// <span> are also supported.
1074+
/// (<i></i>), hyperlinks (<a href='...'></a>). Tags <em></em>, <sup></sup>, <sub></sub>
1075+
/// <span></span> are also supported.
10761076
text: Option<String>,
10771077
/// Sets the angle at which the `text` is drawn with respect to the
10781078
/// horizontal.

plotly/src/traces/image.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub struct Image {
217217
dy: Option<f64>,
218218

219219
/// Specifies the data URI of the image to be visualized. The URI consists
220-
/// of "data:image/[<media subtype>][;base64],<data>".
220+
/// of "data:image/[\<media subtype\>]\[;base64\],\<data\>".
221221
source: Option<String>,
222222

223223
/// Sets text elements associated with each (x,y) pair. If a single string,
@@ -245,12 +245,12 @@ pub struct Image {
245245
/// inserted using %{variable}, for example "y: %{y}". Numbers are
246246
/// formatted using d3-format's syntax %{variable:d3-format}, for example
247247
/// "Price: %{y:$.2f}".
248-
/// https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details
248+
/// <https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format> for details
249249
/// on the formatting syntax. Dates are formatted using d3-time-format's
250250
/// syntax %{variable|d3-time-format}, for example "Day:
251-
/// %{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details
251+
/// %{2019-01-01|%A}". <https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format> for details
252252
/// on the date formatting syntax. The variables available in
253-
/// `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.
253+
/// `hovertemplate` are the ones emitted as event data described at this link <https://plotly.com/javascript/plotlyjs-events/#event-data>.
254254
/// Additionally, every attributes that can be specified per-point (the ones
255255
/// that are `arrayOk: true`) are available. Anything contained in tag
256256
/// `<extra>` is displayed in the secondary box, for example

plotly/src/traces/mesh3d.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ where
190190
/// inserted using %{variable}, for example "y: %{y}". Numbers are
191191
/// formatted using d3-format's syntax %{variable:d3-format}, for example
192192
/// "Price: %{y:$.2f}".
193-
/// https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details
193+
/// <https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format> for details
194194
/// on the formatting syntax. Dates are formatted using d3-time-format's
195195
/// syntax %{variable|d3-time-format}, for example "Day:
196-
/// %{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details
196+
/// %{2019-01-01|%A}". <https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format> for details
197197
/// on the date formatting syntax. The variables available in
198-
/// `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.
198+
/// `hovertemplate` are the ones emitted as event data described at this link <https://plotly.com/javascript/plotlyjs-events/#event-data>.
199199
/// Additionally, every attributes that can be specified per-point (the ones
200200
/// that are `arrayOk: true`) are available. Anything contained in tag
201201
/// `<extra>` is displayed in the secondary box, for example
@@ -204,8 +204,8 @@ where
204204
#[serde(rename = "hovertemplate")]
205205
hover_template: Option<Dim<String>>,
206206
/// Sets the hover text formatting rulefor `x` using d3 formatting
207-
/// 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
208-
/// see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date
207+
/// 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
208+
/// see: <https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format>. We add two items to d3's date
209209
/// formatter: "%h" for half of the year as a decimal number as well as
210210
/// "%{n}f" for fractional seconds with n digits. For example,
211211
/// "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display
@@ -214,8 +214,8 @@ where
214214
#[serde(rename = "xhoverformat")]
215215
x_hover_format: Option<String>,
216216
/// Sets the hover text formatting rulefor `y` using d3 formatting
217-
/// 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
218-
/// see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date
217+
/// 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
218+
/// see: <https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format>. We add two items to d3's date
219219
/// formatter: "%h" for half of the year as a decimal number as well as
220220
/// "%{n}f" for fractional seconds with n digits. For example,
221221
/// "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display
@@ -286,8 +286,8 @@ where
286286
reverse_scale: Option<bool>,
287287

288288
/// Sets the hover text formatting rulefor `z` using d3 formatting
289-
/// 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
290-
/// see: https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format. We add two items to d3's date
289+
/// 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
290+
/// see: <https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format>. We add two items to d3's date
291291
/// formatter: "%h" for half of the year as a decimal number as well as
292292
/// "%{n}f" for fractional seconds with n digits. For example,
293293
/// "2016-10-13 09:15:23.456" with tickformat "%H~%M~%S.%2f" would display

plotly/src/traces/pie.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ where
7878
/// the first point. An underscore before or after “(x|y)other” will add
7979
/// a space on that side, only when this field is shown. Numbers are
8080
/// formatted using d3-format’s syntax %{variable:d3-format}, for example
81-
/// “Price: %{y:$.2f}”. https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax.
82-
/// Dates are formatted using d3-time-format’s syntax
83-
/// %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time- format/tree/v2.2.3#locale_format for
81+
/// “Price: %{y:$.2f}”. <https://github.com/d3/d3-format/tree/v1.4.5#d3-format> for details on the formatting syntax.
82+
/// Dates are formatted using d3-time-format’s syntax
83+
/// %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. <https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format> for
8484
/// details on the date formatting syntax. The variables available in
85-
/// hovertemplate are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event- data.
86-
/// Additionally, every attributes that can be specified per-point (the
85+
/// hovertemplate are the ones emitted as event data described at this link <https://plotly.com/javascript/plotlyjs-events/#event-data>.
86+
/// Additionally, every attributes that can be specified per-point (the
8787
/// ones that are arrayOk: true) are available. Finally, the template
8888
/// string has access to variables label, color, value, percent and text.
89-
/// Anything contained in tag <extra> is displayed in the secondary box, for
89+
/// Anything contained in tag \<extra\> is displayed in the secondary box, for
9090
/// example “<extra>{fullData.name}</extra>”. To hide the secondary box
9191
/// completely, use an empty tag <extra></extra>.
9292
#[serde(rename = "hovertemplate")]
@@ -144,8 +144,8 @@ where
144144
/// axis and colorbar title.text, annotation text rangeselector,
145145
/// updatemenues and sliders label text all support meta. To access the
146146
/// trace meta values in an attribute in the same trace, simply use
147-
/// %{meta[i]} where i is the index or key of the meta item in question. To
148-
/// access trace meta in layout attributes, use %{data[n[.meta[i]} where i
147+
/// %{meta\[i\]} where i is the index or key of the meta item in question. To
148+
/// access trace meta in layout attributes, use %{data[n[.meta\[i\]} where i
149149
/// is the index or key of the meta and n is the trace index.
150150
meta: Option<NumOrString>,
151151
/// Sets the trace name. The trace name appears as the legend item and on
@@ -186,9 +186,10 @@ where
186186
/// Template string used for rendering the information text that appear on
187187
/// points. Note that this will override textinfo. Variables are
188188
/// inserted using %{variable}, for example “y: %{y}”. Numbers are formatted
189-
/// using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”. https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax.
190-
/// Dates are formatted using d3-time-format’s syntax
191-
/// %{variable|d3-time-format}, for example “Day: %{2019-01-01|%A}”. https://github.com/d3/d3-time- format/tree/v2.2.3#locale_format for details on the date formatting syntax.
189+
/// using d3-format’s syntax %{variable:d3-format}, for example “Price: %{y:$.2f}”.
190+
/// <https://github.com/d3/d3-format/tree/v1.4.5#d3-format> for details on the formatting syntax.
191+
/// Dates are formatted using d3-time-format’s syntax %{variable|d3-time-format}, for example
192+
/// “Day: %{2019-01-01|%A}”. <https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format> for details on the date formatting syntax.
192193
/// Every attributes that can be specified per-point (the ones that are
193194
/// arrayOk: true) are available. Finally, the template string has
194195
/// access to variables label, color, value, percent and text.

plotly/src/traces/sankey.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ where
332332
#[serde(rename = "textfont")]
333333
text_font: Option<Font>,
334334
/// Sets the value formatting rule using d3 formatting mini-languages which
335-
/// are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/tree/v1.4.5#d3-format.
335+
/// are very similar to those in Python. For numbers, see: <https://github.com/d3/d3-format/tree/v1.4.5#d3-format>.
336336
#[serde(rename = "valueformat")]
337337
value_format: Option<String>,
338338
/// Adds a unit to follow the value in the hover tooltip. Add a space if a

plotly/src/traces/scatter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ where
146146
/// inserted using %{variable}, for example "y: %{y}". Numbers are
147147
/// formatted using d3-format's syntax %{variable:d3-format}, for example
148148
/// "Price: %{y:$.2f}".
149-
/// https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format for details
149+
/// <https://github.com/d3/d3-3.x-api-reference/blob/master/Formatting.md#d3_format> for details
150150
/// on the formatting syntax. Dates are formatted using d3-time-format's
151-
/// syntax %{variable|d3-time-format}, for example "Day:
152-
/// %{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format for details
151+
/// syntax %{variable|d3-time-format}, for example "Day: %{2019-01-01|%A}".
152+
/// <https://github.com/d3/d3-3.x-api-reference/blob/master/Time-Formatting.md#format> for details
153153
/// on the date formatting syntax. The variables available in
154-
/// `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data.
154+
/// `hovertemplate` are the ones emitted as event data described at this link <https://plotly.com/javascript/plotlyjs-events/#event-data>.
155155
/// Additionally, every attributes that can be specified per-point (the ones
156156
/// that are `arrayOk: true`) are available. Anything contained in tag
157157
/// `<extra>` is displayed in the secondary box, for example

0 commit comments

Comments
 (0)