apache / apache/echarts

[Feature] Create a continuous VisualMap with log distribution

Open
#18,439 4 comments 1 reaction 0 assignees View on GitHub
en new-feature topic: visualMap
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

When creating a series of type "heatmap", it would be nice to have a continuous VisualMap distributed on a log scale. Currently it can only be distributed linearly.

It is possible to achieve similar results by taking the log of all the series data, but in doing so you lose the physical meaning behind the numbers.

An analogous example in python is the difference between [numpy.linspace()](https://numpy.org/doc/stable/reference/generated/numpy.linspace.html#numpy.linspace), and [numpy.geomspace()](https://numpy.org/doc/stable/reference/generated/numpy.geomspace.html#numpy.geomspace).

I propose having a VisualMap option called "scaling", which defaults to "linear", but can be set to "log".

### What does the proposed API look like?

```
option = {
series: [{
type: "heatmap",
//...
}],
visualMap: {
type: "continuous",
scaling: "log" // use the logic from numpy.geomspace()
}
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.