ast-parentchild
Version:
Convert your JavaScript file to acron AST format and then output a json file whihc have parent-child realtionship between nodes
24 lines (18 loc) • 444 B
JavaScript
// import Node from './node.js';
const Node = require('./node.js');
module.exports = class DummyNode extends Node {
constructor(child) {
super(null, [child]);
this.r = 4;
}
_render(g) {
g.append('circle')
.attr('cx', this.r)
.attr('cy', this.r)
.attr('r', this.r);
this.width = this.r * 2;
this.height = this.r * 2;
this.linkX = this.r;
this.linkY = this.r;
}
}