Influxdb to JSOn datapoints

Hi All, I added a custom plugin and now I need to add data: Add Data To Circuits | GlobalNOC Worldview Panel
It needs data in JSON

[
  {
    "name": "hostname.a.b.c+interfaceET-12+input",
    "datapoints": [[1856397.26666666, 1633959000], [1650972.84444445, 1633958640], [1373735.42222222, 1633958280],…] 
  },
  {
    "name": "hostname.a.b.c+interfaceGE-42+input",
    "datapoints": [[1856397.26666666, 1633959000], [1650972.84444445, 1633958640], [1373735.42222222, 1633958280],…] 
  },
  {
    "name": "hostname.a.b.c+interfaceET-12+output",
    "datapoints": [[19015224.4666666, 1633959000], [16855873.2777778, 1633958640], [15234882.4222223, 1633958280],…] 
  },
  {
    "name": "hostname.d.e.f+interfaceET-45+input",
    "datapoints": [[986576809.333332, 1633959000], [913103824.399999, 1633958640], [890706239.466668, 1633958280],…] 
  },
  ...
]

My Datasource is InfluxDB. Is there a way to get results on a JSON?

After install what is the name of the plugin. I installed it but cannot find it.

it is called globalnoc-worldview-panel

oh you have to build it locally. gross

anyways something like this. This is based on my influxdb bucket, you will have to sort it out for your specific data points. The key part is

|> map(fn: (r) => ({r with jsonStr: string(v: json.encode(v: {"city": r.city, "datapoints": r.lat}))}))
import "json"
from(bucket: "population")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "populations")
  |> filter(fn: (r) => r["_field"] == "city" or r["_field"] == "lat" or r["_field"] == "lng" or r["_field"] == "population")
  |> filter(fn: (r) => r["type"] == "census")
  |> map(fn: (r) => ({r with jsonStr: string(v: json.encode(v: {"city": r.city, "datapoints": r.lat}))}))