{"id":16490729,"url":"https://github.com/awinterman/d3-mapping","last_synced_at":"2025-07-09T09:15:47.750Z","repository":{"id":7978477,"uuid":"9381219","full_name":"AWinterman/d3-mapping","owner":"AWinterman","description":"Utility to make working with d3 scales less painful","archived":false,"fork":false,"pushed_at":"2016-02-24T19:15:18.000Z","size":726,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T20:40:43.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"nvie/gitflow","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AWinterman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-11T21:59:26.000Z","updated_at":"2015-04-16T15:09:39.000Z","dependencies_parsed_at":"2022-09-18T16:32:41.070Z","dependency_job_id":null,"html_url":"https://github.com/AWinterman/d3-mapping","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/AWinterman%2Fd3-mapping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fd3-mapping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fd3-mapping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWinterman%2Fd3-mapping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWinterman","download_url":"https://codeload.github.com/AWinterman/d3-mapping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104460,"owners_count":20561377,"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-11T13:48:53.050Z","updated_at":"2025-03-23T12:34:38.916Z","avatar_url":"https://github.com/AWinterman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3-Mapping #\n[![Build Status](https://secure.travis-ci.org/AWinterman/d3-mapping.png)](http://travis-ci.org/AWinterman/d3-mapping) \n\n A simple utility to make working with d3 scales easier.\n\n# Installation #\n\nnpm install d3-Mapping\n\n# Usage #\n\nDesigned to be used node style:\n\n```js\nvar Mapping = require(\"d3-mapping\")\n```\n\nInitialize a new mapping with a scale and an accessor function\n\n```js\nxScale = d3.scale.linear()\nxAccessor = function(d){ return d.x }\n\nx = new Mapping(xScale, xAccessor)\n```\n\n`x` has convenience methods for a number of common tasks. For example:\n\n - `x.scale` holds the reference to the original scale.\n - `x.range` and `x.domain` provide convenient access to `x.scale.domain` and\n   `x.scale.range`\n - `x.place` will map data points onto the screen. It does a little dance\n   to prevent D3 from overwriting its `this` object, so you can use it in d3\n   attribute setters.\n - `x.compute_domain(data, ordinal)` will compute the domain of `data`, set\n   `ordinal == true` to find the unique elements for the dimension rather than\n   the extent\n - `x.min` and `x.max` give more flexibility in manipulating the domain of the\n   mapping. If you provide one argument, the minimum (maximum) of the mapping\n   domain is simply set to that argument. If you\n   pass an array, they compute the minimum or maximum of the value returned by the\n   accessor when applied to the array, and set the corresponding bound of\n   the domain.\n\n\n\n[Check out](http://awinterman.github.io/d3-mapping/example/) a working example,\nor  [Read the literate source](http://awinterman.github.io/d3-mapping/docs/Mapping.html) for more info\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fd3-mapping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawinterman%2Fd3-mapping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawinterman%2Fd3-mapping/lists"}