plotly/
lib.rs

1//! # Plotly.rs
2//!
3//! A plotting library for Rust powered by [Plotly.js](https://plot.ly/javascript/).
4//!
5//! ## Feature Deprecation Notice
6//!
7//! The `kaleido` and `kaleido_download` features are deprecated since version
8//! 0.13.0 and will be removed in version 0.14.0. Please migrate to the
9//! `plotly_static` and `plotly_static_download` features instead.
10#![recursion_limit = "256"] // lets us use a large serde_json::json! macro for testing crate::layout::Axis
11extern crate askama;
12extern crate rand;
13extern crate serde;
14
15#[cfg(feature = "kaleido")]
16#[deprecated(
17    since = "0.13.0",
18    note = "kaleido feature is deprecated and will be removed in version 0.14.0. Use plotly_static feature instead"
19)]
20const _KALEIDO_DEPRECATED: () = ();
21
22#[cfg(feature = "kaleido_download")]
23#[deprecated(
24    since = "0.13.0",
25    note = "kaleido_download feature is deprecated and will be removed in version 0.14.0. Use plotly_static_download feature instead"
26)]
27const _KALEIDO_DOWNLOAD_DEPRECATED: () = ();
28
29#[cfg(all(feature = "kaleido", target_family = "wasm"))]
30compile_error!(
31    r#"The "kaleido" feature is not available on "wasm" targets. Please compile without this feature for the wasm target family."#
32);
33
34#[cfg(all(feature = "kaleido", feature = "plotly_static"))]
35compile_error!(
36    r#"The "kaleido" feature and "plotly_static" are conflictings. Please select only one of them."#
37);
38
39#[cfg(feature = "plotly_ndarray")]
40pub mod ndarray;
41#[cfg(feature = "plotly_ndarray")]
42pub use crate::ndarray::ArrayTraces;
43
44#[cfg(target_family = "wasm")]
45pub mod bindings;
46
47#[cfg(target_family = "wasm")]
48pub mod callbacks;
49
50pub mod common;
51pub mod configuration;
52pub mod layout;
53pub mod plot;
54pub mod traces;
55
56pub use common::color;
57pub use configuration::Configuration;
58pub use layout::Layout;
59pub use plot::{Plot, Trace, Traces};
60// Also provide easy access to modules which contain additional trace-specific types
61pub use traces::{
62    box_plot, contour, heat_map, histogram, image, mesh3d, sankey, scatter, scatter3d,
63    scatter_mapbox, surface,
64};
65// Bring the different trace types into the top-level scope
66pub use traces::{
67    Bar, BoxPlot, Candlestick, Contour, DensityMapbox, HeatMap, Histogram, Image, Mesh3D, Ohlc,
68    Pie, Sankey, Scatter, Scatter3D, ScatterGeo, ScatterMapbox, ScatterPolar, Surface, Table,
69};
70
71pub trait Restyle: serde::Serialize {}
72pub trait Relayout {}
73
74#[cfg(feature = "kaleido")]
75pub use plotly_kaleido::ImageFormat;
76#[cfg(feature = "plotly_static")]
77pub use plotly_static::{self, ImageFormat};
78
79// Not public API.
80#[doc(hidden)]
81mod private;