Thanks to visit codestin.com
Credit goes to github.com

Skip to content

rings: add replacement for Lens type #15

@kortschak

Description

@kortschak

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions