Vega HeatMap

Hi everyone,

I'm trying to build a heatmap in Vega. I can't build it in the normal heatmap visualization because I need each cell to be a ratio.

I have 3 fields, X from 0 to 9, Y from 0 to 9 and Z with values 0 or 1.

My goal is to build a heat map where the value of each cell is the ratio of all [X,Y] where Z==1 divided by all [X,Y].

So I do the following query: "GET logstash-/_search?q=X:0 AND Y:0 AND Z:1" and the hits.total is the numerator value I'm looking for. And if I do this one: "GET logstash-/_search?q=X:0 AND Y:0" I get the denominator.

Is there a way of using the ratio of all the 100 combinations I get to build the heatmap?

Is there a simple example of building a heatmap with vega that I could follow? The only one I found is a bit complicated.

Thank you very much.

@nyuriks ...can u plz help here?

Thanks
Rashmi

Hi again,

I found a simple example I could follow:

But I still encounter the same problem, how do I use the ratio between the results of two queries to color the cells.

Thank you!

Best,

Michael

Hi all,

I am interested in doing a very similar thing in a Kibana Heatmap. Is there no way to be able to perform such a calculation?

Many thanks in advance.

David

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

@Mike_CC if your entire elasticsearch index contains just 200 documents (x-10 * y-10 * z-2), you can just load them all (i.e. all documents that contain x,y, and z fields), and then use the same approach as shown in https://vega.github.io/vega/examples/heatmap/ . If your data is much bigger, you need to construct your query in such a way as to produce those 200 documents.