Skip to content

Commit

Permalink
refactor: pass the complete node size to the layout for computation (#…
Browse files Browse the repository at this point in the history
…6473)

* fix: pass the complete node size to the layout for computation

* chore: update g version
  • Loading branch information
yvonneyx authored Nov 5, 2024
1 parent 858a23f commit d912097
Show file tree
Hide file tree
Showing 20 changed files with 298 additions and 309 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
]
},
"devDependencies": {
"@antv/g-canvas": "^2.0.20",
"@antv/g-plugin-rough-canvas-renderer": "^2.0.20",
"@antv/g-canvas": "^2.0.22",
"@antv/g-plugin-rough-canvas-renderer": "^2.0.22",
"@babel/core": "^7.26.0",
"@babel/plugin-transform-typescript": "^7.25.9",
"@changesets/cli": "^2.27.9",
Expand All @@ -43,12 +43,12 @@
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@swc/core": "^1.7.42",
"@swc/core": "^1.8.0",
"@swc/jest": "^0.2.37",
"@types/d3-hierarchy": "^3.1.7",
"@types/jest": "^29.5.14",
"@types/jsdom": "^21.1.7",
"@types/node": "^20.17.5",
"@types/node": "^20.17.6",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"chalk": "^4.1.2",
Expand All @@ -69,7 +69,7 @@
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-packagejson": "^2.5.3",
"rimraf": "^5.0.10",
"rollup": "^4.24.3",
"rollup": "^4.24.4",
"rollup-plugin-polyfill-node": "^0.13.0",
"rollup-plugin-visualizer": "^5.12.0",
"stats.js": "^0.17.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/g6-extension-3d/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
},
"dependencies": {
"@antv/g-device-api": "^1.6.13",
"@antv/g-plugin-3d": "^2.0.22",
"@antv/g-plugin-device-renderer": "^2.1.4",
"@antv/g-plugin-dragndrop": "^2.0.15",
"@antv/g-webgl": "^2.0.24",
"@antv/g-plugin-3d": "^2.0.24",
"@antv/g-plugin-device-renderer": "^2.2.1",
"@antv/g-plugin-dragndrop": "^2.0.17",
"@antv/g-webgl": "^2.0.26",
"@antv/layout": "1.2.14-beta.8",
"@antv/util": "^3.3.10"
},
"devDependencies": {
"@antv/g": "^6.1.4",
"@antv/g-canvas": "^2.0.20",
"@antv/g": "^6.1.6",
"@antv/g-canvas": "^2.0.22",
"@antv/g6": "workspace:*"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ export const PerformanceDiagnosis = () => {
};

const size = {
'pre-inspection': [240, 80],
problem: [200, 80],
'pre-inspection': [240, 120],
problem: [200, 120],
inspection: [330, 100],
solution: [240, 60],
solution: [200, 120],
}[d.data!.type as string] || [200, 80];

Object.assign(style, {
Expand Down Expand Up @@ -144,9 +144,6 @@ export const PerformanceDiagnosis = () => {
},
layout: {
type: 'antv-dagre',
nodeSize: [200, 40],
nodesep: 70,
ranksep: 5,
},
behaviors: ['zoom-canvas', 'drag-canvas', 'hover-element', 'click-select'],
};
Expand Down
6 changes: 3 additions & 3 deletions packages/g6-extension-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"type-check": "tsc --noEmit -p tsconfig.test.json"
},
"dependencies": {
"@antv/g": "^6.1.4",
"@antv/g-svg": "^2.0.17",
"@antv/react-g": "^2.0.20"
"@antv/g": "^6.1.6",
"@antv/g-svg": "^2.0.19",
"@antv/react-g": "^2.0.22"
},
"devDependencies": {
"@ant-design/icons": "^5.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/g6-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"type-check": "tsc --noEmit -p tsconfig.test.json"
},
"dependencies": {
"@antv/g": "^6.1.4",
"@antv/g-canvas": "^2.0.20",
"@antv/g": "^6.1.6",
"@antv/g-canvas": "^2.0.22",
"@antv/g6": "workspace:*",
"cac": "^6.7.14",
"canvas": "^2.11.2"
Expand Down
1 change: 0 additions & 1 deletion packages/g6/__tests__/demos/case-org-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ export const caseOrgChart: TestCase = async (context) => {
},
layout: {
type: 'dagre',
nodeSize: [150, 60],
},
autoFit: 'view',
behaviors: ['level-of-detail', 'zoom-canvas', 'drag-canvas'],
Expand Down
4 changes: 1 addition & 3 deletions packages/g6/__tests__/demos/layout-antv-dagre-flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const layoutAntVDagreFlow: TestCase = async (context) => {
style: {
size: [60, 30],
radius: 8,
labelFill: '#fff',
labelPlacement: 'center',
labelText: (d) => d.id,
},
Expand All @@ -26,9 +27,6 @@ export const layoutAntVDagreFlow: TestCase = async (context) => {
},
layout: {
type: 'antv-dagre',
nodesep: 100,
ranksep: 70,
controlPoints: true,
},
behaviors: ['drag-element', 'drag-canvas', 'zoom-canvas'],
});
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 12 additions & 12 deletions packages/g6/__tests__/snapshots/layouts/custom-dagre/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d912097

Please sign in to comment.