Up till now we’ve been considering a solution for Focus node explorer with d3.js that leverages massaging the data from Analyzing site content with GAS using the stuff we already had from d3.js. That solution also means that you can use the same solution for any data, regardless of how you created it.  However, Excel doesn’t even have to be involved at all. Using the standalone html file generated in Focus node explorer with d3.js, we just need to replace the data source function. 
In this case I’m going to  use the raw data from Analyzing site content with GAS and massage it directly. 

The source data

When I first wrote this, Google Drive was able to be used as a hosting service. That’s been deprecated, so now I’m using Cloud Storage and Apps Script to write the results to as well as host it. If you want you can use Drive, but you’ll need to find somewhere to host the result. How to do all that is described in Node focus on Blogger posts, and the material it references there. For the rest of this post, I’ll assume you’ve got your data file to some hosting place. I’m using google cloud storage. The data looks like this.

<br>
 "data": [<br>
        {<br>
            "parent": "share",<br>
            "name": "images",<br>
            "key": "images_0",<br>
            "url": "https://sites.google.com/a/mcpher.com/share/images",<br>
            "title": "zzz",<br>
            "tags": {<br>
                "tagmap": [<br>
                    {<br>
                        "name": "d3",<br>
                        "values": [<br>
                            "d3",<br>
                            "d3js",<br>
                            "d3.js"<br>
                        ],<br>
                        "counts": [<br>
                            0,<br>
                            0,<br>
                            0<br>
                        ]<br>
                    },<br>
                    {<br>
                        "name": "vba",<br>
                        "values": [<br>
                            "vba",<br>
                            "vb"<br>
                        ],<br>
                        "counts": [<br>
                            0,<br>
                            0<br>
                        ]<br>
                    },<br>
                    {<br>
                        "name": "excel",<br>
                        "values": [<br>
                            "excel",<br>
                            "xl"<br>
                        ],<br>
                        "counts": [<br>
                            0,<br>
                     etc....<br>

 

Data retrieval and massage functions

You may need to play with some or all of these functions. If you have replicated the Analyzing site content with GAS for your own site then this should work as is (if you don’t need a proxy – see Node focus on Blogger posts, as the code has one built in, otherwise you will need to modify the massage function at least to match your data structure.
 

getTheData()

You probably wont need to change this at all. 

dataMassage()

This creates options, nodes and links from the input data, and emulates what Site data to sheets and Excel tables to d3.js Force diagram do. You won’t need to change this (apart from perhaps some of the options), if you are using Analyzing site content with GAS.

getTheRawData()

You may need to change the proxy and what it returns if you are not using one, or have one of your own.

findOrAddNode()

This probably won’t need changing.

The result

Here’s the end result, accessing the data directly from Google Cloud Storage. It’ll take a while to settle down as there’s lots of data. You can run it here.

The Code

And here’s the complete code

For more on this , see GAS and sites and d3.js.