HI all,
we have som trouble to transform data for a Treemap in vega visualization.
I create data from Elastic like
{
"_index": "eu-metricbeat-2023.01.18-000021",
"_type": "_doc",
"_id": "H6YsyYUBmEzuaZBQ3gRf",
"_score": 1,
"_source": {
"instancename": "ENTW07",
"instancetype": "ADS",
"windows": {
"service": {
"name": "ADS_ENTW07"
}
}
},
"x0": 100,
"y0": 50,
"x1": 100,
"y1": 50,
"depth": 3,
"children": 0
},
{
"_index": "eu-metricbeat-2023.01.18-000021",
"_type": "_doc",
"_id": "IKYsyYUBmEzuaZBQ3gRf",
"_score": 1,
"_source": {
"instancename": "ENTW20",
"instancetype": "AMB",
"windows": {
"service": {
"name": "AMB_ENTW20"
}
}
},
"x0": 100,
"y0": 50,
"x1": 100,
"y1": 50,
"depth": 3,
"children": 0
},
{
"_index": "eu-metricbeat-2023.01.18-000021",
"_type": "_doc",
"_id": "IaYsyYUBmEzuaZBQ3gRf",
"_score": 1,
"_source": {
"instancename": "ENTW07",
"instancetype": "AMB",
"windows": {
"service": {
"name": "AMB_ENTW07"
}
}
},
"x0": 100,
"y0": 50,
"x1": 100,
"y1": 50,
"depth": 3,
"children": 0
},
{
"_index": "eu-metricbeat-2023.01.18-000021",
"_type": "_doc",
"_id": "IqYsyYUBmEzuaZBQ3gRf",
"_score": 1,
"_source": {
"instancename": "ENTW07",
"instancetype": "AMB",
"windows": {
"service": {
"name": "AMB_ENTW07"
}
}
},
"x0": 100,
"y0": 50,
"x1": 100,
"y1": 50,
"depth": 3,
"children": 0
},
an try to create a nested group:
vega code is:
...
data: [
{
name: tree
url: {
index: eu-metricbeat-*
body: {
_source: [
instancetype
instancename
windows.service.name
]
size: 10
query: {
bool: {
must: [
{
exists: {
field: instancetype
}
exists: {
field: instancename
}
}
]
}
}
}
}
format: {
property: hits.hits
}
transform: [
{
type: nest
keys: [
_source.instancename
_source.instancetype
]
}
{
type: treemap
method: {signal: "layout"},
ratio: 1
padding: 10000
size: [200 , 100]
}
]
}
the transformation
transform: [
{
type: nest
keys: [
_source.instancename
_source.instancetype
]
}
do not create child object and do tue this case the transformation
{
type: treemap
method: {signal: "layout"},
ratio: 1
padding: 10000
size: [200 , 100]
}
create always the same x and y values.
Any Idee whats going wrong?