Struct poloto::DataBuilder[][src]

pub struct DataBuilder<D: Display> { /* fields omitted */ }

Insert svg data after the svg element, but before the plot elements.

Implementations

impl DataBuilder<&'static str>[src]

pub fn new() -> Self[src]

impl<D: Display> DataBuilder<D>[src]

pub fn push_css_default(self) -> DataBuilder<impl Display>[src]

Push the default poloto css styling.

pub fn push_default_css_with_variable(self) -> DataBuilder<impl Display>[src]

Instead of the default style, use one that adds variables.

This injects what is produced by StyleBuilder::build_with_css_variables instead of the default StyleBuilder::build.

If you embed the generated svg into a html file, then you can add this example:

.poloto{
   --poloto_bg_color:"black";
   --poloto_fg_color:"white;
   --poloto_color0:"red";
   --poloto_color1:"green";
   --poloto_color2:"yellow";
   --poloto_color3:"orange";
   --poloto_color4:"purple";
   --poloto_color5:"pink";
   --poloto_color6:"aqua";
   --poloto_color7:"red";
}

By default these variables are not defined, so the svg falls back on some default colors.

pub fn push(self, a: impl Display) -> DataBuilder<impl Display>[src]

User can inject some svg elements using this function. They will be inserted right after the svg and default svg tags.

You can override the css in regular html if you embed the generated svg. This gives you a lot of flexibility giving your the power to dynamically change the theme of your svg.

However, if you want to embed the svg as an image, you lose this ability. If embedding as IMG is desired, instead the user can insert a custom style into the generated svg itself.

Trait Implementations

impl Default for DataBuilder<&'static str>[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for DataBuilder<D> where
    D: RefUnwindSafe

impl<D> Send for DataBuilder<D> where
    D: Send

impl<D> Sync for DataBuilder<D> where
    D: Sync

impl<D> Unpin for DataBuilder<D> where
    D: Unpin

impl<D> UnwindSafe for DataBuilder<D> where
    D: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.