Browse Source

fix: miniMap simple node render

master
smallstonesk 4 years ago
parent
commit
7a25906e27
  1. 30
      packages/core/src/components/miniMapSimpleNode/index.tsx

30
packages/core/src/components/miniMapSimpleNode/index.tsx

@ -1,30 +1,22 @@
import {NodeView, Markup} from '@antv/x6';
import {NodeView} from '@antv/x6';
class MiniMapSimpleNode extends NodeView {
protected body: SVGRectElement | undefined;
protected readonly markup: Markup.JSONMarkup = {
protected renderMarkup() {
return this.renderJSONMarkup({
tagName: 'rect',
selector: 'body',
attrs: {
fill: '#D9D9D9'
});
}
};
updateNodeSize() {
var size = this.cell.getSize();
this.setAttrs(size, this.body);
update() {
super.update({
body: {
refWidth: '100%',
refHeight: '100%',
fill: '#D9D9D9',
}
render() {
this.empty();
const doc = this.parseJSONMarkup(this.markup, this.container);
this.body = doc.selectors.body as SVGRectElement;
this.container.append(doc.fragment);
this.updateNodeSize();
this.updateTransform();
return this;
});
}
}

Loading…
Cancel
Save