Skip to content

Commit 480680d

Browse files
authored
feat: open source (#4)
* chore: clean old workspace * chore: inject project tool * chore: ci * feat: all of components * docs: readme * docs: typo * chore: add changeset * chore: fix type err * chore: fix umd path * chore: eslint cli * chore: rename script * chore: umd filename * chore: trigger Preview * chore: export version * chore: add changeset * chore: ci jest * docs: quick start * refactor: dual axes plot
1 parent 48516fd commit 480680d

File tree

208 files changed

+12524
-362
lines changed

Some content is hidden

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

208 files changed

+12524
-362
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "antvis/GPT-Vis" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/pretty-weeks-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@antv/gpt-vis': patch
3+
---
4+
5+
feat: 20 + Visual components

.dumirc.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from 'dumi';
2+
3+
export default defineConfig({
4+
outputPath: 'docs-dist',
5+
favicons: ['https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png'],
6+
themeConfig: {
7+
name: 'GPT-Vis',
8+
logo: 'https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png',
9+
footer: `Open-source MIT Licensed | Copyright © 2024
10+
<br />
11+
Powered by <a herf="https://antv.antgroup.com">Antv</a>`,
12+
socialLinks: {
13+
github: 'https://github.com/antvis/GPT-Vis',
14+
},
15+
},
16+
externals: {
17+
'mapbox-gl': 'window.mapboxgl',
18+
'maplibre-gl': 'window.maplibregl',
19+
},
20+
theme: {
21+
'@c-primary': '#691eff',
22+
'@s-content-width': '100%',
23+
'@s-content-padding': '48px',
24+
'@s-sidebar-width': '300px',
25+
},
26+
});

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ insert_final_newline = true
1111

1212
[*.md]
1313
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.eslintrc.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

.fatherrc.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { defineConfig } from 'father';
2+
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
3+
4+
export default defineConfig({
5+
esm: {
6+
output: 'dist/esm',
7+
},
8+
cjs: {
9+
output: 'dist/cjs',
10+
},
11+
// https://github.com/umijs/father/blob/master/docs/config.md#umd
12+
umd: {
13+
name: 'GPTVis',
14+
output: {
15+
path: 'dist/umd',
16+
filename: 'index.min.js',
17+
},
18+
platform: 'browser',
19+
targets: {
20+
chrome: 51,
21+
},
22+
externals: {
23+
lodash: '_',
24+
'lodash-es': '_',
25+
react: 'React',
26+
'mapbox-gl': {
27+
root: 'mapboxgl',
28+
commonjs: 'mapbox-gl',
29+
commonjs2: 'mapbox-gl',
30+
amd: 'mapbox-gl',
31+
},
32+
'maplibre-gl': {
33+
root: 'maplibregl',
34+
commonjs: 'maplibre-gl',
35+
commonjs2: 'maplibre-gl',
36+
amd: 'maplibre-gl',
37+
},
38+
},
39+
chainWebpack(memo) {
40+
// 关闭压缩方便调试,默认开启
41+
// memo.optimization.minimize(false);
42+
43+
memo
44+
.plugin('webpack-bundle-analyzer')
45+
.use(BundleAnalyzerPlugin, [{ analyzerMode: 'static', openAnalyzer: false }]);
46+
return memo;
47+
},
48+
},
49+
});

.github/.gitleaks.toml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
title = "gitleaks config"
2+
[[rules]]
3+
description = "AWS Manager ID"
4+
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
5+
tags = ["key", "AWS"]
6+
[[rules]]
7+
description = "AWS Secret Key"
8+
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
9+
tags = ["key", "AWS"]
10+
[[rules]]
11+
description = "AWS MWS key"
12+
regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'''
13+
tags = ["key", "AWS", "MWS"]
14+
[[rules]]
15+
description = "Facebook Secret Key"
16+
regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]'''
17+
tags = ["key", "Facebook"]
18+
[[rules]]
19+
description = "Facebook Client ID"
20+
regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]'''
21+
tags = ["key", "Facebook"]
22+
[[rules]]
23+
description = "Twitter Secret Key"
24+
regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]'''
25+
tags = ["key", "Twitter"]
26+
[[rules]]
27+
description = "Twitter Client ID"
28+
regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]'''
29+
tags = ["client", "Twitter"]
30+
[[rules]]
31+
description = "Github"
32+
regex = '''(?i)github(.{0,20})?(?-i)['\"][0-9a-zA-Z]{35,40}['\"]'''
33+
tags = ["key", "Github"]
34+
[[rules]]
35+
description = "Github Token"
36+
regex = '''[0-9a-zA-Z]{35,40}'''
37+
tags = ["key", "Github Token"]
38+
[[rules]]
39+
description = "Alibaba"
40+
regex = '''(alibaba|antfin)-inc'''
41+
tags = ["key", "Alibaba"]
42+
[[rules]]
43+
description = "antfin"
44+
regex = '''(?i)antfin(.{0,20})?(?-i)['\"][0-9a-zA-Z]{35,40}['\"]'''
45+
tags = ["key", "Antfin"]
46+
[[rules]]
47+
description = "LinkedIn Client ID"
48+
regex = '''(?i)linkedin(.{0,20})?(?-i)['\"][0-9a-z]{12}['\"]'''
49+
tags = ["client", "LinkedIn"]
50+
[[rules]]
51+
description = "LinkedIn Secret Key"
52+
regex = '''(?i)linkedin(.{0,20})?['\"][0-9a-z]{16}['\"]'''
53+
tags = ["secret", "LinkedIn"]
54+
[[rules]]
55+
description = "Slack"
56+
regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?'''
57+
tags = ["key", "Slack"]
58+
[[rules]]
59+
description = "Asymmetric Private Key"
60+
regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----'''
61+
tags = ["key", "AsymmetricPrivateKey"]
62+
[[rules]]
63+
description = "Public Key"
64+
regex = '''ssh-rsa'''
65+
tags = ["keys", "public key"]
66+
[[rules]]
67+
description = "Gitlab Key"
68+
regex = '''privateToken|private-token'''
69+
tags = ["keys", "Gitlab"]
70+
[[rules]]
71+
description = "Generic Credential"
72+
regex = '''(?i)(api_key|apikey|secret)(.{0,20})?['|"][0-9a-zA-Z]{16,45}['|"]'''
73+
tags = ["key", "API", "generic"]
74+
[[rules]]
75+
description = "Google API key"
76+
regex = '''AIza[0-9A-Za-z\\-_]{35}'''
77+
tags = ["key", "Google"]
78+
[[rules]]
79+
description = "Heroku API key"
80+
regex = '''(?i)heroku(.{0,20})?['"][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]'''
81+
tags = ["key", "Heroku"]
82+
[[rules]]
83+
description = "MailChimp API key"
84+
regex = '''(?i)(mailchimp|mc)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]'''
85+
tags = ["key", "Mailchimp"]
86+
[[rules]]
87+
description = "Mailgun API key"
88+
regex = '''(?i)(mailgun|mg)(.{0,20})?['"][0-9a-z]{32}['"]'''
89+
tags = ["key", "Mailgun"]
90+
[[rules]]
91+
description = "PayPal Braintree access token"
92+
regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}'''
93+
tags = ["key", "Paypal"]
94+
[[rules]]
95+
description = "Picatic API key"
96+
regex = '''sk_live_[0-9a-z]{32}'''
97+
tags = ["key", "Picatic"]
98+
[[rules]]
99+
description = "SendGrid API Key"
100+
regex = '''SG\.[\w_]{16,32}\.[\w_]{16,64}'''
101+
tags = ["key", "SendGrid"]
102+
[[rules]]
103+
description = "Slack Webhook"
104+
regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'''
105+
tags = ["key", "slack"]
106+
[[rules]]
107+
description = "Stripe API key"
108+
regex = '''(?i)stripe(.{0,20})?['\"][sk|rk]_live_[0-9a-zA-Z]{24}'''
109+
tags = ["key", "Stripe"]
110+
[[rules]]
111+
description = "Square access token"
112+
regex = '''sq0atp-[0-9A-Za-z\-_]{22}'''
113+
tags = ["key", "square"]
114+
[[rules]]
115+
description = "Square OAuth secret"
116+
regex = '''sq0csp-[0-9A-Za-z\\-_]{43}'''
117+
tags = ["key", "square"]
118+
[[rules]]
119+
description = "Twilio API key"
120+
regex = '''(?i)twilio(.{0,20})?['\"][0-9a-f]{32}['\"]'''
121+
tags = ["key", "twilio"]
122+
[whitelist]
123+
description = "Whitelisted files"
124+
file = '''(^\.?gitleaks.toml$|(.*?)(jpg|gif|doc|pdf|bin)|package-lock\.json$)'''

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### PR includes
2+
3+
<!-- Add completed items in this PR, and change [ ] to [x]. -->
4+
5+
- [ ] fixed #0
6+
- [ ] add / modify test cases
7+
- [ ] documents, demos
8+
9+
### Screenshot
10+
11+
| Before | After |
12+
| ------ | ----- |
13+
|||
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Prepare Install'
2+
description: 'Prepare repository and install all dependencies'
3+
4+
inputs:
5+
node-version:
6+
description: 'The node version to setup'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- uses: pnpm/action-setup@v3
13+
with:
14+
version: 9
15+
16+
- name: Use Node.js ${{ inputs.node-version }}
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ inputs.node-version }}
20+
# cache: 'pnpm' # pnpm-lock.yaml caching dependencies to speed up workflows
21+
22+
- name: Install dependencies
23+
shell: bash
24+
run: pnpm install

