
Product
Introducing Module Reachability: Focus on the Vulnerabilities That Matter
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
d3-autocomplete
Advanced tools
d3-autocomplete
Small autocomplete written using D3
PRs welcome!
npm install d3-autocomplete
var createAutocomplete = require('d3-autocomplete')
var autocomplete = createAutocomplete({placeholder: 'Søg'}, function (query, cb) {
cb(null, [
{label: 'Foo', some: 'key'},
{label: 'Bar', some: 'key'}
])
})
autocomplete.on('change', function (data) {
console.log(data)
})
autocomplete.on('error', function (err) {
console.error(err)
})
document.body.appendChild(autocomplete.element)
createAutocomplete(attrs, queryCallback)
Returns:
{
element, // The element to add to the DOM
on(event, listener), // Listen for either `change` or `error` events
add(suggestion), // Add a suggestion
delete(suggestion), // Remove a suggestion
clear(), // Remove all suggestions
open(), // Open suggestions
close(), // Close suggestions
toggle(), // Toggle suggestions
query([value]) // Set/get query of autocomplete
}
attrs
Type: Object
Various attributes to change on the elements created. See the source
queryCallback(query, callback)
Type: Function
Called when requesting completions for query
. Pass back results through callback(err, result)
FAQs
Small autocomplete written using D3
The npm package d3-autocomplete receives a total of 3 weekly downloads. As such, d3-autocomplete popularity was classified as not popular.
We found that d3-autocomplete 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
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.