How to pull data from firebase to put into crossfilter?

by Frank van Puffelen

HTML

<script src="http://static.firebase.com/v0/firebase.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/crossfilter/1.3.7/crossfilter.js"></script>
Example for <a href='http://stackoverflow.com/q/24993059/209103'>How to pull data from firebase to put into crossfilter?</a>
<br/>
<button id='init'>Populate Firebase...</button>
<div id='log'></div>

JavaScript

var ref = new Firebase("https://stackoverflow.firebaseio.com/24993059/");
var quakesRef = ref.child("quakes");

var log = document.getElementById('log');

function populateFirebase() {
    var quakesdata = [{
        "FID": "quake.2013p618454",
        "agency": "WEL(GNS_Primary)",
        "depth": "24.5703",
        "latitude": "-41.5396",
        "longitude": "174.1242",
        "magnitude": "1.7345",
        "magnitudetype": "M",
        "origin_geom": "POINT (174.12425 -41.539614)",
        "origintime": "2013-08-17T19:52:50.074",
        "phases": "17",
        "publicid": "2013p618454",
        "status": "automatic",
        "type": "",
        "updatetime": "2013-08-17T19:54:11.27"
    }, {
        "FID": "quake.2013p618440",
        "agency": "WEL(GNS_Primary)",
        "depth": "26.3281",
        "latitude": "-38.8725",
        "longitude": "175.9561",
        "magnitude": "2.6901",
        "magnitudetype": "M",
        "origin_geom": "POINT (175.95611 -38.872468)",
        "origintime": "2013-08-17T19:45:25.076",
        "phases": "13",
        "publicid": "2013p618440",
        "status": "automatic",
        "type": "",
        "updatetime": "2013-08-17T19:48:15.374"
    }, {
        "FID": "quake.2013p618439",
        "agency": "WEL(GNS_Primary)",
        "depth": "27.0312",
        "latitude": "-41.8992",
        "longitude": "174.3117",
        "magnitude": "4.6968",
        "magnitudetype": "M",
        "origin_geom": "POINT (174.31173 -41.899212)",
        "origintime": "2013-08-17T19:44:28.998",
        "phases": "130",
        "publicid": "2013p618439",
        "status": "automatic",
        "type": "",
        "updatetime": "2013-08-17T19:48:39.064"
    }, {
        "FID": "quake.2013p618432",
        "agency": "WEL(GNS_Primary)",
        "depth": "5.9961",
        "latitude": "-41.7495",
        "longitude": "174.02",
        "magnitude": "1.8642",
        "magnitudetype": "M",
        "origin_geom": "POINT (174.02 -41.749481)",
       ...