Commit 5d8c9fa1 authored by Sylvain Schmitz's avatar Sylvain Schmitz

improve rendering

parent eb8e97fc
......@@ -35,12 +35,25 @@
</concat>
</tokens>
</resourcecount>
<echo message="${fragments}"/>
<!-- get the number of entries -->
<resourcecount property="entries">
<tokens>
<concat>
<filterchain>
<tokenfilter>
<containsstring contains="&lt;query&gt;"/>
</tokenfilter>
</filterchain>
<fileset file="../../benchmark/${xml}.xml"/>
</concat>
</tokens>
</resourcecount>
<copy file="index.html" todir="${target.dir}/${xml}">
<filterchain>
<replacetokens>
<token key="FRAGMENTS" value="${fragments}"/>
<token key="BENCHMARK" value="${xml}"/>
<token key="ENTRIES" value="${entries}"/>
</replacetokens>
</filterchain>
</copy>
......
......@@ -25,11 +25,13 @@ svg {
#chord .group path {
fill-opacity: .5;
stroke: #444;
stroke-width: .1pt;
}
#chord path.chord {
stroke: #000;
stroke-width: .25px;
stroke: #444;
stroke-width: .1pt;
}
path {
......@@ -44,6 +46,7 @@ path.inactive, #circle:hover path.fade {
#matrix text { fill: #333; }
#matrix text.active { fill: red }
#matrix line { stroke: #fff; }
#matrix .row rect:hover { stroke: #333; stroke-width: .25pt; }
</style>
......@@ -118,15 +121,9 @@ queue()
function ready(error, fragments, matrix) {
if (error) throw error;
// maximal number of entries
var maxentries = 0;
for (let f of fragments)
maxentries = (maxentries < parseInt(f.entries))?
parseInt(f.entries): maxentries;
matrixgraph(fragments, matrix, maxentries);
chordgraph(fragments, matrix, maxentries);
matrixgraph(fragments, matrix, @ENTRIES@);
chordgraph(fragments, matrix, @ENTRIES@);
}
function matrixgraph(fragments, matrix, maxentries) {
......@@ -182,6 +179,8 @@ function matrixgraph(fragments, matrix, maxentries) {
.attr("y", x.bandwidth() / 2)
.attr("dy", ".32em")
.attr("text-anchor", "end")
.on("mouseover", mouseoverrow)
.on("mouseout", mouseout)
.text(function(d, i) { return fragments[i].name; });
rtext.append("title").text(function(d, i) {
return fragments[i].name + ": " + fragments[i].entries + " entries" + " ("
......@@ -257,6 +256,13 @@ function matrixgraph(fragments, matrix, maxentries) {
chordsvg.selectAll(".chord").classed("inactive", false);
}
function mouseoverrow(p) {
d3.selectAll(".row text").classed("active", function(d) { return d === p; });
chordsvg.selectAll(".chord").classed("inactive", function(d, i) {
return (d.source.index != p[0].y && d.target.index != p[0].y);
});
}
function mouseoverpercent(p) {
d3.selectAll(".column text").classed("active", function(d) { return d === p; });
chordsvg.selectAll(".chord").classed("inactive", function(d, i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment