Skip to content
Snippets Groups Projects
Commit dd87e524 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

remove x axis domain

parent 6152ec91
No related branches found
No related tags found
No related merge requests found
Pipeline #129455 failed
...@@ -14,12 +14,12 @@ const structureBasket = useStructuresBasket() ...@@ -14,12 +14,12 @@ const structureBasket = useStructuresBasket()
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
genes: null genes: null
}); });
const height = ref<number>(150) const height = ref<number>(120)
const svgRef = ref<SVGElement | null>(null) const svgRef = ref<SVGElement | null>(null)
const margin = ref<PlotMargin>({ const margin = ref<PlotMargin>({
marginTop: 10, marginTop: 10,
marginRight: 7, marginRight: 7,
marginBottom: 30, marginBottom: 40,
marginLeft: 7, marginLeft: 7,
}) })
...@@ -124,19 +124,14 @@ function draw() { ...@@ -124,19 +124,14 @@ function draw() {
gx gx
.attr("transform", `translate(${marginLeft},${toValue(height) + 5})`) .attr("transform", `translate(${marginLeft},${toValue(height) + 5})`)
.call(xAxis) .call(xAxis)
.selectAll("text")
.attr("transform", 'rotate(20)')
.attr("text-anchor", "start")
const gxTitle = createOrSelect(gx, "text", "x-axis-title") gx.call(g => g.select(".domain")
gxTitle .remove())
.attr("text-anchor", "end")
.attr("fill", "currentColor")
gxTitle
.attr("x", toValue(computedPlotWidth))
.attr("y", - 10)
.selectAll("text")
.attr("transform", 'rotate(20)')
.attr("text-anchor", "start")
let gGenes = createOrSelect(svg, "g", "genes") let gGenes = createOrSelect(svg, "g", "genes")
gGenes gGenes
...@@ -160,18 +155,20 @@ function drawGenes(genesGroup: d3.Selection<SVGElement, any, SVGElement, any>) { ...@@ -160,18 +155,20 @@ function drawGenes(genesGroup: d3.Selection<SVGElement, any, SVGElement, any>) {
gGene.append("path") gGene.append("path")
.classed("gene", true) .classed("gene", true)
gGene.append("image") gGene.append("g").classed("img", true).append("image")
.on("mouseover", function (event) { .on("mouseover", function (event) {
d3.select(event.srcElement.previousSibling) const target = d3.select(event.srcElement.parentElement)
.attr("stroke-width", 4) target
.attr("stroke", "darkred") // .attr("stroke-width", 4)
d3.select(event.srcElement).attr("cursor", "pointer") // .attr("stroke", "darkred")
.attr("cursor", "pointer")
}) })
.on("mouseout", function (event) { .on("mouseout", function (event) {
d3.select(event.srcElement.previousSibling) const target = d3.select(event.srcElement.parentElement)
.attr("stroke-width", 0) target
.attr("stroke", null) // .attr("stroke-width", 0)
d3.select(event.srcElement).attr("cursor", "unset") // .attr("stroke", null)
.attr("cursor", "unset")
}) })
gGene.append("text") gGene.append("text")
// .attr("fill", "white") // .attr("fill", "white")
...@@ -185,7 +182,7 @@ function drawGenes(genesGroup: d3.Selection<SVGElement, any, SVGElement, any>) { ...@@ -185,7 +182,7 @@ function drawGenes(genesGroup: d3.Selection<SVGElement, any, SVGElement, any>) {
exit => exit.remove() exit => exit.remove()
) )
genesSelection.attr("transform", d => `translate(${d.x}, 0)`) genesSelection.attr("transform", d => `translate(${d.x}, 0)`)
genesSelection.select("image") genesSelection.select("g.img").select("image")
.attr("transform", d => `translate(0, ${toValue(yScale)("img")})`) .attr("transform", d => `translate(0, ${toValue(yScale)("img")})`)
.attr("href", d => d?.structImg ?? null) .attr("href", d => d?.structImg ?? null)
.attr("width", d => d.width) .attr("width", d => d.width)
......
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