Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@redsift/d3-rs-geo
Advanced tools
d3-rs-geo
presents a TopoJSON map in an SVG container.
View @redsift/d3-rs-geo on Codepen
<script src="//static.redsift.io/reusable/d3-rs-geo/latest/d3-rs-geo.umd-es2015.min.js"></script>
<script>
var chart = d3_rs_geo.html();
d3.select('body').datum('https://static.redsift.io/thirdparty/topojson/examples/world-50m.json').call(chart);
</script>
import { html as chart } from "@redsift/d3-rs-geo";
let eml = chart();
...
var chart = require("@redsift/d3-rs-geo");
var eml = chart.html();
...
Datum can be one of:
url
(URL to load the TopoJSON file) and optionally the keys points
and links
Represents points of interest on the map. [ [ longitude, latitude ] ... ]
Default presentation uses a symbol. You can supply a custom symbol i.e. object that implements a draw
function as per https://github.com/d3/d3-shape#symbol_type or supply a totally custom reusable component via the pointsDisplay
property.
// Display a text label instead of the default symbol.
var points = [ [ -76.852587, 38.991621, 'NY' ], [ -0.076132, 51.5074, 'London' ] ];
function displayText(selection) {
selection.each(function(d, i) {
let node = select(this).selectAll('text').data([ d ]);
node = node.enter().append('text').merge(node);
node.text(d[2]);
});
}
var chart = d3_rs_geo.html().points(points).pointsDisplay(displayText);
d3.select('body')
.datum('https://static.redsift.io/thirdparty/topojson/examples/world-50m.json')
.call(chart);
Represents great arcs between two points. [ [ longitude-1, latitude-1, longitude-2, latitude-2 ] ... ]
Default presentation uses a dashed line.
// Display a solid red line
var links = [ [ -76.852587, 38.991621, -0.076132, 51.5074 ] ];
function redLine(selection) {
selection.attr('stroke', 'red').attr('stroke-width', '2px');
}
var chart = d3_rs_geo.html().links(links).linksDisplay(redLine);
d3.select('body')
.datum('https://static.redsift.io/thirdparty/topojson/examples/world-50m.json')
.call(chart);
Click handler for map interactions. d
will be the object of the interaction from the TopoJSON data structure. E.g. if the click was on a country, d
will be an object and d.id
will be the ISO_3166-1 country code.
d
will be null if the click was outside a country boundary.
Property | Description | Transition | Preview |
---|---|---|---|
classed | String SVG custom class | N | |
width , height , size , scale | Integer SVG container sizes | Y | |
background | |||
theme | |||
margin | |||
graticule | |||
projection | http://map-projections.net/patterson.php | ||
projectionScale | |||
interrupted | Enabled clipping for interrupted projections | ||
country | Boolean enable country polygons | ||
fill | Land filling | ||
points | Decimal expression of [ Longitude, Latitude ] | ||
pointsDisplay | |||
links | |||
linksDisplay | |||
zoom | |||
zoomX , zoomY | |||
onClick |
FAQs
Generates geo maps using D3v4.
The npm package @redsift/d3-rs-geo receives a total of 3 weekly downloads. As such, @redsift/d3-rs-geo popularity was classified as not popular.
We found that @redsift/d3-rs-geo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 23 open source maintainers 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.