Uwazi: Main library map not respecting template colors

Created on 8 Oct 2020  路  5Comments  路  Source: huridocs/uwazi

The map on the main view is not respecting the template assigned color, apparently it is still using the cyclic color generation of our previous color implementation.

Bug Sprint

All 5 comments

related #3097

@fnocetti please also upgrade react-map-gl

We defined that the best behavior in the main map view is to use the inheriting template color for the inherited properties. The reason is that the map is showing geolocations from many templates and you the only way to differentiate its origin is by color. In the other way, imagine this scenario:

Preconditions

  • Template A with geolocation field aG
  • Template B with geolocation field bG
  • Template C with geolocation field cG and inheriting field aG

Case

  • Filter the map to show entities of type B and C

Results

  • If the inherited field uses it's original (inherited) template color, you'll see 3 colors in the map and won't be able to associate geolocations aG to template C
  • If the inherited field uses the inheriting field you'll see 2 colors in the map and the markers aG are associated to template C by their color.

The problem is that I see use cases that would want the 3 colors on some scenarios, and the two colors on others, depending on if you want the marker to reflect its relationship for the original template or not.

But, honestly, in most cases I can think of, I think I would want the color of the template that is inheriting the property, not the parent of the property.

For example, lets say we have victims and perpetrators with "country of origin" inherited as geolocation.

You go into the map... you want to see the "blue" ticks for victims and the "red" ticks for perpetrators and see: aha, look, most victims reside in A, B and C, while most perpetrators come from D and E.

But, if we color code this according to "source" template, all the geolocations would be "countries" with green ticks, and you wouldn't have ANY IDEA of where they came from, if they are victims or perpetrators.

So, I'm really not sure this is the way to go here.

So, for now, what the map should 100% respect is that the markers use the color of the template they are coming from, regardless of it is inherited or not. That is:

  • if tempalate A is assigned color red and has 2 geo props: 1 local and 1 inherited, both should correctly render RED in the map (the inherited will not inherit its color)

This is, as of now, broken and, apparently, assigning colors by template position instead of using the internal color that is now always saved as part of the template.

We can discuss the inheriting color issue elsewhere.

Was this page helpful?
0 / 5 - 0 ratings