Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaffuri committed Jan 8, 2024
1 parent 02e08e1 commit 0ae6424
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- [Tooltip](#tooltip)
- [Buttons](#buttons)
- [View scale](#view-scale)
- [Stretching](#stretching)
- [Legends](#legends)
- [Leaflet](#leaflet)
- [Alright?](#alright)
Expand Down Expand Up @@ -331,15 +332,33 @@ A tooltip may be customised for the grid cells passed over the mouse pointer. By

## Buttons

To show zoom buttons, see [this example](https://eurostat.github.io/gridviz/examples/basics/buttons.html) ([code](https://github.com/eurostat/gridviz/blob/master/examples/basics/buttons.html)).
To show zoom and full screen mode buttons, see [this example](https://eurostat.github.io/gridviz/examples/basics/buttons.html) ([code](https://github.com/eurostat/gridviz/blob/master/examples/basics/buttons.html)).

## View scale

For some predefined style parameters, *viewscale* parameter allows defining styling parameters based on the cells within the map view only. This parameter is an object computed only once from the cells within the view. It may be used for example to compute the minimum and maximum values of these cells and adapt a color scale to this for a better contrast. It should generally be used to compute scales that are view dependant - hence the name *viewscale*.

- See [this basic example](https://eurostat.github.io/gridviz/examples/basics/viewscale_basic.html) ([code](https://github.com/eurostat/gridviz/blob/master/examples/basics/viewscale_basic.html)).
- See [this more advanced example](https://eurostat.github.io/gridviz/examples/basics/viewscale.html) ([code](https://github.com/eurostat/gridviz/blob/master/examples/basics/viewscale.html)) using some predefined function.
- See [this example for stretching functions](https://eurostat.github.io/gridviz/examples/basics/stretching.html) ([code](https://github.com/eurostat/gridviz/blob/master/examples/basics/stretching.html)).

## Stretching

Most of [Gridviz](https://github.com/eurostat/gridviz/) styles rely on a continuous mapping from a statistical variable to a visual variable (color, size, etc.). The statistical distribution can be stretched with one of the _stretching functions_ listed below can be used. These are continuous bijective functions defined from *[0,1]* to *[0,1]* intervals. They have different properties and should be chosen according to the data distribution. The amplitude of the stretching can be adjusted with a parameter.

| Stretching function | Description | Stretching parameter |
| ------------------- | ---------------------------------------- | --------------------- |
| **powerScale** | Polynomial function | Power exponent, from 0 to Infinity. No change: 1 |
| **powerInverseScale** | Polynomial inverse function | Power exponent, from 0 to Infinity. No change: 1 |
| **logarithmicScale** | Exponential function | Logarithmic base, from -Infinity to Infinity. No change: 0 |
| **exponentialScale** | Exponential | Logarithmic base, from -Infinity to Infinity. No change: 0 |
| **circularScale** | Circular | 0: no stretching. 1: perfect circle section |
| **circularInverseScale** | Circular | 0: no stretching. 1: perfect circle section |

For more information on these functions and an overview of how they differ, see:

- [this example](https://eurostat.github.io/gridviz/examples/basics/stretching.html) ([code](https://github.com/eurostat/gridviz/blob/master/examples/basics/stretching.html)).
- the [code](../src/utils/stretching.js)
- those [graphs](https://observablehq.com/@jgaffuri/stretching)

## Legends

Expand Down

0 comments on commit 0ae6424

Please sign in to comment.