The issues you are describing with the legend positioning --- they
affect the heatmap color bar positioning, too. How are you
determining how to position that?
What if you position the legend outside of the area encompassing the
RNA? (Outside of the bounding box.) It would be a bit far away, but
it is a simple away to guarantee no collisions. If you could allow
the user to drag the legend to wherever they want, the user could then
reposition the legend if they want a publication-quality figure, but
you still get a simple implementation of positioning the legend
automatically. The config could specify which side or corner to put
the legend.
Yes, I know the command-line options and Java API exist and are
useful, but the applet HTML is actually my favorite way to specify
what I want VARNA to do because it produces an instance that the user
can interact with in the web browser. And what I'm aiming for
ultimately is something like Rfam has, where you have hundreds of RNAs
color-coded according to various scoring schemes, and the user can
tweak those to produce figures for talk slides and papers.
Cheers,
Andrew