Skip to content

Commit

Permalink
feat: upgrade to beta.9
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Jan 17, 2021
1 parent 89f2a42 commit 86556a9
Show file tree
Hide file tree
Showing 17 changed files with 311 additions and 211 deletions.
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chartjs-chart-geo",
"description": "Chart.js module for charting maps",
"version": "3.0.0-beta.7",
"version": "3.0.0-beta.8",
"author": {
"name": "Samuel Gratzl",
"email": "sam@sgratzl.com",
Expand Down Expand Up @@ -47,41 +47,42 @@
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-typescript": "^8.0.0",
"@types/jest": "^26.0.18",
"@rollup/plugin-typescript": "^8.1.0",
"@types/jest": "^26.0.20",
"@types/jest-image-snapshot": "^4.1.3",
"@types/node": "^14.14.11",
"@types/node": "^14.14.21",
"@types/seedrandom": "^2.4.28",
"@typescript-eslint/eslint-plugin": "^4.9.1",
"@typescript-eslint/parser": "^4.9.1",
"@typescript-eslint/eslint-plugin": "^4.13.0",
"@typescript-eslint/parser": "^4.13.0",
"@yarnpkg/pnpify": "^2.4.0",
"canvas": "^2.6.1",
"chart.js": "^3.0.0-beta.7",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"canvas-5-polyfill": "^0.1.5",
"chart.js": "^3.0.0-beta.9",
"eslint": "^7.18.0",
"eslint-config-prettier": "^7.1.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.2.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"jest": "^26.6.3",
"jest-image-snapshot": "^4.2.0",
"jest-image-snapshot": "^4.3.0",
"prettier": "^2.2.1",
"release-it": "^14.2.2",
"rimraf": "^3.0.2",
"rollup": "^2.34.2",
"rollup": "^2.36.2",
"rollup-plugin-cleanup": "^3.2.1",
"rollup-plugin-dts": "^2.0.0",
"rollup-plugin-dts": "^2.0.1",
"rollup-plugin-terser": "^7.0.2",
"seedrandom": "^3.0.5",
"ts-jest": "^26.4.4",
"tslib": "^2.0.3",
"typedoc": "^0.19.2",
"typescript": "^4.1.2",
"tslib": "^2.1.0",
"typedoc": "^0.20.16",
"typescript": "^4.1.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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.0.0-beta.7/helpers/helpers.esm.js?module",
"chart.js": "https://unpkg.com/chart.js@3.0.0-beta.9?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.0.0-beta.9/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
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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/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-beta.7/dist/chart.js"></script>
<script src="https://unpkg.com/chart.js@3.0.0-beta.9/dist/chart.js"></script>
<script src="../build/index.umd.js"></script>
</head>

Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/createChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import { Chart, ChartConfiguration, defaults, ChartType, DefaultDataPoint } from 'chart.js';
import { toMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot';
import 'canvas-5-polyfill';

expect.extend({ toMatchImageSnapshot });

Expand Down Expand Up @@ -30,7 +31,7 @@ export default function createChart<
canvas.width = width;
canvas.height = height;
defaults.font.family = 'Courier New';
defaults.font.color = 'transparent';
defaults.color = 'transparent';
config.options = Object.assign(
{
responsive: false,
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/bubbleMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ export interface IBubbleMapDataPoint {
export interface IBubbleMapControllerDatasetOptions
extends ControllerDatasetOptions,
IGeoChartOptions,
ScriptableAndArrayOptions<IGeoFeatureOptions>,
ScriptableAndArrayOptions<CommonHoverOptions> {}
ScriptableAndArrayOptions<IGeoFeatureOptions, ScriptableContext>,
ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext> {}

declare module 'chart.js' {
export interface ChartTypeRegistry {
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/choropleth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export class ChoroplethController extends GeoController<GeoFeature> {
export interface IChoroplethControllerDatasetOptions
extends ControllerDatasetOptions,
IGeoChartOptions,
ScriptableAndArrayOptions<IGeoFeatureOptions>,
ScriptableAndArrayOptions<CommonHoverOptions> {}
ScriptableAndArrayOptions<IGeoFeatureOptions, ScriptableContext>,
ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext> {}

declare module 'chart.js' {
export interface ChartTypeRegistry {
Expand Down
5 changes: 4 additions & 1 deletion src/controllers/geo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
UpdateMode,
Element,
VisualElement,
ScriptableContext,
} from 'chart.js';
import { clipArea, unclipArea, valueOrDefault } from 'chart.js/helpers';
import { geoGraticule, geoGraticule10, ExtendedFeature } from 'd3-geo';
Expand Down Expand Up @@ -240,7 +241,9 @@ export interface IGeoChartOptions {
clipMap: boolean | 'outline' | 'graticule' | 'outline+graticule' | 'items';
}

export interface IGeoControllerDatasetOptions extends IGeoChartOptions, ScriptableAndArrayOptions<IGeoFeatureOptions> {
export interface IGeoControllerDatasetOptions
extends IGeoChartOptions,
ScriptableAndArrayOptions<IGeoFeatureOptions, ScriptableContext> {
xAxisID?: string;
yAxisID?: string;
rAxisID?: string;
Expand Down
3 changes: 2 additions & 1 deletion src/scales/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ export function BaseMixin<O extends ILegendScaleOptions>(superClass: { new (...a

const bak = (this.options as IPositionOption).position;
(this.options as IPositionOption).position = this.options.legend.align;
super.update(w, h, margins);
const r = super.update(w, h, margins);
(this.options as IPositionOption).position = bak;
this.height = Math.min(h, this.height);
this.width = Math.min(w, this.width);
return r;
}

draw(chartArea: ChartArea) {
Expand Down
Loading

0 comments on commit 86556a9

Please sign in to comment.