JetBrains / JetBrains/lets-plot

`geom_spoke`: add a parameter that controls the unit for the `radius`

Open
#1,282 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1.8k
Forks
60
PR merge metrics
No merged PRs in 30d

Description

The radius of the spokes can be interpreted differently in different plots:

1. The radius units are bound to the axis units.
Example:
```python
wind_data = {
'x': [0, 0, 0, 1, 1, 1, 2, 2, 2],
'y': [0, 1, 2, 0, 1, 2, 0, 1, 2],
'speed': [0.84, 0.89, 0.92, 0.89, 0.94, 0.97, 0.92, 0.97, 0.99],
'direction': [0.78, 0.72, 0.69, 0.84, 0.78, 0.75, 0.87, 0.81, 0.78],
}

ggplot(wind_data) + \
geom_spoke(aes('x', 'y', radius='speed', angle='direction'),
arrow=arrow(type='closed', angle=15))
```

This is exactly how Lets-Plot works now.

2. The radius has its own units.
Example:
```python
volcano_data = {
'lat': [13.60, 14.88],
'lon': [41.80, 39.92],
'eruptions_count': [3, 2],
}

ggplot(volcano_data, aes('lon', 'lat')) + \
geom_livemap(zoom=8, location=[40.86, 14.24]) + \
geom_point(size=5, color='red') + \
geom_spoke(aes(radius='eruptions_count'), angle=0.79, color='red')
```

Here we want to be able to change the length of the spokes arbitrarily using a scale (see also [issue #1070](https://github.com/JetBrains/lets-plot/issues/1070)).
To do this, we need to be able to change the units of the radius.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.