Skip to content

Commit 85cffa9

Browse files
authored
Merge pull request #179 from sgratzl/release/v4.2.1
Release v4.2.1
2 parents f937fa4 + 85e3f0a commit 85cffa9

Some content is hidden

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

65 files changed

+4318
-3024
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
*.less text
2121
*.styl text
2222
*.js text
23+
*.jsx text
2324
*.ts text
25+
*.tsx text
2426
*.coffee text
2527
*.json text
2628
*.htm text

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
- run: yarn build
2626
- run: yarn lint
2727
- run: yarn test
28-
- run: yarn samples
2928
- uses: actions/upload-artifact@v2
3029
if: failure()
3130
with:
3231
name: diff outputs
3332
path: src/**/__diff_output__/*.png
33+
- run: yarn docs:build

.github/workflows/deploy_website.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy Website
2+
on:
3+
workflow_dispatch: {}
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pages: write
12+
id-token: write
13+
environment:
14+
name: github-pages
15+
url: ${{ steps.deployment.outputs.page_url }}
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
cache: npm
24+
- run: npm i -g yarn
25+
- run: yarn config set checksumBehavior ignore
26+
- name: Cache Node.js modules
27+
uses: actions/cache@v3
28+
with:
29+
path: |
30+
./.yarn/cache
31+
./.yarn/unplugged
32+
key: ${{ runner.os }}-yarn2-v5-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-yarn2-v5
35+
- run: yarn install
36+
- run: yarn docs:build
37+
- uses: actions/configure-pages@v2
38+
- uses: actions/upload-pages-artifact@v1
39+
with:
40+
path: docs/.vitepress/dist
41+
- name: Deploy
42+
id: deployment
43+
uses: actions/deploy-pages@v1

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ npm-debug.log*
1919

2020
*.tgz
2121
/.vscode/extensions.json
22-
/docs
2322
*.tsbuildinfo
2423
.eslintcache
2524
__diff_output__
2625

27-
/samples/type_test.js
26+
docs/.vitepress/dist
27+
docs/.vitepress/cache
28+
docs/.vitepress/config.ts.timestamp*
29+
docs/api/

.prettierignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
/.yarnrc.yml
33
/.yarn
44
/build
5-
/docs
5+
/docs/.vitepress/cache
6+
/docs/.vitepress/dist
7+
/docs/.vitepress/config.ts.timestamp*
8+
/docs/api
69
/coverage
710
/.gitattributes
811
/.gitignore
@@ -14,4 +17,4 @@
1417
*.tgz
1518
*.tsbuildinfo
1619
.eslintcache
17-
/samples/type_test.js
20+
.nojekyll

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
"[yaml]": {
1414
"editor.defaultFormatter": "esbenp.prettier-vscode"
1515
},
16-
"prettier.packageManager": "yarn",
17-
"eslint.packageManager": "yarn",
1816
"npm.packageManager": "yarn",
1917
"eslint.nodePath": ".yarn/sdks",
2018
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
@@ -23,7 +21,6 @@
2321
"typescript.enablePromptUseWorkspaceTsdk": true,
2422
"editor.detectIndentation": false,
2523
"editor.tabSize": 2,
26-
"liveServer.settings.port": 5503,
2724
"search.exclude": {
2825
"**/.yarn": true,
2926
"**/.pnp.*": true

.yarn/releases/yarn-3.5.0.cjs renamed to .yarn/releases/yarn-3.6.1.cjs

Lines changed: 280 additions & 279 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ packageExtensions:
33
dependencies:
44
eslint-import-resolver-node: "*"
55

6-
yarnPath: .yarn/releases/yarn-3.5.0.cjs
6+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2022 Samuel Gratzl
3+
Copyright (c) 2019-2023 Samuel Gratzl
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/.vitepress/config.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { defineConfig } from 'vitepress';
2+
import { name, description, repository, license, author } from '../../package.json';
3+
import typedocSidebar from '../api/typedoc-sidebar.json';
4+
5+
const cleanName = name.replace('@sgratzl/', '');
6+
7+
// https://vitepress.dev/reference/site-config
8+
export default defineConfig({
9+
title: cleanName,
10+
description,
11+
base: `/${cleanName}/`,
12+
useWebFonts: false,
13+
themeConfig: {
14+
// https://vitepress.dev/reference/default-theme-config
15+
nav: [
16+
{ text: 'Home', link: '/' },
17+
{ text: 'Getting Started', link: '/getting-started' },
18+
{ text: 'Examples', link: '/examples/' },
19+
{ text: 'API', link: '/api/' },
20+
{ text: 'Related Plugins', link: '/related' },
21+
],
22+
23+
sidebar: [
24+
{
25+
text: 'Examples',
26+
items: [
27+
{ text: 'Basic', link: '/examples/' },
28+
{ text: 'Choropleth US Map', link: '/examples/choropleth' },
29+
{ text: 'Bubble Map', link: '/examples/bubbleMap' },
30+
{ text: 'Custom Color Scale', link: '/examples/custom' },
31+
{ text: 'Legend Customization', link: '/examples/legend' },
32+
{ text: 'Tooltip Center', link: '/examples/center' },
33+
{ text: 'Projection Offset', link: '/examples/offset' },
34+
{ text: 'Equal Earth Projection', link: '/examples/projection' },
35+
{ text: 'World Atlas', link: '/examples/earth' },
36+
{ text: 'Bubble Map Area Mode', link: '/examples/area' },
37+
],
38+
},
39+
{
40+
text: 'API',
41+
collapsed: true,
42+
items: typedocSidebar,
43+
},
44+
],
45+
46+
socialLinks: [{ icon: 'github', link: repository.url.replace('.git', '') }],
47+
48+
footer: {
49+
message: `Released under the <a href="${repository.url.replace(
50+
'.git',
51+
''
52+
)}/tree/main/LICENSE">${license} license</a>.`,
53+
copyright: `Copyright © 2019-present <a href="${author.url}">${author.name}</a>`,
54+
},
55+
56+
editLink: {
57+
pattern: `${repository.url.replace('.git', '')}/edit/main/docs/:path`,
58+
},
59+
60+
search: {
61+
provider: 'local',
62+
},
63+
},
64+
});