.github/release.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# for .github/workflows/release-label.yml
2+
# These labels can be used in conjunction GitHub's [automatically generated release notes](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes)
3+
4+
changelog:
5+
exclude:
6+
labels:
7+
- ignore-for-release
8+
- pr(chore)
9+
categories:
10+
- title: 🎉 New Features
11+
labels:
12+
- pr(feature)
13+
- title: 📖 Documentation Changes
14+
labels:
15+
- pr(documentation)
16+
- title: 🐛 Bug Fixes
17+
labels:
18+
- pr(bugfix)
19+
- title: 🛠 Breaking Changes
20+
labels:
21+
- pr(breaking)
22+
- title: Other Changes
23+
labels:
24+
- '*'

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'src/**'
8+
- '__tests__/**'
9+
pull_request:
10+
branches:
11+
- '**'
12+
paths:
13+
- 'src/**'
14+
- '__tests__/**'
15+
16+
permissions:
17+
contents: read # to fetch code (actions/checkout)
18+
19+
concurrency:
20+
group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}'
21+
cancel-in-progress: true
22+
23+
jobs:
24+
lint:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
node-version: [18.x]
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Install dependencies
32+
uses: ./.github/actions/prepare-install
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
- name: Check
36+
run: |
37+
pnpm check-deps
38+
pnpm check-format
39+
- name: Lint
40+
run: pnpm lint:ts
41+
42+
# unit-test:
43+
# runs-on: ubuntu-latest
44+
# strategy:
45+
# matrix:
46+
# node-version: [18.x]
47+
# steps:
48+
# - uses: actions/checkout@v4
49+
# - name: Install dependencies
50+
# uses: ./.github/actions/prepare-install
51+
# with:
52+
# node-version: ${{ matrix.node-version }}
53+
# - name: Unit Test
54+
# run: pnpm test:unit
55+
56+
size-test:
57+
runs-on: ubuntu-latest
58+
strategy:
59+
matrix:
60+
node-version: [18.x]
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Install dependencies
64+
uses: ./.github/actions/prepare-install
65+
with:
66+
node-version: ${{ matrix.node-version }}
67+
- name: Szie Test With Build
68+
run: pnpm test:size

0 commit comments

Comments
 (0)