Graphics Reference
In-Depth Information
Remove the
BarLayer
altogether. Then remove the anchor on the label
so that it, too, is centered, but move it down further underneath the icon.
Change these label mappings:
var
labelLayer =
nodeLayer.addLayer(aperture.LabelLayer)
.mapAll({
'offset-y'
: 8,
'font-size'
: 12,
'text-anchor'
:
'start'
});
to the following:
var
labelLayer =
nodeLayer.addLayer(aperture.LabelLayer)
.mapAll({
'offset-y'
: 24,
'font-size'
: 12
});
Lastly, modify the layout call from
flow
:
aperture.layout.flow(data,
function
() {
makeMyGraph(data);
});
To use the
organic
layout instead:
aperture.layout.organic(data,
function
() {
makeMyGraph(data);
});
When the modified code is run, you should see the visualization shown in
Figure 12-6
.
Note that organic layout has a degree of variability, so the node
locations will not be exactly the same in yours.