Skip to content

Commit

Permalink
feat: upgrade to beta.7
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Dec 9, 2020
1 parent 62d6b39 commit 412c155
Show file tree
Hide file tree
Showing 17 changed files with 210 additions and 219 deletions.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,30 +50,30 @@
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-typescript": "^8.0.0",
"@types/jest": "^26.0.15",
"@types/jest": "^26.0.18",
"@types/jest-image-snapshot": "^4.1.3",
"@types/node": "^14.14.10",
"@types/node": "^14.14.11",
"@types/seedrandom": "^2.4.28",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"@yarnpkg/pnpify": "^2.4.0",
"canvas": "^2.6.1",
"chart.js": "^3.0.0-beta.6",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"chart.js": "^3.0.0-beta.7",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^26.6.3",
"jest-image-snapshot": "^4.2.0",
"prettier": "^2.2.1",
"release-it": "^14.2.2",
"rimraf": "^3.0.2",
"rollup": "^2.34.0",
"rollup": "^2.34.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^2.0.0",
"rollup-plugin-terser": "^7.0.2",
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down Expand Up @@ -32,8 +32,10 @@
],
},
options: {
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
scales: {
xy: {
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down Expand Up @@ -32,8 +32,10 @@
],
},
options: {
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
scales: {
xy: {
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/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 Expand Up @@ -36,8 +36,10 @@
],
},
options: {
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
// plugins: {
// datalabels: {
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/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 Expand Up @@ -36,8 +36,10 @@
],
},
options: {
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
// plugins: {
// datalabels: {
Expand Down
8 changes: 4 additions & 4 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/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 Expand Up @@ -36,10 +36,10 @@
],
},
options: {
legend: {
display: false,
},
plugins: {
legend: {
display: false,
},
datalabels: {
align: 'top',
formatter: (v) => {
Expand Down
10 changes: 6 additions & 4 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/[email protected].6?module",
"chart.js/helpers": "https://unpkg.com/[email protected].6/helpers/helpers.esm.js?module",
"chart.js": "https://unpkg.com/[email protected].7?module",
"chart.js/helpers": "https://unpkg.com/[email protected].7/helpers/helpers.esm.js?module",
"chartjs-chart-geo": "../build/index.esm.js",
"d3-geo": "https://unpkg.com/d3-geo?module",
"d3-scale-chromatic": "https://unpkg.com/d3-scale-chromatic?module",
Expand Down Expand Up @@ -45,8 +45,10 @@
],
},
options: {
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
scales: {
xy: {
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down Expand Up @@ -32,8 +32,10 @@
options: {
showOutline: true,
showGraticule: true,
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
scales: {
xy: {
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down Expand Up @@ -32,8 +32,10 @@
options: {
showOutline: true,
showGraticule: true,
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
scales: {
xy: {
Expand Down
8 changes: 5 additions & 3 deletions 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/[email protected].6/dist/chart.js"></script>
<script src="https://unpkg.com/[email protected].7/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down Expand Up @@ -42,8 +42,10 @@
options: {
showOutline: false,
showGraticule: false,
legend: {
display: false,
plugins: {
legend: {
display: false,
},
},
scales: {
xy: {
Expand Down
12 changes: 7 additions & 5 deletions src/__tests__/createChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ export default function createChart<
{
responsive: false,
animation: false,
legend: {
display: false,
},
title: {
display: false,
plugins: {
legend: {
display: false,
},
title: {
display: false,
},
},
},
config.options || {}
Expand Down
12 changes: 0 additions & 12 deletions src/controllers/bubbleMap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ describe('bubbleMap', () => {
],
},
options: {
legend: {
display: false,
},
scales: {
xy: {
projection: 'albersUsa',
Expand Down Expand Up @@ -78,9 +75,6 @@ describe('bubbleMap', () => {
],
},
options: {
legend: {
display: false,
},
scales: {
xy: {
projection: 'albersUsa',
Expand Down Expand Up @@ -117,9 +111,6 @@ describe('bubbleMap', () => {
],
},
options: {
legend: {
display: false,
},
scales: {
xy: {
projection: 'albersUsa',
Expand Down Expand Up @@ -156,9 +147,6 @@ describe('bubbleMap', () => {
],
},
options: {
legend: {
display: false,
},
scales: {
xy: {
projection: 'albersUsa',
Expand Down
24 changes: 13 additions & 11 deletions src/controllers/bubbleMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,19 @@ export class BubbleMapController extends GeoController<PointElement> {
datasetElementType: GeoFeature.id,
showOutline: true,
clipMap: 'outline+graticule',
tooltips: {
callbacks: {
title() {
// Title doesn't make sense for scatter since we format the data as a point
return '';
},
label(item: TooltipItem) {
if (item.formattedValue == null) {
return item.chart.data.labels[item.dataIndex];
}
return `${item.chart.data.labels[item.dataIndex]}: ${item.formattedValue}`;
plugins: {
tooltip: {
callbacks: {
title() {
// Title doesn't make sense for scatter since we format the data as a point
return '';
},
label(item: TooltipItem) {
if (item.formattedValue == null) {
return item.chart.data.labels[item.dataIndex];
}
return `${item.chart.data.labels[item.dataIndex]}: ${item.formattedValue}`;
},
},
},
},
Expand Down
9 changes: 0 additions & 9 deletions src/controllers/choropleth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ describe('choropleth', () => {
],
},
options: {
legend: {
display: false,
},
scales: {
xy: {
projection: 'albersUsa',
Expand Down Expand Up @@ -89,9 +86,6 @@ describe('choropleth', () => {
],
},
options: {
legend: {
display: false,
},
scales: {
xy: {
projection: 'albersUsa',
Expand Down Expand Up @@ -136,9 +130,6 @@ describe('choropleth', () => {
options: {
showOutline: true,
showGraticule: true,
legend: {
display: false,
},
scales: {
xy: {
projection: 'equalEarth',
Expand Down
24 changes: 13 additions & 11 deletions src/controllers/choropleth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,19 @@ export class ChoroplethController extends GeoController<GeoFeature> {
datasetElementType: GeoFeature.id,
dataElementType: GeoFeature.id,
dataElementOptions: ['backgroundColor', 'borderColor', 'borderWidth'],
tooltips: {
callbacks: {
title() {
// Title doesn't make sense for scatter since we format the data as a point
return '';
},
label(item: TooltipItem) {
if (item.formattedValue == null) {
return item.chart.data.labels[item.dataIndex];
}
return `${item.chart.data.labels[item.dataIndex]}: ${item.formattedValue}`;
plugins: {
tooltip: {
callbacks: {
title() {
// Title doesn't make sense for scatter since we format the data as a point
return '';
},
label(item: TooltipItem) {
if (item.formattedValue == null) {
return item.chart.data.labels[item.dataIndex];
}
return `${item.chart.data.labels[item.dataIndex]}: ${item.formattedValue}`;
},
},
},
},
Expand Down
Loading

0 comments on commit 412c155

Please sign in to comment.