Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
leaflet-solr-heatmap
Advanced tools
A Leaflet plugin that visualizes heatmap facets from Solr 5.x
A Leaflet plugin that visualizes heatmap facets from Solr 5.x
// Create a SolrHeatmap layer and add it to the map
var solr = L.solrHeatmap('http://127.0.0.1:8983/solr/gettingstarted', {
// Solr field with geospatial data (should be type Spatial Recursive Prefix Tree)
field: 'loc_srpt',
// Set type of visualization. Allowed types: 'geojsonGrid', 'clusters'
// Note: 'clusters' requires LeafletMarkerClusterer
type: 'geojsonGrid'
}).addTo(map);
Option | Type | Default | Description |
---|---|---|---|
field | String | null | Required. Solr field with geospatial data (should be type Spatial Recursive Prefix Tree) |
type | String | 'geojsonGrid' | Type of visualization. Accepts geojsonGrid , clusters and heatmap |
solrRequestHandler | String | 'select' | Request handler for Solr |
colors | Array | ['#f1eef6', '#d7b5d8', '#df65b0', '#dd1c77', '#980043'] | Colors for heatmap. Array can be of any length. |
maxSampleSize | Number | Number.MAX_SAFE_INTEGER | For improved performance, run Jenks classification on only a sample of Solr counts. Default value turns off sampling. Typical value is 400. |
queryAdapter | String | default | A query adapter used to connect to a Solr interface. Useful for querying applications that may proxy through Solr. |
queryRadius | Number | 40 | Radius (in pixels) used for querying nearby data |
L.SolrHeatmap
layers fire all of the typical events from Leaflet. Additional events include:
Event | Data | Description |
---|---|---|
dataAdded | Object | fires when data is added to the map. Returns an object which is the JSON response from the Solr server |
Install Dependencies
# Install JavaScript depencencies
$ npm install
# Install local solr
$ gem install solr_wrapper
Run Solr
$ solr_wrapper
Index fixture data
$ npm run index
Start local server
npm run start
View the example at http://127.0.0.1:8000/example/
Leaflet Solr Heatmap uses an abstracted query adapater, that can be used to query API's besides the default Solr API. This has been used in Blacklight Heatmaps. Adapters can be added to the L.SolrHeatmapQueryAdapters
object and then selected using the L.solrHeatmap
options instantiation. Query adapters need to implment the following methods:
Method | Returns | Purpose
ajaxOptions
| Object
| Merged options object that defines $.ajax
url and settings.
responseFormatter
| Object
| A way to access a custom API resposne formatter. Should return an Object
that behaves as the Solr Facet Heatmap JSON response (or just passes it through).
FAQs
A Leaflet plugin that visualizes heatmap facets from Solr 5.x
We found that leaflet-solr-heatmap 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.