├── src
├── Building.ts
├── typings.d.ts
├── App.ts
├── City.ts
└── index.ts
├── style.css
├── index.html
├── .editorconfig
├── tsconfig.json
├── docs
├── development.md
└── test.html
├── .gitignore
├── README.md
├── package.json
├── webpack.config.js
├── .github
└── workflows
│ └── deploy.yml
├── public
└── coco.fixtures.json
└── LICENSE
/src/Building.ts:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/style.css:
--------------------------------------------------------------------------------
1 | /* Styles go here. */
2 |
3 | html,
4 | body {
5 | margin: 0;
6 | padding: 0;
7 | }
8 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Codecity
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 | # 使用单引号
11 | quote_type = single
12 |
13 | [*.md]
14 | max_line_length = off
15 | trim_trailing_whitespace = false
16 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es6",
4 | "module": "commonjs",
5 | "moduleResolution": "node",
6 | "experimentalDecorators": true,
7 | "emitDecoratorMetadata": true,
8 | "preserveConstEnums": true,
9 | "suppressImplicitAnyIndexErrors": true,
10 | "outDir": "./lib/",
11 | "sourceMap": true
12 | },
13 | "exclude": [
14 | "node_modules",
15 | "lib"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/docs/development.md:
--------------------------------------------------------------------------------
1 | # Development
2 |
3 |
4 | ## Setup
5 |
6 | ## FontFace
7 |
8 | [http://gero3.github.io/facetype.js/](http://gero3.github.io/facetype.js/)
9 |
10 | ## Browser Plugins
11 |
12 | ### WebXR
13 |
14 | https://github.com/MozillaReality/WebXR-emulator-extension
15 |
16 | plugins: https://addons.mozilla.org/en-US/firefox/addon/webxr-api-emulator/
17 |
18 | ##
19 |
20 | https://addons.mozilla.org/en-US/firefox/addon/three-js-developer-tools/
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18 | .grunt
19 |
20 | # node-waf configuration
21 | .lock-wscript
22 |
23 | # Compiled binary addons (http://nodejs.org/api/addons.html)
24 | build/Release
25 |
26 | # Dependency directory
27 | node_modules
28 |
29 | # Optional npm cache directory
30 | .npm
31 |
32 | # Optional REPL history
33 | .node_repl_history
34 |
35 | # Dist and OSX
36 | dist
37 | lib
38 | .DS_Store
39 |
40 | # Lock
41 | yarn.lock
42 | package-lock.json
43 |
44 | # awesome-typescript
45 | .awcache
46 | .idea
47 | samples
48 | public/data.json
49 |
--------------------------------------------------------------------------------
/src/typings.d.ts:
--------------------------------------------------------------------------------
1 | interface FlareTreeNode {
2 | name: String,
3 | children: FlareTreeNode[],
4 | data: {
5 | loc: LanguageLocData,
6 | git: GitData
7 | }
8 | }
9 |
10 | interface GitData {
11 | last_update: number,
12 | age_in_days: number,
13 | creation_date: number,
14 | user_count: number,
15 | users: number[], // dictionary IDs
16 | details: GitDetails[],
17 | }
18 |
19 | interface GitDetails {
20 | commit_day: number,
21 | users: number[],
22 | commits: number,
23 | lines_added: number,
24 | lines_deleted: number,
25 | }
26 |
27 | interface LanguageLocData {
28 | language: String,
29 | binary: Boolean,
30 | blanks: number,
31 | code: number,
32 | comments: number,
33 | lines: number,
34 | bytes: number,
35 | }
36 |
37 | interface ClocSummary {
38 | language: String,
39 | blanks: String,
40 | code: String,
41 | comments: String,
42 | reports: ClocDetail[],
43 | }
44 |
45 | interface ClocDetail {
46 | blanks: number,
47 | code: number,
48 | comments: number,
49 | file_name: String,
50 | path: String,
51 | }
52 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Codecity
2 |
3 | > codecity is a code explorer in metaverase for fun.
4 |
5 | Codecity 是一个用于在元宇宙中进行遗留系统分析的工具。
6 |
7 | Todo for VR PoC:
8 |
9 | - [x] render city with Three.js
10 | - [x] code render
11 | - [ ] code explorer with city
12 | - [ ] interactive
13 | - [ ] tooltip
14 | - [ ] support for XR devices
15 | - [ ] Oculus Quest 2
16 | - [ ] others
17 |
18 | Todo for Real world:
19 |
20 | - [ ] code analysis integration
21 | - [ ] show struct
22 | - [ ] show callee
23 | - [ ] multiple repo support
24 |
25 | ## Document
26 |
27 | setup:
28 |
29 | install WebVR extension:
30 |
31 | - Chrome: [WebXR API Emulator](https://chrome.google.com/webstore/detail/webxr-api-emulator/mjddjgeghkdijejnciaefnkjmkafnnje)
32 |
33 | guide:
34 |
35 | - [Using VR controllers and locomotion in THREE.js](https://ada.is/blog/2020/05/18/using-vr-controllers-and-locomotion-in-threejs/) Left Controller 位置控制 Hand pos
36 |
37 | code refs:
38 |
39 | - [http://colordodge.com/ProceduralCity/](http://colordodge.com/ProceduralCity/)
40 | - [https://observablehq.com/@analyzer2004/3d-treemap](https://observablehq.com/@analyzer2004/3d-treemap)
41 |
42 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "three-typescript-starter",
3 | "version": "1.0.0",
4 | "description": "three.js + typescript",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "webpack serve --open",
9 | "build": "webpack build"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "git+https://github.com/phodal/codexity.git"
14 | },
15 | "keywords": [],
16 | "author": "Phodal HUANG",
17 | "license": "MIT",
18 | "bugs": {
19 | "url": "https://github.com/phodal/codexity/issues"
20 | },
21 | "homepage": "https://github.com/phodal/codexity#readme",
22 | "devDependencies": {
23 | "@types/three": "^0.134.0",
24 | "copy-webpack-plugin": "^9.0.1",
25 | "css-loader": "latest",
26 | "html-webpack-plugin": "latest",
27 | "progress-bar-webpack-plugin": "latest",
28 | "style-loader": "latest",
29 | "ts-loader": "latest",
30 | "typescript": "latest",
31 | "webpack": "latest",
32 | "webpack-cli": "latest",
33 | "webpack-dev-server": "latest"
34 | },
35 | "dependencies": {
36 | "@types/d3": "^7.1.0",
37 | "cannon": "^0.6.2",
38 | "d3": "^7.1.1",
39 | "stats.js": "^0.17.0",
40 | "three": "latest"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/docs/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Quantize scale
5 |
6 |
7 |
14 |
15 |
16 |
20 |
21 |
22 |
56 |
57 |