426 |
426 |
* @returns {Element} HTML or SVG DOM element depending on whether the vertex is excluded.
|
427 |
427 |
*/
|
428 |
428 |
this.render = function() {
|
429 |
|
size.width += this.countRelatedArchetypes() * relatedArchetypeIconWidth;
|
430 |
|
|
431 |
429 |
rootElement = excluded ? renderExcluded.call(this) : renderIncluded.call(this);
|
432 |
430 |
|
433 |
431 |
this.setHighlighted(highlighted);
|
... | ... | |
475 |
473 |
|
476 |
474 |
rootElement.appendChild(app.utils.createSvgElement('rect', {
|
477 |
475 |
'height': size.height,
|
478 |
|
'width': size.width,
|
|
476 |
'width': size.width + this.countRelatedArchetypes() * relatedArchetypeIconWidth,
|
479 |
477 |
'x': 1,
|
480 |
478 |
'y': 1,
|
481 |
479 |
}));
|
482 |
480 |
|
483 |
481 |
// archetype icon
|
484 |
482 |
var archetypeIcon = app.dom.createSvgElement('g', {
|
485 |
|
'class': 'archetype',
|
|
483 |
'class': 'archetype-icon',
|
486 |
484 |
'transform': 'translate(8, 8)',
|
487 |
485 |
});
|
488 |
486 |
archetypeIcon.addEventListener('click', archetypeClick.bind(this));
|
... | ... | |
502 |
500 |
|
503 |
501 |
// related archetype icons
|
504 |
502 |
var relatedArchetypeListContainer = app.dom.createSvgElement('g', {
|
505 |
|
'transform': `translate(${size.width - this.countRelatedArchetypes() * relatedArchetypeIconWidth}, 0)`,
|
|
503 |
'transform': `translate(${size.width}, 0)`,
|
506 |
504 |
});
|
507 |
505 |
rootElement.appendChild(relatedArchetypeListContainer);
|
508 |
506 |
|
509 |
507 |
var archetypeIconOrder = 0;
|
510 |
508 |
for (var archetypeIndex in relatedArchetypeMap) {
|
511 |
509 |
var relatedArchetype = app.utils.createSvgElement('g', {
|
512 |
|
'class': 'related-archetype',
|
|
510 |
'class': 'archetype-icon',
|
513 |
511 |
'transform': `translate(${archetypeIconOrder * relatedArchetypeIconWidth}, 8)`,
|
514 |
512 |
});
|
515 |
513 |
relatedArchetype.addEventListener('click', relatedArchetypeClick.bind(this, parseInt(archetypeIndex)));
|
... | ... | |
569 |
567 |
|
570 |
568 |
// icon
|
571 |
569 |
var relatedArchetypeIcon = app.dom.createSvgElement('g', {
|
|
570 |
'class': 'archetype-icon',
|
572 |
571 |
'transform': `translate(15, -10)`,
|
573 |
572 |
});
|
574 |
573 |
relatedArchetypeIcon.addEventListener('click', relatedArchetypeClick.bind(this, parseInt(archetypeIndex)));
|
minor fixes