![]() | A JavaScript parser for Votable |
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to install nodejs to deploy the library
sudo apt-get update
sudo apt-get install nodejs npm
There are two ways to install the library :
npm install https://github.com/malapert/JsVotable.git
npm install jsvotable
There are two ways to install the library :
npm install https://github.com/malapert/JsVotable.git
cd node_modules/jsvotable
npm install
npm install jsvotable
cd node_modules/jsvotable
npm install
First, you need to include the JsVotable library :
<script src="JsVotable.min.js"></script>
Then, you can use it on your script :
var votable = new JsVotable.Votable(xhr.responseXML);
One the VOTable is loaded in the library, simply use the available getters. For instance, if you want to load the data from a tabledata, use the following code :
// gets the first resource
var resource = votable.getResources()[0];
// gets the table from the resource
var table = resource.getResourcesOrTables()[0];
// gets the fields
var fields = table.getFields();
// gets the data : it could be tabledata, fits, binary or binary2
var data = table.getData();
if (data!=null && data.getDataImplementationName() == JsVotable.TAG.TABLEDATA) {
var tabledata = data.getData();
var trs = tabledata.getTrs();
}
Look to the example :
Look to the example :
To run the tests, run simply :
npm test
To generate the documentation, run simply :
npm run doc
To minify the library, run simply ;
npm run uglify
- requirejs ^2.3.2 for development and testing
- chai ^3.5.0 for testing
- domparser ^0.1.1 for testing
- mocha ^3.1.1 for testing
- uglify-js ^2.7.3 for minifying
- xmlhttprequest ^1.8.0 for testing
- brfs ^1.4.3 for testing
- jsdom-global ~2.1.0 for testing
- jsdom ~9.6.0 for testing
- jsdoc ^3.4.2 for documentation
- ink-docstrap ^1.3.0 for documentation
Please read CONTRIBUTING.md for details on the process for submitting pull requests to me.
We use SemVer for versioning. For the versions available, see the tags on this repository.
All names are listed in alphabetical order
Jean-Christophe Malapert
Thomas Rolling (CDS / UTBM) for base64 encoding
This project is licensed under the GPLV3 License - see the LICENSE file for details