Skip to content

Commit c9116e3

Browse files
committed
feat: support g2plot chart
1 parent 9085f6d commit c9116e3

File tree

64 files changed

+14442
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+14442
-0
lines changed

.babelrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"presets": [
3+
[
4+
"@vue/babel-preset-app",
5+
{
6+
"modules": false,
7+
"corejs": 3,
8+
"absoluteRuntime": false,
9+
"targets": {
10+
"browsers": "last 2 versions, IE >= 11"
11+
}
12+
}
13+
],
14+
"@babel/preset-typescript"
15+
],
16+
"env": {
17+
"commonjs": {
18+
"presets": [
19+
[
20+
"@vue/babel-preset-app",
21+
{
22+
"modules": "commonjs",
23+
"corejs": 3,
24+
"absoluteRuntime": false,
25+
"targets": {
26+
"browsers": "last 2 versions, IE >= 11"
27+
}
28+
}
29+
],
30+
"@babel/preset-typescript"
31+
]
32+
}
33+
}
34+
}

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# output
2+
es/
3+
lib/
4+
*.d.ts

.eslintrc.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
},
6+
extends: [
7+
'plugin:vue/vue3-strongly-recommended',
8+
'standard',
9+
'plugin:prettier/recommended',
10+
'prettier/vue',
11+
'prettier/@typescript-eslint',
12+
'plugin:@typescript-eslint/recommended',
13+
'prettier/@typescript-eslint',
14+
],
15+
plugins: ['prettier', '@typescript-eslint'],
16+
parser: 'vue-eslint-parser',
17+
parserOptions: {
18+
parser: '@typescript-eslint/parser',
19+
sourceType: 'module',
20+
extraFileExtensions: ['.vue'],
21+
ecmaVersion: 2020,
22+
ecmaFeatures: {
23+
jsx: true,
24+
},
25+
warnOnUnsupportedTypeScriptVersion: true,
26+
},
27+
rules: {
28+
// TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
29+
'default-case': 'off',
30+
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
31+
'no-dupe-class-members': 'off',
32+
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
33+
'no-undef': 'off',
34+
35+
// Add TypeScript specific rules (and turn off ESLint equivalents)
36+
'@typescript-eslint/consistent-type-assertions': 'warn',
37+
'no-array-constructor': 'off',
38+
'@typescript-eslint/no-array-constructor': 'warn',
39+
'@typescript-eslint/no-namespace': 'error',
40+
'no-use-before-define': 'off',
41+
'@typescript-eslint/no-use-before-define': [
42+
'error',
43+
{
44+
functions: false,
45+
classes: false,
46+
variables: false,
47+
typedefs: false,
48+
},
49+
],
50+
'no-unused-vars': 'off',
51+
'@typescript-eslint/no-unused-vars': [
52+
'error',
53+
{
54+
args: 'none',
55+
ignoreRestSiblings: true,
56+
},
57+
],
58+
'no-useless-constructor': 'off',
59+
'@typescript-eslint/no-useless-constructor': 'warn',
60+
'prettier/prettier': 'error',
61+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
62+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
63+
'@typescript-eslint/explicit-function-return-type': 'off',
64+
'@typescript-eslint/explicit-module-boundary-types': 'off',
65+
'@typescript-eslint/member-delimiter-style': 'off',
66+
'@typescript-eslint/no-explicit-any': 'off',
67+
'standard/no-callback-literal': 'off',
68+
},
69+
overrides: [
70+
{
71+
files: [
72+
'**/__tests__/*.{j,t}s?(x)',
73+
'**/tests/unit/**/*.spec.{j,t}s?(x)',
74+
],
75+
env: {
76+
jest: true,
77+
},
78+
},
79+
{
80+
files: ['shims-tsx.d.ts'],
81+
rules: {
82+
'@typescript-eslint/no-empty-interface': 'off',
83+
'@typescript-eslint/no-explicit-any': 'off',
84+
'@typescript-eslint/no-unused-vars': 'off',
85+
},
86+
},
87+
],
88+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,7 @@ dist
102102

103103
# TernJS port file
104104
.tern-port
105+
106+
# build output
107+
es/
108+
lib/

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at kingsongao1221@gmail.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

__tests__/index.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as components from '../src'
2+
3+
describe('index.tsx', () => {
4+
it('component exported', () => {
5+
expect(components).toBeTruthy()
6+
})
7+
})

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
}

docs/.vitepress/config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const path = require('path')
2+
3+
module.exports = {
4+
root: path.resolve(process.cwd(), './docs'),
5+
title: 'G2Plot Vue',
6+
description: 'G2Plot for Vue',
7+
themeConfig: {
8+
nav: [
9+
{ text: 'Home', link: '/' },
10+
{ text: 'Guide', link: '/guide/' },
11+
{ text: 'External', link: 'https://google.com' },
12+
],
13+
sidebar: ['/', ['/guide/', 'Guide']],
14+
},
15+
}

docs/examples/line.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: LineChart
3+
---
4+
5+
## Demos
6+
7+
## API

docs/guide/index.md

Whitespace-only changes.

docs/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
home: true
3+
heroText: G2Plot Vue
4+
actionText: Get Started
5+
actionLink: /guide/
6+
---
7+
8+
<script>
9+
export default {
10+
render() {
11+
return `Vue Demo`
12+
}
13+
}
14+
</script>

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
preset: '@opd/jest-preset-pangu',
3+
setupFiles: ['jest-canvas-mock'],
4+
transformIgnorePatterns: ['/node_modules/'],
5+
collectCoverageFrom: ['./src/**/*.{ts,tsx}', '!./**/*.d.ts'],
6+
}

0 commit comments

Comments
 (0)