tachybase_todo/packages/plugins/@tachybase/plugin-graph-collection-manager/src/client/components/ViewNode.tsx

23 lines
448 B
TypeScript
Raw Normal View History

2023-01-11 11:58:47 +08:00
import { NodeView } from '@antv/x6';
export class SimpleNodeView extends NodeView {
protected renderMarkup() {
return this.renderJSONMarkup({
tagName: 'rect',
selector: 'body',
});
}
update() {
const attrs = this.cell.getAttrs();
const fill = attrs.hightLight ? '#1890ff' : 'gray';
super.update({
body: {
refWidth: '50px',
refHeight: '100px',
fill: fill,
},
});
}
}