|
|
@ -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; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|