Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vertical bar #30

Open
danielecook opened this issue Oct 15, 2015 · 2 comments
Open

Add vertical bar #30

danielecook opened this issue Oct 15, 2015 · 2 comments

Comments

@danielecook
Copy link

Is there a way to add a vertical bar across all tracks?

@chmille4
Copy link
Owner

a vertical bar? Can you give me a quick sketch to give me an idea what you are looking for?

@danielecook
Copy link
Author

I wrote a simple implementation here (having never used Canvas, and which is not integrated into the library...):

// Get canvas object. Provide a start (first vertical line) and an end (second vertical line)
   var boundary = document.getElementById("gene_glyph").getContext("2d");
    // Start
    boundary.beginPath();
    boundary.moveTo(glyph.pixelsToNts(start) + glyph.offset - glyph.pixelsToNts(glyph.scale.min), 15);
    boundary.lineTo(glyph.pixelsToNts(start) + glyph.offset - glyph.pixelsToNts(glyph.scale.min), 1000);
    boundary.strokeStyle = "Blue";
    boundary.stroke();
    // End
    boundary.beginPath();
    boundary.moveTo(glyph.pixelsToNts(end) + glyph.offset - glyph.pixelsToNts(glyph.scale.min), 15);
    boundary.lineTo(glyph.pixelsToNts(end) + glyph.offset - glyph.pixelsToNts(glyph.scale.min), 1000);
    boundary.strokeStyle = "Blue";
    boundary.stroke();

I'm sure there is a cleaner way. I think an ideal method would be invoked like this:

// Canvas is a scribl object
canvas.vertical(nt_pos, stroke, color, etc.)

I essentially want to use this for marking, for example, the start and end of an interval that a user inputs to search on.

screen shot 2015-10-15 at 4 26 46 pm

By the way, this is a great library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants