Explore and model data by grouping, sorting, clustering, and transforming.
Data wrangling is a crucial step in any data analysis workflow, involving the process of cleaning, structuring, and enriching raw data into a more usable format. In CanvasXpress, this process is streamlined with a powerful set of functionalities that allow you to manipulate your data directly within the browser, without the need for server-side processing.
This section provides a comprehensive guide to the various data wrangling methods available in CanvasXpress, enabling you to prepare your datasets for effective visualization and analysis. These functions can be applied programmatically through the API or interactively via the user interface.
Data wrangling, which involves restructuring, enriching, and transforming data into a more valuable format, is important for various purposes, including analytics. CanvasXpress applies a data wrangling process across data sets, integrates information from various data sources to solve problems, and achieve analytical goals.
The CanvasXpress library has a unique set of functionalities that support data-wrangling without the need to contact a server. This result-oriented function empowers our end users to effectively access their data without any hassle. These functions can be called programmatically or used directly through one of the UIs.
Consider the following dataset to showcase some of these methods.
Name | Weight | Height | Waist | Hip | Age | Gender | Excercise | Keith | 65.6 | 174 | 71.5 | 93.5 | 21 | Male | Low |
---|---|---|---|---|---|---|---|
Nina | 51.6 | 161 | 66.5 | 92.0 | 22 | Female | Moderate |
Freddy | 80.7 | 194 | 83.2 | 95.0 | 28 | Male | Moderate |
Tracey | 49.2 | 160 | 61.2 | 91.0 | 19 | Female | Moderate |
Isabelle | 55.2 | 173 | 66.5 | 90.3 | 32 | Female | Low |
Penny | 48.7 | 151 | 61.6 | 90.0 | 35 | Female | Intense |
Grouping can be done through the CanvasXpress configuration
new CanvasXpress(targetId, data, {
graphType: "Boxplot",
// ... other configurations ...
groupingFactors: ["Gender"]
});
or a function call after the visualization has been rendered
var cX = new CanvasXpress(targetId, data, config);
cX.groupSamples(["Gender"]);
Facets can be done through the CanvasXpress configuration
new CanvasXpress(targetId, data, {
graphType: "Bar",
...,
segregateSamplesBy: ["Excercise"]
});
or a function call after the visualization has been rendered
var cX = new CanvasXpress(targetId, data, config);
cX.segregateSamples(["Excercise"]);
Sorting can be done through the CanvasXpress configuration
// Sort data by Age
new CanvasXpress(
targetId,
data, {
graphType: "Bar",
sortData: [['var', 'smp', 'Age']]
});
//Sort data by Height
new CanvasXpress(
targetId,
data, {
graphType: "Bar",
sortData: [['cat', 'smp', 'Height']]
});
or a function call after the visualization has been rendered
var cX = new CanvasXpress(targetId, data, config);
// Sort by Age
cX.modifySort(['var', 'smp', 'Age']);
// Sort by Height
cX.modifySort(['cat', 'smp', 'Height']);
Data can be correlated to its meta-data
Correlation can be done through a function call
var cX = new CanvasXpress(targetId, data, config);
cX.correlateData(true, "Hip");
Histograms can be created through the CanvasXpress configuration
new CanvasXpress(
targetId,
data, {
graphType: "Bar",
showHistogram: true
});
or a function call after the visualization has been rendered
var cX = new CanvasXpress(targetId, data, config);
cX.createHistogram();
Cluster data can be done through the CanvasXpress configuration
new CanvasXpress(
targetId,
data, {
graphType: "Bar",
samplesClustered: true
});
or a function call after the visualization has been rendered
var cX = new CanvasXpress(targetId, data, config);
cX.clusterSamples();
Data transformation can be done through a funciton call
var cX = new CanvasXpress(targetId, data, config);
cX.transform("log2");
Transposing data can be done through the CanvasXpress configuration
new CanvasXpress(
targetId,
data, {
graphType: "Bar",
transposeData: true
});
or a function call after the visualization has been rendered
var cX = new CanvasXpress(targetId, data, config);
cX.transpose();
Pivot data can be done through a funciton call
var cX = new CanvasXpress(targetId, data, config);
cX.pivotX("Gender");