From a9ee4dbe6176df64d89391fdd609d11c04a3a1e3 Mon Sep 17 00:00:00 2001 From: miconis Date: Tue, 14 Sep 2021 10:02:14 +0200 Subject: [PATCH] bug fix in graph drawer --- .../test/java/eu/dnetlib/pace/DedupLocalTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dnet-dedup-test/src/test/java/eu/dnetlib/pace/DedupLocalTest.java b/dnet-dedup-test/src/test/java/eu/dnetlib/pace/DedupLocalTest.java index ad6fa29..71421e7 100644 --- a/dnet-dedup-test/src/test/java/eu/dnetlib/pace/DedupLocalTest.java +++ b/dnet-dedup-test/src/test/java/eu/dnetlib/pace/DedupLocalTest.java @@ -252,12 +252,12 @@ public class DedupLocalTest extends DedupTestUtils { @Ignore public void dedupTest() throws Exception { final String entitiesPath = Paths - .get(DedupLocalTest.class.getResource("/eu/dnetlib/pace/examples/publications.to.fix.json").toURI()) + .get(DedupLocalTest.class.getResource("/eu/dnetlib/pace/examples/openorgs.to.fix.json").toURI()) .toFile() .getAbsolutePath(); DedupConfig dedupConf = DedupConfig.load(readFileFromHDFS(Paths - .get(DedupLocalTest.class.getResource("/eu/dnetlib/pace/config/pub.prod.tree.conf.json").toURI()) + .get(DedupLocalTest.class.getResource("/eu/dnetlib/pace/config/orgs.tree.conf.json").toURI()) .toFile() .getAbsolutePath())); @@ -320,10 +320,11 @@ public class DedupLocalTest extends DedupTestUtils { int nCol = (int) Math.round(Math.ceil(Math.sqrt(nVertexes))); int cStepSize = 500; int rStepSize = 200; - for(int i = 0; i < nCol; i++){ - for(int j = 0; j < nRow; j++){ - frame.addNode(vertexes.get(i + nRow*j), 200 + j*cStepSize, 50 + i*rStepSize); - if (i+nRow*j == nVertexes) + for(int i = 0; i < nRow; i++){ + for(int j = 0; j < nCol; j++){ + int index = nCol*i + j; + frame.addNode(vertexes.get(index), 200 + j*cStepSize, 50 + i*rStepSize); + if (index == nVertexes-1) continue; } }