English 中文(简体)
参考线中的获取价值归属
原标题:Accessing value attribute in Protovis lines
  • 时间:2010-06-13 10:47:12
  •  标签:
  • protovis

I m 采用Protovis Arc下版,我想在数据集界定的价值财产上加权。 我如何利用它?

Dataset is defined like that: Nodes: ... {nodeName:"Books"} ...

Links: ... {source:1, target:4, value:20} ...

arc.link.add(pv.Line).strokeStyle(功能(d) d. Value > 10 ? “#cc0000” : “#ee” ; -

问题回答

The d property refer to the node. 此处的“m>node上定义的“数值>;链接权重在links上,这就是为什么财产功能没有达到你预期的效果。

您可以重新确定自己的财产功能,以获取链接(而不是数据)。 链接数据与上级小组有关,作为第二点:

.strokeStyle(function(d, p) p.value > 10 ? "#c00" : "#eee")

layout documentation。 另见pv.Layout.Network。 参考资料:

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.





相关问题
printing protovis output (programmatically)

I m pondering switching to protovis for visualizations. One thing that keeps me skeptical however - since protovis creates its output as a div in a browser, I wonder if there is any at least semi-...

How do I animate a protovis streamgraph?

I m having trouble figuring out how to animate a protovis streamgraph. I think the best way is to simply pass an array of i, j indexes to .layers() and have the .x() and .y() functions look up the ...

Giving non-leaf nodes data/values in protovis

My data looks similar to this: var root = { node1: { node2: 4, node3: 2 }, node4: { node5: 3 } }; Which is similar to how they suggest the data be laid out ...

Javascript: array.forEach() sometimes not working

this is my code snippet, where the program doesn t enter the foreach loop: var ct = new Array(); ct["me"]= {"name" : "Jakub"}; ct["you"]= {"name" : "stack"}; ct.forEach(function (c){ document....

Trigger resize event on print

I have a div in which I create a chart using protovis. The div has width: 100% and height: 100% and the code to create the chart uses $( #chart ).width() and $( #chart ).height() to get the size of ...

参考线中的获取价值归属

I m 采用Protovis Arc下版,我想在数据集界定的价值财产上加权。 我如何利用它?

Loading a javascript library in javax.script?

I want to run Protovis javascript from Java and get the evaluated SVG code. I am using javax.script.* to run the Javascript: public static void EvalScript() throws Exception { ...

热门标签