d3.js

I’m currently having difficulty referencing an external .tsv file into an HTML file referencing the d3.js library. The code works, but I do not know where the reference the .tsv file, and therefore the dataset, from. Anyone encounter this problem before?

Hi,

Could you please elaborate more on what you try to build.
From what I understand you use the HTML element in order to use d3.js.
Which code doesn’t work? you don’t see the visualization you created or you can’t load data. It would be great if you add a code sample.

Shay

Hi Shay, here are the .js, .css, .html, and .csv file with the small dataset. What I dont know how to do is to reference the .csv file into the .js script (can’t load data). Any help would be appreciated. Thank you

You need to reference both files with a fully qualified URL to their location on another server. Based on the images you provided, I see that both files are on your local machine.

in the case you don’t have such a server:

Thank you Shay!

Hi Shay,
I’m super stumped. I tried hosting the website through the Microsoft Internet Information Services (IIS) on my machine, but it creates a http:// protocol, so I tried following the directions below. This didn’t work.

I then tried hosting the following URL from Mike Bostock’s website: https://bl.ocks.org/mbostock/raw/4062045/ by embedding it as a webite address. This didn’t work either.

I then tried by importing th .csv file into a database on wix, but have no idea where to start linking the dataset into the HTML code, and really don’t know where to start with the link you provided above: https://www.wix.com/code/reference/$w.HtmlComponent.html . Is there a video you can point me to that shows how to link an external dataset into a HTML?

Here is how I tried to do it using “iframe”:

Regarding the javascript file, you probably need to add chartAuto.js at the end of the URL. Once you paste the URL into the browser address and see the file, paste it into the code.

Regarding the data: