GithubHelp home page GithubHelp logo

Comments (8)

Drazair avatar Drazair commented on August 17, 2024

Hey Sptrakesh,

It looks like the rows are wrap with a "location" which it doesn't except. Could you send the query you used, so I can see if it's a problem with the plugin or the query?

And it's currently not possible to have the map center itself based on the points, but should be easy to implement, when I have the time.

from alexandra-trackmap-panel.

sptrakesh avatar sptrakesh commented on August 17, 2024

Hello,

The data is coming from an Akumuli event stream that is retrieved via a custom JSON datasource, so it will be hard for you to replicate.

When I did not see the data, I inspected the map query control implementation, and it looked like you expect a structure similar to what I have above as well.

https://github.com/alexandrainst/alexandra-trackmap-panel/blob/master/src/map_ctrl.js#L88

If I am reading it right, for each row in the rows array, you retrieve the location object, and within the location object you verify the type is geo:json and that it has a value property with an array of coordinates.

If you can share what a valid response should look like (maybe expand the README), I can validate against that. I will also try changing the output in the JSON datasource to be simple latitude longitude to see if that works better.

from alexandra-trackmap-panel.

sptrakesh avatar sptrakesh commented on August 17, 2024

Did a debug build by adding some console output, and now I know why the map shows nothing. Looks like the output is invalid (no errors shown) as far as what Grafana expects. See this screen capture where you can see the query inspector shows the data, but in the map control, during iteration it just sees an array of null values.

Any idea why Grafana hands over different results to the map control?

from alexandra-trackmap-panel.

Drazair avatar Drazair commented on August 17, 2024

Here is the structure that i'm getting from a CrateDB:

[{
  columns: [
    { text: "location" },
    { text: "time_index" }
  ],
  rows: [
    [ 
      "{\"type\":\"geo:json\",\"value\":{\"coordinates\":[56.18803,10.16773],\"type\":\"Point\"},\"metadata\":{\"timestamp\":{\"type\":\"DateTime\",\"value\":\"2019-12-19T06:35:59.390Z\"}}}",
      "2019-12-19T06:35:59Z" 
    ],
    [ 
      "{\"type\":\"geo:json\",\"value\":{\"coordinates\":[56.18803,10.16773],\"type\":\"Point\"},\"metadata\":{\"timestamp\":{\"type\":\"DateTime\",\"value\":\"2019-12-19T06:38:44.376Z\"}}}", 
      "2019-12-19T06:38:44Z" 
    ]
  ],
  type: "table"
}]

It doesn't have to be a json string, here is the string as a object:

{
  "type": "geo:json",
  "value": {
    "coordinates": [56.18803, 10.16773],
    "type": "Point"
  },
  "metadata": {
    "timestamp": {
      "type": "DateTime",
      "value": "2019-12-19T06:35:59.390Z"
    }
  }
}

from alexandra-trackmap-panel.

Drazair avatar Drazair commented on August 17, 2024

The metadata above is not needed for the plugin, it's just part of NSGIv2 data format

from alexandra-trackmap-panel.

sptrakesh avatar sptrakesh commented on August 17, 2024

Thanks for the samples, that is very helpful. Still not clear how the array without a wrapper location object works based on line 88 (on master branch) in the map control code. The bigger issue in my case seems to be a mismatch in the data I see in the query inspector vs the data that gets to the map control.

https://sptci.com/uploads/map-issue.png

from alexandra-trackmap-panel.

Drazair avatar Drazair commented on August 17, 2024

The location variable, that is used in line 88, is the index in the array that was found from the columns list.

Haven't had any problems with a mismatch between the query inspector and the map controls data. This seems more like a problem with the Grafana and your data source.

The response I get in the query inspector looks a lot different compared to yours:
query-inspector

from alexandra-trackmap-panel.

sptrakesh avatar sptrakesh commented on August 17, 2024

Thanks for your help. Definitely looks like a datasource issue.

from alexandra-trackmap-panel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.