Following Mike Bostock's great tutorial on command-line cartography, when trying to produce a choropleth, I receive a TypeError saying that d3.scaleSequential is not a function. I imagine it is just not being exposed? But I don't know how to deal with that through the CLI...?
Error Traceback:
TypeError: d3.scaleSequential is not a function
at evalmachine.:1:26
at Interface. (/usr/local/lib/node_modules/ndjson-cli/ndjson-map:45:14)
at emitOne (events.js:77:13)
at Interface.emit (events.js:169:7)
at Interface._onLine (readline.js:210:10)
at Interface. (readline.js:340:12)
at Array.forEach (native)
at Interface._normalWrite (readline.js:339:11)
at ReadStream.ondata (readline.js:86:10)
at emitOne (events.js:77:13)
I have all of the needed libraries installed and updated through npm, so that isn't the issue..any thoughts on how to debug this would be greatly appreciated.
Currently Installed:
- d3@4.9.1
- d3-geo-projection@2.1.2
- d3-scale@1.0.6
- d3-scale-chromatic@1.1.1
Sample Code
The code is copied pretty much straight from the tutorial and this is the first step that doesn't work..
ndjson-map -r d3 \ '(d.properties.fill = d3.scaleSequential(d3.interpolateViridis).domain([0, 4000])(d.properties.density), d)' \ ca-albers-color.ndjson