ldd / fantasy-map-generator

Minimal fantasy map generator
Other
15 stars 4 forks source link

Example with SVG #2

Closed TehShrike closed 7 years ago

TehShrike commented 7 years ago

I'm a canvas noob - could you add an example to the readme showing how to create an SVG element that I could pass in to drawMap?

I tried just tossing <svg id="map"></svg> into my body, but passing the element in to drawMap resulted in

Uncaught TypeError: svg.selectAll is not a function
    at drawPaths (view.js:126)
    at Object.drawMap (visualize.js:20)
    at (index):16

which I'm pretty sure is the result of me not knowing what I'm doing.

ldd commented 7 years ago

in the browser, with d3: d3.select('#map');

you are right that the documentation is terse.

TehShrike commented 7 years ago

aah, that makes sense, I had assumed that d3 was just used internally. 👍