Graphics Reference
In-Depth Information
.from(
'rose.linksIn.totals.sectorMax'
).using(labelKey);
linkLayer.map(
'target'
)
.from(
'target'
);
linkLayer.map(
'target-offset'
)
.from(
'rose.linksIn.totals.sectorMax'
).using(roseBaseKey);
linkLayer.map(
'stroke'
)
.from(
'other.group'
).using(roseColorKey);
linkLayer.map(
'stroke-width'
)
.from(
'weight'
).using(
new
aperture.Scalar(
'weight'
,[0,1])
.mappedTo([0,20]));
linkLayer.map(
'opacity'
).from(
function
() {
return this
.other ===
this
.target? 0.9 : 0.35;
});
// ...
Next, add the interaction functions. On click, hide the rose representations,
add the links for that node, and then redraw. When the viewer clicks off,
restore the original state.
// ...
var
selected =
null
;
inRose.map(
'visible'
).filter(
function
() {
return
!selected;});
outRose.map(
'visible'
).filter(
function
() {
return
!selected;});
nodeLayer.on(
'click'
,
function
(event) {
if
(selected !== event.data) {
selected = event.data;
linkLayer.all(event.data.links);
usa.all().redraw();
}
return true;