GeoJSON Maps color from hex code

Hi everyone,

I'm a kinda new user of the Elastic Stack and I have a hard time getting what I want from the "maps" visualization.

What I'm trying to do is to create a GeoJSON file with colors and display these colors on the map layer.
I would like to use each shape's "color" property (or fill or backcolor or any other) to store a color value, like a hex code, and use it to affect the displayed color.

I made a simple GeoJSON using geojson.io, for example :


This GeoJSON file has "fill" and "stroke" values storing hex codes.

I upload it to a new Kibana map layer, which works perfectly, but everything has the same color.
I try to change the "fill color" to "by value" and selecting the "fill.keyword" (I don't have other choices with "fill") and it does affect different colors to every shape, but not the ones corresponding to the hex code :

I also tried to set the format as "color" in the Data View :

Doesn't seem to change anything...

Can you please help me with that ?

Thanks a lot in advance :slight_smile:.

PS : I understand that it's probably affecting colors from the palette in a left-to-right manner, but I do not want to use palettes because I want these colors to be changed in real time by an external program depending on conditions.

Regards,
Quentin.

What I'm trying to do is to create a GeoJSON file with colors and display these colors on the map layer.
I would like to use each shape's "color" property (or fill or backcolor or any other) to store a color value, like a hex code, and use it to affect the displayed color.

This is not possible. Would you mind opening an enhancement request
Please include the "why". Meaning, what problem are you trying to solve by coloring features based on a hex color string in the geojson. Understanding your business use case really helps puts requests into context.

Can you add some more details here? What in particular are you having a hard time visualizing with maps? The more specifics the better.

Thank you Nathan for your quick responses !

I will take some time to open an enhancement request, but I'll just keep telling you my goal because there might just be an existing solution for my need and I may have been approaching the issue from a wrong angle.

My "hard time" is that I feel somehow "frustrated" by the fact that I can pick a hex color code for all my shapes, or I can specify a color for each shape using the palette and a text field, but I can't give to each shape its own specific hex color via this text field.

My need is not so clear now, I'm mostly trying to understand the way Kibana visualizations work :slight_smile:
But it will be something like this :
I want to recreate a factory floor using GeoJSON and every production unit/zone/equipment would be a shape and their fill color would mean something. E.g : Blue = working, Green = available... but also analogic values such as temperature or humidity.

The colors scales or conditions could be specific to each equipment, that's why I was thinking about making a custom program that would update the color values...
Maybe one of the kibana maps features could already do that ?
Or otherwise I'll just make custom palettes and use them.

Or am I all wrong ? :innocent:

Or otherwise I'll just make custom palettes and use them.

Creating a custom palette and mapping values to that palette is the recommended approach.

Thanks again !

I understand, it might be a way to get prettier dashboards and probably saves RAM/CPU by avoiding thousands or more different colors on a same page...

But still, I think it would be a very good option to allow the use of individual custom colors given via the documents' fields... especially when GeoJSON seem to contain these properties almost by default.

I think you answered my questions ! Have a nice week-end !

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.