The d
property refers to the node. There's no value
attribute defined on the node in this case; the link weights are defined on the links, which is why the property function isn't doing what you expect.
You can rewrite your property function to access the link (rather than node) data. The link data is associated with the link's parent panel, and is available as the second argument:
.strokeStyle(function(d, p) p.value > 10 ? "#c00" : "#eee")
There's more of an explanation in the layout documentation. And see also the pv.Layout.Network
API reference:
The link
mark is added to a child
panel, whose data
property is
defined as layout's links
property.
The link's data
property is then a
two-element array of the source node
and target node. Thus, poperties such
as strokeStyle
and fillStyle
can
be overridden to compute properties
from either the node data (the first
argument) or the link data (the second
argument; the parent panel data)
dynamically.