Skip to content
Snippets Groups Projects

Overlays additional rendering conditions

Merged Tadeusz Miesiąc requested to merge overlays-additional-rendering-conditions into development
2 unresolved threads

Description

Covered cases where values needed for rendering overlayBioEntities. There is 3 cases to cover

  1. BioEntity has value property, color is null -> interpolate between hexes
  2. BioEntity has color property, value is null -> parse color from decimal to hex
  3. BioEntity has no color nor value property -> use default property from configuration

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
3 3 import { OverlayBioEntityRender } from '@/types/OLrendering';
4 import { convertDecimalToHex } from '@/utils/convert/convertDecimalToHex';
4 5 import { UsePointToProjectionResult } from '@/utils/map/usePointToProjection';
5 6 import Feature from 'ol/Feature';
6 7 import Polygon, { fromExtent } from 'ol/geom/Polygon';
7 8 import { Fill, Style } from 'ol/style';
8 9
9 export const getOverlayFeatures = (
10 bioEntities: OverlayBioEntityRender[],
11 pointToProjection: UsePointToProjectionResult,
12 getHex3ColorGradientColorWithAlpha: GetHex3ColorGradientColorWithAlpha,
13 ): Feature<Polygon>[] =>
14 bioEntities.map(entity => {
15 const feature = new Feature({
16 geometry: fromExtent([
10 export const createOverlayGeometryFeature = (
  • Adrian Orłów
  • Adrian Orłów
    Adrian Orłów @AdrianOrlow started a thread on commit 489dc7e9
  • 25
    26 export const getColorByAvailableProperties = (
    27 entity: OverlayBioEntityRender,
    28 getHexTricolorGradientColorWithAlpha: GetHex3ColorGradientColorWithAlpha,
    29 defaultColor: string,
    30 ): string => {
    31 if (entity.value) {
    32 return getHexTricolorGradientColorWithAlpha(entity.value || ZERO);
    33 }
    34 if (entity.color) {
    35 return convertDecimalToHex(entity.color.rgb);
    36 }
    37 return defaultColor;
    38 };
    39
    40 export const getOverlayFeatures = ({
  • LGTM but there's a lot of tests lacking, is it intentional?

  • Adrian Orłów approved this merge request

    approved this merge request

  • added 1 commit

    • fe71c469 - refactor(getoverlayfeatures): extraced helper functions to separate files, added tests

    Compare with previous version

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

    enabled an automatic merge when the pipeline for fe71c469 succeeds

  • Tadeusz Miesiąc mentioned in commit 4c1a0299

    mentioned in commit 4c1a0299

  • Please register or sign in to reply
    Loading