Re: [choosel] Dendrogram data import

6 views
Skip to first unread message
Message has been deleted

Lars Grammel

unread,
Feb 29, 2012, 1:37:53 PM2/29/12
to cho...@googlegroups.com
> I have succeeded creating Dendrogram using example data, but unfortunately i
> am not able to create one with my own data.
> My data is in the form of a string.
>
> PVClusterLayout layout = vis
> .add(PV.Layout.Cluster())
> .nodes(PVDom.create(FlareData.data(treeString), new
> FlareData.UnitDomAdapter())
> .nodes()).group(false).orient("left");
>
> So I changed the method "data()" in "FlareData" class to accept string and
> build the units based on the string.
> This is where I am struck, I am wondering how to build the nested units from
> the string.
>
> Example string - (node1(node2(node3) (node4)) (node5))
>
> "node1" has 2 children "node2" and "node5"
> "node2" has 2 children "node3" and "node4"

You will need to parse your data into an object structure and then
implement you own PVDomAdapter for whatever class you decide to use
for you tree nodes. Take a look at the FlareData class for an example
of a PVDomAdapter. Parsing the nodes from the String is a different
issue that is not covered by Protovis-GWT. I suggest asking on
Stackoverflow how you can parse such a String into a object structure
using Java (and mention that you are limited to GWT-compatible
libraries).

Lars

Reply all
Reply to author
Forward
0 new messages