Skip to content

Latest commit

 

History

575 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

CanvasXpress

CanvasXpress a stand-alone JavaScript Library for Data Analytics. Built for the purpose of reproducible research with a sophisticated and unobtrusive user interface. Full and effortless audit trail of data, configuration and all user interactions in every visualization without any extra coding.

Installation

The canvasXpress library conists of two files: (1) a CSS file, canvasXpress.css and (2) a JavaScript file, canvasXpress.min.js. These two files must be included in section of the web page pointing directly to the www.canvasXpress.org web site:

<link rel="stylesheet" href="https://www.canvasxpress.org/dist/canvasXpress.css" type="text/css"/>
<script type="text/javascript" src="https://www.canvasxpress.org/dist/canvasXpress.min.js"></script>

or downloaded and included in the section of the web page pointing to the desired location. The library is also on npm (npm install canvasxpress, ESM + UMD + TypeScript definitions) and cdnjs.

<link rel="stylesheet" href="path-to-canvasXpress.css" type="text/css"/>
<script type="text/javascript" src="path-to-canvasXpress.min.js"></script>

NPM

npm install canvasxpress

Yarn

yarn add canvasxpress

Overview

CanvasXpress is a standalone JavaScript library that works in all modern browsers on mobile, tablets and desktop devices. The basic usage is very simple:

Include the JavaScript and the CSS CanvasXpress library files in the element of the web page. Include a script to handle the data, the configuration, and the constructor of the CanvasXpress object in the element of the web page. An advanced use is included in the initialization section. Include a element inside the element where the visualization will be displayed.

Example:

<html>

  <head>

    <!-- 1. Include the CanvasXpress library -->
    <link rel="stylesheet" href="path-to-canvasXpress.css" type="text/css"/>
    <script type="text/javascript" src="path-to-canvasXpress.min.js"></script>

  </head>

  <body>

    <!-- 2. DOM element where the visualization will be displayed -->
    <canvas  id="canvasId" width="540" height="540"></canvas>
    
    <!-- 3. Include script to initialize object -->
    <script>

      // Data
      var data = { "y": {
                     "vars": [ "Gene1"],
                     "smps": [ "Smp1", "Smp2", "Smp3" ],
                     "data": [ [ 10, 35, 88 ] ]
                   }
                 };

      // Configuration
      var conf = { "graphType": "Bar" };

      // Initialize object
      var cX = new CanvasXpress("canvasId", data, conf);

    </script>
    
  </body>

</html>

Integration with other frameworks

(The two CanvasXpress files used in all repos are identical)

R Integration

Install the CanvasXpress R package from CRAN and use it in the R console, R-Studio or in any Shiny application. Here is a link to the Github repo and some Shiny Examples

Python Integration

Install the CanvasXpress Python library from PyPI and use it with Jupyter, Flask and Django.

Node Integration

Install the CanvasXpress Node module from npmjs to create visualizations locally or in the cloud.

React Integration

Install the CanvasXpress Node modules from npmjs to easily integrate with React JS.

License

The CanvasXpress JavaScript library is distributed under the CanvasXpress Community License (Attribution) — see LICENSE and the full terms, FAQ and pricing at https://www.canvasxpress.org/license.html. In short: free to use, including in commercial products, as long as the CanvasXpress attribution mark stays visible; a commercial license removes the mark and adds support. The R package is GPL-3 and the Python package is MIT; neither is subject to the attribution terms.

How to hide the CanvasXpress watermark

With a commercial license, replace the Xs with your license key

  // Include the following HTML snippet in the head of your web pages(s)
  // before the line that references the canvasXpress.min.js file.
  <script>
    window.cX="XXXXXXXXXXX";
  </script>

For more information about CanvasXpress visit our web page at https://www.canvasxpress.org