2015-11-22 23 views
1

我想通過觀看教程和閱讀電子書使用D3.js製作一個龍捲風目擊的森伯斯特圖,但它不工作。我很確定它應該起作用。我正在使用Chrome。我想使用龍捲風數據製作森伯斯特圖

<!DOCTYPE html> 
    <html> 
    <head> 
    <meta charset='utf-8'> 
    <title>Zoomable radial chart with color scales</title> 
    <link href='http://fonts.googleapis.com/css?family=Varela' rel='stylesheet' type='text/css'> 
    <style> 
    body { font-family: Varela,sans-serif; } 
    </style> 
    </head> 
    <body> 
    <script src='http://d3js.org/d3min.js'></script> 
    <script> 

    // Define the dimensions of the visualization. 
    var margin = {top: 30, right: 10, bottom: 20, left: 10}, 
     width = 960 - margin.left - margin.right, 
     height = 500 - margin.top - margin.bottom, 
     radius = Math.min(width, height)/2; 

    // Create the SVG container for the visualization and 
    // define its dimensions. Within that container, add a 
    // group element (`<g>`) that can be transformed via 
    // a translation to account for the margins and to 
    // center the visualization in the container. 
    var svg = d3.select("body").append("svg") 
     .attr("width", width + margin.left + margin.right) 
     .attr("height", height + margin.top + margin.bottom) 
     .append("g") 
     .attr("transform", "translate(" + 
       (margin.left + width/2) + "," + 
       (margin.top + height/2) + ")"); 

    // Define the scales that will translate data values 
    // into visualization properties. The "x" scale 
    // will represent angular position within the 
    // visualization, so it ranges lnearly from 0 to 
    // 2π. The "y" scale will reprent area, so it 
    // ranges from 0 to the full radius of the 
    // visualization. Since area varies as the square 
    // of the radius, this scale takes the square 
    // root of the input domain before mapping to 
    // the output range. 
    var x = d3.scale.linear() 
     .range([0, 2 * Math.PI]); 
    var y = d3.scale.sqrt() 
     .range([0, radius]); 

    // Define the function that creates a partition 
    // layout from the dataset. Because we're using 
    // `d3.nest` to construct the input dataset, the 
    // children array will be stored in the `values` 
    // property unless the node is a leaf node. In 
    // that case the `values` property will hold 
    // the data value itself. 
    var partition = d3.layout.partition() 
     .children(function(d) { 
      return Array.isArray(d.values) ? 
       d.values : null; 
     }) 
     .value(function(d) { 
      return d.values; 
     }); 

    // Define a function that returns the color 
    // for a data point. The input parameter 
    // should be a data point as defined/created 
    // by the partition layout. 
    var color = function(d) { 

     // This function builds the total 
     // color palette incrementally so 
     // we don't have to iterate through 
     // the entire data structure. 

     // We're going to need a color scale. 
     // Normally we'll distribute the colors 
     // in the scale to child nodes. 
     var colors; 

     // The root node is special since 
     // we have to seed it with our 
     // desired palette. 
     if (!d.parent) { 

      // Create a categorical color 
      // scale to use both for the 
      // root node's immediate 
      // children. We're using the 
      // 10-color predefined scale, 
      // so set the domain to be 
      // [0, ... 9] to ensure that 
      // we can predictably generate 
      // correct individual colors. 
      colors = d3.scale.category10() 
       .domain(d3.range(0,10)); 

      // White for the root node 
      // itself. 
      d.color = "#fff"; 

     } else if (d.children) { 

      // Since this isn't the root node, 
      // we construct the scale from the 
      // node's assigned color. Our scale 
      // will range from darker than the 
      // node's color to brigher than the 
      // node's color. 
      var startColor = d3.hcl(d.color) 
           .darker(), 
       endColor = d3.hcl(d.color) 
           .brighter(); 

      // Create the scale 
      colors = d3.scale.linear() 
        .interpolate(d3.interpolateHcl) 
        .range([ 
         startColor.toString(), 
         endColor.toString() 
        ]) 
        .domain([0,d.children.length+1]); 

     } 

     if (d.children) { 

      // Now distribute those colors to 
      // the child nodes. We want to do 
      // it in sorted order, so we'll 
      // have to calculate that. Because 
      // JavaScript sorts arrays in place, 
      // we use a mapped version. 
      d.children.map(function(child, i) { 
       return {value: child.value, idx: i}; 
      }).sort(function(a,b) { 
       return b.value - a.value 
      }).forEach(function(child, i) { 
       d.children[child.idx].color = colors(i); 
      }); 
     } 

     return d.color; 
    }; 

    // Define the function that constructs the 
    // path for an arc corresponding to a data 
    // value. 
    var arc = d3.svg.arc() 
     .startAngle(function(d) { 
      return Math.max(0, 
       Math.min(2 * Math.PI, x(d.x))); 
     }) 
     .endAngle(function(d) { 
      return Math.max(0, 
       Math.min(2 * Math.PI, x(d.x + d.dx))); 
     }) 
     .innerRadius(function(d) { 
      return Math.max(0, y(d.y)); 
     }) 
     .outerRadius(function(d) { 
      return Math.max(0, y(d.y + d.dy)); 
     }); 

    // Retrieve the raw data as a CSV file. 
    d3.csv("tornadoes.csv", function(error, dataset) { 

     // Extract the hierachy from the raw data 
     // Using `d3.nest` operations. The data's 
     // hierarchy is region -> state -> county. 
     // At the county level, we're only interested 
     // in a count of the data points. 
     var hierarchy = { 
      key: "United States", 
      values: d3.nest() 
       .key(function(d) { return d.region; }) 
       .key(function(d) { return d.state; }) 
       .key(function(d) { return d.county; }) 
       .rollup(function(leaves) { 
        return leaves.length; 
       }) 
       .entries(dataset) 
     }; 

     // Construct the visualization. 
     var path = svg.selectAll("path") 
      .data(partition.nodes(hierarchy)) 
      .enter().append("path") 
      .attr("d", arc) 
      .attr("stroke", "#fff") 
      .attr("fill-rule", "evenodd") 
      .attr("fill", color) 
      .on("click", click) 
      .on("mouseover", mouseover) 
      .on("mouseout", mouseout); 

     // Add a container for the tooltip. 
     var tooltip = svg.append("text") 
      .attr("font-size", 12) 
      .attr("fill", "#000") 
      .attr("fill-opacity", 0) 
      .attr("text-anchor", "middle") 
      .attr("transform", "translate(" + 0 + "," + (12 + height/2) +")") 
      .style("pointer-events", "none"); 

     // Add the title. 
     svg.append("text") 
      .attr("font-size", 16) 
      .attr("fill", "#000") 
      .attr("text-anchor", "middle") 
      .attr("transform", "translate(" + 0 + "," + (-10 -height/2) +")") 
      .text("Tornado Sightings in 2013 (www.noaa.gov)"); 

     // Handle clicks on data points. All 
     // we need to do is start the transition 
     // that updates the paths of the arcs. 
     function click(d) { 
      path.transition() 
       .duration(750) 
       .attrTween("d", arcTween(d)); 
      // Hide the tooltip since the 
      // path "underneath" the cursor 
      // will likely have changed. 
      mouseout(); 
     }; 

     // Handle mouse moving over a data point 
     // by enabling the tooltip. 
     function mouseover(d) { 
      tooltip.text(d.key + ": " + 
       d.value + " sighting" + 
       (d.value > 1 ? "s" : "")) 
       .transition() 
       .attr("fill-opacity", 1); 
     }; 

     // Handle mouse leaving a data point 
     // by disabling the tooltip. 
     function mouseout() { 
      tooltip.transition() 
       .attr("fill-opacity", 0); 
     }; 
    }); 

    // Function to interpolate values for 
    // the visualization elements during 
    // a transition. 
    function arcTween(d) { 
     var xd = d3.interpolate(x.domain(), 
        [d.x, d.x + d.dx]), 
      yd = d3.interpolate(y.domain(), 
        [d.y, 1]), 
      yr = d3.interpolate(y.range(), 
        [d.y ? 20 : 0, radius]); 
     return function(d, i) { 
      return i ? 
       function(t) { 
        return arc(d); 
       } : 
       function(t) { 
        x.domain(xd(t)); 
        y.domain(yd(t)).range(yr(t)); 
        return arc(d); 
       }; 
     }; 
    } 

