Skip to content

Instantly share code, notes, and snippets.

Christopher Pietsch cpietsch

Block or report user

Report or block cpietsch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cpietsch
cpietsch / download.js
Created Dec 19, 2018
nodejs script to download images from a csv file
View download.js
var fsPromises = require('fs').promises
var dsv = require('d3-dsv');
var download = require('download');
async function all(){
let data = dsv.csvParse(await fsPromises.readFile("data.csv", { encoding: "utf8" }))
for(let entry of data) {
console.log(entry.url, entry.id)
View keybase.md

Keybase proof

I hereby claim:

  • I am cpietsch on github.
  • I am chrispie (https://keybase.io/chrispie) on keybase.
  • I have a public key ASA1z5V4JBxq8UzVGSXn8oqk_wln55LjyjfFZEUtiEz2IAo

To claim this, I am signing this object:

@cpietsch
cpietsch / .block
Last active Apr 25, 2017
Geo Scatterplot Transitions
View .block
license: mit
@cpietsch
cpietsch / README.md
Last active May 29, 2016
Local Variables 2
View README.md
@cpietsch
cpietsch / README.md
Last active May 29, 2016
Local Variables
View README.md

In response to mbostock's block: Local Variables and the Tweet I implemented a little variation having a .local(name[, value) method you can use on selections.

On set, the value is stored on the given element:

element.local("foo", value);

On get, the value is retrieved from given element, or the nearest ancestor that defines it:

var value = element.local("foo");

@cpietsch
cpietsch / .block
Last active Feb 27, 2016 — forked from mbostock/.block
Pseudo-Dorling Cartogram
View .block
license: gpl-3.0
@cpietsch
cpietsch / README.md
Last active Jan 4, 2016
Voronoi Images
View README.md

Using voronoi tessellation on random points as a surface for images. From here you could distribute the points in a more meaningfull way e.g. using t-SNE or d3.layout.force()

@cpietsch
cpietsch / README.md
Last active May 22, 2019
d3.js map with markers
View README.md

Easy example on how to put marker on a d3.js map.

You got 2 options:

  • using d3.geo.path() which does all the work for you
  • using svg circles and translating them via projection(d.geometry.coordinates)
View gist:851b4497568b12523f1d
var elements = data.map(function(d){
return new nmap_element({
id:d.id,
x:d.x,
y:d.y,
weight:d.weight ? d.weight : 1),
klass:d.class ? d.class : 1)
});
});
@cpietsch
cpietsch / README.md
Last active Jan 4, 2016
node-webkit screenshot
View README.md
You can’t perform that action at this time.