Skip to main content

RawRenderParams

Struct RawRenderParams 

Source
pub struct RawRenderParams {
Show 24 fields pub schema_version: Option<String>, pub width: u32, pub height: u32, pub format: GraphicsFormat, pub device_pixel_ratio: f32, pub camera_view: Option<[f32; 16]>, pub aspect_ratio_mode: AspectRatioMode, pub aspect_ratio_alignment_mode: AspectRatioAlignmentMode, pub view_mode: ViewMode, pub plot_params: PlotParams, pub plot_id: String, pub stores: Option<HashMap<String, ZarrStoreInfo>>, pub wait_for_store_gets: bool, pub timeout: Option<u32>, pub cache_enabled: bool, pub svg_compression_enabled: bool, pub svg_include_document: bool, pub margin_left: Option<f32>, pub margin_right: Option<f32>, pub margin_top: Option<f32>, pub margin_bottom: Option<f32>, pub pickable: bool, pub render_backend: Option<RenderBackend>, pub compute_backend: Option<ComputeBackend>,
}
Expand description

The params that are passed to the crate::render::render function.

Fields§

§schema_version: Option<String>

To enable forward compatibility, specify the schema version that was used to generate the plot. For now, we will just specify the crate version, and will throw a warning if there is a mismatch. We will not fully error, nor will we initially implement any auto-upgrade functionality to convert a prior version to a later version, but we could implement these features in the future. TODO: In the future, we should also decouple the schema_version from the crate/package version, as the latter could advance more quickly than the former.

§width: u32

The width of the plot, in pixels.

§height: u32

The height of the plot, in pixels.

§format: GraphicsFormat

Format to use for outputs.

§device_pixel_ratio: f32§camera_view: Option<[f32; 16]>

The 4x4 camera matrix.

§aspect_ratio_mode: AspectRatioMode§aspect_ratio_alignment_mode: AspectRatioAlignmentMode§view_mode: ViewMode§plot_params: PlotParams§plot_id: String

The plot ID is used for cacheing of intermediate values per plot, and should therefore be unique among plots in the same application.

§stores: Option<HashMap<String, ZarrStoreInfo>>

Zarr stores, keyed by store name, defined once at the top level so that multiple layers can refer to the same store (and its metadata, such as which URL/path it points at and any store extensions it requires).

Every Zarr-based layer identifies the store it reads from via a store_name field, which must be present in the keys of this map. As an ergonomic shortcut, a layer may omit store_name when exactly one store is defined here, in which case that single store is used. See crate::render_traits::resolve_store_name.

The language bindings (bindings-js, bindings-python, bindings-r) use each ZarrStoreInfo to construct the concrete store object and register it under its name before rendering, so that Rust’s zarr_-prefixed bound functions can resolve (store_name, key) lookups.

§wait_for_store_gets: bool

Whether to wait for store.get and store.getRange async calls to resolve. If true, we will try to wait for .get/.getRange async calls to resolve (BUT we will still bail early if timeout elapses first). If false, proceed to rendering something partially, without waiting for all .get/.getRange async calls to successfully resolve.

§timeout: Option<u32>

Timeout in ms before bailing out of awaiting a data request.

§cache_enabled: bool

Allow disabling memoization/cacheing. Useful for testing/debugging.

§svg_compression_enabled: bool

Whether to compress the SVG string using LZ-string if the output format is Vector.

§svg_include_document: bool

Whether to include the parent <svg> document tag, versus only the inner <g> group/contents.

§margin_left: Option<f32>

Margins for plots that need them (e.g. scatterplot axes).

§margin_right: Option<f32>§margin_top: Option<f32>§margin_bottom: Option<f32>§pickable: bool

Pickable determines whether an extra render target is created/used to facilitate picking, but will only be true in certain situations (e.g., interactive plots).

§render_backend: Option<RenderBackend>

Whether to use GPU or CPU for rendering. If None, try GPU, then fallback to CPU.

§compute_backend: Option<ComputeBackend>

Whether to use GPU or CPU for compute operations. If None, try GPU, then fallback to CPU.

Trait Implementations§

Source§

impl Clone for RenderParams

Source§

fn clone(&self) -> RenderParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for RenderParams

Source§

fn default() -> RenderParams

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RenderParams

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<RenderParams, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RenderParams

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,