
Product
Go Support Is Now Generally Available
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
adjust-engine
Advanced tools
Position an element relative to another element. This repository is the workhorse behind adjust.
npm install adjust-engine
adjust = Adjust(options)
Initialize an adjustment. Supports the following options:
left top
right bottom
center middle
10% 16% (x y)
target (string): Alignment point of the target (or host) element. Supports same CSS style adjustments as attachment
.
offset (object): Specify an offset to apply to the attachment element. Here's some examples:
bottom: -10
left: 100
right: 50
top: -25
true
. Automatically flip the element if the adjustment causes the attachment to be out of viewport. You should specify a viewport_position
for flip to work properly.adjust(attachment_position, target_position, [ viewport_position ])
Get a position of where the attachment should be. Here's a full example:
var adjust = Adjust({
attachment: 'center middle',
target: 'center middle'
});
var attachment = {
height: 50,
width: 50
}
var target = {
top: 0,
left: 0,
right: 100,
bottom: 100
}
var position = adjust(attachment, target)
assert.deepEqual(position, {
top: 25,
left: 25,
width: 50,
height: 50,
right: 75,
bottom: 75
})
make test
MIT
FAQs
adjust an element relative to another element
The npm package adjust-engine receives a total of 53 weekly downloads. As such, adjust-engine popularity was classified as not popular.
We found that adjust-engine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.
Security News
vlt adds real-time security selectors powered by Socket, enabling developers to query and analyze package risks directly in their dependency graph.
Security News
CISA extended MITRE’s CVE contract by 11 months, avoiding a shutdown but leaving long-term governance and coordination issues unresolved.