Skip to content

Commit c91f47e

Browse files
authored
Merge pull request #36 from sgratzl/release/v4.1.2
Release v4.1.2
2 parents 9ab1f40 + 8fe3977 commit c91f47e

File tree

7 files changed

+1788
-1680
lines changed

7 files changed

+1788
-1680
lines changed

.yarn/releases/yarn-3.3.1.cjs

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

.yarn/releases/yarn-3.4.1.cjs

Lines changed: 873 additions & 0 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.3.1.cjs
6+
yarnPath: .yarn/releases/yarn-3.4.1.cjs

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "chartjs-plugin-hierarchical",
33
"description": "Chart.js module for hierarchical categories",
4-
"version": "4.1.1",
4+
"version": "4.1.2",
55
"author": {
66
"name": "Samuel Gratzl",
77
"email": "[email protected]",
@@ -54,48 +54,48 @@
5454
],
5555
"devDependencies": {
5656
"@chiogen/rollup-plugin-terser": "^7.1.3",
57-
"@rollup/plugin-commonjs": "^24.0.0",
57+
"@rollup/plugin-commonjs": "^24.0.1",
5858
"@rollup/plugin-node-resolve": "^15.0.1",
5959
"@rollup/plugin-replace": "^5.0.2",
6060
"@rollup/plugin-typescript": "^11.0.0",
61-
"@types/jest": "^29.2.5",
61+
"@types/jest": "^29.4.0",
6262
"@types/jest-image-snapshot": "^6.1.0",
63-
"@types/node": "^18.11.18",
64-
"@types/seedrandom": "^3.0.4",
65-
"@typescript-eslint/eslint-plugin": "^5.48.1",
66-
"@typescript-eslint/parser": "^5.48.1",
67-
"@yarnpkg/sdks": "^2.6.3",
63+
"@types/node": "^18.14.6",
64+
"@types/seedrandom": "^3.0.5",
65+
"@typescript-eslint/eslint-plugin": "^5.54.0",
66+
"@typescript-eslint/parser": "^5.54.0",
67+
"@yarnpkg/sdks": "^2.7.0",
6868
"canvas": "^2.11.0",
6969
"canvas-5-polyfill": "^0.1.5",
70-
"chart.js": "^4.1.2",
71-
"eslint": "^8.31.0",
70+
"chart.js": "^4.2.1",
71+
"eslint": "^8.35.0",
7272
"eslint-config-airbnb-typescript": "^17.0.0",
7373
"eslint-config-prettier": "^8.6.0",
7474
"eslint-config-react-app": "^7.0.1",
7575
"eslint-plugin-flowtype": "^8.0.3",
76-
"eslint-plugin-import": "^2.27.4",
76+
"eslint-plugin-import": "^2.27.5",
7777
"eslint-plugin-jsx-a11y": "^6.7.1",
7878
"eslint-plugin-prettier": "^4.2.1",
79-
"eslint-plugin-react": "^7.32.0",
79+
"eslint-plugin-react": "^7.32.2",
8080
"eslint-plugin-react-hooks": "^4.6.0",
81-
"jest": "^29.3.1",
82-
"jest-environment-jsdom": "^29.3.1",
81+
"jest": "^29.4.3",
82+
"jest-environment-jsdom": "^29.4.3",
8383
"jest-image-snapshot": "^6.1.0",
84-
"prettier": "^2.8.3",
85-
"rimraf": "^4.0.5",
86-
"rollup": "^3.10.0",
84+
"prettier": "^2.8.4",
85+
"rimraf": "^4.3.0",
86+
"rollup": "^3.18.0",
8787
"rollup-plugin-cleanup": "^3.2.1",
88-
"rollup-plugin-dts": "^5.1.1",
88+
"rollup-plugin-dts": "^5.2.0",
8989
"seedrandom": "^3.0.5",
9090
"ts-jest": "^29.0.5",
91-
"tslib": "^2.4.1",
92-
"typedoc": "^0.23.24",
93-
"typescript": "^4.9.4",
91+
"tslib": "^2.5.0",
92+
"typedoc": "^0.23.26",
93+
"typescript": "^4.9.5",
9494
"us-atlas": "^3.0.0",
9595
"world-atlas": "^2.0.2"
9696
},
9797
"scripts": {
98-
"clean": "rimraf build docs node_modules \"*.tgz\" \"*.tsbuildinfo\"",
98+
"clean": "rimraf --glob build docs node_modules \"*.tgz\" \"*.tsbuildinfo\"",
9999
"compile": "tsc -b tsconfig.c.json",
100100
"compile:types": "tsc -p tsconfig.c.json --emitDeclarationOnly",
101101
"start": "yarn run watch",
@@ -113,5 +113,5 @@
113113
"docs": "typedoc src/index.ts",
114114
"prepare": "yarn run build"
115115
},
116-
"packageManager": "yarn@3.3.1"
116+
"packageManager": "yarn@3.4.1"
117117
}

src/plugin/hierarchical.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ function zoomOut(chart: IEnhancedChart, parent: ILabelNode) {
242242

243243
function resolveElement(event: { x: number; y: number }, scale: HierarchicalScale) {
244244
const hor = scale.isHorizontal();
245-
const offset = hor ? scale.top + scale.options.padding : scale.left - scale.options.padding;
245+
const offset = hor ? scale.bottom + scale.options.padding : scale.left - scale.options.padding;
246246
if ((hor && event.y <= offset) || (!hor && event.x > offset)) {
247247
return null;
248248
}
@@ -547,7 +547,7 @@ const hierarchicalPlugin: Plugin = {
547547
if (hor) {
548548
ctx.textAlign = 'center';
549549
ctx.textBaseline = renderLabel === 'above' ? 'bottom' : 'top';
550-
ctx.translate(scale.left, scale.top + scale.options.padding);
550+
ctx.translate(scale.left, scale.bottom + scale.options.padding);
551551
roots.forEach((n) => preOrderTraversal(n, renderHorLevel));
552552
} else {
553553
ctx.textAlign = 'right';

src/scale/hierarchical.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface IHierarchicalScaleOptions extends CategoryScaleOptions {
1212
levelPercentage: number;
1313
/**
1414
* padding of the first collapse to the start of the x-axis
15-
* @default 25
15+
* @default 5
1616
*/
1717
padding: number;
1818
/**
@@ -89,7 +89,7 @@ const defaultConfig: Partial<Omit<IHierarchicalScaleOptions, 'grid'>> & {
8989
/**
9090
* top/left padding for showing the hierarchy marker
9191
*/
92-
padding: 25,
92+
padding: 5,
9393
/**
9494
* position of the hierarchy label
9595
* possible values: 'below', 'above', null to disable

0 commit comments

Comments
 (0)