Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
netil committed Sep 22, 2023
2 parents 7941e93 + 0c1ce81 commit ef65b9c
Show file tree
Hide file tree
Showing 23 changed files with 687 additions and 903 deletions.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@
"d3-zoom": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.22.17",
"@babel/core": "^7.22.20",
"@babel/eslint-parser": "^7.22.15",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.22.15",
"@babel/preset-env": "^7.22.15",
"@babel/preset-env": "^7.22.20",
"@babel/preset-typescript": "^7.22.15",
"@babel/runtime": "^7.22.15",
"@commitlint/cli": "17.7.1",
Expand All @@ -117,17 +117,17 @@
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-typescript": "^11.1.3",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.4",
"@semantic-release/commit-analyzer": "^11.0.0",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^10.0.5",
"@semantic-release/release-notes-generator": "^11.0.7",
"@semantic-release/npm": "^11.0.0",
"@semantic-release/release-notes-generator": "^12.0.0",
"@types/chai": "^4.3.6",
"@types/d3": "^7.4.0",
"@types/mocha": "^10.0.1",
"@types/sinon": "^10.0.16",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@typescript-eslint/eslint-plugin": "^6.7.2",
"@typescript-eslint/parser": "^6.7.2",
"babel-helper-modules": "^6.0.0",
"babel-loader": "^9.1.3",
"babel-plugin-add-module-exports": "^1.0.4",
Expand Down Expand Up @@ -157,7 +157,7 @@
"eslint": "^8.49.0",
"eslint-config-naver": "^2.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsdoc": "^46.6.0",
"eslint-plugin-jsdoc": "^46.8.1",
"eslint-webpack-plugin": "^4.0.1",
"exports-loader": "^4.0.0",
"hammer-simulator": "0.0.1",
Expand All @@ -181,12 +181,12 @@
"mocha": "^10.2.0",
"node-sass": "^9.0.0",
"regenerator-runtime": "^0.14.0",
"rollup": "^3.29.1",
"rollup": "^3.29.2",
"rollup-plugin-delete": "^2.0.0",
"sass-loader": "^13.3.2",
"semantic-release": "^21.1.1",
"semantic-release": "^22.0.0",
"simulant": "^0.2.2",
"sinon": "^15.2.0",
"sinon": "^16.0.0",
"string-replace-loader": "^3.1.0",
"style-loader": "^3.3.3",
"taffydb": "^2.7.3",
Expand Down
4 changes: 2 additions & 2 deletions src/ChartInternal/Axis/Axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Axis {

if (v === "x") {
res = clip.pathXAxis;
} else if (v === "y") { // && config.axis_y_inner) {
} else if (v === "y") { // || v === "y2") {
res = clip.pathYAxis;
}

Expand Down Expand Up @@ -670,7 +670,7 @@ class Axis {
!config.axis_x_tick_multiline &&
positiveRotation
) {
const widthWithoutCurrentPaddingLeft = state.current.width - $$.getCurrentPaddingLeft();
const widthWithoutCurrentPaddingLeft = state.current.width - $$.getCurrentPaddingByDirection("left");
const maxOverflow = this.getXAxisTickMaxOverflow(
xAxisTickRotate, widthWithoutCurrentPaddingLeft - defaultPadding
);
Expand Down
2 changes: 1 addition & 1 deletion src/ChartInternal/ChartInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export default class ChartInternal {
$el.defs = $el.svg.append("defs");

if (hasAxis) {
["id", "idXAxis", "idYAxis", "idGrid"].forEach(v => {
["id", "idXAxis", "idYAxis", "idY2Axis", "idGrid"].forEach(v => {
$$.appendClip($el.defs, state.clip[v]);
});
}
Expand Down
6 changes: 4 additions & 2 deletions src/ChartInternal/internals/clip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,26 @@ export default {
const h = (isRotated ? (margin.top + height) + 10 : margin.bottom) + 20;

const x = isRotated ? -(1 + left) : -(left - 1);
const y = -15; // -Math.max(15, margin.top);
const w = isRotated ? margin.left + 20 : width + 10 + left;

node
.attr("x", x)
.attr("y", -2)
.attr("y", y)
.attr("width", w)
.attr("height", h);
},

/**
* Set y Axis clipPath dimension
* @param {d3Selecton} node clipPath <rect> selection
* @param {d3Selection} node clipPath <rect> selection
* @private
*/
setYAxisClipPath(node): void {
const $$ = this;
const {config, state: {margin, width, height}} = $$;
const isRotated = config.axis_rotated;

const left = Math.max(30, margin.left) - (isRotated ? 20 : 0);
const isInner = config.axis_y_inner;

Expand Down
6 changes: 5 additions & 1 deletion src/ChartInternal/internals/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default {
x.domain(domain || sortValue($$.getXDomain(targets), !config.axis_x_inverted));
org.xDomain = x.domain();

zoomEnabled && $$.zoom.updateScaleExtent();
// zoomEnabled && $$.zoom.updateScaleExtent();

subX.domain(x.domain());
$$.brush?.scale(subX);
Expand All @@ -333,6 +333,10 @@ export default {
org.xDomain : getBrushSelection($$).map(subX.invert);

x.domain(domainValue);
// zoomEnabled && $$.zoom.updateScaleExtent();
}

if (withUpdateOrgXDomain || withUpdateXDomain) {
zoomEnabled && $$.zoom.updateScaleExtent();
}

Expand Down
8 changes: 4 additions & 4 deletions src/ChartInternal/internals/legend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ export default {

const insetLegendPosition = {
top: isLegendTop ?
$$.getCurrentPaddingTop() + config.legend_inset_y + 5.5 :
current.height - height - $$.getCurrentPaddingBottom() - config.legend_inset_y,
$$.getCurrentPaddingByDirection("top") + config.legend_inset_y + 5.5 :
current.height - height - $$.getCurrentPaddingByDirection("bottom") - config.legend_inset_y,
left: isLegendLeft ?
$$.getCurrentPaddingLeft() + config.legend_inset_x + 0.5 :
current.width - width - $$.getCurrentPaddingRight() - config.legend_inset_x + 0.5
$$.getCurrentPaddingByDirection("left") + config.legend_inset_x + 0.5 :
current.width - width - $$.getCurrentPaddingByDirection("right") - config.legend_inset_x + 0.5
};

$$.state.margin3 = {
Expand Down
5 changes: 3 additions & 2 deletions src/ChartInternal/internals/size.axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2017 ~ present NAVER Corp.
* billboard.js project is licensed under the MIT license
*/
import {isNumber} from "../../module/util";
import type {AxisType} from "../../../types/types";

export default {
Expand Down Expand Up @@ -52,7 +53,7 @@ export default {
return 8;
}

if (id === "x" && config.axis_x_height) {
if (id === "x" && isNumber(config.axis_x_height)) {
return config.axis_x_height;
}

Expand Down Expand Up @@ -158,7 +159,7 @@ export default {
const $$ = this;
const {state: {axis, current}} = $$;
const xAxisLength = current.width -
$$.getCurrentPaddingLeft(false) - $$.getCurrentPaddingRight();
$$.getCurrentPaddingByDirection("left") - $$.getCurrentPaddingByDirection("right");
const tickCountWithPadding = axis.x.tickCount +
axis.x.padding.left + axis.x.padding.right;

Expand Down
Loading

0 comments on commit ef65b9c

Please sign in to comment.