Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/main/scripts/neo4jd3.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function Neo4jD3(_selector, _options) {
neo4jDataUrl: undefined,
nodeOutlineFillColor: undefined,
nodeRadius: 25,
nodeTextProperty: undefined,
nodeTextColor: '#ffffff',
relationshipColor: '#a5abb6',
zoomFit: false
},
Expand Down Expand Up @@ -227,7 +229,7 @@ function Neo4jD3(_selector, _options) {
.attr('class', function(d) {
return 'text' + (icon(d) ? ' icon' : '');
})
.attr('fill', '#ffffff')
.attr('fill', options.nodeTextColor)
.attr('font-size', function(d) {
return icon(d) ? (options.nodeRadius + 'px') : '10px';
})
Expand All @@ -238,7 +240,10 @@ function Neo4jD3(_selector, _options) {
})
.html(function(d) {
var _icon = icon(d);
return _icon ? '&#x' + _icon : d.id;
var text = d.id;
if (options.nodeTextProperty)
text = d.properties[options.nodeTextProperty];
return _icon ? '&#x' + _icon : text;
});
}

Expand Down