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.
@observablehq/plot
Advanced tools
Observable Plot is a free, open-source, JavaScript library for visualizing tabular data, focused on accelerating exploratory data analysis. It has a concise, memorable, yet expressive API, featuring scales and layered marks in the grammar of graphics style.
https://observablehq.com/plot/
https://observablehq.com/@observablehq/plot-gallery
See our CHANGELOG and summary release notes.
See our community guide.
See CONTRIBUTING.md.
0.6.16
The new waffle mark 🧇 displays a quantity (or quantitative extent) for a given category; unlike a bar, a waffle is subdivided into cells that allow easier counting, making waffles useful for reading and comparing exact quantities. Plot’s waffle mark is highly configurable: it supports stacking, positive and negative values, rounded corners, partial cells for fractional counts, automatic row or column size determination (with optional override), and more!
<img src="./img/waffle.png" width="708" alt="a waffle chart of Olympic athletes by weight">
Plot.plot({
fx: {interval: 10},
color: {legend: true},
marks: [Plot.waffleY(olympians, Plot.groupZ({y: "count"}, {fill: "sex", sort: "sex", fx: "weight", unit: 10}))]
})
All marks now support GeoJSON data and GeoJSON property shorthand, making it easier to work with GeoJSON. For example, below the data counties
is a GeoJSON FeatureCollection, and unemployment
refers to a property on each feature; the fill option is thus shorthand for (d) => d.properties.unemployment
. The geo mark now also supports the tip option (via an implicit centroid transform), making it easier to use Plot’s interactive tooltips.
<img src="./img/geo-tip.png" width="708" alt="a choropleth map of unemployment by U.S. county">
Plot.plot({
projection: "albers-usa",
color: {
type: "quantile",
n: 9,
scheme: "blues",
label: "Unemployment (%)",
legend: true
},
marks: [
Plot.geo(counties, {
fill: "unemployment",
title: (d) => `${d.properties.name} ${d.properties.unemployment}%`,
tip: true
})
]
})
All marks now also support column name channel shorthand when using Apache Arrow tables as data, and we’ve added detection of Arrow date-type columns. (Arrow represents temporal data using BigInt rather than Date.)
Plot.dot(gistemp, {x: "Date", y: "Anomaly"}).plot() // gistemp is an Arrow Table!
The rect-like marks (rect, bar, cell, and frame) now support individual rounding options for each side (rx1, ry1, etc.) and corner (rx1y1, rx2y1, etc.). This allows you to round just the top side of rects. You can even use a negative corner radius on the bottom side for seamless stacking, as in the histogram of Olympic athletes below.
<img src="./img/rect-rounded.png" width="708" alt="a histogram of Olympic athletes by weight">
Plot.plot({
color: {legend: true},
marks: [
Plot.rectY(olympians, Plot.binX({y: "count"}, {x: "weight", fill: "sex", ry2: 4, ry1: -4, clip: "frame"})),
Plot.ruleY([0])
]
})
Plot now respects the projection domain when determining the default plot height. Previously, the map below would use a default square aspect ratio for the conic-conformal projection regardless of the specified domain, but now the map is perfectly sized to fit North Carolina. (Plot also now chooses a smarter default plot height when the ordinal y scale domain is empty.)
<img src="./img/geo-nc.png" width="659" alt="an unlabeled map showing the outline and counties of North Carolina">Plot.plot({
projection: {.
type: "conic-conformal",
parallels: [34 + 20 / 60, 36 + 10 / 60],
rotate: [79, 0],
domain: state
},
marks: [
Plot.geo(counties, {strokeOpacity: 0.2}),
Plot.geo(state)
]
})
The marker options now render as intended on marks with varying aesthetics, such as the spiraling arrows of varying thickness and color below.
<img src="./img/group-marker.png" width="659" alt="several spiraling lines emanate from the center of the image, with rainbow color and increasing thickness, each capped with a pointed arrow at the end">Plot.plot({
inset: 40,
axis: null,
marks: [
Plot.line(d3.range(400), {
x: (i) => i * Math.sin(i / 100 + ((i % 5) * 2 * Math.PI) / 5),
y: (i) => i * Math.cos(i / 100 + ((i % 5) * 2 * Math.PI) / 5),
z: (i) => i % 5,
stroke: (i) => -i,
strokeWidth: (i) => i ** 1.1 / 100,
markerEnd: "arrow"
})
]
})
This release includes a few more new features, bug fixes, and improvements:
The new className mark option specifies an optional class
attribute for rendered marks, allowing styling of marks via external stylesheets or easier selection via JavaScript; thanks, @RLesser! Plot now reuses clipPath
elements, when possible, when the clip mark option is set to frame or projection.
The difference mark now supports a horizontal orientation via differenceX, and the shift transform now likewise supports shiftY. The Voronoi mark is now compatible with the pointer transform: only the pointed Voronoi cell is rendered; the Voronoi mark now also renders as intended with non-exclusive facets (as when using the exclude facet mode). The tip mark no longer displays channels containing literal color values by default.
FAQs
A JavaScript library for exploratory data visualization.
The npm package @observablehq/plot receives a total of 43,253 weekly downloads. As such, @observablehq/plot popularity was classified as popular.
We found that @observablehq/plot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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
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.