# travis-bug/tensor-view architecture

> Architecture diagram of the GitHub repository travis-bug/tensor-view, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/travis-bug/tensor-view
- Repository: https://github.com/travis-bug/tensor-view

## Overview

Tensor-view is a browser app for entering and exploring interactions as a 3D dynamic multi-relational adjacency tensor. Users add or clear interactions, toggle individual nodes and action layers, and rotate the visualization. The sampled source shows state and rendering in one entry file; finer internal boundaries are conceptual, and unsampled wiring is omitted.

Main entry points: [`src/main.ts`](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts) (Visualization update)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Interaction data"]
  node_normalize["Input normalization<br/>[main.ts]"]
  node_state["Interaction state<br/>[main.ts]"]
end

subgraph group_visualization["Tensor visualization"]
  node_update["Visualization update<br/>[main.ts]"]
  node_tensor["3D tensor scene<br/>[main.ts]"]
  node_list["Interaction list<br/>[main.ts]"]
  node_legend["Action legend<br/>[main.ts]"]
  node_animation["Animation loop<br/>[main.ts]"]
end

subgraph group_browser["Browser interaction"]
  node_form["Interaction form<br/>[main.ts]"]
  node_visibility["Visibility controls<br/>[main.ts]"]
end

node_user(("User"))
node_three["Three.js"]
node_orbit["Orbit controls"]
node_cssrender["CSS2D renderer"]

node_user -->|"submits entries"| node_form
node_form -->|"normalizes input"| node_normalize
node_form -->|"adds interactions"| node_state
node_user -->|"changes visibility"| node_visibility
node_visibility -->|"updates flags"| node_state
node_user -->|"clears data"| node_state
node_form -->|"refreshes view"| node_update
node_visibility -->|"refreshes view"| node_update
node_state -->|"reads data"| node_update
node_update -->|"builds scene"| node_tensor
node_update -->|"updates cards"| node_list
node_update -->|"updates layers"| node_legend
node_animation -->|"renders scene"| node_three
node_animation -->|"renders labels"| node_cssrender
node_orbit -->|"controls camera"| node_three
node_tensor -->|"uses scene objects"| node_three
node_tensor -->|"adds labels"| node_cssrender

click node_form "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_normalize "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_state "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_visibility "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_update "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_tensor "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_list "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_legend "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"
click node_animation "https://github.com/travis-bug/tensor-view/blob/main/src/main.ts"

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_normalize,node_state,node_user toneBlue
class node_update,node_tensor,node_list,node_legend,node_animation toneAmber
class node_form,node_visibility toneMint
class node_three,node_orbit,node_cssrender toneIndigo
```

## Components

### Interaction data

- [Input normalization](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`
- [Interaction state](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`

### Tensor visualization

- [Visualization update](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`
- [3D tensor scene](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`
- [Interaction list](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`
- [Action legend](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`
- [Animation loop](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`

### Browser interaction

- [Interaction form](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`
- [Visibility controls](https://github.com/travis-bug/tensor-view/blob/main/src/main.ts): `src/main.ts`

### Other components

- **User**
- **Three.js**
- **Orbit controls**
- **CSS2D renderer**

## Connections

- User → Interaction form: submits entries
- Interaction form → Input normalization: normalizes input
- Interaction form → Interaction state: adds interactions
- User → Visibility controls: changes visibility
- Visibility controls → Interaction state: updates flags
- User → Interaction state: clears data
- Interaction form → Visualization update: refreshes view
- Visibility controls → Visualization update: refreshes view
- Interaction state → Visualization update: reads data
- Visualization update → 3D tensor scene: builds scene
- Visualization update → Interaction list: updates cards
- Visualization update → Action legend: updates layers
- Animation loop → Three.js: renders scene
- Animation loop → CSS2D renderer: renders labels
- Orbit controls → Three.js: controls camera
- 3D tensor scene → Three.js: uses scene objects
- 3D tensor scene → CSS2D renderer: adds labels
