Comments (2)
You are correct, we use Cairo to render SVG -- unfortunately that is also the reason why I am afraid it is not possible to add such active content to the output using the Cairo API. As far as I remember, it does not include such SVG-specific actions, being independent of the target output format.
I guess this may be possible using an external SVG library in a modification of the sketch tool. The boundary coordinates of the feature boxes in the image as well as metadata for each feature drawn in an image are accessible using the GtImageInfo
and GtRecMap
classes in the GenomeTools API. See http://genometools.org/libgenometools.html#GtImageInfo. However, I would have to research what library would support adding mouseover or click layers to an existing SVG file. Sounds quite non-trivial though.
I definitely see the usefulness of what you request and would love to include something like that as an optional feature for the SVG output, although my time is quite limited right now. Do you have experience with SVG or SVG editing libraries and could suggest some suitable project I could look into? Or is it enough to add some additional code to the end of the file, which -- as you correctly say -- is rather difficult to read as a human.
from genometools.
Unfortunately, no I can't say that I have viable suggestions on other libraries. In an older project we scripted SVG generation by hand. As you say, you have the coordinates, and writing an interactive SVG polygon is pretty simple.
You might have a look an example at http://jsfiddle.net/aweQh/
(Forgive the bad HTML formatting. It was a quick paste from a website I used to run.)
File size and generation time would be much more efficient, I believe, as Cairo seems to be adding a tag for each stroke, including converting text labels to drawings. If for whatever reason you couldn't/wouldn't want to render an SVG in this way (ie I'm sure it could break much of what you have here), I believe you could maybe tack this sort of scripting to the end of the generated SVG, putting up some invisible rectangles with the onmouseover (or onclick) events, with useful info pulled from the gff the same way labels are. Maybe? Unfortunately, I'm not a strong enough programmer outside of Perl to easily immediately understand the API, but I may give it a try. Though, as you say, time is always limited. :)
Thanks for the attention and consideration! As I said, AnnotationSketch in particular has already been really useful for us.
from genometools.
Related Issues (20)
- Running LTRharvest/digest with parallel HOT 5
- gt gff3 -sortlines fails on particular gff HOT 11
- Difficulty extracting intronic regions HOT 2
- There is no -retainids when using ltrdigest, Why don't add one? HOT 2
- We need to run tirvish two times for a single genome? HOT 1
- Install error: cairo.h: No such file or directory on RedHat 7 HOT 2
- How to test whether the GenomeTools library is installed properly HOT 1
- After installation, how to use and test whether the function is normal? HOT 4
- bed_to_gff3 bug HOT 9
- error: ignoring return value of 'fwrite', declared with attribute warn_unused_result [-Werror=unused-result] HOT 3
- LtrPipeline: GenomeTools failed to run ltrharvest. Error code: 139 HOT 4
- gff3validator "Sequence Ontology" out of date? HOT 3
- Assertion error: gt_feature_node_remove_leaf HOT 2
- gt gff3 loss of intergenic regions HOT 1
- sketch all non-overlapping genes on one track HOT 4
- -Werror is for CI + developer only HOT 4
- Fails to build on macOS Ventura / Xcode 14.x HOT 3
- New build warnings on GCC 13 turned errors are blocking builds HOT 1
- Build time issue with GenomeTools 1.5.9 HOT 5
- Aborted (core dumped) with LTR harvest HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genometools.