Skip to main content

MermaidOptions

Struct MermaidOptions 

Source
pub struct MermaidOptions {
Show 41 fields pub theme: MermaidThemeMode, pub background_color: Option<String>, pub responsive_svg: Option<bool>, pub center_labels: Option<bool>, pub output_dir: Option<PathBuf>, pub puppeteer_config_file: Option<PathBuf>, pub html_labels: Option<bool>, pub theme_variables: Option<MermaidThemeVariables>, pub font_family: Option<String>, pub font_size: Option<u32>, pub start_on_load: Option<bool>, pub arrow_marker_absolute: Option<bool>, pub deterministic_ids: Option<bool>, pub deterministic_id_seed: Option<String>, pub max_text_size: Option<u64>, pub max_edges: Option<u64>, pub security_level: Option<MermaidSecurityLevel>, pub log_level: Option<MermaidLogLevel>, pub look: Option<MermaidLook>, pub layout: Option<MermaidLayout>, pub hand_drawn_seed: Option<i64>, pub wrap: Option<bool>, pub flowchart: Option<MermaidFlowchartConfig>, pub sequence: Option<MermaidSequenceConfig>, pub gantt: Option<MermaidGanttConfig>, pub er: Option<MermaidErConfig>, pub pie: Option<MermaidPieConfig>, pub class_diagram: Option<MermaidNodeRendererConfig>, pub state: Option<MermaidNodeRendererConfig>, pub git_graph: Option<MermaidGitGraphConfig>, pub journey: Option<MermaidJourneyConfig>, pub mindmap: Option<MermaidMindmapConfig>, pub timeline: Option<MermaidTimelineConfig>, pub sankey: Option<MermaidSankeyConfig>, pub xy_chart: Option<MermaidXyChartConfig>, pub block: Option<MermaidBlockConfig>, pub requirement: Option<MermaidRequirementConfig>, pub c4: Option<MermaidC4Config>, pub architecture: Option<MermaidArchitectureConfig>, pub radar: Option<MermaidRadarConfig>, pub treemap: Option<MermaidTreemapConfig>,
}
Expand description

Top-level mermaid configuration. Single flat object - every mermaid.initialize() knob (themeVariables, flowchart, sequence, gantt, look, layout, …) lives at the same level as the dmc-side rendering knobs (responsiveSvg, centerLabels, outputDir, …). All fields are typed end-to-end; no serde_json::Value catch-all.

None on CompileConfig.mermaid means “use built-in defaults” (light + dark themes, htmlLabels:false, flowchart spacing).

Fields§

§theme: MermaidThemeMode

Theme spec. Single string (one render -> chartSvg) or mode -> theme map (per-mode render -> ${mode}Svg each). Always stripped from the mermaid configFile in build_mermaid_config - it’s a dmc-side knob, not a mermaid one.

§background_color: Option<String>

mmdc --backgroundColor. Default "transparent".

§responsive_svg: Option<bool>

Apply the responsive-width post-process. Default true.

§center_labels: Option<bool>

Inject text-anchor="middle" on label <text> / <tspan> so flowchart node labels center inside their <rect> when htmlLabels:false is in effect. Default true.

§output_dir: Option<PathBuf>

Disk cache directory.

§puppeteer_config_file: Option<PathBuf>

Forwarded to mmdc --puppeteerConfigFile.

§html_labels: Option<bool>

Override the bundled htmlLabels: false default. true switches flowchart node labels back to HTML-in-<foreignObject>.

§theme_variables: Option<MermaidThemeVariables>§font_family: Option<String>§font_size: Option<u32>§start_on_load: Option<bool>§arrow_marker_absolute: Option<bool>§deterministic_ids: Option<bool>§deterministic_id_seed: Option<String>§max_text_size: Option<u64>§max_edges: Option<u64>§security_level: Option<MermaidSecurityLevel>§log_level: Option<MermaidLogLevel>§look: Option<MermaidLook>§layout: Option<MermaidLayout>§hand_drawn_seed: Option<i64>§wrap: Option<bool>§flowchart: Option<MermaidFlowchartConfig>§sequence: Option<MermaidSequenceConfig>§gantt: Option<MermaidGanttConfig>§er: Option<MermaidErConfig>§pie: Option<MermaidPieConfig>§class_diagram: Option<MermaidNodeRendererConfig>

class is a Rust keyword - exposed under class in JSON via serde(rename).

§state: Option<MermaidNodeRendererConfig>§git_graph: Option<MermaidGitGraphConfig>§journey: Option<MermaidJourneyConfig>§mindmap: Option<MermaidMindmapConfig>§timeline: Option<MermaidTimelineConfig>§sankey: Option<MermaidSankeyConfig>§xy_chart: Option<MermaidXyChartConfig>§block: Option<MermaidBlockConfig>§requirement: Option<MermaidRequirementConfig>§c4: Option<MermaidC4Config>§architecture: Option<MermaidArchitectureConfig>§radar: Option<MermaidRadarConfig>§treemap: Option<MermaidTreemapConfig>

Trait Implementations§

Source§

impl Clone for MermaidOptions

Source§

fn clone(&self) -> MermaidOptions

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 MermaidOptions

Source§

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

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

impl Default for MermaidOptions

Source§

fn default() -> MermaidOptions

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

impl<'de> Deserialize<'de> for MermaidOptions

Source§

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

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

impl Serialize for MermaidOptions

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.