|
1 | | -# RAWGraphs Custom Chart template |
| 1 | +# Ridgeline Plot for RAWGraphs |
2 | 2 |
|
3 | | -This template allows you to create and utilize your own custom chart within the RAWGraphs interface. Custom charts are stored locally on your machine but can be shared with others by downloading the `.rawgraphs` project file and sending it to them. |
| 3 | +This custom chart is intended to be used inside the [RAWGraphs app](https://app.rawgraphs.io/). |
4 | 4 |
|
5 | | -Within a custom chart, you have the ability to define the chart variables and visual options that you wish to expose. By defining a JavaScript function and utilizing these inputs, you can generate a chart. Charts can be generated as SVG, canvas, or HTML nodes. |
| 5 | +## What is a Ridgeline Plot |
6 | 6 |
|
7 | | -When you load the custom chart in RAWGraphs, the necessary interface components will be automatically generated based on your chart specifications. |
| 7 | +A ridgeline plot (also known as a joy plot) shows the distribution or temporal evolution of several groups over a shared continuous axis. Each group is rendered as a filled area with an optional stroke, stacked vertically with a configurable amount of overlap. The overlapping layout makes it easy to compare many series at once while preserving the individual shape of each distribution. |
8 | 8 |
|
9 | | -Outlined below are the fundamental operations you can perform to initiate a new project. |
| 9 | +The chart is inspired by the [D3 Ridgeline Plot](https://observablehq.com/@d3/ridgeline-plot) by Mike Bostock. |
10 | 10 |
|
11 | | -For more detailed instructions on building custom charts, read the following documentation: |
| 11 | +## Installation |
12 | 12 |
|
13 | | -* [Create your first chart](docs/add-a-new-chart.md) |
14 | | -* [Good practices and conventions](docs/good-practices.md) |
15 | | -* [RAWgraphs core library technical documentation](https://rawgraphs.github.io/rawgraphs-core/docs/) |
| 13 | +- Download the latest release asset (`index.umd.js`) from the side panel on this page or from the [Releases](../../releases/latest) tab. |
| 14 | +- In [RAWGraphs](https://app.rawgraphs.io/) load a dataset. You can try the [sample traffic file](example/datasets/traffic_weekly.csv). |
| 15 | +- In section `2. Choose a chart`, scroll down and click `Load your chart`. |
| 16 | +- Select the `Load from file` tab, then drag and drop the downloaded file. |
| 17 | +- Click `Load your chart`, acknowledge the pop-up about external code, and continue. |
| 18 | +- The Ridgeline Plot will now be available in your chart list. |
16 | 19 |
|
17 | | -## Install |
| 20 | +## Contribute |
18 | 21 |
|
19 | | -To create a custom chart you'll need [node.js](https://nodejs.org/en) installed on your computer. |
| 22 | +If you'd like to contribute, follow the RAWGraphs [custom template guide](https://github.com/rawgraphs/custom-rawcharts-template). |
20 | 23 |
|
21 | | -In terminal navigate the folder in wich you cloned this template and run: |
| 24 | +## Edit the code |
| 25 | + |
| 26 | +### Install dependencies |
22 | 27 |
|
23 | 28 | ```sh |
24 | 29 | npm install |
25 | 30 | ``` |
26 | 31 |
|
27 | | -## Run Sandbox |
28 | | - |
29 | | -While developing your custom chart, you can see it in realtime by running the sandbox environment. |
| 32 | +### Run Sandbox |
30 | 33 |
|
31 | | -In terminal navigate the folder in wich you cloned this template and run: |
| 34 | +Modify the chart locally with live reload. |
32 | 35 |
|
33 | 36 | ```sh |
34 | 37 | npm run sandbox |
35 | 38 | ``` |
36 | 39 |
|
37 | | -You can find your charts at [http://localhost:9000](http://localhost:9000) |
38 | | - |
39 | | -## Build |
| 40 | +Open [http://localhost:9000](http://localhost:9000) to view the sandbox. |
40 | 41 |
|
41 | | -When you are satisfied with your project, you can build the js bundle to be used in the RAWGraphs interface. |
| 42 | +### Build |
42 | 43 |
|
43 | | -In terminal navigate the folder in wich you cloned this template and run: |
| 44 | +Create the bundle to load in RAWGraphs. |
44 | 45 |
|
45 | 46 | ```sh |
46 | 47 | npm run build |
47 | 48 | ``` |
48 | 49 |
|
49 | | -This will generate a folder named `lib` in which you will find three files. |
| 50 | +The `lib/index.umd.js` file is the bundle you can load into RAWGraphs. |
| 51 | + |
| 52 | +## Credits |
| 53 | + |
| 54 | +Original chart concept by [Mike Bostock](https://observablehq.com/@d3/ridgeline-plot). |
50 | 55 |
|
51 | 56 | The one named `index.umd.js` is the bundle that can be loaded by RAWGraphs. You cna rename it as you prefer. |
0 commit comments