3D/4D Visualization

Hey there,

I hope you can help me, I've posted this question on github, bun got no answer for 4 weeks or so.

My plan is to build my own 3D/4D visualization, 3 dimensions to be choosen as the space koordinates and a fourth one for colouring. My basis is the area3D_vis visualization from github (https://github.com/JuanCarniglia/area3d_vis) and I want to set the colour dimension by myself.

What I did is: Extend the buckets by the z dimension:

{
    group: 'buckets',
    name: 'split',
    title: 'Z Dimension',
    aggFilter: ['terms',
      'significant_terms',
      'filters',
      'date_range',
      'histogram',
      'date_histogram',
      'range'
    ]
  }

just like the dimensions where defined - this works, I can choose it in kibana.
And the metric can be choosen separately.
The response table looks fine, too.

The js code for handling the response is

_.map(resp.aggregations, function (xElementRoot) {
  if (xElementRoot !== null) {
    _.map(xElementRoot.buckets, function (xElement) {
      if (xElement !== null) {
        x = parseInt(xElement.key);
        fiberX++;
        _.map(xElement[3].buckets, function (yElementBucket) {
          y = parseInt(yElementBucket.key);
          fiberY++;                                                                 
          _.map(xElement[4].buckets, function (zElementBucket) {
            z = parseInt(zElementBucket.key);
            fiberZ++;
            if (zElementBucket.hasOwnProperty('1')) {
              z = parseInt(zElementBucket[1].value);
            } else {
              z = zElementBucket.doc_count;
          }
          data.add({
            id: counter++,
            x: x,
            y: parseInt(yElementBucket.key),
            z: z,
            style: z
          });
        });
      });
    }
   });
  }
});

And there's the rub I think: the _.map() function provided by vis.js
Has anyone experience with vis.js or even the area3d_vis visualization?

Thanks so far,

Markus


There was a Kibana issue/feature request on github a few... few more days ago:

Anyone?

Kind regards,

Markus

_.map() is a lodash function. Documentation can be found at https://lodash.com/docs/3.10.1#map.

I am not sure what you are asking. Could you please re-state your question?

Nathan

What I want to do is extend the existing visualization for kibana to select 4 dimensions, 3 in space and one as the colour (style variable -> see data.add(...) in my last post).
I am able to get the request to elastic right, but I don't get it to read the response right and handle it with _.map().

Is this more comprehensible?

Thank you,
Markus

In Kibana 6.0 and up, your plugin can use a custom response handler. If you are having trouble with the default response handler, then wire in your own.

It is still not clear why _.map is causing you problems. Maybe provide a response and the output of tabify?

Here is the response:

{
  "took": 17,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 241,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "buckets": [
        {
          "3": {
            "buckets": [
              {
                "4": {
                  "buckets": [
                    {
                      "key": 1,
                      "doc_count": 120
                    }
                  ]
                },
                "key": 0,
                "doc_count": 120
              }
            ]
          },
          "key": 79,
          "doc_count": 120
        },
        {
          "3": {
            "buckets": [
              {
                "4": {
                  "buckets": [
                    {
                      "key": 1,
                      "doc_count": 1
                    },
                    {
                      "key": 2,
                      "doc_count": 120
                    }
                  ]
                },
                "key": -1,
                "doc_count": 121
              }
            ]
          },
          "key": 105,
          "doc_count": 121
        }
      ]
    }
  },
  "status": 200
}

and the output tabified (as formatted .csv):

"x",   "y",   "z",   Count
79,    0,     1,     120
105,   "-1",  1,     1
105,   "-1",  2,     120

I think the problem is not directly coming from _.map() but from the function provided in area3d_vis,
function(xElementRoot){...},
function(xElement){...}
and
function(yElementBucket){...}
.

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