{"id":19481638,"url":"https://github.com/mattdodge/d3fire","last_synced_at":"2025-04-25T15:32:08.135Z","repository":{"id":140969425,"uuid":"10809569","full_name":"mattdodge/D3Fire","owner":"mattdodge","description":"Power your D3 visualizations with data from Firebase","archived":false,"fork":false,"pushed_at":"2015-12-11T00:11:37.000Z","size":6,"stargazers_count":30,"open_issues_count":1,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-03T23:51:15.479Z","etag":null,"topics":["d3","d3js","firebase","javascript"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/mattdodge.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-06-20T01:15:21.000Z","updated_at":"2023-03-11T23:12:26.000Z","dependencies_parsed_at":"2023-03-23T05:21:18.451Z","dependency_job_id":null,"html_url":"https://github.com/mattdodge/D3Fire","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/mattdodge%2FD3Fire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2FD3Fire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2FD3Fire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattdodge%2FD3Fire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattdodge","download_url":"https://codeload.github.com/mattdodge/D3Fire/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250844407,"owners_count":21496568,"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":["d3","d3js","firebase","javascript"],"created_at":"2024-11-10T20:05:57.344Z","updated_at":"2025-04-25T15:32:07.885Z","avatar_url":"https://github.com/mattdodge.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"D3Fire\n======\n\nPlugin to easily hook up a Firebase to your D3 visualizations. D3's data binding can be quite powerful, but tends to assume that you have a working copy of the data in your script somewhere. This plugin comes in handy when you want to defer your data storage to Firebase, which provides a \"realtime\" database and does not require you to keep your own local copy.\n\n\nInstall\n-----\n\nPretty simple, just include the script tag for this plugin after you have included the Firebase and D3 script tags. Still need an example? Try this:\n\n\n```html \n\u003cscript type='text/javascript' src='http://d3js.org/d3.v3.min.js'\u003e\u003c/script\u003e\n\u003cscript type='text/javascript' src='https://cdn.firebase.com/v0/firebase.js'\u003e\u003c/script\u003e\n\u003cscript type='text/javascript' src='d3fire.min.js'\u003e\u003c/script\u003e\n```\n\nUse It\n-----\nThe plugin creates a new D3 function that operates on a selection called `firebase()`.  Take a selection and bind a Firebase to it; you can include callback functions for when data is added/updated/deleted from the Firebase.\n\n```javascript\nd3.select('svg').firebase(\n    'https://yourfirebase.firebaseIO.com', \n    {\n        createFunc : function(newData) {\n            // callback when data is added, maybe we want to add a text element?\n            return this.append('text').text(newData.val());\n        },\n        updateFunc : function(changedData) {\n            // data was changed, let's change the text\n            this.text(changedData.val());\n        }\n    }\n);\n```\n\nD3Fire will take care of binding to the `__data__` attribute of each selector, giving you a copy of the Firebase snapshot to use in later calls.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattdodge%2Fd3fire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattdodge%2Fd3fire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattdodge%2Fd3fire/lists"}