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

rings: add replacement for Lens type #15

Open
kortschak opened this issue Aug 17, 2018 · 0 comments
Open

rings: add replacement for Lens type #15

kortschak opened this issue Aug 17, 2018 · 0 comments
Assignees

Comments

@kortschak
Copy link
Member

The design intention for the Lens type in the rings package was to allow users to selectively magnify regions of the plot. This has benefits in genomics plotting and also in highly differentially dense graph plots. The approach was to provide a shim arc that adjusted the circumferential coordinates of arcs places on top of it. This was not properly wired through all the types that would need to know about it.

I still think this is a useful addition to the package, but I think a better approach would be to add an interface type:

// Lens modifies an Arc to allow it to adjust the magnification of regions of itself.
type Lens interface {
    // Focus returns a change in position for a given angle.
    // The returned delta must not result in an angle outside
    // the receiver's arc.
    Focus(theta Angle) (delta Angle)
}

With this change arcs that are being plotted onto will be queried for satisfaction of Lens and have the angular coordinates adjusted by the returned delta.

@kortschak kortschak self-assigned this Aug 17, 2018
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

1 participant