這裏是tornadoes.csv樣本:

state,region,county,region_code,state_code,county_code,date,timezone,injuries_direct,injuries_indirect,deaths_direct,deaths_indirect,damage,f_scale,length,width,latitude,longitude 
Connecticut,New England,Fairfield County,1,9,1,01-Jul-13 09:58:00,EST-5,0,0,0,0,0.00K,EF0,3.7,150,41.1,-73.63 
Connecticut,New England,Hartford County,1,9,3,01-Jul-13 12:28:00,EST-5,0,0,0,0,5.00M,EF1,2.07,200,41.9,-72.65 
Connecticut,New England,Hartford County,1,9,3,01-Jul-13 12:45:00,EST-5,0,0,0,0,25.00K,EF0,0.86,50,41.98,-72.52 
Connecticut,New England,Tolland County,1,9,13,10-Jul-13 16:20:00,EST-5,0,0,0,0,50.00K,EF1,10.87,100,41.72,-72.41 
Maine,New England,Somerset County,1,23,25,02-Jun-13 15:36:00,EST-5,0,0,0,0,0.00K,EF0,0.03,40,45.07,-69.95 
Maine,New England,Washington County,1,23,29,17-Jul-13 17:48:00,EST-5,0,0,0,0,,EF0,0.15,50,45.67,-67.88 
Maine,New England,Piscataquis County,1,23,21,19-Jul-13 13:00:00,EST-5,0,0,0,0,,EF1,2.14,300,46.2,-69.1 
Maine,New England,Piscataquis County,1,23,21,11-Sep-13 14:48:00,EST-5,0,0,0,0,,EF0,0.25,125,, 
Massachusetts,New England,Norfolk County,1,25,21,09-May-13 15:31:00,EST-5,0,0,0,0,20.00K,EF0,0.38,50,42.1,-71.1 
Massachusetts,New England,Franklin County,1,25,11,01-Sep-13 17:25:00,EST-5,0,0,0,0,0.00K,EF0,0.05,10,, 
Delaware,Mid East,New Castle County,2,10,3,10-Jun-13 15:47:00,EST-5,0,0,0,0,,EF0,0.87,150,39.65,-75.74 
Maryland,Mid East,Prince George's County,2,24,33,19-Apr-13 18:26:00,EST-5,0,0,0,0,25.00K,EF0,0.5,75,38.84,-76.81 
Maryland,Mid East,Baltimore County,2,24,5,10-Jun-13 14:24:00,EST-5,0,0,0,0,1.00K,EF0,0.5,100,39.46,-76.45 
Maryland,Mid East,Baltimore County,2,24,5,10-Jun-13 14:44:00,EST-5,0,0,0,0,10.00K,EF0,0.2,75,39.26,-76.59 
Maryland,Mid East,St. Mary's County,2,24,37,10-Jun-13 20:01:00,EST-5,0,0,0,0,0.50K,EF0,0.25,50,38.22,-76.75 
Maryland,Mid East,St. Mary's County,2,24,37,13-Jun-13 14:24:00,EST-5,0,0,0,0,0.00K,EF0,13.83,200,38.28,-76.74 
Maryland,Mid East,Montgomery County,2,24,31,13-Jun-13 14:38:00,EST-5,0,0,0,0,1.00K,EF0,20.1,150,39.08,-77.32 
Maryland,Mid East,St. Mary's County,2,24,37,13-Jun-13 14:42:00,EST-5,0,0,0,0,0.00K,EF0,1.8,75,38.4,-76.54 
Maryland,Mid East,Prince George's County,2,24,33,01-Jul-13 18:33:00,EST-5,0,0,0,0,0.50K,EF0,2.3,75,38.7,-76.9 
Maryland,Mid East,Harford County,2,24,25,22-Jul-13 23:12:00,EST-5,0,0,0,0,3.00K,EF0,0.8,100,39.63,-76.18 
Maryland,Mid East,Harford County,2,24,25,13-Aug-13 05:01:00,EST-5,0,0,0,0,0.00K,EF0,1,75,39.52,-76.27 
New Jersey,Mid East,Union County,2,34,39,01-Jul-13 08:17:00,EST-5,0,0,0,0,20.00K,EF0,4.77,50,40.68,-74.45 
New Jersey,Mid East,Ocean County,2,34,29,13-Aug-13 09:05:00,EST-5,0,0,0,0,250.00K,EF0,3.16,100,, 
New Jersey,Mid East,Bergen County,2,34,3,07-Oct-13 14:16:00,EST-5,0,0,0,0,30.00K,EF1,1.25,100,, 
New York,Mid East,Chenango County,2,36,17,19-Apr-13 18:53:00,EST-5,0,0,0,0,70.00K,EF0,1.99,200,42.25,-75.45 
New York,Mid East,Delaware County,2,36,25,19-Apr-13 18:56:00,EST-5,0,0,0,0,30.00K,EF0,1.21,200,42.26,-75.42 
New York,Mid East,Montgomery County,2,36,57,29-May-13 17:47:00,EST-5,0,0,0,0,,EF1,0.58,500,42.85,-74.2 
New York,Mid East,Schenectady County,2,36,93,29-May-13 17:48:00,EST-5,1,0,0,0,,EF2,12.22,1760,42.85,-74.19 
New York,Mid East,Schoharie County,2,36,95,29-May-13 17:57:00,EST-5,0,0,0,0,0.00K,EF1,1.57,200,42.53,-74.58 
New York,Mid East,Saratoga County,2,36,91,29-May-13 18:10:00,EST-5,0,0,0,0,,EF1,0.75,200,42.79,-73.81 
New York,Mid East,Monroe County,2,36,55,19-Jul-13 18:31:00,EST-5,0,0,0,0,35.00K,EF0,0.28,10,43.32,-77.72 
New York,Mid East,Steuben County,2,36,101,27-Jul-13 17:10:00,EST-5,0,0,0,0,100.00K,EF1,14,500,42.05,-77.55 
Pennsylvania,Mid East,Erie County,2,42,49,28-May-13 18:35:00,EST-5,5,0,0,0,75.00K,EF1,1.69,50,41.92,-80.3 
Pennsylvania,Mid East,Erie County,2,42,49,28-May-13 18:53:00,EST-5,2,0,0,0,300.00K,EF1,17.83,150,41.9,-80.13 
Pennsylvania,Mid East,Warren County,2,42,123,28-May-13 20:25:00,EST-5,0,0,0,0,10.00K,EF0,2.76,50,41.89,-79.36 
Pennsylvania,Mid East,Warren County,2,42,123,28-May-13 20:58:00,EST-5,0,0,0,0,2.00K,EF1,4.22,100,41.91,-79.09 
Pennsylvania,Mid East,Perry County,2,42,99,27-Jun-13 13:19:00,EST-5,0,0,0,0,2.50K,EF1,3.02,50,40.26,-77.65 
Pennsylvania,Mid East,Centre County,2,42,27,27-Jun-13 15:05:00,EST-5,0,0,0,0,0.00K,EF1,1,75,40.78,-77.74 
Pennsylvania,Mid East,Lawrence County,2,42,73,10-Jul-13 15:42:00,EST-5,0,0,0,0,100.00K,EF1,1.16,250,40.9,-80.4 
Pennsylvania,Mid East,Potter County,2,42,105,27-Jul-13 16:00:00,EST-5,0,0,0,0,30.00K,EF1,2.94,200,41.68,-77.99 
Pennsylvania,Mid East,Somerset County,2,42,111,07-Aug-13 18:20:00,EST-5,0,0,0,0,2.00K,EF0,0.22,75,40.11,-79.01 
Illinois,Great Lakes,Franklin County,3,17,55,29-Jan-13 21:38:00,CST-6,0,0,0,0,0.00K,EF0,0.58,75,37.97,-89.11 
Illinois,Great Lakes,Saline County,3,17,165,29-Jan-13 22:16:00,CST-6,2,0,0,0,200.00K,EF2,0.97,125,37.84,-88.62 
Illinois,Great Lakes,Ford County,3,17,53,18-Apr-13 07:36:00,CST-6,0,0,0,0,15.00K,EF0,0.57,20,, 
Illinois,Great Lakes,Christian County,3,17,21,09-May-13 16:41:00,CST-6,0,0,0,0,0.00K,EF0,0.55,20,39.52,-89.19 
Illinois,Great Lakes,Carroll County,3,17,15,19-May-13 19:02:00,CST-6,0,0,0,0,0.00K,EF0,0.1,50,42,-89.99 
Illinois,Great Lakes,Macoupin County,3,17,117,20-May-13 21:14:00,CST-6,3,0,0,0,0.00K,EF2,0.2,75,39.07,-89.73 
Illinois,Great Lakes,Grundy County,3,17,63,28-May-13 19:18:00,CST-6,0,0,0,0,5.00K,EF0,1.85,20,41.26,-88.39 
Illinois,Great Lakes,Rock Island County,3,17,161,30-May-13 15:44:00,CST-6,0,0,0,0,40.00K,EF0,1.25,150,41.43,-90.73 
Illinois,Great Lakes,Whiteside County,3,17,195,30-May-13 16:35:00,CST-6,0,0,0,0,0.00K,EF0,0.57,25,41.66,-89.98 
Illinois,Great Lakes,Madison County,3,17,119,31-May-13 19:29:00,CST-6,0,0,0,0,0.00K,EF3,8.63,150,38.81,-90.12 
Illinois,Great Lakes,Macoupin County,3,17,117,31-May-13 19:49:00,CST-6,0,0,0,0,,EF2,1.47,150,39.13,-89.83 
Illinois,Great Lakes,Montgomery County,3,17,135,31-May-13 20:02:00,CST-6,0,0,0,0,,EF1,4.26,50,39.33,-89.68 
Illinois,Great Lakes,Macon County,3,17,115,31-May-13 21:03:00,CST-6,0,0,0,0,500.00K,EF1,1.99,100,39.86,-88.99 
Illinois,Great Lakes,Vermilion County,3,17,183,31-May-13 22:24:00,CST-6,0,0,0,0,50.00K,EF1,0.49,70,40.02,-87.6 
Illinois,Great Lakes,De Kalb County,3,17,37,12-Jun-13 15:32:00,CST-6,0,0,0,0,20.00K,EF1,2.27,100,41.73,-88.89 
Illinois,Great Lakes,Jo Daviess County,3,17,85,12-Jun-13 17:50:00,CST-6,0,0,0,0,0.00K,EF0,0.5,20,42.22,-90.24 
Illinois,Great Lakes,Carroll County,3,17,15,12-Jun-13 17:53:00,CST-6,1,0,0,0,0.00K,EF2,6.6,880,42.17,-90.15 
Illinois,Great Lakes,Will County,3,17,197,12-Jun-13 18:50:00,CST-6,0,0,0,0,35.00K,EF0,0.24,50,41.29,-87.91 
Illinois,Great Lakes,Henry County,3,17,73,24-Jun-13 15:00:00,CST-6,0,0,0,0,50.00K,EF1,6.21,50,41.43,-90.01 
Illinois,Great Lakes,Lee County,3,17,103,24-Jun-13 15:32:00,CST-6,0,0,0,0,10.00K,EF0,2.79,100,41.7,-89.56 
Illinois,Great Lakes,Bureau County,3,17,11,24-Jun-13 15:33:00,CST-6,0,0,0,0,10.00K,EF0,0.63,75,41.56,-89.34 
Illinois,Great Lakes,Coles County,3,17,29,29-Jun-13 13:05:00,CST-6,0,0,0,0,4.00K,EF0,0.14,20,39.58,-88.41 
Illinois,Great Lakes,Wabash County,3,17,185,01-Jul-13 18:41:00,CST-6,0,0,0,0,0.00K,EF0,0.8,50,38.4,-87.89 
Illinois,Great Lakes,Wayne County,3,17,191,02-Jul-13 17:55:00,CST-6,0,0,0,0,0.00K,EF0,0.67,50,38.45,-88.28 
Illinois,Great Lakes,La Salle County,3,17,99,01-Sep-13 17:42:00,CST-6,0,0,0,0,0.00K,EF0,1.63,50,, 
Illinois,Great Lakes,Alexander County,3,17,3,31-Oct-13 18:20:00,CST-6,0,0,0,0,100.00K,EF0,1.24,200,37.3,-89.51 
Illinois,Great Lakes,Alexander County,3,17,3,31-Oct-13 18:35:00,CST-6,0,0,0,0,10.00K,EF1,2.67,50,37.32,-89.27 
Illinois,Great Lakes,Pulaski County,3,17,153,31-Oct-13 18:40:00,CST-6,0,0,0,0,10.00K,EF1,3.84,50,37.32,-89.22 
Illinois,Great Lakes,Williamson County,3,17,199,31-Oct-13 18:51:00,CST-6,0,0,0,0,40.00K,EF1,6.43,175,37.61,-88.83 
Illinois,Great Lakes,Johnson County,3,17,87,31-Oct-13 18:56:00,CST-6,0,0,0,0,30.00K,EF1,0.7,50,37.33,-88.97 
Illinois,Great Lakes,Saline County,3,17,165,31-Oct-13 18:59:00,CST-6,0,0,0,0,70.00K,EF1,3.47,175,37.61,-88.71 
Illinois,Great Lakes,Peoria County,3,17,143,17-Nov-13 10:52:00,CST-6,0,0,0,0,40.00K,EF0,0.16,100,40.58,-89.66 
Illinois,Great Lakes,Tazewell County,3,17,179,17-Nov-13 10:53:00,CST-6,10,0,0,0,45.00M,EF2,2.1,100,40.58,-89.65 
Illinois,Great Lakes,Tazewell County,3,17,179,17-Nov-13 10:59:00,CST-6,121,0,3,0,910.00M,EF4,14.16,880,40.62,-89.57 
Illinois,Great Lakes,Woodford County,3,17,203,17-Nov-13 11:12:00,CST-6,4,0,0,0,25.00M,EF3,20.7,880,40.75,-89.35 
Illinois,Great Lakes,Macoupin County,3,17,117,17-Nov-13 11:30:00,CST-6,0,0,0,0,0.00K,EF0,2.11,20,39.23,-89.73 
Illinois,Great Lakes,Montgomery County,3,17,135,17-Nov-13 11:33:00,CST-6,0,0,0,0,0.00K,EF0,1.87,50,39.26,-89.7 
Illinois,Great Lakes,La Salle County,3,17,99,17-Nov-13 11:33:00,CST-6,0,0,0,0,150.00K,EF2,6.53,200,40.93,-89.04 
Illinois,Great Lakes,Livingston County,3,17,105,17-Nov-13 11:41:00,CST-6,0,0,0,0,75.00K,EF2,4.97,200,40.98,-88.93 
Illinois,Great Lakes,Livingston County,3,17,105,17-Nov-13 11:43:00,CST-6,0,0,0,0,0.00K,EF0,2.6,50,40.96,-88.93 
Illinois,Great Lakes,Clinton County,3,17,27,17-Nov-13 11:47:00,CST-6,0,0,0,0,0.00K,EF1,0.37,50,38.71,-89.52 
Illinois,Great Lakes,Washington County,3,17,189,17-Nov-13 12:04:00,CST-6,2,0,2,0,,EF4,10.59,200,38.42,-89.45 
Illinois,Great Lakes,Washington County,3,17,189,17-Nov-13 12:13:00,CST-6,0,0,0,0,0.00K,EF1,3.58,100,38.48,-89.25 
Illinois,Great Lakes,Christian County,3,17,21,17-Nov-13 12:15:00,CST-6,0,0,0,0,300.00K,EF1,2.52,100,39.4,-89.08 
Illinois,Great Lakes,Clinton County,3,17,27,17-Nov-13 12:16:00,CST-6,0,0,0,0,0.00K,EF0,1.18,20,38.51,-89.19 
Illinois,Great Lakes,Fayette County,3,17,51,17-Nov-13 12:22:00,CST-6,0,0,0,0,0.00K,EF2,8.5,200,39,-88.93 
Illinois,Great Lakes,Grundy County,3,17,63,17-Nov-13 12:22:00,CST-6,5,0,0,0,10.75M,EF2,4.42,200,41.24,-88.3 
Illinois,Great Lakes,Jasper County,3,17,79,17-Nov-13 12:25:00,CST-6,0,0,0,0,250.00K,EF1,3.53,100,38.85,-88.09 
Illinois,Great Lakes,Will County,3,17,197,17-Nov-13 12:26:00,CST-6,0,0,0,0,2.00M,EF2,7.6,200,41.29,-88.25 
Illinois,Great Lakes,Effingham County,3,17,49,17-Nov-13 12:28:00,CST-6,0,0,0,0,400.00K,EF1,2.9,100,39.07,-88.81 
Illinois,Great Lakes,Moultrie County,3,17,139,17-Nov-13 12:30:00,CST-6,0,0,0,0,860.00K,EF1,7.02,440,39.75,-88.6 
Illinois,Great Lakes,Douglas County,3,17,41,17-Nov-13 12:37:00,CST-6,0,0,0,0,825.00K,EF1,3.52,440,39.78,-88.47 
Illinois,Great Lakes,Will County,3,17,197,17-Nov-13 12:42:00,CST-6,0,0,0,0,750.00K,EF2,5.21,200,41.41,-87.93 
Illinois,Great Lakes,Douglas County,3,17,41,17-Nov-13 12:44:00,CST-6,0,0,0,0,1.20M,EF3,8.04,440,39.84,-88.33 
Illinois,Great Lakes,Champaign County,3,17,19,17-Nov-13 12:45:00,CST-6,6,0,0,0,60.00M,EF3,14.67,880,40.24,-88.17 
Illinois,Great Lakes,Douglas County,3,17,41,17-Nov-13 12:46:00,CST-6,0,0,0,0,220.00K,EF1,4.51,440,39.83,-88.27 
Illinois,Great Lakes,Champaign County,3,17,19,17-Nov-13 12:52:00,CST-6,0,0,0,0,800.00K,EF2,10.7,440,39.88,-88.19 
Illinois,Great Lakes,Kankakee County,3,17,91,17-Nov-13 13:00:00,CST-6,0,0,0,0,0.00K,EF1,0.05,75,41.3,-87.55 
Illinois,Great Lakes,Vermilion County,3,17,183,17-Nov-13 13:00:00,CST-6,0,0,0,0,2.50M,EF2,14.16,440,40.35,-87.93 
Illinois,Great Lakes,Will County,3,17,197,17-Nov-13 13:01:00,CST-6,0,0,0,0,100.00K,EF1,0.11,150,41.3,-87.55 
Illinois,Great Lakes,Vermilion County,3,17,183,17-Nov-13 13:03:00,CST-6,1,0,0,0,9.50M,EF2,19.68,440,39.94,-87.9 
Illinois,Great Lakes,Jefferson County,3,17,81,17-Nov-13 13:05:00,CST-6,0,0,0,0,3.00K,EF1,0.15,25,38.28,-88.76 
Illinois,Great Lakes,Wayne County,3,17,191,17-Nov-13 13:08:00,CST-6,0,0,0,0,150.00K,EF2,9.48,150,38.37,-88.53 
Illinois,Great Lakes,Iroquois County,3,17,75,17-Nov-13 13:14:00,CST-6,0,0,0,0,0.00K,EF0,1,100,40.49,-87.73 
Illinois,Great Lakes,Iroquois County,3,17,75,17-Nov-13 13:19:00,CST-6,0,0,0,0,20.00K,EF0,4.52,75,40.52,-87.67 
Illinois,Great Lakes,Wayne County,3,17,191,17-Nov-13 13:29:00,CST-6,0,0,0,0,10.00K,EF1,1.03,100,38.42,-88.17 
Illinois,Great Lakes,Edwards County,3,17,47,17-Nov-13 13:31:00,CST-6,0,0,0,0,200.00K,EF2,6.83,300,38.43,-88.15 
Illinois,Great Lakes,Edwards County,3,17,47,17-Nov-13 13:33:00,CST-6,0,0,0,0,150.00K,EF2,4.14,100,38.42,-88.15 
Illinois,Great Lakes,Wabash County,3,17,185,17-Nov-13 13:44:00,CST-6,1,0,0,0,250.00K,EF2,10.28,225,38.49,-87.92 
Illinois,Great Lakes,Massac County,3,17,127,17-Nov-13 14:20:00,CST-6,33,0,3,0,5.50M,EF3,7.77,500,37.12,-88.64 
Illinois,Great Lakes,Pope County,3,17,151,17-Nov-13 14:26:00,CST-6,0,0,0,0,500.00K,EF2,3.3,300,37.12,-88.5 
Indiana,Great Lakes,Orange County,3,18,117,30-Jan-13 01:47:00,EST-5,0,0,0,0,25.00K,EF0,0.37,75,38.61,-86.61 
Indiana,Great Lakes,Harrison County,3,18,61,30-Jan-13 04:17:00,EST-5,0,0,0,0,40.00K,EF0,0.44,215,38.12,-85.91 
Indiana,Great Lakes,Vigo County,3,18,167,09-May-13 19:14:00,EST-5,0,0,0,0,2.00K,EF0,0.14,20,39.38,-87.41 
Indiana,Great Lakes,Vigo County,3,18,167,09-May-13 19:24:00,EST-5,0,0,0,0,1.50K,EF0,0.15,20,39.39,-87.31 
Indiana,Great Lakes,Putnam County,3,18,133,21-May-13 01:29:00,EST-5,0,0,0,0,45.00K,EF0,1.05,100,39.85,-86.73 
Indiana,Great Lakes,Hendricks County,3,18,63,21-May-13 01:34:00,EST-5,0,0,0,0,10.00K,EF0,0.13,30,39.87,-86.67 
Indiana,Great Lakes,Benton County,3,18,7,31-May-13 19:30:00,EST-5,0,0,0,0,0.00K,EF0,0.5,20,40.54,-87.2 
Indiana,Great Lakes,Pike County,3,18,125,26-Jun-13 18:16:00,EST-5,0,0,0,0,20.00K,EF1,0.59,75,38.45,-87.1 
Indiana,Great Lakes,Perry County,3,18,123,26-Jun-13 20:29:00,EST-5,0,0,0,0,200.00K,EF1,5.26,100,, 
Indiana,Great Lakes,Miami County,3,18,103,10-Jul-13 12:28:00,EST-5,2,0,0,0,0.00K,EF1,3.47,200,40.75,-86.11 
Indiana,Great Lakes,Newton County,3,18,111,17-Nov-13 13:27:00,CST-6,0,0,0,0,250.00K,EF0,2.16,100,40.76,-87.3 
Indiana,Great Lakes,Jasper County,3,18,73,17-Nov-13 13:29:00,CST-6,0,0,0,0,75.00K,EF1,3.36,100,40.78,-87.27 
Indiana,Great Lakes,Jasper County,3,18,73,17-Nov-13 13:50:00,CST-6,0,0,0,0,150.00K,EF1,10.24,100,40.97,-87.12 
Indiana,Great Lakes,Pulaski County,3,18,131,17-Nov-13 14:03:00,CST-6,0,0,0,0,0.00K,EF1,13.18,100,41.08,-86.89 
Indiana,Great Lakes,Vermillion County,3,18,165,17-Nov-13 14:22:00,EST-5,0,0,0,0,300.00K,EF2,4.21,150,40.1,-87.53 
Indiana,Great Lakes,Warren County,3,18,171,17-Nov-13 14:25:00,EST-5,0,0,0,0,15.00K,EF2,1.73,150,40.13,-87.46 
Indiana,Great Lakes,Fountain County,3,18,45,17-Nov-13 14:32:00,EST-5,0,0,0,0,175.00K,EF2,10.31,75,40.12,-87.25 
Indiana,Great Lakes,Benton County,3,18,7,17-Nov-13 14:40:00,EST-5,0,0,0,0,50.00K,EF1,2.89,100,40.56,-87.15 
Indiana,Great Lakes,Montgomery County,3,18,107,17-Nov-13 14:42:00,EST-5,0,0,0,0,1.00K,EF2,0.59,75,40.21,-87.09 
Indiana,Great Lakes,White County,3,18,181,17-Nov-13 14:43:00,EST-5,0,0,0,0,0.00K,EF2,9.1,1200,40.57,-87.1 
Indiana,Great Lakes,Tippecanoe County,3,18,157,17-Nov-13 14:43:00,EST-5,0,0,0,0,10.00K,EF2,1.83,75,40.21,-87.08 
Indiana,Great Lakes,Montgomery County,3,18,107,17-Nov-13 14:47:00,EST-5,0,0,0,0,30.00K,EF1,1.78,40,40.17,-86.96 
Indiana,Great Lakes,Tippecanoe County,3,18,157,17-Nov-13 14:47:00,EST-5,0,0,0,0,18.00K,EF1,3.89,50,40.5,-87.08 
Indiana,Great Lakes,White County,3,18,181,17-Nov-13 14:51:00,EST-5,0,0,0,0,0.00K,EF2,4.15,300,40.69,-86.88 
Indiana,Great Lakes,Tippecanoe County,3,18,157,17-Nov-13 14:51:00,EST-5,0,0,0,0,21.00K,EF0,0.25,50,40.3,-86.92 
Indiana,Great Lakes,White County,3,18,181,17-Nov-13 14:52:00,EST-5,0,0,0,0,0.00K,EF2,9.23,900,40.56,-87.08 
Indiana,Great Lakes,Tippecanoe County,3,18,157,17-Nov-13 14:52:00,EST-5,0,0,0,0,125.00K,EF2,3.1,75,40.3,-86.95 
Indiana,Great Lakes,Tippecanoe County,3,18,157,17-Nov-13 14:54:00,EST-5,0,0,0,0,750.00K,EF3,8.69,100,40.35,-86.83 
Indiana,Great Lakes,Knox County,3,18,83,17-Nov-13 14:56:00,EST-5,1,0,0,0,75.00K,EF2,8.81,100,38.54,-87.61 
Indiana,Great Lakes,Tippecanoe County,3,18,157,17-Nov-13 14:56:00,EST-5,0,0,0,0,10.00K,EF1,2.87,35,40.29,-86.81 
Indiana,Great Lakes,Clinton County,3,18,23,17-Nov-13 15:04:00,EST-5,0,0,0,0,5.00K,EF0,3.4,100,40.41,-86.69 
Indiana,Great Lakes,Carroll County,3,18,15,17-Nov-13 15:06:00,EST-5,0,0,0,0,30.00K,EF1,16.44,100,40.43,-86.63 
Indiana,Great Lakes,White County,3,18,181,17-Nov-13 15:07:00,EST-5,0,0,0,0,0.00K,EF1,0.81,150,40.82,-86.59 
Indiana,Great Lakes,Clinton County,3,18,23,17-Nov-13 

我將不勝感激社會各界的輸入。我真的想要它的工作!謝謝!!!

+1

你可以[編輯]你的問題,告訴我們你的(long,long ...)代碼的*部分*不起作用嗎?例如,你是否看到你的3D龍捲風在屏幕上旋轉並吹走所有文字*但是*不知何故你不能將其顏色設置爲灰色? – usr2564301

+0

@Jongware嗨! :)其實,這是一個空白頁面!我會更多地關注它。也許這是我的瀏覽器,但我嘗試使用Safari,而且我得到了同樣的東西! – Johnathan

回答

0

有兩件事情錯在你的HTML文件:

的d3js庫不爲我加載。替換這是你的標籤(從d3js.org拍攝):http://d3js.org/

<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script> 

你的HTML文件丟失關閉標籤。把這個放在html文件的末尾:

</script> 
</body> 

這應該解決問題。