pub enum ImageFormat {
PNG,
JPEG,
WEBP,
SVG,
PDF,
EPS,
}Expand description
Supported image formats for static image export.
This enum defines all the image formats that can be exported from Plotly
plots. Note that PDF export is implemented using browser JavaScript
functionality from html2pdf library, not the native Plotly PDF export.
§Supported Formats
- PNG: Portable Network Graphics format (recommended for web use)
- JPEG: Joint Photographic Experts Group format (good for photos)
- WEBP: Google’s modern image format (excellent compression)
- SVG: Scalable Vector Graphics format (vector-based, scalable)
- PDF: Portable Document Format (implemented via browser JS)
§Deprecated Formats
- EPS: Encapsulated PostScript format (deprecated since 0.13.0, will be
removed in 0.14.0)
- Use SVG or PDF instead for vector graphics
- EPS is not supported in the open source version and in versions prior to 0.13.0 has been generating empty images.
§Examples
use plotly_static::ImageFormat;
let format = ImageFormat::PNG;
assert_eq!(format.to_string(), "png");Variants§
PNG
Portable Network Graphics format
JPEG
Joint Photographic Experts Group format
WEBP
WebP format (Google’s image format)
SVG
Scalable Vector Graphics format
Portable Document Format (implemented via browser JS)
EPS
👎Deprecated since 0.13.0: Use SVG or PDF instead. EPS variant will be removed in version 0.14.0
Encapsulated PostScript format (deprecated)
This format is deprecated since version 0.13.0 and will be removed in version 0.14.0. Use SVG or PDF instead for vector graphics. EPS is not supported in the open source Plotly ecosystem version.
Trait Implementations§
Source§impl Clone for ImageFormat
impl Clone for ImageFormat
Source§fn clone(&self) -> ImageFormat
fn clone(&self) -> ImageFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ImageFormat
impl Debug for ImageFormat
Source§impl Display for ImageFormat
impl Display for ImageFormat
Auto Trait Implementations§
impl Freeze for ImageFormat
impl RefUnwindSafe for ImageFormat
impl Send for ImageFormat
impl Sync for ImageFormat
impl Unpin for ImageFormat
impl UnwindSafe for ImageFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.