Browse Source

fix: miniMap simple node render

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

36
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() {
var size = this.cell.getSize();
this.setAttrs(size, this.body);
} }
render() { update() {
this.empty(); super.update({
const doc = this.parseJSONMarkup(this.markup, this.container); body: {
this.body = doc.selectors.body as SVGRectElement; refWidth: '100%',
this.container.append(doc.fragment); refHeight: '100%',
this.updateNodeSize(); fill: '#D9D9D9',
this.updateTransform(); }
return this; });
} }
} }

Loading…
Cancel
Save