bug fix in graph drawer

This commit is contained in:
miconis 2021-09-14 10:02:14 +02:00
parent 5a52aed8e1
commit a9ee4dbe61
1 changed files with 7 additions and 6 deletions

View File

@ -252,12 +252,12 @@ public class DedupLocalTest extends DedupTestUtils {
@Ignore @Ignore
public void dedupTest() throws Exception { public void dedupTest() throws Exception {
final String entitiesPath = Paths 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() .toFile()
.getAbsolutePath(); .getAbsolutePath();
DedupConfig dedupConf = DedupConfig.load(readFileFromHDFS(Paths 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() .toFile()
.getAbsolutePath())); .getAbsolutePath()));
@ -320,10 +320,11 @@ public class DedupLocalTest extends DedupTestUtils {
int nCol = (int) Math.round(Math.ceil(Math.sqrt(nVertexes))); int nCol = (int) Math.round(Math.ceil(Math.sqrt(nVertexes)));
int cStepSize = 500; int cStepSize = 500;
int rStepSize = 200; int rStepSize = 200;
for(int i = 0; i < nCol; i++){ for(int i = 0; i < nRow; i++){
for(int j = 0; j < nRow; j++){ for(int j = 0; j < nCol; j++){
frame.addNode(vertexes.get(i + nRow*j), 200 + j*cStepSize, 50 + i*rStepSize); int index = nCol*i + j;
if (i+nRow*j == nVertexes) frame.addNode(vertexes.get(index), 200 + j*cStepSize, 50 + i*rStepSize);
if (index == nVertexes-1)
continue; continue;
} }
} }