I am trying to ensure that no lines or shapes overlap in a generated aspose diagram. As I found in anopther pose, I tried implementing this strategy, but am still not seeing any changes.
diagram
.getPages()
.getPage(0)
.getPageSheet()
.getPageLayout()
.getLineAdjustFrom()
.setValue(aspose.LineAdjustFromValue.ALL_LINES);
compact-tree.png (18.7 KB)
@hinkley.dev
A ticket as DIAGRAMJAVA-51048 has been logged in our issue management system to further analyze this case. We will look into its details and let you know as soon as the ticket is resolved. Please be patient and spare us some time.
We are sorry for the inconvenience.
@hinkley.dev
Please provide the code and template file that generated this issue so that we can continue to dig deeper.
Thanks.
Here is a code snippet and the template file. We have also tried using LineAdjustFrom
as well as other things, but are unable to get a situation where lines are not intersectiong.connection.zip (18.6 KB)
const connectors = [];
_.each(payload.edges, (edge) => {
//https://docs.aspose.com/diagram/net/working-with-connector-type-shape/
const connector = new aspose.Shape();
const from = findVisioId(payload.nodes, edge.from);
const to = findVisioId(payload.nodes, edge.to);
if (!_.isBlank(edge.label)) {
connector
.getText()
.getValue()
.add(new aspose.Txt(_.toString(edge.label)));
connectors.push({ connector, from, to, text: edge.label });
}
connector.getLine().getLineWeight().setValue(0.01388);
const connecter1Id = diagram.addShape(connector, 'Dynamic connector', 0);
connector.setConnectorsType(aspose.ConnectorsTypeValue.STRAIGHT_LINES);
connector
.getLayout()
.getShapeRouteStyle()
.setValue(aspose.ShapeRouteStyleValue.CENTER_TO_CENTER);
connector.sendToBack();
if (_.isBlank(from) || _.isBlank(to)) return;
page.connectShapesViaConnector(
from,
aspose.ConnectionPointPlace.BOTTOM,
to,
aspose.ConnectionPointPlace.BOTTOM,
connecter1Id
);
});
//https://docs.aspose.com/diagram/java/create-layout-and-auto-fit-shapes/
const flowChartOptions = new aspose.LayoutOptions();
flowChartOptions.setLayoutStyle(aspose.LayoutStyle.COMPACT_TREE);
flowChartOptions.setDirection(aspose.LayoutDirection.DOWN_THEN_RIGHT);
flowChartOptions.setSpaceShapes(2);
flowChartOptions.setEnlargePage(true);
diagram.layout(flowChartOptions);
diagram
.getPages()
.getPage(0)
.getPageSheet()
.getPageLayout()
.getLineAdjustFrom()
.setValue(aspose.LineAdjustFromValue.ALL_LINES);
const options = new aspose.DiagramSaveOptions(aspose.SaveFileFormat.VSDX);
// set Auto fit page property
options.setAutoFitPageToDrawingContent(true);
diagram.save(fileName, options);
@hinkley.dev
Thanks for the code and template file.
We will further look into its details and keep you posted with the status of ticket resolution.
Please be patient and spare us some time.
Thanks.