Revize d0a10e2e
Přidáno uživatelem Tomáš Šimandl před více než 6 roky(ů)
sources/src/main/webapp/js/components/group.js | ||
---|---|---|
463 | 463 |
}); |
464 | 464 |
|
465 | 465 |
return { |
466 |
groupId: this.id, |
|
467 | 466 |
id: this.id, |
468 | 467 |
name: this.name, |
469 | 468 |
verticesId: verticesId, |
470 | 469 |
verticesEdgeFromId: [], // TODO: what to put in here? |
471 | 470 |
verticesEdgeToId: [], // TODO: what to put in here? |
471 |
position: position, |
|
472 | 472 |
}; |
473 | 473 |
}; |
474 | 474 |
|
sources/src/main/webapp/js/components/vertex.js | ||
---|---|---|
471 | 471 |
archetype: this.archetype, |
472 | 472 |
attributes: props.attributes, |
473 | 473 |
id: this.id, |
474 |
originalId: this.id, |
|
475 | 474 |
text: '', |
476 | 475 |
name: this.name, |
476 |
position: position, |
|
477 | 477 |
}; |
478 | 478 |
}; |
479 | 479 |
|
sources/src/main/webapp/js/graphLoader.js | ||
---|---|---|
27 | 27 |
data.vertices.forEach(function(component) { |
28 | 28 |
var vertex = new Vertex(component); |
29 | 29 |
|
30 |
var position = component.position |
|
30 |
var position = component.position;
|
|
31 | 31 |
|
32 |
if (position === null) { |
|
32 |
if (position === null || app.utils.isUndefined(position)) {
|
|
33 | 33 |
// set random |
34 | 34 |
vertex.setPosition(new Coordinates( |
35 | 35 |
Math.floor(Math.random() * canvasSize), |
... | ... | |
43 | 43 |
app.nodeList.push(vertex); |
44 | 44 |
app.vertexList.push(vertex); |
45 | 45 |
|
46 |
vertexMap[component.originalId] = vertex;
|
|
46 |
vertexMap[component.id] = vertex;
|
|
47 | 47 |
}); |
48 | 48 |
|
49 | 49 |
// construct edges |
... | ... | |
100 | 100 |
|
101 | 101 |
// position |
102 | 102 |
var position = component.position |
103 |
if (position === null) { |
|
103 |
if (position === null || app.utils.isUndefined(position)) {
|
|
104 | 104 |
// set random |
105 | 105 |
group.setPosition(new Coordinates( |
106 | 106 |
Math.floor(Math.random() * canvasSize), |
Také k dispozici: Unified diff
removed originalId + minor fix