1# Plotters Release Notes 2 3This documents contains the release notes for every major release since v0.3. 4 5## Plotters v0.3 6 7Plotters v0.3 is shipped with multiple major improvements. 8 9## Plug-and-play backend importing 10 11### Introduction 12 13Previously, Plotters implements all supported backend in the core crate. As the project is becoming bigger and bigger and 14more and more backend is supported, those backend implementation cause a huge mantainance burden. 15 16For example, when `cairo-rs` crate is updated, plotters should release a new version with updated `cairo-rs` dependency for 17our cairo backend. However, most of the users doesn't actually use this backend and pushing new version for updating cairo backend 18seems to be annoying for most of the people. As more and more backend is added, the depdendency is out of control. 19 20### Details 21 22To address this, we are now move all backend implementation code out of the plotters crate. To use a specific backend, you need to 23explicitly add backend crate to your dependency. For example, to use bitmap backend for v0.2.x, we can do this 24 25```rust 26use plotters::prelude::*; 27fn main() { 28 let backend = BitMapBackend::new(...) 29} 30``` 31 32After this update, you should do the following code instead: 33 34```rust 35use plotters::prelude::*; 36use plotter_bitmap::BitMapBackend; // <= This extra import is used to plug the backend to Plotters 37 38fn main() { 39 let backend = BitMapBackend::new(...) 40} 41 42``` 43 44### Backward compatibility 45 46Plotters 0.3 has introduced concept of tier 1 backends, which is the most supported. 47All tier 1 backends could be imported automatically with the core crate (But can be opt-out as well). 48Currently we have two tier 1 backends: `plotters-bitmap` and `plotters-svg`. 49These are used by most of the people. 50 51To ease the upgrade for tier 1 backends, we still keep feature options in the core crate that can opt in those crates. And this is enabled by default. 52 53Thus, if plotters is imported with default feature set, there would require no change. If the default feature set is opt out, then the following change 54should be make with your `Crates.toml`: 55 56```toml 57plotters = {version = "0.3", default_features = false, features = ["bitmap_backend", "svg_backend"]} # Instead of using feature "bitmap" and "svg" 58``` 59 60For non tier 1 backends, manmually import is required (Please note tier on backends can be imported in same way). For example: 61 62```toml 63plotters = {version = "0.3", default_features = false} # Instead of having features = ["cairo"] at this point 64plotters-cairo = "0.3" # We should import the cairo backend in this way. 65``` 66 67And in your code, instead of import `plotters::prelude::CairoBackend`, you should import `plotters_cairo::CairoBackend` 68 69## Enhanced Coordinate System Abstraction 70 71### Details 72 73Plotters 0.3 ships with tons of improvement made in the coordinate abstraction and support much more kinds of coordinate. 74 75* `chrono::NaiveDate` and `chrono::NaiveDateTime` are now supported 76* Better abstraction of discrete coordinates 77* Linspace coordinate, which can be used converting a continous coorindate into a discrete buckets 78* Nested coordinate 79* Slices can now be used as cooradnite specification, which allows people define an axis of category. 80* 3D Coordinate is now supported 81 82## Fix bugs and improve testing 83