Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/bun-formatcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Format Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run format check
run: bun run format:check
71 changes: 71 additions & 0 deletions .github/workflows/bun-pver-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Publish to npm
on:
push:
branches:
- main
workflow_dispatch:

env:
UPSTREAM_REPOS: "" # comma-separated list, e.g. "eval,tscircuit,docs"
UPSTREAM_PACKAGES_TO_UPDATE: "" # comma-separated list, e.g. "@tscircuit/core,@tscircuit/protos"

jobs:
publish:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'v')) }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install -g pver
- run: bun install --frozen-lockfile
- run: bun run build
- run: pver release --no-push-main
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}

- name: Create Pull Request
id: create-pr
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore: bump version"
title: "chore: bump version"
body: "Automated package update"
branch: bump-version-${{ github.run_number }}
base: main
token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
committer: tscircuitbot <githubbot@tscircuit.com>
author: tscircuitbot <githubbot@tscircuit.com>

- name: Enable auto-merge
if: steps.create-pr.outputs.pull-request-number != ''
run: |
gh pr merge ${{ steps.create-pr.outputs.pull-request-number }} --auto --squash --delete-branch
env:
GH_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}

# - name: Trigger upstream repo updates
# if: env.UPSTREAM_REPOS && env.UPSTREAM_PACKAGES_TO_UPDATE
# run: |
# IFS=',' read -ra REPOS <<< "${{ env.UPSTREAM_REPOS }}"
# for repo in "${REPOS[@]}"; do
# if [[ -n "$repo" ]]; then
# echo "Triggering update for repo: $repo"
# curl -X POST \
# -H "Accept: application/vnd.github.v3+json" \
# -H "Authorization: token ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}" \
# -H "Content-Type: application/json" \
# "https://api.github.com/repos/tscircuit/$repo/actions/workflows/update-package.yml/dispatches" \
# -d "{\"ref\":\"main\",\"inputs\":{\"package_names\":\"${{ env.UPSTREAM_PACKAGES_TO_UPDATE }}\"}}"
# fi
# done
26 changes: 26 additions & 0 deletions .github/workflows/bun-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Type Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
type-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun i

- name: Run type check
run: bunx tsc --noEmit
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Finder (MacOS) folder config
.DS_Store
package-lock.json
.vercel
cosmos-export
bun.lock
79 changes: 77 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,77 @@
# trace-capacity-visualizer
A react component and poppygl layer for rendering capacity nodes and 3d traces for viewing routing
# CapacityNode3dDebugger

A React component for visualizing capacity mesh nodes in 3D space using Three.js.

## Features

- 3D visualization of capacity mesh nodes
- Interactive controls for orbiting, zooming, and panning
- Layer-based visualization with customizable thickness
- Toggle options for different visual elements (root, obstacles, output)
- Wireframe and solid rendering modes
- Opacity controls for mesh visualization
- Box shrinking for better spatial visualization
- Border highlighting for mesh boxes

## Usage

```tsx
import { CapacityNode3dDebugger } from './lib/CapacityNode3dDebugger'
import type { CapacityMeshNode } from './lib/types'

const nodes: CapacityMeshNode[] = [
{
capacityMeshNodeId: "node1",
center: { x: 0, y: 0 },
width: 10,
height: 10,
layer: "top",
availableZ: [0, 1, 2]
}
// ... more nodes
]

function App() {
return (
<CapacityNode3dDebugger
nodes={nodes}
layerThickness={1}
height={600}
defaultShowRoot={true}
defaultShowObstacles={false}
defaultShowOutput={true}
defaultWireframeOutput={false}
/>
)
}
```

## Props

- `nodes`: Array of capacity mesh nodes to visualize
- `simpleRouteJson`: Optional SimpleRouteJson data for obstacles and bounds
- `layerThickness`: Visual Z thickness per layer (default: 1)
- `height`: Canvas height (default: 600)
- `defaultShowRoot`: Show root bounds initially (default: true)
- `defaultShowObstacles`: Show obstacles initially (default: false)
- `defaultShowOutput`: Show output mesh initially (default: true)
- `defaultWireframeOutput`: Use wireframe for output initially (default: false)
- `style`: Optional CSS styles for the container

## Controls

- **Show 3D/Hide 3D**: Toggle 3D visualization
- **Rebuild 3D**: Rebuild the 3D scene
- **Root**: Toggle root bounds visibility
- **Obstacles**: Toggle obstacles visibility
- **Output**: Toggle output mesh visibility
- **Wireframe Output**: Toggle between solid and wireframe rendering
- **Opacity**: Adjust mesh opacity (0-1)
- **Shrink boxes**: Enable box shrinking for better visualization
- **Show borders**: Toggle border highlighting on mesh boxes

## Mouse Controls

- **Drag**: Orbit camera
- **Wheel**: Zoom in/out
- **Right-drag**: Pan camera
Loading