diff --git a/.babelrc b/.babelrc new file mode 100755 index 0000000000..149855cffc --- /dev/null +++ b/.babelrc @@ -0,0 +1,8 @@ +{ + "plugins": [ + "transform-remove-strict-mode" + ], + "presets": [ + "@babel/preset-env" + ] +} diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 0000000000..a2f217c26e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab +indent_size = 1 + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100755 index 0000000000..8dcfb7d80d --- /dev/null +++ b/.eslintignore @@ -0,0 +1,14 @@ +build/ +bundler/ +coverage/ +lib/ +dist/ +mocks/ +node_modules/ +demos/assets/ +demos/index.html +demos/* +rollup/* +webpack/* +src/core/three.js +testdemo/* \ No newline at end of file diff --git a/.eslintrc b/.eslintrc new file mode 100755 index 0000000000..39752e76b3 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,51 @@ +{ + "extends": [ + "egg" + ], + "globals": { + "$": true, + "AMap": true, + "L7": true, + "AMapUI": true, + "DataSet": true, + "G2": true, + "_": true, + "mapboxgl":true, + "dat" : true, + }, + "env": { + "browser": true, + "node": true + }, + "parser": "babel-eslint", + "parserOptions": { + "sourceType": "module" + }, + "plugins": [ + "html" + ], + "rules": { + "no-console": [ + "error", + { + "allow": [ + "warn", + "error" + ] + } + ], + "no-bitwise": [ + 0 + ], + "experimentalDecorators": [ + 0 + ], + "comma-dangle": [ + "error", + "never" + ], + "linebreak-style": [ + 0 + ] + } +} diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100755 index 0000000000..6ed9d91adb --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,24 @@ + + +* **L7 Version**: +* **Platform**: +* **Mini Showcase(like screenshots)**: +* **CodePen Link**: + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100755 index 0000000000..fd86cfc330 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ + + +##### Checklist + + +- [ ] `npm test` passes +- [ ] tests and/or benchmarks are included +- [ ] commit message follows commit guidelines + +##### Description of change + diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000000..d4daf4beb3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,80 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# lock +package-lock.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +build +dist +temp +.DS_Store +.idea +lib +*.sw* +*.un~ +demos/gd.html +demos/data +demos/image +.vscode +demos/hexagon.html +demos/model +testdemo +webpack-dev.config.js +webpack.config.js +.si.yml \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100755 index 0000000000..08c8e71761 --- /dev/null +++ b/.npmignore @@ -0,0 +1,82 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# lock +package-lock.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +.DS_Store + +# npmignore - content above this line is automatically generated and modifications may be omitted +# see npmjs.com/npmignore for more details. +test + +*.sw* +*.un~ +.idea +bin +bundler +demos +docs +src +temp +webpack-dev.config.js +webpack.config.js +testdemo +rollup +.si.yml diff --git a/.si.yml b/.si.yml new file mode 100644 index 0000000000..77c9205a38 --- /dev/null +++ b/.si.yml @@ -0,0 +1,11 @@ +before_deploy: + - tnpm install + - tnpm run build + - rm -rf ./vis/ + - mkdir vis + - cp -r demos build vis/ + - cd ./vis/ + - node ./demos/list.js +options: + dist: 'vis' + branch: 'dev' \ No newline at end of file diff --git a/.torch.compile.opts.js b/.torch.compile.opts.js new file mode 100755 index 0000000000..142e0804d2 --- /dev/null +++ b/.torch.compile.opts.js @@ -0,0 +1,19 @@ +const path = require('path'); +module.exports = { + babelrc: { + presets: [ + "@babel/preset-env" + ], + }, + extensions: ['.js'], + include: [ + 'src/**/*.js', + 'test/**/*.js', + 'node_modules/_three@0.101.1@three/**/*.js', + 'node_modules/three/**/*.js', + 'node_modules/simple-statistics/src/*.js' + ], + exclude: [ + 'node_modules/@babel/**/*.js' + ] +} diff --git a/.travis.yml b/.travis.yml new file mode 100755 index 0000000000..fee155eca2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +language: node_js + +node_js: + - "8" + +env: + matrix: + - TEST_TYPE=ci + +addons: + apt: + packages: + - xvfb + +install: + - export DISPLAY=':99.0' + - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + - npm install + +script: + - | + if [ "$TEST_TYPE" = ci ]; then + npm run ci + fi diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100755 index 0000000000..6216ceb6dd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +#### 0.0.1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100755 index 0000000000..d693dd355c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,142 @@ +# Contribution Guide + +If you have any comment or advice, please report your [issue](https://github.com/antvis/g2/issues), +or make any change as you wish and submit an [PR](https://github.com/antvis/g2/pulls). + +## Reporting New Issues + +- Please specify what kind of issue it is. +- Before you report an issue, please search for related issues. Make sure you are not going to open a duplicate issue. +- Explain your purpose clearly in tags(see **Useful Tags**), title, or content. + +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. + +## Submitting Code + +### Pull Request Guide + +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. + +```bash +# 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. +$ git checkout -b branch-name + +# Run the test after you finish your modification. Add new test cases or change old ones if you feel necessary +$ npm test + +# 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. +$ git add . # git add -u to delete files +$ git commit -m "fix(role): role.use must xxx" +$ git push origin branch-name +``` + +Then you can create a Pull Request at [g2](https://github.com/antvis/g2/pulls). + +No one can guarantee 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. + +1. Need: What function you want to achieve (Generally, please point out which issue is related). +2. Updating Reason: Different with issue. Briefly describe your reason and logic about why you need to make such modification. +3. Related Testing: Briefly describe what part of testing is relevant to your modification. +4. User Tips: Notice for g2 users. You can skip this part, if the PR is not about update in API or potential compatibility problem. + +### Style Guide + +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`. + +### Commit Message Format + +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. + +```xml +(): + + + +