我正在使用Draw2D来渲染图表。我正在渲染父矩形和子矩形:
var parent = new draw2d.shape.basic.Rectangle(90, 30);
var child1 = new draw2d.shape.basic.Rectangle(30, 30);
var child2 = new draw2d.shape.basic.Rectangle(30, 30);
var child3 = new draw2d.shape.basic.Rectangle(30, 30);
parent.addFigure(child1, new draw2d.layout.locator.CenterLocator(parent));
parent.addFigure(child2, new draw2d.layout.locator.CenterLocator(parent));
parent.addFigure(child3, new draw2d.layout.locator.CenterLocator(parent));
然而,根据the documentation,
在图中添加子图。交出数字没有 支持拖放操作。它只是一个装饰者 连接。主要用于标签或其他花式装饰: - )
此外,Figure
对象没有方法insertFigure
和removeFigure
。
如何在Draw2D中正确包装一个图形?
答案 0 :(得分:0)
似乎,我应该使用draw2d.shape.layout.VerticalLayout
或draw2d.shape.layout.HorizontalLayout
来统一数字,但这些类仍然没有插入或删除子节点的方法。