On this page 6 sections

Graph layout controls

Edit dip/graph_viewer.dip, under graph_viewer[default], to tune the graph. The viewer schema documents the controls and validates the new numerical ranges with !condition.

These values govern visual layout. They do not express causal efficacy, doctrinal importance, confidence, or philosophical distance. Every visible link attracts its endpoints according to its layout class, including links that express opposition or exclusion.

Attraction and preferred distance

LinksAttraction parameterDefaultDistance parameterDefault
is_kind_oflink_strength_kind_of0.5link_distance_kind_of2.7
Kinds listed in structural_link_kinds, except is_kind_oflink_strength_structural0.3link_distance_structural3.2
All other linkslink_strength_default0.2link_distance_default4.1

structural_link_kinds initially contains identity, classification, and composition. It is an editable string array; the viewer checks its entries against the relation-color kind registry. The specific is_kind_of rule takes precedence.

For example, raising link_strength_default gives influence links more attraction, together with all other links in that class. Lowering link_strength_kind_of reduces the clustering caused by taxonomic links. These changes do not guarantee a particular global arrangement.

Collision, repulsion, and settling

ParameterMeaningDefault
link_spacingMultiplier on final preferred link distance1.6
link_arrow_clearance_ratioTotal link clearance in multiples of arrow length2.0
charge_strengthGlobal repulsion at the default icon size-8.0
charge_icon_scale_exponentHow repulsion scales with icon size2.0
collision_icon_radius_ratioCollision radius relative to scaled icon diameter0.52
collision_arrow_clearance_ratioAdditional collision radius in arrow lengths0.5
collision_strengthCollision correction strength0.72
collision_iterationsCollision iterations per tick2
alpha_decayCooling per tick; lower values allow more settling0.045
alpha_minMinimum simulation activity before stopping0.002
velocity_decayFraction of velocity removed per tick0.65
cooldown_msMaximum settling time per run in milliseconds9000
initial_radiusRadius of the initial spherical placement5.0
initial_jitterWidth of deterministic position perturbation0.2
tour_depth_ratioInitial tour depth perturbation in multiples of icon size, before recentering3.0

The existing icon_gap, icon-size controls, arrow-size control, and selection_repulsion_* settings remain in the same DIPL record. Initial placement uses the explicit DIPL order described below and a deterministic spherical distribution; making its spread configurable does not change that algorithm.

Guided tours start from their authored DIPL coordinates with deterministic depth offsets scaled by tour_depth_ratio. The offsets are centered to preserve the scene’s initial mean depth. Nodes then relax freely using the shared attraction, repulsion, collision, and cooling settings above. Restore restarts the active scene; exiting a tour restores the saved exploration layout.

What remains calculated

Code combines the DIPL settings with the current graph geometry. With icon slider value I, individual icon scale S, icon gap G, and rendered arrow length A:

preferred link distance = link_spacing × max(
    distance for the link's layout class,
    I × (S_source + S_target) / 2 + 2 × G + link_arrow_clearance_ratio × A
)

collision radius = I × S × collision_icon_radius_ratio
                 + G + collision_arrow_clearance_ratio × A

repulsion = charge_strength × (I / default_icon_size)^charge_icon_scale_exponent

The half-sum uses the two endpoint radii; 2 × G reserves one gap per endpoint. Mathematical constants in the spherical-placement formula, hash constants for deterministic jitter, and the force solver’s algorithms remain code. They are not separately authored tuning values. D3 handles link-degree bias and integration internally; changing a displayed attraction parameter does not change a philosophical claim.

Apply changes

  • Local Python mode: restart python3 tools/ontology_graph.py --port 8878, then refresh the page. DIPL changes invalidate the persistent DIPH5 cache at server startup.
  • Static web mode: rebuild with ./setup.sh --build and serve or publish the rebuilt artifact.

Both modes use the same viewer code and DIPL settings. See viewer instructions.

Introductory rotation

After the initial graph settles and the camera fits it, the view begins a slow orbit. Moving the pointer, touching, clicking, scrolling, focusing a control, or using the keyboard stops it for the rest of that page load, including interactions during loading. Reheat, Reset, and tours do not restart it. Hidden tabs pause the orbit, and reduced-motion preferences disable it. Icons continue facing the viewer.

DIPL controls in graph_viewer[default] are intro_rotation_enabled (true), intro_rotation_speed (currently 8 in the viewer record, approximately a 7.5-second orbit at 60 fps; schema fallback 0.8), and intro_rotation_delay_ms (500 ms after camera fitting). These are presentation choices, with no ontological meaning.

Stable concept and connection order

The original DIPL exporter and the persisted DIPH5 reader can return map entries in different orders. The graph previously used that incidental order to assign initial positions and process forces, so a cache change could alter its arrangement.

Two ordered DIPL lists now make this choice explicit:

  • graph_layout_concepts.dip: graph_layout.concept_order determines which concept receives each starting position and the order of simulation nodes.
  • graph_layout_edges.dip: graph_layout.edge_order determines the order of simulation connections.

Each list entry applies the graph_layout_entry schema and contains an existing id and an explicit integer position. Positions preserve the original uncached declaration order. The viewer sorts by these positions: alphabetical map keys and lexicographically exported list indices no longer change initialization. Both Python and static viewers use these lists, including Restore starting layout.

When adding a concept or connection, append its ID with the next unused position to the appropriate list. Remove its entry if the record is deleted. The validator rejects missing, repeated, and unknown IDs, as well as invalid or repeated positions. Changing positions is an intentional visual change; it makes no claim of philosophical priority.

This stabilizes ordering, not every final coordinate. Adding concepts changes the initial distribution, and topology, filters, icon size, cooling time, library versions, and browser performance can still affect relaxation. The order does not prescribe a cone, cylinder, or sphere as the final shape. Guided tours retain their own authored coordinates and scene order.