# Help With A Chord Diagram

Hi again,

I am in the middle of creating a chord diagram, and I now have all the data in place to make it happen. However, I am not sure of the best way to go about it. Attached is my .gh file with an example of how I want it to look (thanks .gh forum). I also tried to internalize my excel file/upload it with no success, I am not sure how to do this (image is attached).

My pseudo code (logic) for the diagram is to:

1. Create points for the two data branches on the edge of the matrix.
2. Each cell should either have a number or not - if it does have number, draw that many lines between the points of the two branches - exp. if the cell says six - six lines are drawn between the two edge points - this could also be done with line thickness as a way to denote the relative strength of the cell

I have used the ReadExcelSheet from TT Toolbox to get the branches and have put the lettering from each on the outside of the circle. These two lists are matched so a line between the two branches should work.

I am struggling with associating the branches with points as all of the text functions I have seen donāt have outputs except bake and I need to have them at a cartesian location (I do recognize Human can break down a text to its location).

I am unsure how to make the excel data I have read like I want. Do I construct a domain and then try to pull the number from there? Or is the domain not already built, and it is a matter of matching the lists together?

I hope I explained myself clear enough - and I have tried for many hours to figure it out with limited success.

image|690x194

Updated Chord.gh (24.9 KB)

If someone could even help to link a text object to a point, so I could then try to figure out how to connect the points, that would be an awesome start. I need the labels that go around my circle to have points associated with them.

Thanks you

the data points on the circle are sorted like this:

so first value will be ālinkedā to point#0, second value to point#1ā¦ and so on

I donāt have an Excel license / TT plugin, if you want you can export / attach your data as csv?

I would have responded earlier but I have been running around for the morning.

GH forums wont allow me to attach a csv - unless you know a work around?

I will attempt to link those points to the data - I thought of this of course, but I couldnāt think of a component that would associate the point with the excel file, therefore I was attempting to extract a point from the text itself.

I will soon let you know of success or failure.

Thanks

Many other ways to share files such as Google Drive. Or just copy/paste the entire .csv file into a GH text panel.

Thank you!

Relationship Matrix_.xlsx

Google Drive is so much better than Microsoft OneDrive!

Here it is in a GH text panel:
Relationship Matrix.gh (7.5 KB)

I need to get better.

I just opened both the .csv file, and the text panel file and I noticed that the data doesnāt appear like it does in the xlsx file - a glaring difference is the first row which doesnāt read all 64 headers as one branch, but now has 5 branches.

However, I have been trying to read the data in this format in GH the last couple days so I can see how this is very useful, so long as the data matches the original sheet.

Lets say that the data did match the original sheet, would it be possible to use a āgreater than componentā, and a ādispatchā component to filter the text panel for anything āgreater than, or equal to oneā and drawing a line between the x and y trend (which is what the data is) exp. P5 and P10.

Thank you

This is how I would start to parse the .csv data using Split (Text Split) with a comma as āCā input, but honestly, Iām not following this thread in detail and at a glance, itās too much work to understand how you want to use this?

Ok, I understand

Thanks for the help!

thanks @Joseph_Oster for the Google Sheet thing

@brendan.webb how is your data to be interpreted?
for instance, how are to be interpreted empty cells (like F5) in the chord diagram?
same question for (for instance) F7 that carries a value but itās a zero, or like D21 that has value 11?
what data identifies the ābetween this pair there is a chordā ?

Hi

Empty cells, and 0ās, are to be interpreted as no connection between the points. I should have selected all 0ās in the excel file and made them blank to make this clearā¦ Anywhere there is a number 1 or greater, that should be a line between the two points on the x and y. I have yet to decide how I want to interpret that number further (for example should the higher the number is, the brighter the hue) - to begin though I am just attempting to ensure there is a curve connection between the x and y where appropriate.

it should look something like this

Updated Chord_Re.gh (23.6 KB)

2 Likes

Based on that description, Iāve done some data cleanup - just enough to know that this model is pretty far from OKā¦

Updated Chord_2021Apr29a.gh (28.6 KB)

P.S. @inno, you are way more patient than I am!

I ended up adding a column in Google Sheet and using the formula TextJoin(";";False;A1:BM1) to get all the cells of that row separated by a ā;ā (a few header cells had a Return stroke to be deleted otherwise the whole thing was not working properly)

Sorry for the delayed response - this is the first time that I have been able to get to my computer since I last messaged here - I will look at everything this afternoon but from the images, it looks great! Thank you so much for the help!!! I have been struggling with this for a while, and hopefully the script you have given will help me understand how data from excel is translated in GH.

:)

Based on your comment about patience, Iām assuming that I didnāt give a good enough description in my original post for adequate understanding of the problemā¦ I will work on my clarity in the futureā¦ Thank you so much for the help!!! I would have responded earlier but this is the first time that I have been able to get to my computer since the last time I messaged here.

Cheers

1 Like