
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Principal component analysis plugin for D3.js (v4)
import * as d3 from 'd3'
import {Renderer, PCA} from '../src'
d3.csv('data.csv')
.row((d) => {
const obj = {
name: d.name,
values: {}
}
for (const key in d) {
if (key !== 'name') {
obj.values[key] = +d[key]
}
}
return obj
})
.get((errors, data) => {
const p = 0.98
const pca = new PCA(data)
const lambda = pca.lambda()
const sumLambda = lambda.reduce((a, x) => a + x)
const renderer = new Renderer().size([400, 400])
let i
let acc = 0
for (i = 0; i < lambda.length; ++i) {
acc += lambda[i]
if (acc > sumLambda * p) {
break
}
}
const n = i + 1
for (let i = 0; i < n; ++i) {
for (let j = i + 1; j < n; ++j) {
d3.select('body')
.append('svg')
.datum(pca.get(i, j))
.call(renderer.render())
}
}
})
Run following commands and open http://localhost:8080/
.
$ git clone https://github.com/likr/d3-pca
$ cd d3-pca
$ npm i
$ npm start
FAQs
Principal component analysis plugin for D3.js
The npm package d3-pca receives a total of 2 weekly downloads. As such, d3-pca popularity was classified as not popular.
We found that d3-pca 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.