Extracted from simple-statistics.
// using reduce | |
var team = posts.team.reduce(function(prev, post, index, list) { | |
prev.push(post.metadata.title); | |
return prev; | |
}, []); | |
// using map | |
var team = posts.team.map(function(post) { | |
return post.metadata.title); | |
}); |
Welcome to OpenStreetMap You have just joined an international volunteer organization whose goal is nothing less than a rich, detail map of the whole world that is open-source. What does that mean? It means that this is a map whose data is available to everyone for free. OpenStreetMap is an important effort that will have impact around the globe. Millions who never have had access to geographical information now will have access to
Request a single tile from PMTiles, use the vector-tiles module to read it, the d3-geo tools to turn it into a string. d3-geo is probably unnecessary.
This approach feels limited:
Requires restitching tiles if more than one. Limited attributes. Any tile-based solution is going to make compromises in favor of responsiveness and lightweight data. What this wants is completeness and non-sliced data.
This is a more wordy, narrative accompaniment to my pretty bare presentation about d3 that I gave to the jQuery DC Meetup.
- Not a chart library (though you can make charts with it)
- Not a map library (though you can make maps with it)
Which is to say, d3 can be used for building things, but the 'atomic parts' are lower-level than bar graphs or projections or so on. This is a powerful fact. It also means that d3 is a good basis for simple interfaces, like Vega.js, that make its power accessible in other ways.
- Not a compatibility layer (it doesn't work with bad browsers)
This is a non-technical reading list for technical people.
- How to Program Independent Games
- Kill Math (and Don't Kill Math)
- Move Fast and Don't Break Things
- Launch & The Web Is a Customer Service Medium by Paul Ford
- _why at Art & Code
- Repetitive Process
This is a list of software you should read like a novel.
#import "stdio.h" | |
#import "time.h" | |
#import "string.h" | |
// make now | |
int main() { | |
time_t now; | |
int hour; | |
char ampm[2]; |
import { Portal } from "@radix-ui/react-portal"; | |
import clsx from "clsx"; | |
import { useAtom } from "jotai"; | |
import { atomWithMachine } from "jotai/xstate"; | |
import { useRouter } from "next/router"; | |
import { useEffect } from "react"; | |
import { assign, createMachine } from "xstate"; | |
import clamp from "lodash/clamp"; |
This is companion code to this guide.
const fs = require('fs'); | |
const d3 = require('d3-dsv'); | |
const path = require('path'); | |
const yaml = require('js-yaml'); | |
const toMarkdown = require('to-markdown'); | |
d3.csvParse( | |
fs.readFileSync('./goodreads_library_export.csv', 'utf8') | |
).filter(row => { | |
return row['Exclusive Shelf'] !== 'to-read'; |