docs/.vitepress/theme/index.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import Theme from 'vitepress/theme';
2+
import { createTypedChart } from 'vue-chartjs';
3+
import { Tooltip, PointElement } from 'chart.js';
4+
import {
5+
BubbleMapController,
6+
ChoroplethController,
7+
ColorScale,
8+
ColorLogarithmicScale,
9+
SizeLogarithmicScale,
10+
SizeScale,
11+
GeoFeature,
12+
ProjectionScale,
13+
} from '../../../src';
14+
15+
export default {
16+
...Theme,
17+
enhanceApp({ app }) {
18+
app.component(
19+
'BubbleMapChart',
20+
createTypedChart('bubbleMap', [
21+
ProjectionScale,
22+
BubbleMapController,
23+
SizeScale,
24+
SizeLogarithmicScale,
25+
PointElement,
26+
GeoFeature,
27+
Tooltip,
28+
])
29+
);
30+
app.component(
31+
'ChoroplethChart',
32+
createTypedChart('choropleth', [
33+
ProjectionScale,
34+
ChoroplethController,
35+
ColorScale,
36+
ColorLogarithmicScale,
37+
GeoFeature,
38+
Tooltip,
39+
])
40+
);
41+
},
42+
};

docs/examples/albers.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import type { ChartConfiguration } from 'chart.js';
2+
import { Feature, topojson } from '../../src';
3+
4+
// #region data
5+
import states10m from 'us-atlas/states-10m.json';
6+
7+
const nation: Feature = topojson.feature(states10m as any, states10m.objects.nation as any).features[0];
8+
const states: Feature = topojson.feature(states10m as any, states10m.objects.states as any).features;
9+
10+
export const data: ChartConfiguration<'choropleth'>['data'] = {
11+
labels: states.map((d) => d.properties.name),
12+
datasets: [
13+
{
14+
label: 'States',
15+
outline: nation,
16+
data: states.map((d) => ({
17+
feature: d,
18+
value: Math.random() * 11,
19+
})),
20+
},
21+
],
22+
};
23+
// #endregion data
24+
// #region config
25+
export const config: ChartConfiguration<'choropleth'> = {
26+
type: 'choropleth',
27+
data,
28+
options: {
29+
scales: {
30+
projection: {
31+
axis: 'x',
32+
projection: 'albersUsa',
33+
},
34+
color: {
35+
axis: 'x',
36+
quantize: 5,
37+
legend: {
38+
position: 'bottom-right',
39+
align: 'right',
40+
},
41+
},
42+
},
43+
},
44+
};
45+
// #endregion config

docs/examples/area.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Bubble Map Area Mode
3+
---
4+
5+
# Bubble Map Area Mode
6+
7+
<script setup>
8+
import {config} from './area';
9+
</script>
10+
11+
<BubbleMapChart
12+
:options="config.options"
13+
:data="config.data"
14+
/>
15+
16+
### Code
17+
18+
:::code-group
19+
20+
<<< ./area.ts#config [config]
21+
22+
<<< ./bubbleMap.ts#data [data]
23+
24+
:::

docs/examples/area.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type { ChartConfiguration } from 'chart.js';
2+
import { Feature, topojson } from '../../src';
3+
import { data } from './bubbleMap';
4+
5+
// #region config
6+
export const config: ChartConfiguration<'bubbleMap'> = {
7+
type: 'bubbleMap',
8+
data,
9+
options: {
10+
scales: {
11+
projection: {
12+
axis: 'x',
13+
projection: 'albersUsa',
14+
},
15+
size: {
16+
axis: 'x',
17+
size: [1, 20],
18+
mode: 'area',
19+
},
20+
},
21+
layout: {
22+
// padding: 20
23+
},
24+
},
25+
};
26+
// #endregion config

docs/examples/bubbleMap.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Bubble Map
3+
---
4+
5+
# Bubble Map
6+
7+
<script setup>
8+
import {config} from './bubbleMap';
9+
</script>
10+
11+
<BubbleMapChart
12+
:options="config.options"
13+
:data="config.data"
14+
/>
15+
16+
### Code
17+
18+
:::code-group
19+
20+
<<< ./bubbleMap.ts#config [config]
21+
22+
<<< ./bubbleMap.ts#data [data]
23+
24+
:::

0 commit comments

Comments
 (0)