diff --git a/Project.toml b/Project.toml index a2cc3fc..0baa8d6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FlowAtlas" uuid = "ef7debb3-0d09-4604-8960-6109d4c5b3e0" authors = ["gszep "] -version = "0.1.8" +version = "0.1.9" [deps] CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca" diff --git a/src/assets/violins.js b/src/assets/violins.js index a088d92..e9b0e4a 100644 --- a/src/assets/violins.js +++ b/src/assets/violins.js @@ -1,4 +1,4 @@ -function violins(data, color="#0088AA", alpha='11', +function violins(data, color="#0088AA", margin=({top:40,right:20,bottom:40,left:60}) ) { const svg = d3.select("div#violins svg") @@ -34,14 +34,14 @@ function violins(data, color="#0088AA", alpha='11', .x( (x,i)=> binCentre(data.binCentres[i]) ) .y0( y=>-density(y) ).y1( y=>density(y) ) - group.append("path").attr("fill",color+alpha).attr("stroke",color) + group.append("path").attr("fill","none").attr("stroke",color) .attr("id", x=>x.id ).attr("d", x=>violin(x.values) ) ////////////////////////////////////////////// violin color event .style("cursor","pointer") .on("click", function(event,data){ - var hex = event.target.getAttribute("fill") + var hex = event.target.getAttribute("stroke") var color = document.createElement("input") Object.assign( color, { @@ -60,8 +60,6 @@ function violins(data, color="#0088AA", alpha='11', feature.setStyle(style) document.querySelectorAll(`#${CSS.escape(data.id)}`).forEach( violin=>{ - - violin.setAttribute("fill",color+alpha) violin.setAttribute("stroke",color) })