#1224 Possibility to style text color of nodes and subgraphs as well as apply classes to subgraphs

This commit is contained in:
Knut Sveidqvist
2020-02-05 19:39:50 +01:00
parent 4d5ecc5518
commit 822df37f8c
4 changed files with 50 additions and 2 deletions

View File

@@ -283,6 +283,9 @@ export const draw = function(text, id) {
logger.debug('Parsing failed');
}
console.log('Classes:', flowDb.getClasses());
console.log('Subgraphs:', flowDb.getSubGraphs());
// Fetch the default direction, use TD if none was found
let dir = flowDb.getDirection();
if (typeof dir === 'undefined') {
@@ -430,6 +433,11 @@ export const draw = function(text, id) {
const te = cluster.select('.label');
te.attr('transform', `translate(${xPos + width / 2}, ${yPos + 14})`);
te.attr('id', id + 'Text');
console.log('Fixing subgraph', id, subG.id, subG.classes); // eslitn-disable-line
for (let j = 0; j < subG.classes.length; j++) {
clusterEl[0].classList.add(subG.classes[j]);
}
}
}