Overlays additional rendering conditions
2 unresolved threads
2 unresolved threads
Description
Covered cases where values needed for rendering overlayBioEntities. There is 3 cases to cover
- BioEntity has
value
property, color is null -> interpolate between hexes - BioEntity has
color
property, value is null -> parse color from decimal to hex - BioEntity has no color nor value property -> use default property from configuration
Merge request reports
Activity
Filter activity
requested review from @AdrianOrlow, @MateuszBolewski, and @mateusz-winiarczyk
added 1 commit
- 489dc7e9 - feat(overlays): cover rendering cases for additional properties for bioEntities
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 = ( changed this line in version 4 of the diff
- Resolved by Tadeusz Miesiąc
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 = ({ added 1 commit
- fe71c469 - refactor(getoverlayfeatures): extraced helper functions to separate files, added tests
enabled an automatic merge when the pipeline for fe71c469 succeeds
mentioned in commit 4c1a0299
Please register or sign in to reply