Skip to content

Commit 492cf35

Browse files
committed
Add more feature options
1 parent e6951fd commit 492cf35

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ version = "0.3.29"
4848
features = ['Document', 'DomRect', 'Element', 'HtmlElement', 'Node', 'Window', 'HtmlCanvasElement', 'CanvasRenderingContext2d']
4949

5050
[features]
51-
default = ["image_encoder", "svg", "chrono", "palette_ext", "gif_backend", "deprecated_items", "bitmap", "ttf", "errorbar", "candlestick", "boxplot"]
51+
default = ["image_encoder", "svg", "chrono", "palette_ext", "gif_backend",
52+
"deprecated_items", "bitmap", "ttf", "errorbar", "candlestick",
53+
"boxplot", "histogram", "area_series", "line_series", "point_series"]
5254
ttf = ["font-kit", "rusttype", "lazy_static"]
5355
image_encoder = ["image", "bitmap"]
5456
palette_ext = ["palette"]
@@ -64,6 +66,10 @@ debug = [] # Enable debugging code
6466
errorbar = []
6567
candlestick = []
6668
boxplot = []
69+
histogram = []
70+
area_series = []
71+
line_series = []
72+
point_series = []
6773

6874

6975
[dev-dependencies]

src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,15 @@ pub mod prelude {
678678
pub use crate::coord::{make_partial_axis, RangedDate, RangedDateTime, RangedDuration};
679679

680680
pub use crate::drawing::*;
681-
pub use crate::series::{AreaSeries, Histogram, LineSeries, PointSeries};
681+
#[cfg(feature = "area_series")]
682+
pub use crate::series::AreaSeries;
683+
#[cfg(feature = "histogram")]
684+
pub use crate::series::Histogram;
685+
#[cfg(feature = "line_series")]
686+
pub use crate::series::LineSeries;
687+
#[cfg(feature = "point_series")]
688+
pub use crate::series::PointSeries;
689+
682690
pub use crate::style::{
683691
AsRelative, Color, FontDesc, FontFamily, FontStyle, FontTransform, HSLColor, IntoFont,
684692
Palette, Palette100, Palette99, Palette9999, PaletteColor, RGBColor, ShapeStyle,

src/series/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@
1010
So iterator combinator such as `map`, `zip`, etc can also be used.
1111
*/
1212

13+
#[cfg(feature = "area_series")]
1314
mod area_series;
15+
#[cfg(feature = "histogram")]
1416
mod histogram;
17+
#[cfg(feature = "line_series")]
1518
mod line_series;
19+
#[cfg(feature = "point_series")]
1620
mod point_series;
1721

22+
#[cfg(feature = "area_series")]
1823
pub use area_series::AreaSeries;
24+
#[cfg(feature = "histogram")]
1925
pub use histogram::Histogram;
26+
#[cfg(feature = "line_series")]
2027
pub use line_series::LineSeries;
28+
#[cfg(feature = "point_series")]
2129
pub use point_series::PointSeries;

0 commit comments

Comments
 (0)