English | 简体中文
@antv/data-wizard
A js/ts library for data processing and analysis.
The framework of DataWizard is as follows:
✨ Features
Data Processing
DataWizard can help you extract information of fields from a dataset sample by its DataFrame
module. You can get or slice data by it. The information includes the field's characteristics (field name, data type, statistics, etc.) and properties (continuity, discreteness, etc.), as well as field-to-field relationships (correlation, periodicity, etc.).
For relational data (network data), DW processes and analyzes it through the GraphData
module, which supports reading nodes-links data, links arrays, and hierarchical data. Using GraphData
, you can parse arrays, graph data and hierarchical data, and extract common-used structural and statistical features. Also, the nodes and edges can be converted to DataFrame
, and its API to analyze the statistics of each node field and link field.
In short, DataFrame
and GraphData
can help you understand and process a dataset. This is the premise of data analysis and Automatic chart recommendation.
Statistical Methods
The statistics
module of DataWizard provides common statistical methods, including computing minimum, maximum, variance, Pearson correlation coefficient, etc. The statistical information extracting of DataFrame
and GraphData
is also based on statistics
.
Data Mocking
The random
module of DataWizard provides you comprehensive data mocking options. Data types include basic data, text data, datetime data, color data, Web data, location data, Chinese data address, etc.. You can use it to quickly develop some data generating or auto-filling functions. For example, the auto-fill function in the desgin engineering plugin Kitchen.
📦 Installation
$ npm install @antv/data-wizard
🔨 Quick Start
DataFrame
import { DataFrame } from '@antv/data-wizard';
const df = new DataFrame([
{ a: 1, b: 4, c: 7 },
{ a: 2, b: 5, c: 8 },
{ a: 3, b: 6, c: 9 },
]);
df.info();
statistics
import { statistics as stats } from '@antv/data-wizard';
stats.min([1, 2, 3, 201, 999, 4, 5, 10]);
stats.variance([1, 2, 3, 201, 999, 4, 5, 10]);
stats.pearson([1, 2, 3, 201, 999, 4, 5, 10], [12, 22, 23, 2201, 2999, 24, 25, 210]);
random
import { random } from '@antv/data-wizard';
const r = new random();
r.boolean();
r.phone({asterisk: true});
r.datetime();
r.rgb();
r.url();
r.coordinates();
r.address();
📖 Documentation
For more usages, please check the API reference.
📄 License
MIT