Skip to content

About

Next.js and Cytoscape.js interface for exploring causal graphs.

Topics

Resources

Contributing

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

TypeScript and React library monorepo for causal graph interfaces, built on Cytoscape.js.

基于 Cytoscape.js 的因果图 TypeScript / React 库 Monorepo。

Docs / 文档 · Studio · Issues

Perspectiva uses cytocausal to compare versions of a causal graph

cytocausal provides causal graph data models, Cytoscape.js rendering/transitions, and composable React workspace and editor components (CausalWorkspace, CausalEditor). For product overview, live showcase, and API guides, see the bilingual documentation. Install the npm alpha with npm install @cytocausal/react@next.

cytocausal 提供因果图数据模型、Cytoscape.js 渲染与过渡层,以及可组合的 React 工作区与编辑器组件(CausalWorkspace、CausalEditor)。功能介绍、交互示例与 API 文档请访问中英双语文档站。运行 npm install @cytocausal/react@next 安装 npm 预发布版。

Quick Start / 本地运行

Prerequisites: Node.js >=22.18 and npm.

前置环境:Node.js >=22.18 与 npm。

git clone https://github.com/SonghaiFan/cytocausal.git
cd cytocausal
npm ci
npm run dev

Available local dev servers:

可用的本地开发服务器:

  • npm run dev — Starter app at http://localhost:3102 (edit apps/starter/src/data.ts and /editor)
    npm run dev:Starter 应用,监听 http://localhost:3102(含 /editor 示例)
  • npm run dev:docs — Bilingual Nextra docs & showcase at http://localhost:3200/en/ or /zh-cn/
    npm run dev:docs:双语文档站与示例,监听 http://localhost:3200/en/ 或 /zh-cn/
  • npm run dev:studio — Browser-local causal graph editor at http://localhost:3103
    npm run dev:studio:浏览器本地因果图编辑器,监听 http://localhost:3103

No environment variables are required for local development. Deployment overrides (NEXT_PUBLIC_STUDIO_URL, NEXT_PUBLIC_PERSPECTIVA_URL, NEXT_PUBLIC_EXPLORER_URL, NEXT_PUBLIC_DOCS_URL) are documented in docs/deployment/README.md.

本地开发无需配置环境变量。部署时的链接覆盖变量(NEXT_PUBLIC_STUDIO_URL、NEXT_PUBLIC_PERSPECTIVA_URL、NEXT_PUBLIC_EXPLORER_URL、NEXT_PUBLIC_DOCS_URL)见 docs/deployment/README.md。

Architecture & Structure / 技术栈与目录结构

Tech Stack / 技术栈: TypeScript 5.9, React 19, Cytoscape.js 3.31, Next.js 16, Nextra 4, esbuild, npm workspaces, Playwright.

Path / 路径 Description / 说明
packages/core/ @cytocausal/core: renderer-independent data model, provenance, validation, versions, and causal analysis (zero runtime deps)
@cytocausal/core:与渲染无关的数据模型、出处、校验、版本与因果分析(零运行时依赖)
packages/cytoscape/ @cytocausal/cytoscape: Cytoscape.js styles, layouts, animated transitions, and highlighting
@cytocausal/cytoscape:Cytoscape.js 因果样式、布局、过渡动画与高亮
packages/react/ @cytocausal/react: CausalWorkspace, CausalEditor, composable UI panels, and interaction hooks
@cytocausal/react:CausalWorkspace、CausalEditor、可组合面板与交互 Hooks
apps/starter/ Minimal Next.js host starter and /editor example (:3102)
最简 Next.js 宿主示例与 /editor 路由(:3102)
apps/studio/ Browser-local causal graph authoring app (:3103)
浏览器本地因果图编辑应用(:3103)
apps/docs/ Bilingual Nextra docs site and interactive showcase (:3200)
双语 Nextra 文档站与交互展示页(:3200)
scripts/release/ & tests/package-consumers/ Release tarball build/pack pipeline and consumer verification tests
发布 tarball 构建打包脚本与消费端集成测试

Development & Testing / 开发与测试

Command / 命令 Purpose / 用途
npm test Run unit tests across all workspaces
运行所有工作区的单元测试
npm run typecheck Run TypeScript checks across all workspaces
运行所有工作区的类型检查
npm run check:content Validate bilingual docs content parity and tutorials
校验双语文档内容一致性与教程脚本
npm run build Build all apps and workspaces
构建所有应用与工作区
npm run test:e2e Run Playwright browser tests (run npm run build first; requires Chrome)
运行 Playwright 浏览器测试(需先构建并安装 Chrome)
npm run release:verify Build, pack, and verify standalone @cytocausal/* release tarballs
构建、打包并校验独立 @cytocausal/* 发布包

Contributing / 参与贡献

  1. Fork this repository and create a branch from main; read CONTRIBUTING.md before opening a PR.
    Fork 本仓库并从 main 切出分支;提交 PR 前请阅读 CONTRIBUTING.md。
  2. Verify changes locally with npm test, npm run typecheck, npm run check:content, and npm run build (plus npm run release:verify for package changes).
    本地运行 npm test、npm run typecheck、npm run check:content 与 npm run build(涉及包改动时再运行 npm run release:verify)。
  3. Open a pull request summarizing the scope and test output.
    提交 Pull Request,说明改动范围与校验结果。

License / 许可证

Code and documentation are licensed under MIT. Datasets and the logo are governed by separate terms in DATA.md.

代码与文档采用 MIT 许可证。数据集与标志遵循单独条款,见 DATA.md。


ttng  cytocausal  Aethel  VisDelta  syuze  News Metro

Frank series · Made by Songhai Fan

Frank

About

Next.js and Cytoscape.js interface for exploring causal graphs.

Topics

Resources

Contributing

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages