【发布时间】:2015-03-03 04:26:49
【问题描述】:
我已成功为示例数据集实现了代码花视图。用来实现的代码是:
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 元素了。任何帮助表示赞赏。谢谢你。
【问题讨论】:
标签: svg d3.js visualization fisheye