INNER CODE UNIT · JavaScript
getColor
sheerun/graphqlviz · index.js:280
function getColor (obj) {
var color = this.theme.types.color
if (obj.isEnumType && !this.theme.enums.hide) {
color = this.theme.enums.color
} else if (obj.isInputType && !this.theme.inputs.hide) {
color = this.theme.inputs.color
} else if (obj.isInterfaceType && !this.theme.interfaces.hide) {
color = this.theme.interfaces.color
} else if (obj.isUnionType && !this.theme.unions.hide) {
color = this.theme.unions.color
}
return color
}
templates.edge = _.template(
'${ "\\"" + leftNode.name + "\\"" + (leftNode.port ? ":" + leftNode.port : "")} -> ${ "\\"" + rightNode.name + "\\"" + (rightNode.port ? ":" + rightNode.port : "")}${ _.isEmpty(attributes) ? "" : " [" + attributes.join(" ") + "]"};'
)
templates.edgeAttr = _.template(