{"id":13784219,"url":"https://github.com/derbyjs/d-barchart","last_synced_at":"2025-11-06T22:30:31.097Z","repository":{"id":15760345,"uuid":"18499159","full_name":"derbyjs/d-barchart","owner":"derbyjs","description":"example barchart component built with derby + some d3.js","archived":false,"fork":false,"pushed_at":"2016-01-12T06:31:12.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-27T19:41:50.228Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derbyjs.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":"2014-04-06T20:58:18.000Z","updated_at":"2016-01-12T06:31:13.000Z","dependencies_parsed_at":"2022-07-22T22:49:46.733Z","dependency_job_id":null,"html_url":"https://github.com/derbyjs/d-barchart","commit_stats":null,"previous_names":["codeparty/d-barchart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derbyjs%2Fd-barchart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derbyjs%2Fd-barchart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derbyjs%2Fd-barchart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derbyjs%2Fd-barchart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derbyjs","download_url":"https://codeload.github.com/derbyjs/d-barchart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239513377,"owners_count":19651322,"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-03T19:00:37.637Z","updated_at":"2025-11-06T22:30:30.784Z","avatar_url":"https://github.com/derbyjs.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":[],"readme":"d-barchart\n==================\n\nExample d3 Bar chart Derby component.\nalso see:\n[d-barchart-vanilla](http://github.com/derbyjs/d-barchart-vanilla)\n[d-d3-barchart](http://github.com/derbyjs/d-d3-barchart)\n\n# Usage\n[Example usage](http://github.com/derbyjs/derby-examples/charts)\n\n## In your template\n```\n\u003cview name=\"d-barchart\" data={{_page.data}} width=300 height=200\u003e\u003c/view\u003e\n```\nsome optional arguments\n```\n\u003cview name=\"d-barchart\" data={{_page.data}} margins={{_page.margins}}\u003e\u003c/view\u003e\n```\n\n\n## Your data\n```\nmodel.set(\"_page.data\", [ { value: 1 }, { value: 10 } ]);\n```\n\nOptional data\n```\nmodel.set(\"_page.margins\", {top: 0, right: 20, bottom: 0, left: 20 });\n```\n\n## Implementation pattern\n\nIn this example we take advantage of derby's bindings to associate our data with the DOM.\nWe use the __layout__ pattern where we transform input data into layout data, and then render the layout data.\nThe benefit here is we get server-side rendering and readable templates that react to changes in the data. The trade-off is that we lose d3's transitions because we don't use the selection api.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderbyjs%2Fd-barchart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderbyjs%2Fd-barchart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderbyjs%2Fd-barchart/lists"}