0
我已經成功地爲示例數據集實現了一個codeflower視圖。用於實現該代碼是:魚眼畸變和codeflower
var currentCodeFlower;
var createCodeFlower = function(json) {
document.getElementById('jsonData').value = JSON.stringify(json);
if(currentCodeFlower) currentCodeFlower.cleanup();
var total = countElements(json);
//console.log(total);
w = parseInt(Math.sqrt(total) * 50, 10);
h = parseInt(Math.sqrt(total) * 50, 10);
currentCodeFlower = new CodeFlower("#visualization",w,h).update(json);
};
d3.json('data.json', createCodeFlower);
我現在想魚眼失真添加到這個可視化的,我不知道如何去這個問題。我查看了魚眼的documentation,但是因爲我使用了codeflower.js,所以我不知道如何訪問svg元素。任何幫助表示讚賞。謝謝。