{"id":13554785,"url":"https://github.com/CSNW/d3.compose","last_synced_at":"2025-04-03T07:32:51.520Z","repository":{"id":14795192,"uuid":"17517291","full_name":"CSNW/d3.compose","owner":"CSNW","description":"Compose complex, data-driven visualizations from reusable charts and components with d3","archived":false,"fork":false,"pushed_at":"2022-12-10T17:12:27.000Z","size":6132,"stargazers_count":696,"open_issues_count":18,"forks_count":24,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-04-14T13:07:09.292Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://CSNW.github.io/d3.compose/","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/CSNW.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2014-03-07T14:59:21.000Z","updated_at":"2023-12-26T18:20:13.000Z","dependencies_parsed_at":"2022-08-30T14:51:23.331Z","dependency_job_id":null,"html_url":"https://github.com/CSNW/d3.compose","commit_stats":null,"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSNW%2Fd3.compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSNW%2Fd3.compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSNW%2Fd3.compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSNW%2Fd3.compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSNW","download_url":"https://codeload.github.com/CSNW/d3.compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222935625,"owners_count":17060398,"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-08-01T12:02:54.830Z","updated_at":"2024-11-04T03:31:18.171Z","avatar_url":"https://github.com/CSNW.png","language":"JavaScript","readme":"# d3.compose\n\nCompose rich, data-bound charts from charts (like Lines and Bars) and components (like Axis, Title, and Legend) with d3 and d3.chart.\n\n- Advanced layout engine automatically positions and sizes charts and components, layers by z-index, and is responsive by default with automatic scaling\n- Standard library of charts and components for quickly creating beautiful charts\n- `Chart` and `Component` bases for creating composable and reusable charts and components\n- Includes helpers and mixins that cover a range of standard functionality\n- CSS class-based styling is extensible and easy to customize to match your site\n\n[![npm version](https://img.shields.io/npm/v/d3.compose.svg?style=flat-square)](https://www.npmjs.com/package/d3.compose)\n\n## Getting Started\n\n1. Download the [latest release](https://github.com/CSNW/d3.compose/releases)\n2. Download the dependencies:\n\n    - [D3.js (\u003e= 3.0.0)](http://d3js.org/)\n    - [d3.chart (\u003e= 0.2.0)](http://misoproject.com/d3-chart/)\n\n3. Add d3.compose and dependencies to your html:\n\n    ```html\n    \u003c!doctype html\u003e\n    \u003chtml\u003e\n      \u003chead\u003e\n        \u003c!-- ... --\u003e\n\n        \u003clink rel=\"stylesheet\" type=\"text/css\" href=\"d3.compose.css\"\u003e\n      \u003c/head\u003e\n      \u003cbody\u003e\n        \u003c!-- ... --\u003e\n\n        \u003cscript src=\"d3.js\"\u003e\u003c/script\u003e\n        \u003cscript src=\"d3.chart.js\"\u003e\u003c/script\u003e\n\n        \u003cscript src=\"d3.compose.js\"\u003e\u003c/script\u003e\n\n        \u003c!-- Your code --\u003e\n      \u003c/body\u003e\n    \u003c/html\u003e\n    ```\n\n4. Create your first chart\n\n    ```js\n    var chart = d3.select('#chart')\n      .chart('Compose', function(data) {\n        var scales = {\n          x: {type: 'ordinal', data: data, key: 'x'},\n          y: {data: data, key: 'y'}\n        };\n\n        var charts = [\n          d3c.lines({\n            data: data,\n            xScale: scales.x,\n            yScale: scales.y\n          })\n        ];\n\n        var yAxis = d3c.axis({scale: scales.y});\n\n        return [\n          [yAxis, d3c.layered(charts)]\n        ];\n      })\n      .width(600)\n      .height(400);\n\n    chart.draw([{x: 0, y: 10}, {x: 10, y: 50}, {x: 20, y: 30}]);\n    ```\n\n## Examples and Docs\n\nSee [http://CSNW.github.io/d3.compose/](http://CSNW.github.io/d3.compose/) for live examples and docs.\n\n## Development\n\n1. Install modules `npm install`\n2. Test with `npm test` or `npm run test:watch`\n3. Build with `npm run build`\n\nNote on testing: Requires Node 4+ (for latest jsdom) and d3.chart doesn't currently support running from within node\nand requires the following line be added inside the IIFE in `node_modules/d3.chart.js`: `window = this;` (before `use strict`). This will be resolved by a [pending PR](https://github.com/misoproject/d3.chart/pull/113) to fix this issue with d3.chart (also, the dependency on d3.chart is likely to be removed in a later version of d3.compose).\n\n### Release\n\n(With all changes merged to master and on master branch)\n\n1. `npm version {patch|minor|major|version}`\n2. `npm publish`\n\n### Docs\n\n1. On master, run `npm run docs`\n2. Switch to `gh-pages` branch\n3. Navigate to `_tasks` directory (`cd _tasks`)\n4. (`npm install` _tasks, if necessary)\n5. Run docs task `npm run docs`\n6. Navigate back to root\n7. View site with `bundle exec jekyll serve`\n\nNote: For faster iteration, create a separate clone, switch to `gh-pages` branch, set `docs_path` environment variable to original clone (e.g. Windows: `SET docs_path=C:\\...\\d3.compose\\_docs\\`), and then run steps 3-6.\n","funding_links":[],"categories":["JavaScript","others","Data Visualization"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCSNW%2Fd3.compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCSNW%2Fd3.compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCSNW%2Fd3.compose/lists"}