Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bivariate-color-manager): 13725 - create docs for bivariate_colo… #464

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/features/bivariate_color_manager/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Bivariate Color Manager

Currently, we apply colors to sentiments manually via DB but don't have a full picture is this works good or bad.
The main idea was to create a tool to give users control over managing sentiments and their colors for bivariate layers.

### How to activate

It requires beta feature bivariate_color_manager turned on.
Then through sidebar you can go on /bivariate-manager route and use it.

### How data is processed

Data fetching and postprocessing happens in bivariateColorManagerResourceAtom.

1. To fetch all the data '/bivariate_matrix' endpoint is used for the whole world (no geometry).
As a result we have `{ correlationRates, indicators, axis, colors, meta }`.
2. We loop through axis, get rid of those with bad quality (< 0.5), and then make an object `axisNumeratorInfo` with key pairs: { axis numerators : axis most quality denominator}. The main goal of `axisNumeratorInfo` is to get most quality denominator for every axis. We use pair numerator + its most quality denominator when you select an item in sublist.
3. Then we loop through correlationRates (axis intersectons), each correlationRate has x and y quotient. We accumulate unique combinations in the object `bivariateColorManagerData`, key - "{vertical: "x.direction", horizontal: "y.direction"}", value - {vertical, horizontal, maps}. For each combination legend is created to be possible to paint it on combination selection in the list.
This object `bivariateColorManagerData` represents a main data structure you see on color manager feature's ui.
Its keys are table's rows, its values' fields `horizontal` and `vertical` are row's sublists, that are sorted descending by quality.
`Maps` count is a multiplication of vertical and horizontal rows count.