Skip to content

Commit

Permalink
feat: upgrade to chart.js 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Apr 5, 2021
1 parent 6cad944 commit 93a7dfd
Show file tree
Hide file tree
Showing 18 changed files with 711 additions and 434 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Chart.js module for charting maps with legends. Adding new chart types: `choropleth` and `bubbleMap`.

**Works only with Chart.js >= 3.0.0-alpha.2**
**Works only with Chart.js >= 3.0.0**

![Choropleth](https://user-images.githubusercontent.com/4129778/78821942-8b974700-79da-11ea-988d-142f7788ffe6.png)

Expand All @@ -23,7 +23,7 @@ works great with https://github.com/chartjs/chartjs-plugin-datalabels
## Install

```bash
npm install --save chart.js@next chartjs-chart-geo@next
npm install --save chart.js chartjs-chart-geo
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

module.exports = {
preset: 'ts-jest',
testRegex: '((\\.|/)(test|spec))\\.[jt]sx?$',
testRegex: '((\\.|/)(test|spec))\\.tsx?$',
};
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"src/**/*.ts"
],
"peerDependencies": {
"chart.js": "^3.0.0-rc.3"
"chart.js": "^3.0.2"
},
"dependencies": {
"@types/d3-geo": "^2.0.0",
Expand All @@ -47,21 +47,21 @@
"topojson-client": "^3.1.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-replace": "^2.4.1",
"@rollup/plugin-typescript": "^8.2.0",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/plugin-replace": "^2.4.2",
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^26.0.22",
"@types/jest-image-snapshot": "^4.3.0",
"@types/node": "^14.14.36",
"@types/node": "^14.14.37",
"@types/seedrandom": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@yarnpkg/pnpify": "^2.4.0",
"canvas": "^2.7.0",
"canvas-5-polyfill": "^0.1.5",
"chart.js": "3.0.0-rc.3",
"eslint": "^7.22.0",
"eslint": "^7.23.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-prettier": "^8.1.0",
"eslint-config-react-app": "^6.0.0",
Expand All @@ -72,18 +72,18 @@
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^26.6.3",
"jest-image-snapshot": "^4.4.0",
"jest-image-snapshot": "^4.4.1",
"prettier": "^2.2.1",
"release-it": "^14.5.0",
"release-it": "^14.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.42.4",
"rollup": "^2.44.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^3.0.1",
"rollup-plugin-terser": "^7.0.2",
"seedrandom": "^3.0.5",
"ts-jest": "^26.5.4",
"tslib": "^2.1.0",
"typedoc": "^0.20.34",
"typedoc": "^0.20.35",
"typescript": "^4.2.3",
"us-atlas": "^3.0.0",
"world-atlas": "^2.0.2"
Expand Down
2 changes: 1 addition & 1 deletion samples/albers.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/albersCustom.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/albersLegend.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/albersLog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/bubbleMap.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<!-- <script src="https://unpkg.com/chartjs-plugin-datalabels"></script> -->
<script src="../build/index.umd.js"></script>
<script src="https://unpkg.com/papaparse"></script>
Expand Down
2 changes: 1 addition & 1 deletion samples/bubbleMapArea.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<!-- <script src="https://unpkg.com/chartjs-plugin-datalabels"></script> -->
<script src="../build/index.umd.js"></script>
<script src="https://unpkg.com/papaparse"></script>
Expand Down
2 changes: 1 addition & 1 deletion samples/bubbleMapLog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<!-- <script src="https://unpkg.com/chartjs-plugin-datalabels"></script> -->
<script src="../build/index.umd.js"></script>
<script src="https://unpkg.com/papaparse"></script>
Expand Down
4 changes: 2 additions & 2 deletions samples/default_esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<script type="importmap-shim">
{
"imports": {
"chart.js": "https://unpkg.com/chart.js@3.0.0-rc.5?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.0.0-rc.5/helpers/helpers.esm.js?module",
"chart.js": "https://unpkg.com/chart.js@3.0.0?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.0.0/helpers/helpers.esm.js?module",
"chartjs-chart-geo": "../build/index.js",
"d3-geo": "https://unpkg.com/d3-geo?module",
"d3-scale-chromatic": "https://unpkg.com/d3-scale-chromatic?module",
Expand Down
2 changes: 1 addition & 1 deletion samples/earth.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/earth_click.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/germany.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/chart.js@3.0.0-rc.5/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion src/controllers/GeoController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { clipArea, unclipArea, valueOrDefault } from 'chart.js/helpers';
import { geoGraticule, geoGraticule10, ExtendedFeature } from 'd3-geo';
import { ProjectionScale } from '../scales';
import { GeoFeature, IGeoFeatureOptions } from '../elements';
import type { GeoFeature, IGeoFeatureOptions } from '../elements';

export const geoDefaults = {
showOutline: false,
Expand Down
2 changes: 1 addition & 1 deletion src/elements/GeoFeature.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Element, BarElement, BarOptions, VisualElement, Point } from 'chart.js';
import { geoContains, GeoProjection } from 'd3-geo';
import { ProjectionScale } from '../scales';
import type { ProjectionScale } from '../scales';

export interface IGeoFeatureOptions extends BarOptions {
/**
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"declaration": false,
"sourceMap": true,
"strict": true,
"importsNotUsedAsValues": "remove",
"importsNotUsedAsValues": "error",
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"strictBindCallApply": true,
Expand Down
Loading

0 comments on commit 93a7dfd

Please sign in to comment.