Skip to content

Commit

Permalink
Merge branch 'gui-master' into t
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Oct 7, 2023
2 parents 7b9d7f4 + e919168 commit 26bee9a
Show file tree
Hide file tree
Showing 952 changed files with 47,025 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist/
build/
examples/
56 changes: 56 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
jest: true,
},
extends: ['airbnb-base', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import'],
rules: {
semi: 'error',
'no-unused-vars': 'off',
'no-return-assign': 'off',
'no-sequences': 'off',
'no-plusplus': 'off',
'no-redeclare': 'warn',
'no-param-reassign': 'warn',
'no-restricted-syntax': 'warn',
'no-nested-ternary': 'warn',
'max-classes-per-file': 'off',
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'object-curly-newline': 'off',
'class-methods-use-this': 'off',
'no-shadow': 'off',
'no-console': 'off',
'arrow-body-style': 'off',
'import/no-unresolved': 'off',
'no-useless-constructor': 'off',
'no-unused-expressions': 'off',
'no-dupe-class-members': 'off',
'prefer-destructuring': 'off',
'no-underscore-dangle': 'off',
'no-compare-neg-zero': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
'@typescript-eslint/no-unused-vars': ['warn'],
'no-use-before-define': 'off',
'no-bitwise': 'off',
'no-lonely-if': 'off',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
};
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on: [push]

jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: '16'
- name: Run ci
run: |
npm install
npm run ci
- name: Upload Snapshot
if: ${{ failure() }}
env:
REF_NAME: ${{ github.ref_name }}
GITHUB_WORKSPACE: ${{ github.workspace }}
OSS_REGION: ${{ secrets.OSS_REGION }}
OSS_ACCESS_KEY_ID: ${{ secrets.OSS_ACCESS_KEY_ID }}
OSS_ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
OSS_BUCKET: ${{ secrets.OSS_BUCKET }}
run: |
npm run upload
- name: coverall
if: ${{ success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
86 changes: 86 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# lock
package-lock.json
yarn.lock
pnpm-lock.yaml

# 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
es
esm

*.sw*
*.un~

# website
.cache
public

# lh
.lh

# tests
__tests__/integration/**/*-diff.png
__tests__/integration/**/*-actual.png
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 修改仓库镜像(中国镜像)
registry=https://registry.npmmirror.com
# pnpm
auto-install-peers=true
git-checks=false
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__tests__/performance/reports
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"printWidth": 120,
"arrowParens": "always"
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"cSpell.words": [
"bbox",
"Sparkline",
"timebar"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2021 AntV

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<h1 align="center">
<b>GUI</b>
</h1>

<div align="center">

UI components for [G](https://github.com/antvis/g).

[![Build Status](https://github.com/antvis/gui/workflows/CI/badge.svg?branch=master)](https://github.com/antvis/gui/actions)
[![Coverage Status](https://coveralls.io/repos/github/antvis/GUI/badge.svg?branch=master)](https://coveralls.io/github/antvis/GUI?branch=master)
[![npm Version](https://img.shields.io/npm/v/@antv/gui.svg)](https://www.npmjs.com/package/@antv/gui)
[![npm Download](https://img.shields.io/npm/dm/@antv/gui.svg)](https://www.npmjs.com/package/@antv/gui)
[![npm License](https://img.shields.io/npm/l/@antv/gui.svg)](https://www.npmjs.com/package/@antv/gui)

</div>

## ✨ Features

## 📦 Installation

```bash
$ npm install @antv/gui
```

## 🔨 Getting Started

```ts
import { Canvas } from '@antv/g';
import { Renderer } from '@antv/g-canvas';
import { Button } from '@antv/gui';

// create a canvas
const canvas = new Canvas({
container: 'container',
width: 600,
height: 600,
renderer: new Renderer(),
});

// create a button
const button = new Button({
/* ... */
});

canvas.appendChild(button);

// render it
canvas.render();
```

## 📎 Components

- [API](./docs//api.md)
- UI components
- [Axis](https://github.com/antvis/GUI/blob/master/docs/api/ui/axis.zh.md)
- [Legend](https://github.com/antvis/GUI/blob/master/docs/api/ui/legend.zh.md)
- [Tooltip](https://github.com/antvis/GUI/blob/master/docs/api/ui/tooltip.zh.md)
- [Slider](https://github.com/antvis/GUI/blob/master/docs/api/ui/slider.zh.md)
- [Scrollbar](https://github.com/antvis/GUI/blob/master/docs/api/ui/scrollbar.zh.md)
- [Button](https://github.com/antvis/GUI/blob/master/docs/api/ui/button.zh.md)
- [Checkbox](https://github.com/antvis/GUI/blob/master/docs/api/ui/checkbox.zh.md)
- [Navigator](https://github.com/antvis/GUI/blob/master/docs/api/ui/navigator.zh.md)
- [Breadcrumb](https://github.com/antvis/GUI/blob/master/docs/api/ui/breadcrumb.zh.md)
- [Sparkline](https://github.com/antvis/GUI/blob/master/docs/api/ui/sparkline.zh.md)

## 📮 Contribution

```bash
$ git clone [email protected]:antvis/gui.git

$ cd gui

$ npm install

$ npm run dev
```

Then send a pull request after coding.

## 📄 License

MIT@[AntV](https://github.com/antvis).
5 changes: 5 additions & 0 deletions __tests__/bugs/issue-1.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('issue-1', () => {
test('#1', () => {
expect(1).toBe(1);
});
});
Loading

0 comments on commit 26bee9a

Please sign in to comment.