clinical-timeline icon indicating copy to clipboard operation
clinical-timeline copied to clipboard

Hide splitted track does not work if tracks have the same name

Open inodb opened this issue 8 years ago • 2 comments

We expect the initial tracks to have different names, but it is possible that a split track might have the same name. Currently the track that is hidden is always the first one instead of the one that was clicked on: hide_same_name Problem First splitted track with same name is hidden Expected behavior The splited track clicked on should be hidden

inodb avatar Mar 03 '16 15:03 inodb

I am not sure it this is a straight-forward bug fix. If I am missing something please let me know.

We are getting the innerHTML of the particular element and then passing it over to the getTrack function which returns the first element of the array which matches with the said track name(from the data). I am uncertain on how to map the clicked element with the data since from the HTML side we only have access to the innerHTMLand that is not unique.

Any ideas?

madhug-nadig avatar Mar 03 '16 19:03 madhug-nadig

It looks like a more tricky problem than anticipated. It would require some changes to the API i.e. toggleTrackVisibility and getTrack should use more than just the track name. Maybe we could change it to work in such a way that when the given input is a string it will use the name, but when you supply an object e.g. {label:trackname,split:true} it will use underscorejs' where http://underscorejs.org/#where

Another way would be to bind the data using D3 to the label/add track button and set the visible attribute to false or true. I will try to break this issue down a bit more. Thanks for looking into it

inodb avatar Mar 04 '16 00:03 inodb