Skip to main content

LayoutConfig

Struct LayoutConfig 

Source
pub struct LayoutConfig {
    pub seed: u64,
    pub max_iterations: u32,
    pub theta: f32,
    pub repulsion: f32,
    pub spring_stiffness: f32,
    pub gravity: f32,
    pub damping: f32,
    pub cool_factor: f32,
    pub min_alpha: f32,
    pub max_step: f32,
    pub min_dist: f32,
}
Expand description

布局参数。默认值适合百到万级节点的知识图谱;视觉调参走 arc-tokens(G3/G4)。

Fields§

§seed: u64

随机种子:同种子 → 同初始位置 → 同布局(方案 §4 可复现要求)。

§max_iterations: u32

最大迭代步数(冷却兜底上限)。

§theta: f32

Barnes–Hut 打开精度(盒边长 / 距离);0.9 兼顾精度与速度,1e-9 ≈ 暴力。

§repulsion: f32

排斥强度(库仑式 F = strength·m_i·m_j/d²)。

§spring_stiffness: f32

弹簧刚度(胡克 F = stiffness·weight·d)。

§gravity: f32

向心重力加速度。

§damping: f32

速度阻尼(0–1,越大越快停)。

§cool_factor: f32

冷却系数:每步 alpha 乘以该值。

§min_alpha: f32

alpha 低于该值视为冷却结束。

§max_step: f32

单步最大位移(防爆炸)。

§min_dist: f32

软化距离:两点间最小有效距离。

Trait Implementations§

Source§

impl Clone for LayoutConfig

Source§

fn clone(&self) -> Self

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 LayoutConfig

Source§

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

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

impl Default for LayoutConfig

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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> 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.