INNER CODE UNIT · JavaScript
graph
sheerun/graphqlviz · index.js:431
function graph (processedTypes, typeTheme) {
var result = ''
if (typeTheme.group) {
result += 'subgraph cluster_' + groupId++ + ' {'
if (typeTheme.color) {
result += 'color=' + typeTheme.color + ';'
}
if (typeTheme.groupLabel) {
result += 'label="' + typeTheme.groupLabel + '";'
}
}
result += _.map(processedTypes, v => {
// sort if desired
if (this.theme.field.sort) {
v.fields = _.sortBy(v.fields, 'name')
}