Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Oct 25, 2023
1 parent 6e44433 commit 4222080
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## Ridges.js

A JavaScript library to make ridge plots.
> A JavaScript library for generating ridgeline plots, providing options for both **horizontal** and **vertical** layouts.
This library combines the features of box plots and ridgeline plots into a unified visualization for each group. To use this library effectively, your input data should include summarized metrics.

![](assets/demo.png)

Expand All @@ -10,9 +12,15 @@ Install the package from [npm](https://www.npmjs.com/package/ridges.js),
npm install ridges.js
```

The library offers both **horizontal** and **vertical** layouts for creating ridge plots.
To begin using Ridges.js, follow these steps:

1. Choose your preferred layout, either horizontal or vertical.
2. Instantiate a new visualization object.
3. Customize the visualization by configuring properties such as titles, selected metrics, the number of ticks, and more.
4. Provide your data.
5. Render the plot in your desired dimensions.

To get started, choose your preferred layout and then instantiate a new visualization object. Customize the visualization state by configuring properties such as titles, selected metrics, the number of ticks, and more. Next, input your data, and render the plot in your desired dimensions!
Here's an example:

```js
import { VerticalRidgePlot, HorizontalRidgePlot } from "ridges.js";
Expand All @@ -31,5 +39,22 @@ vridge.setInput(data);
vridge.render(300, 500);
```

### Data model

The data object is expected to contain **groups** as keys, and each `group` should have metrics for visualizing the boxes and ridges. Here's an example:

```js
const data = {
january: {
min: 1,
max: 20,
mean: 10,
median: 5,
quantiles: [1, 5, 9, 10], // box plot metrics
values: [1, 2, 5, 20, 15, 18], // for the histogram
}
}
```

Check out more examples in the [app directory](./app/)!

0 comments on commit 4222080

Please sign in to comment.