
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A small library that gives you D3 style selections in THREE.js. Now you can do awesome stuff in WebGL with a familiar API. Subunit selects into a THREE.js scene graph just like selecting into the DOM with D3.
npm install subunit
The library only has peer dependency on THREE.js. D3 is not required to be loaded on the page.
The code below is an excerpt from this simple demo that creates some blue and red bars.
...
const barMaterial = new THREE.MeshPhongMaterial({ color: '#4183c4' }); // blue material
const bigMaterial = new THREE.MeshPhongMaterial({ color: '#ff0000' }); // red material
const rootNode = Subunit.select(scene); // select the scene
rootNode.node().position.x = -size[0] / 2; // adjust the root node
rootNode.selectAll('bar') // select with tags separated by periods e.g 'tag1.tag2.tag3'
.data(data).enter() // specify your data and call enter on the selection
.append('mesh') // append a mesh
.attr('tags', 'bar') // add a tag
.tagged('big', function (d) { // conditionally add a tag
return d.frequency > 0.07;
})
.attr('material', barMaterial)
.attr('geometry', function (d) {
const w = x.bandwidth();
const h = size[1] - y(d.frequency);
return new THREE.BoxGeometry(w, h, 5);
})
.each(function (d) {
const x0 = x(d.letter);
const y0 = -y(d.frequency) / 2;
this.position.set(x0, y0, 240);
});
rootNode.selectAll('bar.big') // use the tags like classes to select items
.attr('material', bigMaterial);
...
There is starter repo for loading Subunit in browser with THREE.js.
clone the repo
cd subunit
npm install && npm start
That will fire up a dev server and open your browser to the demos index.
FAQs
D3 style selections in WebGL, select into a THREE.js scene graph
The npm package subunit receives a total of 46 weekly downloads. As such, subunit popularity was classified as not popular.
We found that subunit 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.