Protovis - Sunbursts : Continuation Of "To Create Protovis Sunburst Charts : Python Script To Create Dataset In Json Format (Or) Parent - Child Json"
0
0
Entering edit mode
11.1 years ago
ram.dsramesh ▴ 40

Help!! Please check this link to find the better clue of my question To Create Protovis Sunburst Charts : Python Script To Create Dataset In Json Format (Or) Parent - Child Json

Thanks for a.zielezinski for the python script. Hoping that you followed me previous question and got an idea about what I am talking. Yes, it's about Sunbursts charts from Protovis check here

enter image description here

Now going ahead with the Sunburst chart, the problem is - if you see the diagram the last peripheral nodes are coloured based on the function. (You can check it from the Protovis page link given above)

function update(method) {
  switch (method) {
    case "byte": partition.size(function(d) d.nodeValue); break;
    case "file": partition.size(function(d) d.firstChild ? 0 : 1); break;
  }
  vis.render();
}

I have the same excel file like this which is read using the python script and rewritten in json format as presented in my previous post. I have to use the following excel and use the final BEI_STATUS as the index for colouring the last peripheral nodes.

L1            L2          L3        L4         L5        GENE_NAME    BEI_STATUS
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRD            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRA3            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRA6            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRQ            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRA5            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRP            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRA2            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRB3            1
Ion channel    LGIC     CYS_LOOP    GABAA    ANIONIC    GABRG3            1

Writing data in json format is fine and easy, but the difficulty now here is how to change or re-write the function which is used to colour the peripheral nodes. I need help in changing the function specified above which can accommodate my parameter (BEI_STAUTS) for colouring. One thing should be noted here is graph should be ended till GENE_NAME and the colour of the GENE_NAME should be based on the numerical values in BEI_STATUS.

Any sort of help appreciated. Thanks in advance

python • 5.8k views
ADD COMMENT
0
Entering edit mode

I am not sure I understood the question. Do you want to colour the peripheral notes by the variable "BEI_STATUS", instead of the function. Is this correct?

ADD REPLY
0
Entering edit mode

Yes!! that's correct :)

ADD REPLY

Login before adding your answer.

Traffic: 3156 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6