JetBrains / JetBrains/lets-plot
The tooltip format with `{}` in the pattern ignores the default formatting
- Dominant language
- Kotlin
- Stars
- 1.8k
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
When using the '{}' construction in the format pattern, a string representation of the value is substituted into the result.
It would be better to use the default formatted value.
For example, we want to change the content of the axis tooltip by adding a symbol to the value:
```
N = 21
x = [v for v in range(N)]
y0 = [pow(10, v / 10.) for v in range(N)]
y1 = [v * 5 for v in range(N)]
formula = ['10^(x/10)'] * N + ['5*x'] * N
data = dict(x=x * 2, y=y0 + y1, formula=formula)
ggplot(data) + geom_point(aes('x', 'y', color='formula', size='formula')) + scale_size_manual(values=[7, 3]) + scale_y_log10()
```
* default axis tooltip:

* after specifying the format for the y-axis tooltip:
` tooltips=layer_tooltips().format('^y', '{} %'))`

* Expected: `1.58 %`
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.