ChemCharts for CheapStat

Description

CheapStat is an inexpensive, open-source, programmable potentiostat, as described in CheapStat: An Open-Source, “Do-It-Yourself” Potentiostat for Analytical and Educational Applications.

ChemCharts is a free software package that is intended to supplement the CheapStat hardware system with software for graphing the output from the CheapStat potentiostat. ChemCharts is written using HTML and JavaScript (ECMAScript 6 [2015]), and runs in a web browser.

ChemCharts uses Google Charts to display potentiostat data as a scatter chart. ChemCharts users can select one or two data points to define a line, which is then overlaid on the scatter chart using a Google Charts “ComboChart.” Users can then select one or more additional points, and ChemCharts will calculate the distance from each of these points to the line.

The data generated by CheapStat can be saved to a tab-delimited text file (see Wikipedia: Tab-separated values). ChemCharts uses the Papa Parse CSV parser to read the data file produced by the CheapStat system, since this parser can automatically detect whether a delimiter-separated values file uses commas or tabs as delimiters.

Chart

So far, ChemCharts produces only one type of chart: a scatter chart of potentiostat data, optionally rendered with a line chart overlay.

Start a Potentiostat Chart

This HTML file and supporting JavaScript code is primarily intended to read a CheapStat data file—a tab-separated values (TSV) file—but can also be used to read and graph data from a comma-separated values (CSV) file generated by a spreadsheet program, for example.

The Potentiostat Chart page provides the option of converting the integer values read from a CheapStat potentiostat to current measurements by scaling them using a slope and offset (Y intercept) determined through a calibration process. See CheapStat Current Scaling.

Installation and Use

There are two different ways to use ChemCharts (specifically, to use Potentiostat Chart):

  1. As a local file

    You can open the file potentiostat_chart.html by entering a file URL in your browser’s address bar, such as file:///c:/some path/chemcharts/potentiostat_chart.html for a Windows file, or by dragging the file and dropping it onto an open browser window or tab.

    This method of using ChemCharts works for the Firefox browser [1], Microsoft Edge (but only by using a file URL, not by using drag-and-drop) [2], and possibly some others, but not for Google Chrome [3] or Opera [4] which, once a data file has been selected, generate the error message that the ChemCharts script file “has been blocked by CORS [Cross-Origin Resource Sharing] policy.”

  2. From a web server

    The preferred way to use ChemCharts is to access its pages via a web server.

    If you are using ChemCharts in an institutional environment (e.g., a university or business), ask your technical services department to install the ChemCharts files on a web server for you.

    If you are a non-institutional user, or if you would prefer to use ChemCharts on your own desktop or laptop computer rather than from an institutional server, you can install the ChemCharts files in the public files area of a web server on your local machine. If your computer is running Apple’s MacOS or OS X or Linux, the Apache web server is probably already installed. If your computer is a Windows machine, you can download and install XAMPP, a free (open source), easy-to-install Apache distribution. Assuming you install XAMPP in the root folder of your C: drive, copy the chemcharts directory (along with the files and sub-directories it contains) to C:\xampp\htdocs\. You should then be able to run ChemCharts by entering the URL \localhost\chemcharts\ in your browser’s address bar.

    You could also use ChemCharts by accessing it on a remote server. ChemCharts is hosted by the Augustana Faculty of the University of Alberta (Canada) at https://wagner.augustana.ualberta.ca/chemcharts/. This is a convenient way to use ChemCharts, but it does not allow you to extend or modify the software to suit your particular needs (see Customization below).

Customization

Because this software package is licensed under the Apache License (see below), you are allowed to freely use, modify, and distribute this software product.

In order to extend or modify the software, you will have to know quite a bit about HTML, JavaScript [ECMAScript], jQuery, and Google Charts.

However, there are some options that can be selected or modified without knowing too much about any of the above-listed languages or software packages. There are a few options you might want to change:

Copyright and Licenses

ChemCharts

Copyright © 2018, 2020 Jonathan Mohr

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Version: 1.4.5

Date: 2020-11-19

jQuery JavaScript library

Copyright JS Foundation and other contributors

Released under the MIT License (MIT), a short, permissive software license. Basically, you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.

https://jquery.org/license

See https://jquery.com/

Papa Parse CSV parser

Copyright (c) 2015 Matt Holt

Licensed under the MIT License (MIT)

https://opensource.org/licenses/MIT

See https://www.papaparse.com/

Google Charts

Google Charts is a free service. Code samples are licensed under the Apache 2.0 License.

See https://developers.google.com/chart/

Math.js—an extensive math library for JavaScript and Node.js

Copyright (C) 2013-2018 Jos de Jong <wjosdejong@gmail.com>

Licensed under the Apache License, Version 2.0.

See https://github.com/josdejong/mathjs and http://mathjs.org

Numeral.js—a Javascript library for formatting and manipulating numbers

Copyright (C) 2012 Adam Draper

Licensed under the MIT License (MIT).

See https://github.com/adamwdraper/Numeral-js and http://numeraljs.com

Regression.js—Regression functions for JavaScript

Copyright(c) 2013 Tom Alexander

Licensed under the MIT License (MIT).

See https://github.com/Tom-Alexander/regression-js

Point object prototypes

Copyright (c) 2011 Mike Dunn [Moagrius]

Licensed under the MIT License (MIT)

See https://github.com/moagrius/Point

Footnotes

[1] Tested with Firefox version 63.0.1 (64-bit).

[2] Tested with Microsoft Edge 44.17763.1.0.

[3] Tested with Google Chrome version 70.0.3538.102 (Official Build) (64-bit). Enable Developer tools and select Console to see the error message.

[4] Tested with Opera version 56.0 (Windows 10 64-bit).