Browse Source

fix: miniMap simple node render

master
smallstonesk 5 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 { class MiniMapSimpleNode extends NodeView {
protected body: SVGRectElement | undefined; protected renderMarkup() {
return this.renderJSONMarkup({
protected readonly markup: Markup.JSONMarkup = {
tagName: 'rect', tagName: 'rect',
selector: 'body', selector: 'body',
attrs: { });
fill: '#D9D9D9'
} }
};
updateNodeSize() { update() {
var size = this.cell.getSize(); super.update({
this.setAttrs(size, this.body); 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