Skip to content

Commit 1bfd6ff

Browse files
committed
Added API documentation
1 parent e2e6189 commit 1bfd6ff

File tree

5 files changed

+410
-10
lines changed

5 files changed

+410
-10
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# JSPlot
2+
3+
JSPlot is an open-source Javascript graph-plotting and vector-graphics library, designed for embedding scientific charts
4+
in websites.
5+
6+
The full source code is available in this GitHub repository, in the `src` directory.
7+
A [gallery of example plots](https://jsplot.dcford.org.uk/demos.php), together
8+
with [API documentation](https://jsplot.dcford.org.uk/documentation.php) is available on
9+
the [JSPlot website](https://jsplot.dcford.org.uk/). A minified version of the source code is available
10+
here: https://jsplot.dcford.org.uk/js/jsplot.min.js
11+
12+
### License
13+
14+
This code is distributed under the Gnu General Public License (GPL v3). It is (C)
15+
Dominic Ford 2019 - 2021.
16+
17+
### Plotting options
18+
19+
JSPlot supports a wide range of 2D and 3D chart types, which are designed to look similar to styles often seen in the
20+
scientific literature. Supported chart types include scatter charts, line charts, bar charts, plots with error bars, and
21+
more. Data can be either numerical or time stamps, making it easy to plot time-series data along axes which
22+
automatically render dates and times into an appropriate format.
23+
24+
Options are provided to make plots either static or interactive. In the latter case, the user can click and drag plots
25+
to scroll the axes or use the mouse wheel to zoom in/out. Such interactive charts are fully compatible with touch-screen
26+
devices, where pinch gestures are used to zoom.
27+
28+
Supported output media include HTML5 canvas objects, PNG files, and SVG files.
29+
30+
### Directory structure
31+
32+
Within this repository, the code is stored in the following directories:
33+
34+
`src` – This contains all the Javascript source code for JSPlot.
35+
36+
`website` – This contains the PHP source code for the [JSPlot website](https://jsplot.dcford.org.uk/), including
37+
all the example plots.
38+
39+
`build` – This contains a Python 3 script to build the example website into a form which can be served by an http
40+
server such as Apache. It compiles the LESS style files into regular CSS, and minifies the Javascript sources into a
41+
single file. It creates a directory `dist` containing the built website.
42+
43+
### Dependencies
44+
45+
JSPlot requires `jQuery`.
46+
47+
If you wish to build the example website (note that this is not necessary to run JSPlot), you will need to
48+
install `Python 3`, `nodejs`, `bower`, `uglify-js`, `less`, `less-plugin-clean-css`. The latter four packages can be
49+
installed via the node package manager (`npm`) as follows:
50+
51+
`npm install -g bower uglify-js less less-plugin-clean-css`
52+
53+
## Author
54+
55+
JSPlot was written by [Dominic Ford](https://dcford.org.uk/) 2019-2021.

build/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import php_preprocess
3030

3131
# Flag to choose whether we minify CSS and Javascript
32-
minify = False
32+
minify = True
3333

3434
# These subdirectories get symlinked rather than copies, because they're quite big
3535
symlinkDirectories = ['vendor']

website/css/style.less

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
h2 { margin:12px 0; border-bottom: 1px solid #aaa; padding: 4px 0; }
3737
h3 { padding: 30px 0 10px 0; font-size:20px; color:#888; border-bottom: 1px solid #ddd; clear: both; }
3838
h4 { padding-top: 30px; }
39-
h5 { padding-top: 20px; color: #777; font-size:19px; font-weight: normal; }
39+
h5 { margin: 30px 0 20px 0; font-size:19px; font-weight: bold; }
4040

4141
h3 a { color: @dark_purple; font-weight: bold; }
4242

@@ -51,6 +51,17 @@ table.padded-table td { padding: 5px; }
5151
table.stripy thead { font-weight: bold; background-color: #ffffff; text-align: center; }
5252
table.stripy tbody tr:nth-child( odd) { background-color: #e8e8e8; }
5353

54+
table.bordered { border: 2px solid #888888; border-collapse:collapse; }
55+
table.bordered2 { border-top: 0; }
56+
table.bordered thead td { border: 1px solid #888888; }
57+
table.bordered td { border-left: 1px solid #888888; border-right: 1px solid #888888; border-top: 0; border-bottom: 0; padding: 8px 6px; }
58+
59+
table.bordered_slim td { padding: 2px 6px; }
60+
61+
table.api_ref { font-size: 15px; margin: 25px 0; }
62+
table.api_ref td:nth-child(2) { max-width: 240px; }
63+
64+
5465
.btn {
5566
margin: 15px 8px;
5667
}

0 commit comments

Comments
 (0)