theodi/comma-chameleon

Name: comma-chameleon

Owner: The Open Data Institute

Description: A desktop CSV editor for data publishers

Created: 2015-08-10 13:10:56.0

Updated: 2018-01-20 01:39:22.0

Pushed: 2017-10-03 09:37:07.0

Homepage: https://comma-chameleon.io/

Size: 5626

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Stories in Ready Build Status Dependency Status

Comma Chameleon

Comma Chameleon is a desktop CSV editor (built with Electron.js) that provides a simple interface for editing data.

See https://comma-chameleon.io/ for features and screenshots or download the app and start using it now!

Follow the public feature roadmap for Comma Chameleon

Summary of features

Validate your CSV on the fly using CSVlint, so you can be sure your data is reuse-ready before you publish it
Comma Chameleon lets you export your data as a Data Package, ready for publication and reuse
Integrate with Octopub and publish your data to Github

Download and Install App

Choose a platform from the Releases page.

Drag the application to your applications folder. If you encounter a warning message informing you the application cannot be opened due to emanating from an unknown developer try the following. This occurs due to Mac OS quarantining applications where it cannot determine the certificate used to sign the application.
Steps:

Right click the app, then option+click on Open.

Development
Requirements

node and npm

You can use npm to install all relevant packages and development dependencies using the following set of commands. Node and Bower install the dependencies contained in package.json and bower.json respectively

install -g bower electron
install
r install
External (non-JS) dependencies

Comma Chameleon relies on CSVlint.sh to carry out CSV validation. This is not included in the repo, and is downloaded and installed by the build.js script. As with the page build script, this script is also run when the app is started with the npm start command.

Development: Running the full application locally

To open the app run:

start

This will download the non-JS dependencies (namely CSVlint.sh), build the handlebars views (from comma-chameleon/views-content) and start the app.

Application Architecture

Comma Chameleon is built using Electron.js, a framework that allows developers to build desktop applications using web technology.

There are two parts of the application, the main process and the renderer process. The main process deals with things like carrying out file operations, validating CSVs, rendering views, and exporting to Github. The renderer acts very much like client side JS in a web browser, dealing with things like presentation, and user interactions.

IPC messaging

Electron passes and listens for messages between main and renderer using the IPC module, one for the main process and one for the renderer process.

For example, when importing an Excel file, the main process reads the Excel file and opens a new window in the renderer process. Once the window has opened, the main process sends the worksheet names to the renderer process, which are then displayed to the user. Once a user selects a worksheet, the renderer process sends a message back to the main process, and the main process converts the relevant worksheet to CSV and loads it into a new window.

Views

To keep things DRY, the HTML views are written using Handlebars, see the views-content folder. The views are then built using the page-build.js script, which also gets run when the app is started with the npm start command.

Tests

Electron-Mocha has been adopted for testing, it enables both DOM and node.js testing and provides command line options to enable testing of both.

Assuming you have installed electron-mocha globally (via npm i electron-mocha -g), you can run the tests like this:

test

Or to run the main and renderer tests separately, you can run:

run test-main  # run tests for the runtime components provided by Electron
run test-renderer # run tests that execute client side

Otherwise you can run:

tron-mocha test/main/
tron-mocha --renderer test/renderer/ # run tests that execute client side
Deployment: Packaging
Building a new package

(This assumes you're running OSX)

Install gulp

 install wine # This allows us to specify the icon for Windows pacakges
i electron-packager -g
 build

You can also build a package for a specific platform by running gulp build --platform={one of 'linux', 'darwin' or 'win32'}.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.