This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var topojson = require("topojson"); | |
//var TDXApi = require("nqm-api-tdx"); | |
var fs = require("fs"); | |
function propertyTransform(feature) { | |
return feature.properties; | |
} | |
function databot(input, output, context) { | |
output.progress(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let total = 0; | |
for (let i = 0; i < 100; i++) { | |
asynchronousFunction(i, (result) => { | |
total = total + result; | |
}); | |
} | |
storeTotal(total); | |
/* | |
what is wrong with this code? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// estimator.js | |
module.exports = (function() { | |
var getData = function(id, cb) { | |
return api.getDataAsync(id, this.state.filter); | |
} | |
function estimator(initial) { | |
this.state = initial; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function blob(xIn, yIn) { | |
const x = xIn; | |
const y = yIn; | |
this.setY = (yIn) => { | |
y = y; | |
}; | |
this.getY = () => { | |
return y; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const databot = function(input, output, context) { | |
const api = context.tdxApi; | |
let x = 0; | |
const readStream = api.getNDDatasetData( | |
"HygXQFrwx-", // This contains nearly 6 million documents | |
null, | |
null, | |
{limit: 0} | |
); | |
const writeStream = split(JSON.parse, null, {trailing: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (function() { | |
"use strict"; | |
const Promise = require("bluebird"); | |
function databot(input, output, context) { | |
const tdxApi = context.tdxApi; | |
const mappingId = input.mappingId; | |
// filter boundary dataset with a list of all ccgs | |
const filter = { | |
mappingType: "ons-mapping", | |
parentType: "CCG15CD", |