{"id":13481247,"url":"https://github.com/alangrafu/radar-chart-d3","last_synced_at":"2025-05-16T17:09:19.207Z","repository":{"id":7067390,"uuid":"8352719","full_name":"alangrafu/radar-chart-d3","owner":"alangrafu","description":"Simple radar chart in D3.js","archived":false,"fork":false,"pushed_at":"2021-11-23T06:03:49.000Z","size":838,"stargazers_count":425,"open_issues_count":21,"forks_count":169,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-12T19:21:30.477Z","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":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alangrafu.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}},"created_at":"2013-02-22T07:35:55.000Z","updated_at":"2025-04-30T21:45:35.000Z","dependencies_parsed_at":"2022-09-13T17:50:44.956Z","dependency_job_id":null,"html_url":"https://github.com/alangrafu/radar-chart-d3","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alangrafu%2Fradar-chart-d3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alangrafu%2Fradar-chart-d3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alangrafu%2Fradar-chart-d3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alangrafu%2Fradar-chart-d3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alangrafu","download_url":"https://codeload.github.com/alangrafu/radar-chart-d3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"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-07-31T17:00:50.086Z","updated_at":"2025-05-16T17:09:19.159Z","avatar_url":"https://github.com/alangrafu.png","language":"JavaScript","funding_links":[],"categories":["Charts"],"sub_categories":[],"readme":"## Radar Chart\nA reusable radar chart implementation in D3.js. Styleable, configurable and transition-capable.\n\n[![Radar Example](http://bl.ocks.org/tpreusse/raw/2bc99d74a461b8c0acb1/thumbnail.png)](http://bl.ocks.org/tpreusse/2bc99d74a461b8c0acb1)\n\n## Usage\n\n### Install\n`bower install git@github.com:alangrafu/radar-chart-d3.git --save`\n\n### Data structure\n```\nvar data = [\n  {\n    className: 'germany', // optional, can be used for styling\n    axes: [\n      {axis: \"strength\", value: 13, yOffset: 10},\n      {axis: \"intelligence\", value: 6},\n      {axis: \"charisma\", value: 5},  \n      {axis: \"dexterity\", value: 9},  \n      {axis: \"luck\", value: 2, xOffset: -20}\n    ]\n  },\n  {\n    className: 'argentina',\n    axes: [\n      {axis: \"strength\", value: 6},\n      {axis: \"intelligence\", value: 7},\n      {axis: \"charisma\", value: 10},  \n      {axis: \"dexterity\", value: 13},  \n      {axis: \"luck\", value: 9}\n    ]\n  }\n];\n```\n\n`xOffset` and `yOffset` are optional values that allows a developer to change the position of a specific label. It is important to add them in **the first** group of axes.\n\n### Simple single chart drawing\n```html\n\u003cdiv class=\"chart-container\"\u003e\u003c/div\u003e\n\u003cscript\u003e\nRadarChart.draw(\".chart-container\", data);\n\u003c/script\u003e\n```\n\n### D3.js reusable chart API\n```javascript\nvar chart = RadarChart.chart();\nvar svg = d3.select('body').append('svg')\n  .attr('width', 600)\n  .attr('height', 800);\n\n// draw one\nsvg.append('g').classed('focus', 1).datum(data).call(chart);\n\n// draw many radars\nvar game = svg.selectAll('g.game').data(\n  [\n    data,\n    data,\n    data,\n    data\n  ]\n);\ngame.enter().append('g').classed('game', 1);\ngame\n  .attr('transform', function(d, i) { return 'translate(150,600)'; })\n  .call(chart);\n```\n\n### Style with CSS\n```css\n.radar-chart .area {\n  fill-opacity: 0.7;\n}\n.radar-chart.focus .area {\n  fill-opacity: 0.3;\n}\n.radar-chart.focus .area.focused {\n  fill-opacity: 0.9;\n}\n.area.germany, .germany .circle {\n  fill: #FFD700;\n  stroke: none;\n}\n.area.argentina, .argentina .circle {\n  fill: #ADD8E6;\n  stroke: none;\n}\n```\n\n### Configure\n```javascript\n// retrieve config\nchart.config();\n// all options with default values\nchart.config({\n  containerClass: 'radar-chart', // target with css, the default stylesheet targets .radar-chart\n  w: 600,\n  h: 600,\n  factor: 0.95,\n  factorLegend: 1,\n  levels: 3,\n  maxValue: 0,\n  minValue: 0,\n  radians: 2 * Math.PI,\n  color: d3.scale.category10(), // pass a noop (function() {}) to decide color via css\n  axisLine: true,\n  axisText: true,\n  circles: true,\n  radius: 5,\n  open: false,  // whether or not the last axis value should connect back to the first axis value\n                // if true, consider modifying the chart opacity (see \"Style with CSS\" section above)\n  axisJoin: function(d, i) {\n    return d.className || i;\n  },\n  tooltipFormatValue: function(d) {\n    return d;\n  },\n  tooltipFormatClass: function(d) {\n    return d;\n  },\n  transitionDuration: 300\n});\n```\n\n## Example\n###CSV2Radar\n\nDisplay a csv file as a radar chart at [http://alangrafu.github.io/radar-chart-d3/csv2radar.html](http://alangrafu.github.io/radar-chart-d3/csv2radar.html).\n\n\n[![Example](https://rawgit.com/tpreusse/radar-chart-d3/master/example/demo.svg)](http://bl.ocks.org/tpreusse/2bc99d74a461b8c0acb1)\nhttp://bl.ocks.org/tpreusse/2bc99d74a461b8c0acb1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falangrafu%2Fradar-chart-d3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falangrafu%2Fradar-chart-d3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falangrafu%2Fradar-chart-d3/lists"}