在D3 V4中使用format.parse吗?

时间:2018-08-21 08:43:32

标签: javascript d3.js

我正在尝试修改此b.lock

原始块正在使用D3 V3,但我正在尝试使用V4。

我被原始作者特别在代码中使用“ format.parse”的部分困住了

// get min/max dates
          var time_extent = d3.extent(neigh_data, function(d){
            return format.parse(d['timestamp']);
          });

// define the values to map for x and y position of the line
          var line = d3.svg.line()
                       .x(function(d) { return time_scale(format.parse(d['timestamp'])); })
                       .y(function(d) { return measure_scale(+d[field]); });

我知道这是关于时间格式的,但是我似乎无法弄清楚什么是V4。在API参考中,它指出format.parse为

  

format.parse(string):解析指定的字符串,返回相应的date对象。

但是,除了timeParse之外,我似乎找不到其他选择,但我尝试过但没有用。

0 个答案:

没有答案