Fix for legacy class diagram

This commit is contained in:
Knut Sveidqvist
2022-07-04 19:37:56 +02:00
parent bc6830cbdb
commit 10f56129c1
8 changed files with 57 additions and 75 deletions

View File

@@ -1,19 +1,18 @@
import { line, curveBasis } from 'd3';
import { lookUpDomId, relationType } from './classDb';
import utils from '../../utils';
import { log } from '../../logger';
let edgeCount = 0;
export const drawEdge = function (elem, path, relation, conf) {
export const drawEdge = function (elem, path, relation, conf, diagObj) {
const getRelationType = function (type) {
switch (type) {
case relationType.AGGREGATION:
case diagObj.db.relationType.AGGREGATION:
return 'aggregation';
case relationType.EXTENSION:
case diagObj.db.EXTENSION:
return 'extension';
case relationType.COMPOSITION:
case diagObj.db.COMPOSITION:
return 'composition';
case relationType.DEPENDENCY:
case diagObj.db.DEPENDENCY:
return 'dependency';
}
};
@@ -150,10 +149,11 @@ export const drawEdge = function (elem, path, relation, conf) {
* @param {SVGSVGElement} elem The element to draw it into
* @param classDef
* @param conf
* @param diagObj
* @todo Add more information in the JSDOC here
*/
export const drawClass = function (elem, classDef, conf) {
log.info('Rendering class ' + classDef);
export const drawClass = function (elem, classDef, conf, diagObj) {
log.debug('Rendering class ', classDef, conf);
const id = classDef.id;
const classInfo = {
@@ -164,7 +164,7 @@ export const drawClass = function (elem, classDef, conf) {
};
// add class group
const g = elem.append('g').attr('id', lookUpDomId(id)).attr('class', 'classGroup');
const g = elem.append('g').attr('id', diagObj.db.lookUpDomId(id)).attr('class', 'classGroup');
// add title
let title;