Skip to content

Commit

Permalink
bugfix; alpha not acceptable violin fill
Browse files Browse the repository at this point in the history
  • Loading branch information
gszep committed Oct 10, 2021
1 parent 957e4b2 commit b3f33fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FlowAtlas"
uuid = "ef7debb3-0d09-4604-8960-6109d4c5b3e0"
authors = ["gszep <[email protected]>"]
version = "0.1.8"
version = "0.1.9"

[deps]
CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca"
Expand Down
8 changes: 3 additions & 5 deletions src/assets/violins.js
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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, {
Expand All @@ -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)
})

Expand Down

0 comments on commit b3f33fe

Please sign in to comment.