link to data from histogram tooltips doesn't work properly at the moment

Issue #205 resolved
David Platten created an issue

Links in mean DAP and DLP histogram plots take the user to more days than they should.

Comments (14)

  1. David Platten reporter

    I've looked at this again this morning and can't see a problem. It may be that my browser was using a cached JavaScript file for the plots. It would be good if someone else checked to see if they think the links from the histogram tooltips take you to the correct data.

    Thanks.

  2. Ed McDonagh

    Which branch @dplatten?

    I'm not sure how soon I can do this, but I'll try. So you think there may have been a problem where the tooltip links didn't respect the date filters?

  3. David Platten reporter

    Any branch with the recently-changed GETs will do. The problem may have been date filtering or study name filtering when viewing an acquisition plot.

  4. David Platten reporter

    It's not possible to link from the CTDIvol histograms as there is no filter defined for CTDIvol at the moment. If I added a new filter then yes, it would be trivial to add the links. I was a little reluctant to add CTDIvol filters as the filter list is already a little congested on the CTfiltered.html page. Do you know if it is possible to make a filter hidden on the page, but still be active?

  5. David Platten reporter

    I tried searching to answer my question a few weeks ago and couldn't find an answer.

  6. David Platten reporter

    There is a problem with the links from histogram tooltips if the protocol or study name includes an ampersand (&) symbol. This is escaped to "&", but not then unescaped in the underlying views.py code, preventing the database filtering from working.

  7. David Platten reporter
    • changed status to open

    There is a problem with the links from histogram tooltips if the protocol or study name includes an ampersand (&) symbol. This is escaped to "&", but not then unescaped in the underlying views.py code, preventing the database filtering from working.

  8. David Platten reporter

    I think it may be more elegant, and still work, if I processed the text contained in requestResults that is sent to view.py rather than in the chart JavaScript. Something like the code below may work.

    import HTMLParser
    import urllib
    
    myString = "Head & spine"
    h = HTMLParser.HTMLParser()
    myStringUnescaped = h.unescape(myString)
    print myStringUnescaped
    
    myStringRecoded = urllib.quote_plus(myStringUnescaped)
    print myStringRecoded
    
    # Or in fewer lines
    myStringNew = urllib.quote_plus(h.unescape(myString))
    print(myStringNew)
    

    This will also catch other possible problems that I haven't encountered yet.

  9. David Platten reporter

    I don't think my earlier idea about unescaping & in python is a good one. I can't seem to get it to work, so I'm leaving it as it is - a simple text replace in the JavaScript of each chart

  10. Log in to comment