pub struct DepictOptions { /* private fields */ }Expand description
Style options for MolHandle::depict_svg_opts.
Construct with new DepictOptions(), then call setters:
const opts = new DepictOptions();
opts.set_background("transparent");
opts.set_dark(true);
opts.set_width(240);
opts.set_height(240);Implementations§
Source§impl DepictOptions
impl DepictOptions
pub fn new() -> Self
pub fn set_width(&mut self, w: u32)
pub fn set_height(&mut self, h: u32)
pub fn set_padding(&mut self, p: f64)
pub fn set_background(&mut self, bg: String)
pub fn set_dark(&mut self, dark: bool)
pub fn set_highlight_atoms(&mut self, atoms: Vec<u32>)
pub fn set_highlight_bonds(&mut self, bonds: Vec<u32>)
pub fn set_highlight_color(&mut self, color: String)
Sourcepub fn set_atom_color(&mut self, idx: u32, color: String)
pub fn set_atom_color(&mut self, idx: u32, color: String)
Set a per-atom color override (CSS color string). Calling multiple times
for the same idx uses the last value. The atom is highlighted even if
not in set_highlight_atoms.
pub fn set_atom_ids(&mut self, v: bool)
pub fn set_show_atom_indices(&mut self, v: bool)
pub fn set_kekulize(&mut self, v: bool)
Trait Implementations§
Source§impl Default for DepictOptions
impl Default for DepictOptions
Source§impl From<DepictOptions> for JsValue
impl From<DepictOptions> for JsValue
Source§fn from(value: DepictOptions) -> Self
fn from(value: DepictOptions) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for DepictOptions
impl FromWasmAbi for DepictOptions
Source§impl IntoWasmAbi for DepictOptions
impl IntoWasmAbi for DepictOptions
Source§impl LongRefFromWasmAbi for DepictOptions
impl LongRefFromWasmAbi for DepictOptions
Source§type Abi = WasmPtr<WasmRefCell<DepictOptions>>
type Abi = WasmPtr<WasmRefCell<DepictOptions>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRef<DepictOptions>
type Anchor = RcRef<DepictOptions>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for DepictOptions
impl OptionFromWasmAbi for DepictOptions
Source§impl OptionIntoWasmAbi for DepictOptions
impl OptionIntoWasmAbi for DepictOptions
Source§impl RefFromWasmAbi for DepictOptions
impl RefFromWasmAbi for DepictOptions
Source§type Abi = WasmPtr<WasmRefCell<DepictOptions>>
type Abi = WasmPtr<WasmRefCell<DepictOptions>>
The Wasm ABI type references to
Self are recovered from.Source§type Anchor = RcRef<DepictOptions>
type Anchor = RcRef<DepictOptions>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for DepictOptions
impl RefMutFromWasmAbi for DepictOptions
Source§type Abi = WasmPtr<WasmRefCell<DepictOptions>>
type Abi = WasmPtr<WasmRefCell<DepictOptions>>
Same as
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<DepictOptions>
type Anchor = RcRefMut<DepictOptions>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for DepictOptions
impl SupportsInstanceProperty for DepictOptions
impl SupportsStaticProperty for DepictOptions
Source§impl TryFromJsValue for DepictOptions
impl TryFromJsValue for DepictOptions
Source§impl VectorFromWasmAbi for DepictOptions
impl VectorFromWasmAbi for DepictOptions
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[DepictOptions]>
Source§impl VectorIntoWasmAbi for DepictOptions
impl VectorIntoWasmAbi for DepictOptions
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[DepictOptions]>) -> Self::Abi
Source§impl WasmDescribeVector for DepictOptions
impl WasmDescribeVector for DepictOptions
Auto Trait Implementations§
impl Freeze for DepictOptions
impl RefUnwindSafe for DepictOptions
impl Send for DepictOptions
impl Sync for DepictOptions
impl Unpin for DepictOptions
impl UnsafeUnpin for DepictOptions
impl UnwindSafe for DepictOptions
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.