0
D3.js를 사용하여 사용자가 클러 칭 결과를 볼 수있는 덴도 그램을 생성했습니다. 그러나 디스플레이를 깨끗하게 유지하려면 부모 노드를 최대한 단순하게 유지해야합니다 (텍스트가없고 원이 없음).D3 덴도 그램에서 내부 및 리프 (최종) 노드를 구별하는 방법
이 데이터가 현재 표시되는 방식입니다 : http://i.imgur.com/Cz52Fhl.png
그리고 이것은 내가 그것을 보여 드리고자 방법의 예입니다 (방향이 중요하지 않습니다, 무슨 중요한 것은 내부 노드는 텍스트 또는 원하지 않은 것입니다) : http://i.imgur.com/Oo2A0b7.png
코드 ...
// Compute the new tree layout.
var nodes = tree.nodes(root).reverse(),
links = tree.links(nodes);
// Normalize for fixed-depth.
nodes.forEach(function(d) { d.y = d.depth * 130; });
// Update the nodes…
var node = svg.selectAll("g.node")
.data(nodes, function(d) { return d.id || (d.id = ++i); });
// Enter any new nodes at the parent's previous position.
var nodeEnter = node.enter().append("g")
.attr("class", "node")
.attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; })
.on("click", click);
nodeEnter.append("circle")
.attr("r", 1e-6)
.style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; });
nodeEnter.append("text")
.attr("x", function(d) { return d.children || d._children ? -10 : 10; })
.attr("dy", ".35em")
.attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; })
.text(function(d) { return d.canonical; })
.style("fill-opacity", 1e-6);
아 그래,하지만 Clusterfck JS 라이브러리를 사용하고 있으며 매우 제한되어 있으며 기본적으로 완전히 정보를 생성합니다. 나는 이것에 문제가있다. JavaScript 또는 PHP에서 이러한 알고리즘 (예 : 유클리드 거리 및 마할 라 노비스 거리)이 구현 된 다른 라이브러리를 알고 계십니까? – gilvandev
clusterfck와 유사 함 : 그림 https://code.google.com/p/figue/wiki/ 소개 – widged
euclidian 거리의 경우, 다음을 확인하십시오 : http://www.codeproject.com/Articles/477689/JavaScript-Machine- 학습 - 및 - 신경망 - wi – widged