Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions example/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,12 @@ const config = {
},
labelRender: (label) => {
if(!label) {
return (
<span className="visual-modeling-label">
connection
</span>
)
return 'connection';
}

return (
<Tooltip title="自定义label">
<span className="visual-modeling-label">{label}</span>
{label}
</Tooltip>
)
}
Expand Down Expand Up @@ -154,7 +150,7 @@ class Component extends React.Component {
onLoaded={(canvas) => {
this.canvas = canvas;
canvas.on('events', (data) => {
console.log(data);
// console.log(data);
});
}}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-visual-modeling",
"version": "1.0.32",
"version": "1.0.33",
"description": "一个基于React的数据可视化建模的DAG图,适用于UML,数据库建模,数据仓库建设等业务",
"main": "dist/index.js",
"pack": "pack/index.js",
Expand Down
6 changes: 6 additions & 0 deletions src/canvas/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,12 @@ export default class TableNode extends Node {
this.fieldsList = [];
_.set(this, 'options._columns', newCol);
this._addFields();

// 获取所有columns的宽度
let width = getWidth(newCol);
let textWidth = width - OPER_ICON_WIDTH;
$(this.dom).find('.title').css('width', width);
$(this.dom).find('.title-text').css('width', textWidth);
}

_createTitleEndpoint() {
Expand Down
4 changes: 3 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const actions = [
icon: 'table-build-icon table-build-icon-quanping2',
title: '居中',
onClick: (canvas) => {
canvas.focusCenterWithAnimate();
canvas.focusCenterWithAnimate(undefined, () => {
console.log('complete!!!')
});
}
}
];