{"id":17809543,"url":"https://github.com/ldd/fantasy-map-generator","last_synced_at":"2026-03-10T15:02:35.737Z","repository":{"id":57232774,"uuid":"83455088","full_name":"ldd/fantasy-map-generator","owner":"ldd","description":"Minimal fantasy map generator","archived":false,"fork":false,"pushed_at":"2017-09-12T01:50:20.000Z","size":102,"stargazers_count":15,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T02:10:17.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ldd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T16:32:10.000Z","updated_at":"2024-03-20T19:23:05.000Z","dependencies_parsed_at":"2022-08-31T14:10:48.371Z","dependency_job_id":null,"html_url":"https://github.com/ldd/fantasy-map-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldd%2Ffantasy-map-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldd%2Ffantasy-map-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldd%2Ffantasy-map-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ldd%2Ffantasy-map-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ldd","download_url":"https://codeload.github.com/ldd/fantasy-map-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243871904,"owners_count":20361380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T15:19:44.748Z","updated_at":"2026-03-10T15:02:30.712Z","avatar_url":"https://github.com/ldd.png","language":"JavaScript","readme":"terrain.js\n=============\n\nMinimal JavaScript fantasy map generator.\n\n![fantasy map example](https://user-images.githubusercontent.com/1187476/30304277-a1880070-973a-11e7-938f-1008f0409132.png)\n\nSee the [demo](https://ldd.github.io/fantasy-map-generator/).\n\n![fantasy map slideshow](https://user-images.githubusercontent.com/1187476/30303900-933e8644-9738-11e7-8f3d-bea3340f8986.gif)\n\nAuthor: Leonardo FLorez\n\nCan be used as a plain script, or a Node.js module.\n\n\nScript tag usage\n----------------\nIn the browser, include `d3` and `terrain.min.js`:\n\n```html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js\"\u003e\n\u003c/script\u003e\n\u003cscript src=\"terrain.min.js\"\u003e\n\u003c/script\u003e\n```\n\nOptionally, a web worker may include `terrain.worker.min.js`, which attempts to be as tiny as possible, and does not include drawing functions (`drawMap`, `colorMap`)\n\n```js\n// Generate a Map.\n// terrain.generateMap(numberOfPoints, seedString, useSeed);\nvar aMap = terrain.generateMap(512, 'map!', false);\n\n// Draw a map to a svg element.\n// terrain.drawMap(svgElement, points, coast, rivers);\nvar svgElement = d3.select('#mesh');\nterrain.drawMap(svgElement, aMap.points, aMap.coast, aMap.rivers);\n\n// Color a map inside a svg element.\n// terrain.drawMap(svgElement, points, colorFn);\nterrain.colorMap(svgElement, aMap.points, function(normalizedHeight){\n    return 'gray';\n});\n```\n\nNode.js usage\n-------------\n\n```\nnpm install fantasy-map-generator\n```\n\n```js\n// Generate a Map.\nvar terrain = require('fantasy-map-generator');\nterrain.generateMap(512, 'map!', false);\n```\n\nVersion notes\n-------------\n  * Add an image and a slideshow to the `README`\n* Version 0.0.3\n  * Fix adding `web` and `webWorker` builds, ignored by `.npmignore`\n* Version 0.0.2 \n  * Add getting svg example in the `README`\n  * Save to png in the demo (`gh-pages` branch)\n  * Add `web` and `webWorker` builds (`npm-module` branch)\n\n* Version 0.0.1 initial release\n \nLicense: MIT\n\nCopyright 2017 Leonardo Florez.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldd%2Ffantasy-map-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fldd%2Ffantasy-map-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fldd%2Ffantasy-map-generator/lists"}