{"id":26210788,"url":"https://github.com/dkaoster/d3-parliament-chart","last_synced_at":"2025-06-23T14:36:13.060Z","repository":{"id":40700078,"uuid":"327298546","full_name":"dkaoster/d3-parliament-chart","owner":"dkaoster","description":"parliament / congress / legislature charts simplified","archived":false,"fork":false,"pushed_at":"2024-09-27T06:21:51.000Z","size":1189,"stargazers_count":28,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T00:07:38.145Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkaoster.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":"2021-01-06T12:02:14.000Z","updated_at":"2025-03-19T21:54:15.000Z","dependencies_parsed_at":"2025-03-12T07:44:27.720Z","dependency_job_id":null,"html_url":"https://github.com/dkaoster/d3-parliament-chart","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.5483870967741935,"last_synced_commit":"fca83ba19ab5d4b90dbf400924092477f9c7d53a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkaoster%2Fd3-parliament-chart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkaoster%2Fd3-parliament-chart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkaoster%2Fd3-parliament-chart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkaoster%2Fd3-parliament-chart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkaoster","download_url":"https://codeload.github.com/dkaoster/d3-parliament-chart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647301,"owners_count":21139086,"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":"2025-03-12T07:34:16.409Z","updated_at":"2025-04-13T00:07:41.784Z","avatar_url":"https://github.com/dkaoster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" markdown=\"1\"\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/dkaoster/d3-parliament-chart/main/demo/parliament-chart.png\" width=\"80%\" align=\"center\" /\u003e\n\n# d3-parliament-chart\nparliament / congress / legislature charts simplified\n\n\u003c/div\u003e\n\n## Installing\n\nIf you use NPM, `npm install d3-parliament-chart`. Otherwise, download the [latest release](https://github.com/dkaoster/d3-parliament-chart/releases/latest).\n\n## API Reference\n\n\u003ca href=\"#parliamentChart\" name=\"parliamentChart\"\u003e#\u003c/a\u003e \u003cb\u003eparliamentChart\u003c/b\u003e(data, width)\n\nGiven an array of objects and the width of the chart, `parliamentChart()` creates an object that can either be used to return processed seat locations or called on a d3 selection directly. The height is automatically set to half of the width. The most basic usage of this plugin:\n\n```js\nd3.select('g').call(d3.parliamentChart([\n  { color: 'blue' }, { color: 'blue' }, { color: 'green' }, { color: 'red' }\n]))\n```\n\nNote: if data objects contain x and y values, this library will overwrite those values. If the chart is not big enough to accommodate the given settings, it will fit a half circle and any further data points will not be assigned an x / y value.\n\n\u003ca href=\"#data\" name=\"data\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003edata\u003c/b\u003e(data)\n\nIf data is provided, replaces the raw data in this object. If data is not provided, this function acts like a getter and adds a `x` and a `y` attribute to each element in the array, which specifies the coordinates of each point. Seats are arranged in order of their polar degrees, left to right corresponding with 0 to data length respectively.\n\n\u003ca href=\"#aggregatedData\" name=\"aggregatedData\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003eaggregatedData\u003c/b\u003e(data)\n\nThis function provides a more convenient method to set an aggregated version of the data. It takes an array of objects in which each object has a `seats` key that specifies how many seats this party / color has. For instance, you can pass in:\n\n```\n[{ seats: 48, color: 'blue' }, { seats: 2, color: 'black' }, { seats: 50, color: 'red' }] \n```\n\n\u003ca href=\"#width\" name=\"width\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003ewidth\u003c/b\u003e(width)\n\nSets the width used for calculating the points of the parliament chart.\n\n\u003ca href=\"#sections\" name=\"sections\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003esections\u003c/b\u003e(sections)\n\nSets the number of sections we want to show in this parliament chart.\n\n\u003ca href=\"#sectionGap\" name=\"sectionGap\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003esectionGap\u003c/b\u003e(sectionGap)\n\nSets the gap between sections for this parliament chart.\n\n\u003ca href=\"#seatRadius\" name=\"seatRadius\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003eseatRadius\u003c/b\u003e(seatRadius)\n\nSets the radius of each seat in this parliament chart.\n\n\u003ca href=\"#rowHeight\" name=\"rowHeight\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003erowHeight\u003c/b\u003e(rowHeight)\n\nSets the height of each row for this parliament chart.\n\n\u003ca href=\"#debug\" name=\"debug\"\u003e#\u003c/a\u003e \u003ci\u003epc\u003c/i\u003e.\u003cb\u003edebug\u003c/b\u003e(debug)\n\nTakes a boolean that if true, draws a set of guidelines for what this chart is supposed to look like.\n\n## Development Mode\n\nDevelopment mode enables you to work on this library locally. To run this repo in development mode, run \n\n``` \nnpm run dev\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkaoster%2Fd3-parliament-chart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkaoster%2Fd3-parliament-chart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkaoster%2Fd3-parliament-chart/lists"}