Add/delete nodes and edges in a graph

36 views
Skip to first unread message

Gabi Purcaru

unread,
Nov 17, 2010, 10:47:57 AM11/17/10
to protovis
I want to use a network layout to add and delete nodes dynamically. I
can't find that in the damn thing in the API. Could you help me out?

Jan van Gemert

unread,
Nov 18, 2010, 7:46:04 AM11/18/10
to protovis
Hi,

I haven't used the network layout myself, but usually you "delete"
things by setting .visible(false).

Hope that helps,

Jan

Brad Williams

unread,
Nov 19, 2010, 6:07:13 PM11/19/10
to protovis
Hi there,
I've not done this before, but I have noticed a few posts in this
group about how to do what you're after.
I'd suggest searching the discussions.

I think it can be done as suggested, by changing the visibility of the
node and associated link, however that wont actually remove the node.
I believe you can update the data set used to render the graph (add or
delete from) and the rerender the graph.

Hope this helps.

Brad

Gabi Purcaru

unread,
Nov 22, 2010, 4:42:21 PM11/22/10
to protovis
Thanks for your reply; I'm updating the data set as suggested; still,
I have a problem: after the modifications I need to reset() the
network, and it doesn't calculate the linkDegree correctly all the
time, and the nodes get bigger and bigger and eventually they reset to
their good size. Any suggestions?

Erik Post

unread,
Nov 23, 2010, 8:00:07 AM11/23/10
to prot...@googlegroups.com
Hi Gabi,

I noticed this too a while ago. It's a bug that was fixed in the
development version. See
line 294-296 of
http://gitorious.org/protovis/protovis/commit/3ec4c9b296db63c46643ed7db009f9cd188d4511

Cheers,
Erik

> --
> You received this message because you are subscribed to the Google Groups "protovis" group.
> To post to this group, send email to prot...@googlegroups.com.
> To unsubscribe from this group, send email to protovis+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/protovis?hl=en.
>
>

Gabi Purcaru

unread,
Nov 23, 2010, 2:24:56 PM11/23/10
to protovis
That worked like a charm. Thanks!

On Nov 23, 3:00 pm, Erik Post <eriksen...@gmail.com> wrote:
> Hi Gabi,
>
> I noticed this too a while ago. It's a bug that was fixed in the
> development version. See
> line 294-296 ofhttp://gitorious.org/protovis/protovis/commit/3ec4c9b296db63c46643ed7...
Reply all
Reply to author
Forward
0 new messages