# xieguigang/scibasic architecture

> Architecture diagram of the GitHub repository xieguigang/scibasic, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xieguigang/scibasic
- Repository: https://github.com/xieguigang/scibasic

## Overview

sciBASIC# is a broad VisualBasic scientific-computing framework; the supplied tree is a partial cross-section, not enough to map its full script, data, ML, LLM, or GPU runtime. This graph focuses on the well-evidenced network-visualization and layout code: callers provide a graph or nodes, layout algorithms adjust positions, and WebCola also supports constraint-based routing. The README documents many additional capabilities, but their source paths are absent from this tree. Edges are limited to relationships shown by excerpts, SOURCE INDEX references, or explicit documentation.

Main entry points: [`gr/network-visualization/WebCola/gridrouter.ts`](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/gridrouter.ts) (Grid Router), [`gr/network-visualization/WebCola/rectangle.ts`](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/rectangle.ts) (Rectangle Projection), [`gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs`](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs) (ForceAtlas 2), [`gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs`](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs) (Label Adjustment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_webcola["WebCola Geometry"]
  node_gridrouter["Grid Router<br/>[gridrouter.ts]"]
  node_rect["Rectangle Projection<br/>[rectangle.ts]"]
  node_geom["Geometry Primitives<br/>[geom.ts]"]
  node_vpsc["Constraint Solver<br/>[vpsc.ts]"]
  node_rbtree["Red-Black Tree<br/>[rbtree.ts]"]
  node_shortest["Shortest Paths<br/>[shortestpaths.ts]"]
  node_pqueue["Priority Queue<br/>[pqueue.ts]"]
end

subgraph group_layouts["Network Layouts"]
  node_abstract["Layout Base<br/>[AbstractLayout.cs]"]
  node_autolayout["Auto Layout<br/>[AutoLayout.cs]"]
  node_forceatlas["ForceAtlas"]
  node_forceatlas2["ForceAtlas 2<br/>[ForceAtlas2.cs]"]
  node_forcefactory["Force Factory<br/>[ForceFactory.cs]"]
  node_fa2data["Force Layout State"]
  node_labeladjust["Label Adjustment<br/>[LabelAdjust.cs]"]
  node_quad["QuadTree<br/>[QuadTree.cs]"]
  node_openordnode["OpenOrd Node<br/>[Node.cs]"]
  node_globalrandom["Global Random<br/>[GlobalRandom.cs]"]
end

subgraph group_science["Scientific Modules"]
  node_cephes["Cephes Math<br/>[mconf.h]"]
  node_ei["Exponential Integral<br/>[ei.c]"]
  node_hmm["HMM Module<br/>[index.js]"]
  node_ttest["Student t Tests<br/>[abstact.js]"]
end

node_gridrouter -->|"uses geometry"| node_geom
node_gridrouter -->|"routes rectangles"| node_rect
node_gridrouter -->|"solves constraints"| node_vpsc
node_gridrouter -->|"uses paths"| node_shortest
node_rect -->|"creates constraints"| node_vpsc
node_rect -->|"indexes events"| node_rbtree
node_rect -->|"uses points"| node_geom
node_shortest -->|"uses queue"| node_pqueue
node_abstract -->|"references nodes"| node_openordnode
node_abstract -->|"initializes positions"| node_globalrandom
node_autolayout -->|"schedules layout"| node_forceatlas
node_autolayout -->|"schedules layout"| node_labeladjust
node_forceatlas2 -->|"builds forces"| node_forcefactory
node_forceatlas2 -->|"updates state"| node_fa2data
node_forceatlas2 -->|"adjusts nodes"| node_openordnode
node_forceatlas -->|"extends base"| node_abstract
node_labeladjust -->|"uses spatial index"| node_quad
node_labeladjust -->|"varies displacement"| node_globalrandom
node_ei -->|"uses configuration"| node_cephes

click node_gridrouter "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/gridrouter.ts"
click node_rect "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/rectangle.ts"
click node_geom "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/geom.ts"
click node_vpsc "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/vpsc.ts"
click node_rbtree "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/rbtree.ts"
click node_shortest "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/shortestpaths.ts"
click node_pqueue "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/pqueue.ts"
click node_abstract "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/AbstractLayout.cs"
click node_autolayout "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/AutoLayout.cs"
click node_forceatlas "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas/ForceAtlasLayout.cs"
click node_forceatlas2 "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs"
click node_forcefactory "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceFactory.cs"
click node_fa2data "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2LayoutData.cs"
click node_labeladjust "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs"
click node_quad "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/force/quadtree/QuadTree.cs"
click node_openordnode "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/openord/Node.cs"
click node_globalrandom "https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/GlobalRandom.cs"
click node_cephes "https://github.com/xieguigang/scibasic/blob/master/Data_science/Mathematica/Math/cephes/mconf.h"
click node_ei "https://github.com/xieguigang/scibasic/blob/master/Data_science/Mathematica/Math/cephes/ei.c"
click node_hmm "https://github.com/xieguigang/scibasic/blob/master/Data_science/DataMining/HMM/index.js"
click node_ttest "https://github.com/xieguigang/scibasic/blob/master/Data_science/Mathematica/data/Student's%20T-test/ttest-js/hypothesis/abstact.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gridrouter,node_rect,node_geom,node_vpsc,node_rbtree,node_shortest,node_pqueue toneBlue
class node_abstract,node_autolayout,node_forceatlas,node_forceatlas2,node_forcefactory,node_fa2data,node_labeladjust,node_quad,node_openordnode,node_globalrandom toneAmber
class node_cephes,node_ei,node_hmm,node_ttest toneMint
```

## Components

### WebCola Geometry

- [Grid Router](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/gridrouter.ts): `gr/network-visualization/WebCola/gridrouter.ts`
- [Rectangle Projection](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/rectangle.ts): `gr/network-visualization/WebCola/rectangle.ts`
- [Geometry Primitives](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/geom.ts): `gr/network-visualization/WebCola/geom.ts`
- [Constraint Solver](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/vpsc.ts): `gr/network-visualization/WebCola/vpsc.ts`
- [Red-Black Tree](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/rbtree.ts): `gr/network-visualization/WebCola/rbtree.ts`
- [Shortest Paths](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/shortestpaths.ts): `gr/network-visualization/WebCola/shortestpaths.ts`
- [Priority Queue](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/WebCola/pqueue.ts): `gr/network-visualization/WebCola/pqueue.ts`

### Network Layouts

- [Layout Base](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/AbstractLayout.cs): `gr/network-visualization/network_layout/layout/AbstractLayout.cs`
- [Auto Layout](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/AutoLayout.cs): `gr/network-visualization/network_layout/layout/AutoLayout.cs`
- [ForceAtlas](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas/ForceAtlasLayout.cs): `gr/network-visualization/network_layout/layout/forceAtlas/ForceAtlasLayout.cs`
- [ForceAtlas 2](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs): `gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs`
- [Force Factory](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceFactory.cs): `gr/network-visualization/network_layout/layout/forceAtlas2/ForceFactory.cs`
- [Force Layout State](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2LayoutData.cs): `gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2LayoutData.cs`
- [Label Adjustment](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs): `gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs`
- [QuadTree](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/force/quadtree/QuadTree.cs): `gr/network-visualization/network_layout/layout/force/quadtree/QuadTree.cs`
- [OpenOrd Node](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/openord/Node.cs): `gr/network-visualization/network_layout/layout/openord/Node.cs`
- [Global Random](https://github.com/xieguigang/scibasic/blob/master/gr/network-visualization/network_layout/layout/GlobalRandom.cs): `gr/network-visualization/network_layout/layout/GlobalRandom.cs`

### Scientific Modules

- [Cephes Math](https://github.com/xieguigang/scibasic/blob/master/Data_science/Mathematica/Math/cephes/mconf.h): `Data_science/Mathematica/Math/cephes/mconf.h`
- [Exponential Integral](https://github.com/xieguigang/scibasic/blob/master/Data_science/Mathematica/Math/cephes/ei.c): `Data_science/Mathematica/Math/cephes/ei.c`
- [HMM Module](https://github.com/xieguigang/scibasic/blob/master/Data_science/DataMining/HMM/index.js): `Data_science/DataMining/HMM/index.js`
- [Student t Tests](https://github.com/xieguigang/scibasic/blob/master/Data_science/Mathematica/data/Student's%20T-test/ttest-js/hypothesis/abstact.js): `Data_science/Mathematica/data/Student's T-test/ttest-js/hypothesis/abstact.js`

## Connections

- Grid Router → Geometry Primitives: uses geometry (evidence: `gr/network-visualization/WebCola/gridrouter.ts`)
- Grid Router → Rectangle Projection: routes rectangles (evidence: `gr/network-visualization/WebCola/gridrouter.ts`)
- Grid Router → Constraint Solver: solves constraints (evidence: `gr/network-visualization/WebCola/gridrouter.ts`)
- Grid Router → Shortest Paths: uses paths (evidence: `gr/network-visualization/WebCola/gridrouter.ts`)
- Rectangle Projection → Constraint Solver: creates constraints (evidence: `gr/network-visualization/WebCola/rectangle.ts`)
- Rectangle Projection → Red-Black Tree: indexes events (evidence: `gr/network-visualization/WebCola/rectangle.ts`)
- Rectangle Projection → Geometry Primitives: uses points (evidence: `gr/network-visualization/WebCola/rectangle.ts`)
- Shortest Paths → Priority Queue: uses queue (evidence: `gr/network-visualization/WebCola/shortestpaths.ts`)
- Layout Base → OpenOrd Node: references nodes (evidence: `gr/network-visualization/network_layout/layout/AbstractLayout.cs`)
- Layout Base → Global Random: initializes positions (evidence: `gr/network-visualization/network_layout/layout/AbstractLayout.cs`)
- Auto Layout → ForceAtlas: schedules layout (evidence: `gr/network-visualization/network_layout/layout/AutoLayout.cs`)
- Auto Layout → Label Adjustment: schedules layout (evidence: `gr/network-visualization/network_layout/layout/AutoLayout.cs`)
- ForceAtlas 2 → Force Factory: builds forces (evidence: `gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs`)
- ForceAtlas 2 → Force Layout State: updates state (evidence: `gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs`)
- ForceAtlas 2 → OpenOrd Node: adjusts nodes (evidence: `gr/network-visualization/network_layout/layout/forceAtlas2/ForceAtlas2.cs`)
- ForceAtlas → Layout Base: extends base (evidence: `gr/network-visualization/network_layout/layout/forceAtlas/ForceAtlasLayout.cs`)
- Label Adjustment → QuadTree: uses spatial index (evidence: `gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs`)
- Label Adjustment → Global Random: varies displacement (evidence: `gr/network-visualization/network_layout/layout/labelAdjust/LabelAdjust.cs`)
- Exponential Integral → Cephes Math: uses configuration (evidence: `Data_science/Mathematica/Math/cephes/ei.c`)
