i am new to kibana and using vega and am trying to create a meshnet with the espressiff environment and i m sending mqtt msg from my root esp to kibana. i can see the msg in the discover section and they look like this:
enter image description here
this comes from this schema:
enter image description here
so i tried using vega but i m not getting anything
right now the amount of nodes inside my mesh net are 3
how can i visualize this. i havent found anything that really helped me up until now.
this is what i ve tried up until now. and i get the err:
enter image description here
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"description": "A tree diagram showing sensor connections.",
"data": [
{
"name": "edges",
"url": {
"%context%": true,
"index": "25_36_170",
"body": {
"size": 3,
"_source": ["sensors.values.edges.from", "sensors.values.edges.to"]
}
},
"format": { "property": "hits.hits" }
},
{
"name": "nodes",
"source": "edges",
"transform": [
{
"type": "flatten",
"fields": ["_source.sensors.values.edges"]
},
{
"type": "formula",
"as": "source",
"expr": "datum['_source.sensors.values.edges'].from"
},
{
"type": "formula",
"as": "target",
"expr": "datum['_source.sensors.values.edges'].to"
},
{
"type": "fold",
"fields": ["source", "target"]
},
{
"type": "identifier",
"as": "id"
},
{
"type": "formula",
"as": "node",
"expr": "datum.value"
},
{
"type": "collect",
"sort": { "field": "node" }
}
]
}
],
"scales": [
{
"name": "color",
"type": "ordinal",
"domain": { "data": "nodes", "field": "node" },
"range": { "scheme": "category10" }
}
],
"marks": [
{
"type": "text",
"from": { "data": "nodes" },
"encode": {
"enter": {
"x": { "field": "id", "type": "ordinal", "band": 0.5 },
"y": { "field": "id", "type": "ordinal", "band": 0.5 },
"text": { "field": "node" },
"fill": { "scale": "color", "field": "node" }
}
}
}
]
}