【发布时间】:2018-11-25 16:19:34
【问题描述】:
谁能解释一下 Deck.gl 与 d3js 相比如何进行数据更新和转换?例如在这段代码中:
var updateLayers = function(dataset) {
var scatterplot = new deck.ScatterplotLayer({
/* unique id of this layer */
id: 'checkins',
/* data: an array of objects */
data: dataset,
/* data accessors */
getPosition: d => d.geometry.coordinates, // returns longitude, latitude, [altitude]
getRadius: d => circleSize(d.properties.reviews), // returns radius in meters
getColor: d => [255, 0, 0],
outline: true, // returns R, G, B, [A] in 0-255 range
transitions: {
getRadius: {
duration: 1000,
easing: d3.easeCubicInOut,
enter: value => [value[0], value[1], value[2], 1] // fade in
}
}
})
// Add the layer to deckgl:
deckgl.setProps({ layers: [scatterplot] });
}
我不清楚enter: value => [value[0], value[1], value[2], 1] 在做什么。谁能解释一下?我通常希望(根据 d3js)这个 enter: 正在设置转换中的断点,但我不清楚 value 指的是什么?
【问题讨论】: