Skip to content
Snippets Groups Projects

Resolve MIN-189 "/display general overlays"

2 unresolved threads
Merged Tadeusz Miesiąc requested to merge MIN-189/display-general-overlays into development
2 unresolved threads

Description

This PR introduces basic overlay functionality.

Things done

  • render one overlay
  • fetch bioEntities for overlay
  • fetch configuration (to use default colors later)
  • get color value based on linear value from configuration
  • display overlay on view click

How it works

  1. fetch bioEntities for overlay
  2. parse them to object containing upper left corner and bottom left corner coordinates + color value - this allow rendering
  3. in useOlMapOverlaysLayer bioEntities for current selected map are selected
  4. based on coordinates add rectangle in getOverlayFeatures function and set their color
  5. add features to layer
  6. add layer to map
  7. render :smile:

Cases not covered

  • Did not cover case where receiving color in different properties from API - coming in next PR

Things not done

  • switching overlay off
  • rendering multiple overlays
  • testing - I did not test hooks, and store function since there will be few quite big changes in next PR - it would be waste of time

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 10 [{ alpha: 0.8, position: -0.75 }, '#BF4000cc'],
    11 [{ alpha: 0.5, position: -0.5 }, '#80800080'],
    12 [{ alpha: 0, position: -0.25 }, '#40BF0000'],
    13 [{ alpha: 1, position: 0 }, '#00FF00ff'],
    14 [{ alpha: 1, position: 0.25 }, '#00BF40ff'],
    15 [{ alpha: 1, position: 0.5 }, '#008080ff'],
    16 [{ alpha: 1, position: 0.75 }, '#0040BFff'],
    17 [{ alpha: 1, position: 1 }, '#0000FFff'],
    18 ];
    19
    20 it.each(cases)(`and position %s should return %s`, (input, output) => {
    21 expect(
    22 getHexTricolorGradientColorWithAlpha({
    23 leftColor: RED_HEX,
    24 middleColor: GREEN_HEX,
    25 rightColor: BLUE_HEX,
  • Adrian Orłów
  • todo.txt 0 → 100644
    1 - poinformować zespół ze w czw się spóźnię
  • LGTM, superb job!

    There's a lot of tests lacking but I understand why regarding the description. IMO it's a good idea to add TODOs for tests, we may forget about many of them

    Also, please check my comment about "parseOverlayBioEntityToOlRenderingFormat" - it's an RFC if there's no good explanation behind parsing the data in thunk

  • Adrian Orłów approved this merge request

    approved this merge request

  • added 1 commit

    • d1862203 - fix(removed todo.txt): file delete

    Compare with previous version

  • added 1 commit

    • 15f9bd3f - fix(removed todo.txt): file delete

    Compare with previous version

  • Adrian Orłów approved this merge request

    approved this merge request

  • Adrian Orłów mentioned in merge request !82 (closed)

    mentioned in merge request !82 (closed)

  • Tadeusz Miesiąc added 12 commits

    added 12 commits

    Compare with previous version

  • Tadeusz Miesiąc enabled an automatic merge when the pipeline for b2282dfd succeeds

    enabled an automatic merge when the pipeline for b2282dfd succeeds

  • Tadeusz Miesiąc mentioned in commit ed9523e9

    mentioned in commit ed9523e9

  • Please register or sign in to reply
    Loading