-1
绘制线串
我目前在过滤了CSV文件中获得我的数据以这种方式提供过滤后的数据作为输入到D3.js
d3.csv("Viz2SampleData.csv", function(data43)
{
links = [];
data43.filter(function(d,i)
{
if (d3.select("#select-owner").node().value == "ALL" && d3.select("#select-contractor").node().value != "ALL" && d3.select("#select-launch").node().value == "ALL")
{
// for(var i=0, len=d.length-1; i<=len; i++)
// {
console.log(d.length)
if (d3.select("#select-contractor").node().value == d.CountryOfContractor)
{
return d;
}
]
})
}
})//closing for filter
现在,我想提请使用下面只代码的链接对于上面根据我的条件选择的过滤数据。下面的代码在没有任何过滤器的情况下为CSV文件中的所有行绘制线串。该data43元素没有得到过滤或者我访问它在一个错误的方式
links.push({
type: "LineString",
coordinates: [
[ data43[i].OperatorOwnerLon, data43[i].OperatorOwnerLat ],
[ data43[i].CountryOfContractorLon, data43[i].CountryOfContractorLat ],
[ data43[i].lon, data43[i].lat ]
}
乔纳森我不能感谢你才好。这就像一个魅力:) – sjaikumar