{"id":24542670,"url":"https://github.com/vasturiano/d3-morton-order","last_synced_at":"2025-04-15T11:12:11.828Z","repository":{"id":12551496,"uuid":"72190700","full_name":"vasturiano/d3-morton-order","owner":"vasturiano","description":"D3 layout to visualize distance variables using a continuous Morton (Z-order) space-filling curve.","archived":false,"fork":false,"pushed_at":"2025-04-09T19:35:38.000Z","size":128,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T11:11:49.787Z","etag":null,"topics":["d3js","morton-order","space-filling-curves","z-order"],"latest_commit_sha":null,"homepage":"https://observablehq.com/@vasturiano/morton-z-order-curve","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vasturiano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-28T08:49:32.000Z","updated_at":"2025-04-09T19:35:42.000Z","dependencies_parsed_at":"2025-04-09T20:26:55.662Z","dependency_job_id":"f5f7e3e3-dabf-4252-bdf8-a4fe4eeb9c20","html_url":"https://github.com/vasturiano/d3-morton-order","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-morton-order","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-morton-order/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-morton-order/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasturiano%2Fd3-morton-order/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasturiano","download_url":"https://codeload.github.com/vasturiano/d3-morton-order/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249058379,"owners_count":21205910,"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":["d3js","morton-order","space-filling-curves","z-order"],"created_at":"2025-01-22T19:17:02.066Z","updated_at":"2025-04-15T11:12:11.821Z","avatar_url":"https://github.com/vasturiano.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"d3-morton\n==============\n\n[![NPM package][npm-img]][npm-url]\n[![Build Size][build-size-img]][build-size-url]\n[![NPM Downloads][npm-downloads-img]][npm-downloads-url]\n\nD3 layout to visualize distance variables using a continuous Morton (Z-order) space-filling curve. Here's an [example](https://observablehq.com/@vasturiano/morton-z-order-curve).\n\nSee also [d3-hilbert](https://github.com/vasturiano/d3-hilbert).\n\n## Quick start\n\n```js\nimport d3ZOrder from 'd3-morton';\n```\nor using a *script* tag\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/npm/d3-morton\"\u003e\u003c/script\u003e\n```\nthen\n```js\nconst myRange = { start: 4, length: 9 };\nd3.zOrder()\n    .order(2)\n    .layout(myRange)\n```\n\n## API reference\n\n| Method | Description | Default |\n| ------------------ | -------------------------------------------------------------------------------------------------------------------------- | ------------- |\n| **canvasWidth**([*number*]) | Getter/setter for the length of each side of the square canvas which covers the full domain of the Z-order curve. | 1 |\n| **order**([*int*]) | Getter/setter for the extent of the Z-Order curve domain, determined by `4^order`. **The maximum safe order is *26***, due to the JS numbers upper-boundary of 53 bits. | 4 |\n| **simplifyCurves**([*boolean*]) | Getter/setter for whether to simplify the resolution of the curve to the most canonical 2-bit boundary that fits the range integral. For example, in a 2nd order curve (16 values), a range from *8* to *15* can be simplified from 8 vertices to 2 (each filling a square with 4 values), on the lower quadrants. This simplification greatly reduces the number of vertices in the curve and improves the calculation and rendering performance, specially for high-order ranges which tend to fall on 2-bit boundaries. | true |\n| **layout**(*rangeObject*) | Extends the input rangeObject (syntax: `{start:\u003cint\u003e, length:\u003cint\u003e}`) with 2 additional properties defining the Z-Order curve: **.cellWidth** (*number* defining the side length of each square cell and essentially the thickness of the line, according to the canvasWidth) and **.pathVertices** (*Array* of [*num*,*num*], the sequential x,y coordinates of all the vertex points in the curve). | |\n| **getValAtXY**(*num*, *num*) | Returns the reverse translated value on the curve domain found at coordinates *x*,*y*, relative to the canvasWidth. | |\n\n\n[npm-img]: https://img.shields.io/npm/v/d3-morton\n[npm-url]: https://npmjs.org/package/d3-morton\n[build-size-img]: https://img.shields.io/bundlephobia/minzip/d3-morton\n[build-size-url]: https://bundlephobia.com/result?p=d3-morton\n[npm-downloads-img]: https://img.shields.io/npm/dt/d3-morton\n[npm-downloads-url]: https://www.npmtrends.com/d3-morton\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasturiano%2Fd3-morton-order","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasturiano%2Fd3-morton-order","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasturiano%2Fd3-morton-order/lists"}