The short answer is yes. There are a number of places you can host the D3.js library file(s?) and any other Javascript files you would write that contain the code for your visualization.
If you had an on-prem farm that might include somewhere in the _layouts
folder, but you say "Microsoft hosted" so I am assuming you are talking about SharePoint Online, and thus have no access to a file system.
In that case, there are plenty of places in a site itself you can host JS files. Most sites have a "Site Assets" library and/or a "Style Library" library. Or, you could even create a dedicated document library just to hold your scripts.
Once your scripts are uploaded to the site, you can create a new site page (aka wiki page), and use either Content Editor web parts or Script Editor web parts to link to your JS files and load them on the page.
The next step is to figure out how you are getting the data you are going to feed into D3. If the data is stored in SharePoint somewhere, like maybe a custom list, then the JavaScript Object Model is absolutely a reasonable way to go. The link you have in your question is about how to use the JSOM, but it is from a series of articles about creating a "SharePoint Add-In", which I don't think you need to do.
Here are some other links about using the JSOM to work with SharePoint data:
JavaScript API reference for SharePoint 2013
Complete basic operations using JavaScript library code in SharePoint 2013
Using the JavaScript object model (JSOM) in apps for SharePoint
Another possible option would be to use the SP2013 REST services:
Get to know the SharePoint 2013 REST service
REST API reference and samples
Now, if your data is stored in a file, like a .csv
, you can store that file somewhere in SharePoint (like a document library), and retrieve it, open and parse it with your code.
If the data is coming from somewhere else entirely, you'll have to figure out how you can retrieve it from your code.