
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
kartograph-js
Advanced tools
Kartograph.js is a JavaScript library that renders SVG maps in web browsers. It is built on top of jQuery and RaphaelJS. Please have a look at the API docs for more details.
Initializing a new map
map = $K.map('#map', 600, 400);
map.loadMap('world.svg', function() {
map.addLayer('countries', {
styles: {
fill: '#ee9900'
},
title: function(d) {
return d.countryName;
}
});
});
```
Choropleth maps (aka coloring map polygons based on data):
```javascript
pop_density = { 'USA': 123455, 'CAN': 232323, ... };
colorscale = new chroma.ColorScale({
colors: chroma.brewer.YlOrRd,
limits: chroma.limits(chroma.analyze(pop_density), 'k-means', 9)
});
map.getLayer('countries').style('fill', function(data) {
return colorscale.get(pop_density[data.iso]);
});
```
Adding symbols is easy, too:
```javascript
cities = [{ lat: 43, lon: -75, label: 'New York', population: 19465197 }];
map.addSymbols({
data: cities,
location: function(d) {
return [d.lon, d.lat];
},
type: Kartograph.Bubble,
radius: function(d) {
return Math.sqrt(d.population) * 0.001;
}
})
```
### Author
Kartograph was created by [Gregor Aisch](http://github.com/gka/). It is supported by [Piwik Web Analytics](http://piwik.org) and the [Open Knowledge Foundation](http://okfn.org).
### License
Kartograph.js is licensed under [LGPL](http://www.gnu.org/licenses/lgpl-3.0.txt)
FAQs
JavaScript library for SVG mapping
We found that kartograph-js 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
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.