@antv/g6-core
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -63,3 +63,3 @@ import { __assign } from "tslib"; | ||
if (fixSize) { | ||
r = isNumber(fixSize) ? fixSize : fixSize[0]; | ||
r = isNumber(fixSize) ? fixSize / 2 : fixSize[0] / 2; | ||
} else { | ||
@@ -89,3 +89,3 @@ var size = this.getSize(cfg); | ||
if (fixSize) { | ||
r = isNumber(fixSize) ? fixSize : fixSize[0]; | ||
r = isNumber(fixSize) ? fixSize / 2 : fixSize[0] / 2; | ||
} else { | ||
@@ -92,0 +92,0 @@ r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2; |
@@ -50,3 +50,3 @@ var subjectColor = 'rgb(95, 149, 255)'; | ||
export default { | ||
version: '0.8.0', | ||
version: '0.8.1', | ||
rootContainerClassName: 'root-container', | ||
@@ -53,0 +53,0 @@ nodeContainerClassName: 'node-container', |
@@ -163,2 +163,9 @@ import { __assign } from "tslib"; | ||
}); | ||
// if it is a circle combo, diagnal length of the children's bbox should be the diameter of the combo's bbox | ||
if (!model.collapsed && item.getKeyShape().get('type') === 'circle') { | ||
comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width); | ||
comboBBox.height = comboBBox.width; | ||
item.set('bbox', comboBBox); | ||
item.refresh(); | ||
} | ||
var comboModel_1 = item.getModel(); | ||
@@ -165,0 +172,0 @@ (children || []).forEach(function (child) { |
@@ -30,3 +30,3 @@ import { __assign, __extends } from "tslib"; | ||
var size = { | ||
r: Math.hypot(bbox.height, bbox.width) / 2 || Global.defaultCombo.size[0] / 2, | ||
r: bbox.width / 2 || Global.defaultCombo.size[0] / 2, | ||
width: bbox.width || Global.defaultCombo.size[0], | ||
@@ -33,0 +33,0 @@ height: bbox.height || Global.defaultCombo.size[1] |
@@ -609,12 +609,20 @@ import { __assign } from "tslib"; | ||
x = _a.x, | ||
y = _a.y; | ||
y = _a.y, | ||
fixSize = _a.fixSize, | ||
collapsed = _a.collapsed, | ||
fixCollapseSize = _a.fixCollapseSize; | ||
var useFixSize = collapsed ? fixCollapseSize : fixSize; | ||
var _b = isArray(useFixSize) ? useFixSize : [useFixSize, useFixSize], | ||
width = _b[0], | ||
height = _b[1]; | ||
var halfSize = [width / 2, height / 2]; | ||
return { | ||
minX: x, | ||
minY: y, | ||
maxX: x, | ||
maxY: y, | ||
minX: x - halfSize[0], | ||
minY: y - halfSize[1], | ||
maxX: x + halfSize[0], | ||
maxY: y + halfSize[1], | ||
x: x, | ||
y: y, | ||
width: undefined, | ||
height: undefined | ||
width: width, | ||
height: height | ||
}; | ||
@@ -638,2 +646,7 @@ } | ||
comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2; | ||
// if it is a circle combo, diagnal length of the children's bbox should be the diameter of the combo's bbox | ||
if ((combo === null || combo === void 0 ? void 0 : combo.getKeyShape().get('type')) === 'circle') { | ||
comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width); | ||
comboBBox.height = comboBBox.width; | ||
} | ||
Object.keys(comboBBox).forEach(function (key) { | ||
@@ -640,0 +653,0 @@ if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) { |
@@ -66,3 +66,3 @@ "use strict"; | ||
if (fixSize) { | ||
r = (0, _util.isNumber)(fixSize) ? fixSize : fixSize[0]; | ||
r = (0, _util.isNumber)(fixSize) ? fixSize / 2 : fixSize[0] / 2; | ||
} else { | ||
@@ -92,3 +92,3 @@ var size = this.getSize(cfg); | ||
if (fixSize) { | ||
r = (0, _util.isNumber)(fixSize) ? fixSize : fixSize[0]; | ||
r = (0, _util.isNumber)(fixSize) ? fixSize / 2 : fixSize[0] / 2; | ||
} else { | ||
@@ -95,0 +95,0 @@ r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2; |
@@ -56,3 +56,3 @@ "use strict"; | ||
var _default = { | ||
version: '0.8.0', | ||
version: '0.8.1', | ||
rootContainerClassName: 'root-container', | ||
@@ -59,0 +59,0 @@ nodeContainerClassName: 'node-container', |
@@ -170,2 +170,9 @@ "use strict"; | ||
}); | ||
// if it is a circle combo, diagnal length of the children's bbox should be the diameter of the combo's bbox | ||
if (!model.collapsed && item.getKeyShape().get('type') === 'circle') { | ||
comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width); | ||
comboBBox.height = comboBBox.width; | ||
item.set('bbox', comboBBox); | ||
item.refresh(); | ||
} | ||
var comboModel_1 = item.getModel(); | ||
@@ -172,0 +179,0 @@ (children || []).forEach(function (child) { |
@@ -37,3 +37,3 @@ "use strict"; | ||
var size = { | ||
r: Math.hypot(bbox.height, bbox.width) / 2 || _global.default.defaultCombo.size[0] / 2, | ||
r: bbox.width / 2 || _global.default.defaultCombo.size[0] / 2, | ||
width: bbox.width || _global.default.defaultCombo.size[0], | ||
@@ -40,0 +40,0 @@ height: bbox.height || _global.default.defaultCombo.size[1] |
@@ -626,12 +626,20 @@ "use strict"; | ||
x = _a.x, | ||
y = _a.y; | ||
y = _a.y, | ||
fixSize = _a.fixSize, | ||
collapsed = _a.collapsed, | ||
fixCollapseSize = _a.fixCollapseSize; | ||
var useFixSize = collapsed ? fixCollapseSize : fixSize; | ||
var _b = (0, _util.isArray)(useFixSize) ? useFixSize : [useFixSize, useFixSize], | ||
width = _b[0], | ||
height = _b[1]; | ||
var halfSize = [width / 2, height / 2]; | ||
return { | ||
minX: x, | ||
minY: y, | ||
maxX: x, | ||
maxY: y, | ||
minX: x - halfSize[0], | ||
minY: y - halfSize[1], | ||
maxX: x + halfSize[0], | ||
maxY: y + halfSize[1], | ||
x: x, | ||
y: y, | ||
width: undefined, | ||
height: undefined | ||
width: width, | ||
height: height | ||
}; | ||
@@ -655,2 +663,7 @@ } | ||
comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2; | ||
// if it is a circle combo, diagnal length of the children's bbox should be the diameter of the combo's bbox | ||
if ((combo === null || combo === void 0 ? void 0 : combo.getKeyShape().get('type')) === 'circle') { | ||
comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width); | ||
comboBBox.height = comboBBox.width; | ||
} | ||
Object.keys(comboBBox).forEach(function (key) { | ||
@@ -657,0 +670,0 @@ if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) { |
{ | ||
"name": "@antv/g6-core", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"description": "A Graph Visualization Framework in JavaScript", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1192135
35353