Jump to content

Ctrl clicking not working on leaf


Recommended Posts

I'm developing a line chart and I'm having trouble with marking the whole leaf. It works when marking the first one but if I ctrl+click a second leaf it unmarks the previously marked leaf.
There's also a problem that on some lines, a specific point is not marked when switching from marking one line to another (doesn't happen if marking the line when nothing is marked)

image.thumb.png.602715e32c8c9be166842770f183b2d3.png

The blue circles are points at which the marking starts/stops. The ones in the middle of the line show that a point is not marked, breaking the line in 2.

Here is the relevant code :

svg.selectAll(".line")
    .data(data)
    .join("path")
    .attr("fill", "none")
    .attr("class", d => d.columnName)
    .attr("stroke", d => d.color)
    .attr("stroke-width", 3)
    .attr("d", d => line(d.values))
    .clone()
    .attr("stroke-width", 15)
    .attr("opacity", 0)
    .on("click", (e: MouseEvent, d) => e.ctrlKey ? d.mark("ToggleOrAdd") : d.mark())

and data preparation :

let data = colorLeaves.map(leaf => {
    let rows = leaf.rows();
    return {
        color: rows[0].color().hexCode,
        columnName: leaf.key!,
        mark: (op?: MarkingOperation) => leaf.mark(op),
        values: cumul(rows)
    }
});

I've checked and I do receive "ToggleOrAdd" as the value for op in the mark callback when ctrl is pressed

It also appears that on every marked line the last value is never marked
console.log(data.find(l => l.values[0].isMarked)?.values.slice(-1)[0].isMarked)  always gives false

Edited by Gaspard Martin-Jouannaud
Link to comment
Share on other sites

  • 3 weeks later...

Hi Gaspard,

Can you confirm - is this still an issue for you? And, which version of Spotfire are you using?

I just ran a quick test, and all appears to be working for me in similar circumstances.

If it is still an issue, it may be best to run a quick troubleshooting meeting to help you find the solution. Please email dr@spotfire.com if you would like us to assist further.

Thanks,

Andrew Berridge

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...