├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .github └── workflows │ └── build.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── CONTRIBUTING.zh-CN.md ├── LICENSE ├── README.md ├── assets ├── compact-box-bt.png ├── compact-box-h.png ├── compact-box-lr.png ├── compact-box-rl.png ├── compact-box-tb.png ├── compact-box-v.png ├── dendrogram-bt.png ├── dendrogram-h.png ├── dendrogram-lr.png ├── dendrogram-rl.png ├── dendrogram-tb.png ├── dendrogram-v.png ├── indented-h.png ├── indented-lr.png ├── indented-rl.png ├── layered-tidy-bt.png ├── layered-tidy-h.png ├── layered-tidy-lr.png ├── layered-tidy-rl.png ├── layered-tidy-tb.png ├── layered-tidy-v.png └── mindmap.png ├── bin ├── mkdir-dist.js ├── screenshot.js └── win-dev.js ├── demos ├── app.js ├── assets │ ├── bootstrap-4.0.0-beta │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.js │ ├── clipboard-1.7.1.min.js │ ├── codemirror-5.29.0 │ │ ├── codemirror-merged.min.css │ │ └── codemirror-merged.min.js │ ├── common.css │ ├── d3-4.10.0.min.js │ ├── g2.js │ ├── g2.min.js │ ├── index.css │ ├── index.js │ ├── jquery-3.2.1.min.js │ ├── jquery.resizable-0.20.0.js │ ├── lazyload-2.0.0-beta.2.min.js │ ├── lodash-4.17.4.min.js │ ├── popper.js-1.12.5 │ │ ├── popper-utils.min.js │ │ └── popper.min.js │ └── routie-0.3.2.min.js ├── data │ └── mind.json ├── index.njk └── mind.html ├── package.json ├── src ├── compact-box.js ├── dendrogram.js ├── indented.js ├── index.js ├── layout │ ├── base.js │ ├── dendrogram.js │ ├── do-layout.js │ ├── hierarchy.js │ ├── indented.js │ ├── mindmap.js │ ├── non-layered-tidy.js │ └── separate-root.js ├── mindmap.js └── util.js ├── webpack-dev.config.js └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "transform-remove-strict-mode" 4 | ], 5 | "presets": [ 6 | [ 7 | "@babel/preset-env", 8 | { 9 | "loose": true, 10 | "modules": false 11 | } 12 | ] 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [Makefile] 16 | indent_style = tab 17 | indent_size = 1 18 | 19 | [*.md] 20 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/ 2 | coverage/ 3 | demos/assets/ 4 | dist/ 5 | lib/ 6 | mocks/ 7 | node_modules/ 8 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["egg"], 3 | "globals": { 4 | "$": true, 5 | "DataSet": true, 6 | "Hierarchy": true, 7 | "G2": true 8 | }, 9 | "parser": "babel-eslint", 10 | "parserOptions": { 11 | "sourceType": "module" 12 | }, 13 | "plugins": ["html"], 14 | "rules": { 15 | "no-bitwise": [0], 16 | "experimentalDecorators": [0], 17 | "comma-dangle": ["error", "never"], 18 | "no-console": [ 19 | "error", 20 | { 21 | "allow": ["warn", "error"] 22 | } 23 | ], 24 | "linebreak-style": [0], 25 | "quotes": [0], 26 | "arrow-parens": [0] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: [ push, pull_request ] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v2.3.4 13 | 14 | - name: Setup Node.js environment 15 | uses: actions/setup-node@v2.1.5 16 | with: 17 | node-version: '12' 18 | 19 | - name: Cache node modules 20 | uses: actions/cache@v2 21 | env: 22 | cache-name: cache-node-modules 23 | with: 24 | path: ./node_modules 25 | key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package.json') }} 26 | restore-keys: | 27 | cache-node-modules- 28 | 29 | - name: Run ci 30 | run: | 31 | npm install 32 | npm run ci -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # lock 9 | package-lock.json 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | *.pid.lock 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # nyc test coverage 24 | .nyc_output 25 | 26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 27 | .grunt 28 | 29 | # Bower dependency directory (https://bower.io/) 30 | bower_components 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (http://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules/ 40 | jspm_packages/ 41 | 42 | # Typescript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | build 64 | dist 65 | temp 66 | .DS_Store 67 | .idea 68 | demos/assets/screenshots 69 | lib 70 | 71 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # lock 9 | package-lock.json 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | *.pid.lock 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # nyc test coverage 24 | .nyc_output 25 | 26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 27 | .grunt 28 | 29 | # Bower dependency directory (https://bower.io/) 30 | bower_components 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (http://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules/ 40 | jspm_packages/ 41 | 42 | # Typescript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | # build 64 | demos 65 | temp 66 | test 67 | webpack-dev.config.js 68 | webpack.config.js 69 | .DS_Store 70 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antvis/hierarchy/d786901874f59d96c47e2a5dfe17b373eefd72e3/CHANGELOG.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guide 2 | 3 | If you have any comment or advice, please report your [issue](https://github.com/antvis/hierarchy/issues), 4 | or make any change as you wish and submit an [PR](https://github.com/antvis/hierarchy/pulls). 5 | 6 | ## Reporting New Issues 7 | 8 | - Please specify what kind of issue it is. 9 | - Before you report an issue, please search for related issues. Make sure you are not going to open a duplicate issue. 10 | - Explain your purpose clearly in tags(see **Useful Tags**), title, or content. 11 | 12 | AntV group members will confirm the purpose of the issue, replace more accurate tags for it, identify related milestone, and assign developers working on it. 13 | 14 | ## Submitting Code 15 | 16 | ### Pull Request Guide 17 | 18 | If you are developer of AntV repo and you are willing to contribute, feel free to create a new branch, finish your modification and submit a PR. AntV group will review your work and merge it to master branch. 19 | 20 | ```bash 21 | # Create a new branch for development. The name of branch should be semantic, avoiding words like 'update' or 'tmp'. We suggest to use feature/xxx, if the modification is about to implement a new feature. 22 | $ git checkout -b branch-name 23 | 24 | # Run the test after you finish your modification. Add new test cases or change old ones if you feel necessary 25 | $ npm test 26 | 27 | # If your modification pass the tests, congradulations it's time to push your work back to us. Notice that the commit message should be wirtten in the following format. 28 | $ git add . # git add -u to delete files 29 | $ git commit -m "fix(role): role.use must xxx" 30 | $ git push origin branch-name 31 | ``` 32 | 33 | Then you can create a Pull Request at [hierarchy](https://github.com/antvis/hierarchy/pulls). 34 | 35 | No one can garantee how much will be remembered about certain PR after some time. To make sure we can easily recap what happened previously, please provide the following information in your PR. 36 | 37 | 1. Need: What function you want to achieve (Generally, please point out which issue is related). 38 | 2. Updating Reason: Different with issue. Briefly describe your reason and logic about why you need to make such modification. 39 | 3. Related Testing: Briefly descirbe what part of testing is relevant to your modification. 40 | 4. User Tips: Notice for hierarchy users. You can skip this part, if the PR is not about update in API or potential compatibility problem. 41 | 42 | ### Style Guide 43 | 44 | Eslint can help to identify styling issues that may exist in your code. Your code is required to pass the test from eslint. Run the test locally by `$ npm run lint`. 45 | 46 | ### Commit Message Format 47 | 48 | You are encouraged to use [angular commit-message-format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) to write commit message. In this way, we could have a more trackable history and an automatically generated changelog. 49 | 50 | ```xml 51 | (): 52 | 53 | 54 | 55 |