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.
@visactor/vgrammar-core
Advanced tools
VGrammar, not only generate charts, but also provide data visualization tools.
Introduction • Demo • Tutorial • API• Option
English| 简体中文
(video)
VGrammar is a visual grammar library based on visual rendering engine VRender. The core capabilities are as follows:
This repository includes the following packages:
// npm
npm install @visactor/vgrammar
// yarn
yarn add @visactor/vgrammar
import { View } from '@visactor/vgrammar';
const spec = {
data: [
{
id: 'table',
values: [
{
value: 3676,
name: ' ~ 29'
},
{
value: 3872,
name: '30 ~ 39'
},
{
value: 1668,
name: '40 ~ 49'
},
{
value: 610,
name: '50 ~'
}
]
},
{
id: 'pie',
source: 'table',
transform: [
{
type: 'pie',
field: 'value',
asStartAngle: 'startAngle',
asEndAngle: 'endAngle'
}
]
}
],
scales: [
{
id: 'colorScale',
type: 'ordinal',
domain: { data: 'table', field: 'name' },
range: [
'#6690F2',
'#70D6A3',
'#B4E6E2',
'#63B5FC',
'#FF8F62',
'#FFDC83',
'#BCC5FD',
'#A29BFE',
'#63C4C7',
'#F68484'
]
}
],
marks: [
{
type: 'arc',
from: { data: 'pie' },
dependency: ['viewBox', 'colorScale'],
encode: {
update: (datum, element, params) => {
const viewBox = params.viewBox;
const maxR = Math.min(viewBox.width() / 2, viewBox.height() / 2);
return {
x: viewBox.x1 + viewBox.width() / 2,
y: viewBox.y1 + viewBox.height() / 2,
startAngle: datum.startAngle,
endAngle: datum.endAngle,
innerRadius: 100,
outerRadius: maxR,
fill: params.colorScale.scale(datum.name)
};
},
hover: {
fill: 'red'
}
}
}
]
};
const vGrammarView = new View({
autoFit: true,
container: 'chart',
hover: true
});
vGrammarView.parseSpec(spec);
vGrammarView.runAsync();
More demos and detailed tutorials
Project | Description |
---|---|
VChart | A charts lib based on VisActor/VGrammar |
React Component Library | A React chart component library based on VisActor/VChart |
AI-generated Components | AI-generated chart component. |
If you would like to contribute, please read the Code of Conduct and Guide first。
Small streams converge to make great rivers and seas!
FAQs
VGrammar is a visual grammar library
The npm package @visactor/vgrammar-core receives a total of 7,303 weekly downloads. As such, @visactor/vgrammar-core popularity was classified as popular.
We found that @visactor/vgrammar-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.