Forked from William Savage's Pen P2 - Zoomable tree map - using Json & D3.js(v3).
A Pen by Jonas Almeida on CodePen.
<a href="https://www.pewresearch.org/fact-tank/2021/07/16/home-broadband-adoption-computer-ownership-vary-by-race-ethnicity-in-the-u-s"> | |
<img src="https://www.pewresearch.org/wp-content/uploads/2021/07/FT_21.07.15_TechRegulation_01.png"> | |
</a> | |
<a href="https://www.pewresearch.org/fact-tank/2021/06/22/digital-divide-persists-even-as-americans-with-lower-incomes-make-gains-in-tech-adoption"> | |
<img src="https://www.pewresearch.org/wp-content/uploads/2021/06/ft_2021.06.22_digitaldivideincome_01.png"> | |
</a> |
{ | |
"https://data.cdc.gov/resource/muzy-jte6.json":{ | |
"name":"Weekly Counts of Deaths by State and Select Causes, 2019-2020", | |
"type":"socrata", | |
"description":"Provisional counts of deaths by the week the deaths occurred, by state of occurrence, and by select underlying causes of death for 2019-2020. The dataset also includes weekly provisional counts of death for COVID-19, coded to ICD-10 code U07.1 as an underlying or multiple cause of death." | |
}, | |
"https://data.cdc.gov/resource/3yf8-kanr.json":{ | |
"name":"Weekly Counts of Deaths by State and Select Causes, 2014-2018", | |
"type":"socrata", | |
"description":"Final counts of deaths by the week the deaths occurred, by state of occurrence, and by select causes of death for 2014-2018. Death counts in this dataset were derived from the National Vital Statistics System database that provides the most timely access to the data. Therefore, counts may differ slightly from final data due to differences in processing, recoding, and imputation." |
Verifying my Blockstack ID is secured with the address 194cZZBfYZYtuRdnjVbNWnVNkUX6B8xJYL https://explorer.blockstack.org/address/194cZZBfYZYtuRdnjVbNWnVNkUX6B8xJYL |
Verifying my Blockstack ID is secured with the address 194cZZBfYZYtuRdnjVbNWnVNkUX6B8xJYL https://explorer.blockstack.org/address/194cZZBfYZYtuRdnjVbNWnVNkUX6B8xJYL |
var http = require('http') | |
var port = process.env.PORT || 1337; | |
http.createServer(function(req, res) { | |
res.writeHead(200, { | |
'Content-Type': 'text/plain', | |
'Access-Control-Allow-Origin': '*' // CORS | |
}); | |
if(req.url.match('=')){ | |
var pp=req.url.slice(2).split('=') // parameter array | |
var parm={} |
Forked from William Savage's Pen P2 - Zoomable tree map - using Json & D3.js(v3).
A Pen by Jonas Almeida on CodePen.
A Pen by Jonas Almeida on CodePen.
<h2>Mean Absolute Deviation = <span id="y"> ... </span></h2> | |
<p><textarea id="x"></textarea></p> | |
(separate values with commas) |
// One way to measure goodness of fit is to | |
// assess the even distribution of values arround | |
// the regression line. This is a non-parameric | |
// approach that is not sensitive to the magitude | |
// of the noise, only to its structure | |
RSD={ | |
res2sign:function(r){ // counts same-sideness of residuals in array r | |
var rs = 0 | |
for(var i=1;i<r.length;i++){rs+=((r[i]*r[i-1])>0)} |
// SPARQL query composition at http://agalpha.mathbiol.org/repositories/tcga#query/r/TCGA-CM-4743-01A-01_URL | |
label='TCGA-CM-4743-01A-0' // example of a label | |
url = 'http://agalpha.mathbiol.org/download?file=query.json&accept=application%2Fsparql-results%2Bjson&path=%2Frepositories%2Ftcga%3Fquery%3Dselect%2520distinct%2520%253Fo%2520%253Fu%250Awhere%2520%257B%250A%2509%253Ft%2520a%2520%253Chttp%253A%252F%252Fpurl.org%252Ftcga%252Fcore%2523platform%253E.%250A%2520%2520%2509%253Ft%2520%253Chttp%253A%252F%252Fwww.w3.org%252F2000%252F01%252Frdf-schema%2523label%253E%2520%2522tissue_images%2522.%250A%2520%2520%2509%253Fo%2520%253Chttp%253A%252F%252Fpurl.org%252Ftcga%252Fcore%2523platform%253E%2520%253Ft.%250A%2520%2520%2509%253Fo%2520rdfs%253Alabel%2520%253FL.%250A%2520%2520%2509filter%2520REGEX(%253FL%252C%72'+label+'1%27)%250A%2520%2520%2520%2520%253Fo%2520tcga%253Aurl%2520%253Fu%250A%257D%26infer%3Dfalse' | |
$.getJSON(url,function(x){ | |
y=x.results.bindings.map(function(xi){return xi.u.value}); | |
console.log(' |