PitchInteractiveInc / Phinch

Phinch is an open-source framework for visualizing biological data, funded by a grant from the Alfred P. Sloan foundation. This project represents an interdisciplinary collaboration between Pitch Interactive, a data visualization studio in Oakland, CA, and biological researchers at UC Riverside.
http://phinch.org/
BSD 2-Clause "Simplified" License
149 stars 30 forks source link

Phinch sample names do not strip rich text info #12

Open ryneches opened 10 years ago

ryneches commented 10 years ago

Cutting and pasting names for samples in the Phinch Name column in the Filter Data page can result in unusable names.

I recommend stripping HTML elements and checking for valid Unicode. html_element_names

hollybik commented 10 years ago

Right now, editing names in the Phinch Name column is only geared towards manually typing in the names of a samples or two. The best way to pull in all your samples names is to include a column with a header name of phinchID in your tab-delimited sample mapping file (the one you use in QIIME and then embed into your .biom file using the biom add-metadata command). Note that phinchID names should be < 15 characters so that they are fully visible in the graph axes.

ryneches commented 10 years ago

If users are able to type names of a sample or two, the application needs to be able to behave correctly if the user cuts and pastes that text. Many browsers will try to preserve formatting information, which is then not handled correctly by other parts of Phinch. Some basic input validation on the sample name input field would avoid this problem.

Phinch already uses jQuery, so this is a one-liner :

jQuery(html).text();

Otherwise, I strongly recommend that sample name editing should be disabled if input validation is not a development priority. A half-working feature, especially when there is a better alternative, is worse than no feature.

hollybik commented 10 years ago

Ok thanks for the clarification Russell, I'll reopen this issue and mark it as a future development priority. Or feel free to fork the repo and add in that one-liner yourself; we can review and merge.