Do you have a notebook that you’re working on as a starting point? There are so many potential variations on this theme that it’s hard to answer.
I’d point out, though, that the Simple D3 template does pretty much what you request. It generates circles whose cx and r attributes are generated by functions.
The specific problem I’d like to solve is that I’d like to pass a “tile” to the drawing function.
The tile might be a polygon, or a path, or a rectangle, or maybe someday an image. I understand how to set attributes of an object using variables but I don’t know how to set a different underlying object which might have different attributes. So I might want my “tile” to be a rectangle with specific attributes, or a path with different attributes, but those objects have different attribute families.
Having said that, if you want to use wallpaper groups to generate tilings, I think you would get more idiomatic D3 code by using the group to generate data that describes the tiling (perhaps a list of transforms) and then using a construct like
I think that this will generally be more efficient than appending a bunch of polygons separately. I did something like that when generating Penrose tilings here:
Of course, Penrose tilings are not periodic like wallpaper tilings but the idea behind the code is similar.