更新时间:2023-01-26 08:47:54
I've enhanced the system to take an array of user information. This is then used to build the nodes.
*Latest Code http://jsfiddle.net/LsMZp/49/ *
the remaining issues here.
x and y are set to 0.
$.each(userData, function( index, value ) {
var defs = patternsSvg.append('svg:defs');
defs.append('svg:pattern')
.attr('id', "--"+index+"-"+value.userName.toLowerCase())
.attr('patternUnits', 'userSpaceOnUse')
.attr('width', 100)
.attr('height',100)
.append('svg:image')
.attr('xlink:href', value.userImage)
.attr('x', 0)
.attr('y', 0)
.attr('width', 100)
.attr('height', 100);
});