Giter VIP home page Giter VIP logo

alexandra-trackmap-panel's Introduction

Track Map - Grafana Panel Plugin

A map plugin to visualise coordinates as markers, hexbin, ant path, or heatmap.

Earlier versions

This is a new version of the Track Map plugin - now built with React, which works with Grafana 7+.

Note that this plugin is not backwards compatible with the old Grafana 6 versions.

For Grafana 6 and older, please use our 1.x branch instead.

How to use

Query

The queries in Grafana can be formatted as Table or Time series and contain the fields latitude and longitude or just lat and lon. To add intensity to the heatmap (instead of using only coordinates), the intensity field should be added.

To add a text popup to the markers, a popup, text or desc field should be added. If no popup field exists, latitude and longitude are displayed in the popup.

popup

To add a mouseover tooltip to the markers, add a tooltip field. The tooltips can be shown permanently by toggling the Always show tooltips option (may require map reload).

tooltip

Data query example (TimescaleDB with PostGIS):

SELECT
avg("lat") as "latitude",  
avg("long") as "longitude",  
max(abs("rssi")) as "intensity",
max("rssi") as "tooltip",
clusters
FROM (SELECT lat,
long,
geo,
rssi,
ST_ClusterKMeans(geo, 100) over() as clusters
FROM table_name) table_name_clustered
GROUP BY clusters
ORDER BY clusters;

Multiple queries at once

It is possible to add multiple data queries to the same map, but these must all be either Table or Time series, not a mix of the two.

Configuration

The panel has general configuration options as well as options specific to each visualisation type.

Map center and zoom can be changed with the Map center latitude, Map center longitude and Zoom properties.

Centering the map on the first/last position or zooming to fit all data within the map bounds on load can be achieved by using the Map center to first position, Map center to last position and Zoom map to fit data bounds switches.

To update query variables when the map bounds are updated turn on Use map bounds in query. See section "Updating query based on map bounds" below.

Switch between views (Markers, Ant Path, Ant Path With Markers, Hexbin, Heatmap) by selecting a Visualisation type .

Note that some options are disabled when others are enabled - e.g. you cannot set a specific zoom level and also zoom the map to fit all data at the same time.

Markers

  • Size: The size of the markers
  • Size of last marker: The size of the last marker
  • Show only last marker: Shows only last marker
  • Use secondary icon for last marker: Uses secondary icon image for last marker
  • Use secondary icon for all markers: Uses secondary icon image for all markers
  • Always show tooltips: Always show the mouseover tooltips
  • Use HTML for markers: Insert custom HTML/SVG for icons
  • Custom icon width: Use to scale custom icon. Leave empty if custom HTML/SVG has inline size.
  • Custom icon height: Use to scale custom icon. Leave empty if custom HTML/SVG has inline size.

markers_options

Ant Path

  • Delay: The delay of the animation
  • Weight: The width of the path
  • Color: The color of the path
  • Pulse color: The color of the pulse running along the path
  • Paused: Pause/start the animation
  • Reverse: Reverse the animation direction
  • Hardware Acceleration: Use/do not use hardware acceleration with the animation

ant_path_options

Ant Path With Markers

  • Delay: The delay of the animation
  • Weight: The width of the path
  • Color: The color of the path
  • Pulse color: The color of the pulse running along the path
  • Paused: Pause/start the animation
  • Reverse: Reverse the animation direction
  • Hardware Acceleration: Use/do not use hardware acceleration with the animation
  • Show only last marker: Shows only last marker
  • Use secondary icon for last marker: Uses secondary icon image for last marker
  • Use secondary icon for all markers: Uses secondary icon image for all markers
  • Always show tooltips: Always show the mouseover tooltips
  • Use HTML for markers: Insert custom HTML/SVG for icons
  • Custom icon width: Use to scale custom icon. Leave empty if custom HTML/SVG has inline size.
  • Custom icon height: Use to scale custom icon. Leave empty if custom HTML/SVG has inline size.

ant_markers_options

Hexbin

  • Opacity: The opacity of the hexagons
  • Color range from (hex): Color ranges from this value
  • Color range to (hex): Color ranges to this value
  • Radius range from: Min radius
  • Radius range to: Max radius

hexbin_options

Heatmap

  • Maximum intensity: Value of intensity that is considered the maximum achievable. Set to 0 to compute the value automatically

heatmap_options

Hover Marker

  • Color: Color to display the hover marker outline in
  • Fill color: Color to use to fill the hover marker
  • Fill opacity: The opacity of the fill color
  • Weight: Width of the outline
  • Radius: Radius of the marker

Changing marker icons or using custom HTML/SVG icons

There are two ways to change the marker icons. To change the images used, replace the marker.png and marker_secondary.png files in the /src/img folder. To use custom HTML or SVG for icons, toggle the Use HTML for markers option and paste the HTML/SVG in the Default marker HTML field. The custom icon is surrounded by a div. The size of this div can be set with Custom icon width and Custom icon height. If left empty, the sizes should be defined in the custom HTML/SVG.

Example (small yellow square with inline height/width):

Use HTML for markers: True
Default marker HTML: <div style="background:yellow; width:10px; height:10px;"></div>
Custom icon height: Empty (no value)
Custom icon width: Empty (no value)

Example (custom image with set size):

Use HTML for markers: True
Default marker HTML: <img src="http://your-image-url-here.jpg" width="100%" />
Custom icon height: 50
Custom icon width: 25

If a timeseries has a label with the key entered in Override label and the label value matches a key set in Marker HTML overrides by label, then the HTML will be overriden by the defined HTML in the marker override. For multiple series, add multiple Marker HTML overrides by label.

Example:

Timeseries label is: {"icon": "a"}
Override label: "icon"
Marker HTML overrides by label: key="a", value="<div>custom HTML</div>"

Change ant path colors with labels

In the ant path options, if a timeseries has a label with the key entered in Override label and the label value matches a key set in Color overrides by label, then the selected color will be used for the ant path. For multiple series, add multiple Color overrides by label.

Example:

Timeseries label is: {"antCol": "a"}
Override label: "antCol"
Color overrides by label: key="a", value=[color selected in the GUI]

Icon, popup, and tooltip offset

Change the offset values Icon offset, Popup offset, and Tooltip offset to override the default placement of marker icons, popups, and tooltips. The format should be x,y - e.g. 0,50.

Changing map style (map tiles)

The tiles that are loaded and displayed within the map can be changed via the "Custom map tiles URL schema" configuration.
This allows customization of the style to be used for the map (e.g. streets, satellite or dark):

map_tiles_config

To make use of this configuration, specify a Tile Server URL (see schema) in the input field. On the OpenStreetMap Wiki there is a list of publicly available tile servers.

Mapbox

One of the options is to use the Static Tile API provided by Mapbox, which provides a variety of styles (and also allows you to create your own).

You can use some public example styles with the following URL schemes (the API key has to be exchanged accordingly):

  • Streets (v11):
    https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/256/{z}/{x}/{y}?access_token=[YOUR API TOKEN]
  • Satellite (v9):
    https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token=[YOUR API TOKEN]
  • Satellite Streets (v11):
    https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/256/{z}/{x}/{y}?access_token=[YOUR API TOKEN]
  • Dark (v10):
    https://api.mapbox.com/styles/v1/mapbox/dark-v10/tiles/256/{z}/{x}/{y}?access_token=[YOUR API TOKEN]

Updating query based on map bounds

To update the query dynamically based on the map bounds turn on Use map bounds in query. To use this you must manually add four variables to the dashboard (via settings in the top right corner). Add four variables of type constant with names minLat, minLon, maxLat, and maxLon. The values can be anything, e.g. 1, 2, 3, 4 - they will be overwritten by the plugin. Remember to save the dashboard. The variables can then be used in a query. Here is an example that limits the query to the bounds of the map:

SELECT
  avg("lat") as "latitude",
  avg("long") as "longitude",
  max(abs("rssi")) as "intensity",
  max("rssi") as "tooltip",
FROM (
  SELECT sys_time, lat, long, geo, rssi, ST_ClusterKMeans(geo, 15) over() as clusters from table_name
  Where lat >= $minLat
    AND lat <= $maxLat
    AND long >= $minLon
    AND long <= $maxLon
) table_name_clustered
GROUP BY clusters

Installation

If you are running Grafana locally, you can clone or download the repository directly into the plugin directory, reset the Grafana server, and the plugin should get detected automatically.

If you are using Docker, a guide can be found here, for instance using the ZIP file as so:

-e "GF_INSTALL_PLUGINS=https://github.com/alexandrainst/alexandra-trackmap-panel/archive/refs/heads/master.zip" \

Another example of installing the plug-in in Docker (Replace grafana_image_name with your own image name).

sudo docker exec -it -u root grafana_image_name sh
# Add git and npm inside docker image
apk add git
# Enter plugins folder
cd /var/lib/grafana/plugins/
# Download the source code
git clone https://github.com/alexandrainst/alexandra-trackmap-panel.git
# Exit the docker image
exit
# Restart the grafana docker image
sudo docker restart grafana_image_name

For more information on Grafana plugins look here.

Development

To compile the plugin you need npm.

1. Install dependencies

npm install

2. Build plugin in development & watch mode

npm run dev

3. Build plugin in production mode

npm run build

4. (optional) Update plugin scaffolding

npx @grafana/create-plugin@latest update

License

MIT © Alexandra Institute.

alexandra-trackmap-panel's People

Contributors

alkarex avatar codefunta avatar dependabot[bot] avatar drazair avatar hengsokly avatar j-or avatar pesintta avatar sebastien-coavoux avatar sydoxx avatar tpachmann avatar zhongyuwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alexandra-trackmap-panel's Issues

Cannot read data from Elasticsearch

Hi. I have the installed the version 1.2.4 of the plugin and I cannot visualize data in Grafana. My data looks like:

"location_index": {
    "type": "geo:json",
    "value": {
      "coordinates": [55.96086,9.75394],
      "type": "Point"
    }
}

Do you have examples that I can check for Elasticsearch as data source?

L.heatLayer is not a function

I had problems with getting InfluxDB data to display (s. #2 ). After getting it to work, it suddenly stopped working with Grafana 6.4.1 and with the update to 6.4.2, I get the following error:

Panel data error: TypeError: "L.heatLayer is not a function"            metrics_panel_ctrl.ts:202:6
    value module.js:10
    value module.js:10
    emit index.js:129
    emit emitter.ts:11
    handleQueryResult sdk.ts:1
    next metrics_panel_ctrl.ts:82
    RxJS 8
        __tryOrUnsub
        next
        _next
        next
        _next
        next
        next
        nextInfiniteTimeWindow
    next PanelModel.ts:5
    RxJS 19
        __tryOrUnsub
        next
        _next
        next
        notifyNext
        _next
        next
        _next
        next
        next
        _next
        next
        _next
        next
        _next
        next
        _next
        next
        o
    Angular 6
        f
        f
        $digest
        evalAsync
        p
        n

Just updated to 6.4.3 and the error is still there:

Panel data error: TypeError: "L.heatLayer is not a function"           metrics_panel_ctrl.ts:202:6
    value module.js:10
    value module.js:10
    emit index.js:129
    emit emitter.ts:11
    handleQueryResult sdk.ts:1
    next metrics_panel_ctrl.ts:82
    RxJS 8
        __tryOrUnsub
        next
        _next
        next
        _next
        next
        next
        nextInfiniteTimeWindow
    next PanelModel.ts:5
    RxJS 19
        __tryOrUnsub
        next
        _next
        next
        notifyNext
        _next
        next
        _next
        next
        next
        _next
        next
        _next
        next
        _next
        next
        _next
        next
        o
    Angular 7
        f
        f
        $digest
        $apply
        r
        p
        n

InfluxDB 2.0 (Flux)

Still loving this plugin! :)

I just migrated my setup to InfluxDB 2.0, which is using Flux as the query language. I am completely new to this, and was wondering if you have an example query (for this plugin) I could use as a starting point.

thank you

Hover over for details

I was wondering if it is possible to configure the map in a way that when the mouse hovers over a track point, it shows the details (or at least the time stamp) of that point, like any other graph in Grafana does, i.e.:

grafana-hover-over-example

If it is not possible, please take this as a feature request :)

Thank you!

Cannot read data on TrackMap-panel-Grafana using Amazon timestream as the datasource

Hi, I have the installed the version 2.1.2 of the plugin and I cannot visualize data on Grafana 7.4.1. My data looks like:

SELECT
DeviceId,
CREATE_TIME_SERIES(time, measure_value::double) AS "*"
FROM "my_DB"."my_Table"
WHERE $__timeFilter
AND measure_name = 'latitude'
AND measure_name = 'longitude'
GROUP BY DeviceId

Do you have an example/format/setting I can use? Thanks anyone

Data Point not plotting in the graph - InfluxCloud DB

Hi,
I a trying this plug-in with grafana and using influx cloud DB database.

I am unable to see any data point s drawn.

can you please guide me how can I use it with influx cloud DB.

below is my output of the query.
,result,table,_time,_value,_field
,_result,0,2020-02-18T07:27:58.853339466Z,17.4632916,lat
,_result,0,2020-02-18T07:27:58.853864976Z,17.4632916,lat
,_result,0,2020-02-18T07:28:58.017188544Z,17.4632916,lat
,_result,0,2020-02-18T07:28:58.017295643Z,17.4632916,lat

Track line across the entire world when position has moved from eastern to western hemisphere

What happened? Track map shows a line across the entire world when position has moved from eastern to western hemisphere.What was expected to happen?Track Map should not plot a trace line when positions shifts from eastern to western hemisphere. This is exception should be rather easy to implement. Steps to reproduce the problem: 1. create a trace map 2. add a position time series where positions shifts from eastern to western hemisphere
2019-12-16-1009

Intensity hard to get working with TestData DB

Dear developers,

The TrackMap plugin seems to work great for visualisation of location paths in grafana 7.2.0.

I have basic points working with simple test-data, but have some trouble seeing individual points (green in options) and their intensity, I hope you guide me in the right direction to get this working. I have entered two points with latitude and longitude as well as 2 intensity values. With the intensity metric disabled I see a line between the two points. When I enable the intensity metric, the map goes back to worldview without any line.
image

I was also hoping to have the identity_id or name of separate points visible with the point or with a tooltip, is this possible? I tried using the identiy_id mentioned from the older TrackLab 1.2.5 documentation.

Kind regards,
Dennis

How to use re-center as starting position

First of all this plugin is fantastic. I use Antpath to track ship route, I have a dashboard variable to switch between ship, and re-center function is working good, as I change ship the map is recentered correctly to show all route. But when I first load the dashboard, the map show me the configured starting position, but I can't know where the ship could be, so starting position is meaningless for me in this situation. As I click to refresh dashboard data, re-center is triggered and route is now centered in the map. Is it possible to automatically re-centering the map at first data load instead of using configured start position?

Tracking position on map from other panels

Use-case: Select a time frame like last 30 minutes
1 Panel with ant-path and markers.
1 Panel showing a metric as a graph
Select the shared crosshair option in Grafana global options for the panel.

Hover over the graph.
Trackmap should highlight the marker for the given timestamp using the alternate colour(if markers are displayed). If ant-path is selected display a marker at the position of time timestamp that moves along the path as the hover is moved on the graph. Similar to props-trackmap. Very useful to correlate metrics to positions. While a tooltip on hover in trackmap is available in the plugin currently, the amount of data associated with each popup is limited to a single metric. The timestamp is also not shared to other graphs(shared crosshair grafana function) and is not as easy to use as hovering over an adjacent graph panel.

Great work with the plugin.

Newest versions available on Grafana Cloud

Hi,

I'm using Grafana Cloud (8.0.4), and I would very much like to use this plugin. The latest version available to install from https://grafana.com/grafana/plugins/alexandra-trackmap-panel/?tab=installation is 1.2.6, which I think is not compatible with this Grafana version. I don't think I have another option to manually install the latest version (2.2.1) of this plugin in Grafana Cloud.
I'm now getting a stacktrace when trying to add a panel with the Trackmap vizualization:

TypeError: Cannot read property 'emit' of undefined

    at Xt (https://grafana-assets.grafana.net/grafana-pro/8.0.4/public/build/DashboardPage.15a18d43ff262349d5e8.js:223:4307)
    at k (https://grafana-assets.grafana.net/grafana-pro/8.0.4/public/build/vendors~app.15a18d43ff262349d5e8.js:2:70367)
    at div
    at div
    at div
    at t (https://grafana-assets.grafana.net/grafana-pro/8.0.4/public/build/vendors~app.15a18d43ff262349d5e8.js:2:706836)

Regards, Stijn

Transformed query won't display path

Hello,

I'm currently trying to display a path queried via GraphQL. Unfortunately the data source does not allow to rename columns and only returns PostGIS coordinates as an object which are then flattened.


Query
image


Returned columns
image


I now simply reformatted the data with Grafanas 'Transform' feature. But the path is still missing on the map.

image

image

For comparison on the right side is a random walk which is displayed correctly on the map.

image

image

Am I doing something wrong or is there something wrong with transformations? Thank you.

Markers showing up with longitude=0

Dear developers,
I just upgraded your plugin from githup, re-installed and re-build with npm, and restarted grafana (v7.5.7 on Ubuntu 20.04.2), I am still using the TestData DB plugin for the metrics. For some reason the longitude is now always 0, I get an error about null longitude in 1970 but it is there in the inspect panel with valid timestamp (see below). The map positioned itself in the correct area of the Netherlands (as in #31), I zoomed out to find the marker.
image.
Adding "longitude" in the second "Custom latitude column name" does not help, changing that to "latitude" gets me south of Russia, shows my markers but not the tooltip.
image
Any idea why this happens and how to resolve it?

Kind regards,
Dennis

X,Y Trackmap over a static background

It would be very useful to have a support for X,Y coordinates and a static background.

My use case would be drawing an heatmap/trackmap over a static picture like a floor layout or a camera snapshot.

Dark theme

Missing a dark theme (or satellite) like in the original world map plugin

Screenshot_3

Unexpected error when trying to create panel

I installed the plugin to Grafana 7.2.1. When I tried creating a panel in Firefox 81.0.1, I get the following error message:

TypeError: this.events is undefined

There are two error messages on the browser console:

Plugin component error Error: [$injector:unpr] Unknown provider: variableSrvProvider <- variableSrv
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=variableSrvProvider%20%3C-%20variableSrv
    Angular 11
    f plugin_component.ts:223
    f plugin_component.ts:258
    link plugin_component.ts:266
plugin_component.ts:269:18
    link plugin_component.ts:269
TypeError: this.events is undefined
    value panel_ctrl.ts:66
    Angular 2
    React 13
    value Angular
react-dom.production.min.js:196:194
    React 17
    value Angular

It doesn't work on Chrome 86.0 either, but with a different error message:

plugin_component.ts:269 Plugin component error Error: [$injector:unpr] Unknown provider: variableSrvProvider <- variableSrv
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=variableSrvProvider%20%3C-%20variableSrv
    at angular.js:116
    at angular.js:4887
    at Object.a [as get] (angular.js:5047)
    at angular.js:4892
    at a (angular.js:5047)
    at s (angular.js:5072)
    at Object.invoke (angular.js:5098)
    at angular.js:11076
    at it (angular.js:9926)
    at angular.js:9248****
react-dom.production.min.js:196 TypeError: Cannot read property 'emit' of undefined
    at MapCtrl.value (panel_ctrl.ts:66)
    at t.value (AngularPanelOptions.tsx:81)
    at t.value (AngularPanelOptions.tsx:49)
    at mc (react-dom.production.min.js:251)
    at KqkS.t.unstable_runWithPriority (scheduler.production.min.js:18)
    at Wo (react-dom.production.min.js:120)
    at gc (react-dom.production.min.js:244)
    at ic (react-dom.production.min.js:223)
    at react-dom.production.min.js:121
    at KqkS.t.unstable_runWithPriority (scheduler.production.min.js:18)

Handling clicks on the marker

It would be great if you could switch to other dashboards when you click on the marker. With support for field variables in the url.

Update Track Map to latest version on Grafana Plugin repository

Currently in the Grafana hosted plugin respository the latest version of Track Map isn't avaliable (https://grafana.com/grafana/plugins/alexandra-trackmap-panel/) newest version is 1.2.6 this version doesn't appear to work with the latest versions of Grafana (Or i haven't been able to get it working)

Can also see on the built in plugin admin page in grafana that the plugin suggests it is compatiable with versions above grafana 6 but doesn't appear to work.

image

Is it possible to get the latest version of Track Map avaliable within the grafana plugin respository?

Thanks

Map not updating correctly when starting with null/0 (lat/lon) values in time range

When starting/opening grafana with a timerange that does not contain latitude/longitude data ( eg null or 0 --> setting :
Discard positions that contains null (avoid plugin crash) or exactly 0 (inconsistent) coordinates to ON ) the map/panel gives an error --> "Invalid LatLng object: (NaN, NaN)"

When correcting the timerange to a point that does contain lat/lon data the map is not updated/refreshed. This can only be solved by completely refreshing the webpage --> Pressing F5.

Is there a way to solve this?

It would also be nice that if there is no lat/lon data in the specific range the map is still visible instead of disapearing and only showing the "Invalid LatLng object: (NaN, NaN)" error.
I would prefer if it shows an error like "NO GPS DATA".

Thanks,

2.2.0 build fails, 2.1.0 works

Getting an error during build of 2.2.0.

Commands used:

yarn
yarn build

Tried with node@12, node@14, node@15, getting the same error for latest master (2.2.0). The workaround for now is to build 2.1.0 instead.

 ERROR in /home/tim/alexandra-trackmap-panel/src/TrackMapPanel.tsx
  ERROR in /home/tim/alexandra-trackmap-panel/src/TrackMapPanel.tsx(172,64):
  TS2769: No overload matches this call.
    Overload 1 of 2, '(props: Readonly<MarkerProps>): Marker<MarkerProps, Marker<any>>', gave the following error.
      Type 'Icon<IconOptions>' is not assignable to type 'Icon<IconOptions> | DivIcon | undefined'.
        Type 'Icon<IconOptions>' is not assignable to type 'DivIcon'.
          Types of property 'addTo' are incompatible.
            Type '(map: Map | LayerGroup<any>) => Icon<IconOptions>' is not assignable to type '(map: Map | LayerGroup<any>) => DivIcon'.
              Types of parameters 'map' and 'map' are incompatible.
                Type 'L.Map | L.LayerGroup<any>' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>'.
                  Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
                    Type 'L.Map' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map'.
                      Types of property 'getRenderer' are incompatible.
                        Type '(layer: L.Path) => L.Renderer' is not assignable to type '(layer: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer'.
                          Types of parameters 'layer' and 'layer' are incompatible.
                            Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path' is not assignable to type 'L.Path'.
                              Types of property 'setStyle' are incompatible.
                                Type '(style: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path' is not assignable to type '(style: L.PathOptions) => L.Path'.
                                  Types of parameters 'style' and 'style' are incompatible.
                                    Type 'L.PathOptions' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions'.
                                      Types of property 'renderer' are incompatible.
                                        Type 'L.Renderer | undefined' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer | undefined'.
                                          Type 'L.Renderer' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer'.
                                            Types of property 'addTo' are incompatible.
                                              Type '(map: L.Map | L.LayerGroup<any>) => L.Renderer' is not assignable to type '(map: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer'.
                                                Types of parameters 'map' and 'map' are incompatible.
                                                  Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>' is not assignable to type 'L.Map | L.LayerGroup<any>'.
                                                    Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
                                                      Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map' is not assignable to type 'L.Map'.
                                                        Types of property 'getRenderer' are incompatible.
                                                          Type '(layer: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer' is not assignable to type '(layer: L.Path) => L.Renderer'.
                                                            Types of parameters 'layer' and 'layer' are incompatible.
                                                              Type 'L.Path' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path'.
                                                                Types of property 'setStyle' are incompatible.
                                                                  Type '(style: L.PathOptions) => L.Path' is not assignable to type '(style: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Path'.
                                                                    Types of parameters 'style' and 'style' are incompatible.
                                                                      Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").PathOptions' is not assignable to type 'L.PathOptions'.
                                                                        Types of property 'renderer' are incompatible.
                                                                          Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer | undefined' is not assignable to type 'L.Renderer | undefined'.
                                                                            Type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer' is not assignable to type 'L.Renderer'.
                                                                              Types of property 'addTo' are incompatible.
                                                                                Type '(map: import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>) => import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Renderer' is not assignable to type '(map: L.Map | L.LayerGroup<any>) => L.Renderer'.
                                                                                  Types of parameters 'map' and 'map' are incompatible.
                                                                                    Type 'L.Map | L.LayerGroup<any>' is not assignable to type 'import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").Map | import("/home/tim/alexandra-trackmap-panel/node_modules/@types/leaflet/index").LayerGroup<any>'.
                                                                                      Type 'Map' is not assignable to type 'Map | LayerGroup<any>'.
    Overload 2 of 2, '(props: MarkerProps, context?: any): Marker<MarkerProps, Marker<any>>', gave the following error.
      Type 'Icon<IconOptions>' is not assignable to type 'Icon<IconOptions> | DivIcon | undefined'.
        Type 'Icon<IconOptions>' is not assignable to type 'DivIcon'.

  Trace: Build failed
      at /home/tim/alexandra-trackmap-panel/node_modules/@grafana/src/cli/utils/useSpinner.ts:10:13
      at step (/home/tim/alexandra-trackmap-panel/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:140:27)
      at Object.throw (/home/tim/alexandra-trackmap-panel/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:121:57)
      at rejected (/home/tim/alexandra-trackmap-panel/node_modules/@grafana/toolkit/node_modules/tslib/tslib.js:112:69)
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
✖ Build failed
error Command failed with exit code 1.

Add Grafana 7 compatibility

At the moment, it does not look like this plugin works with Grafana 7

More precisely, might be related to Removes variableSrv grafana/grafana#24779

When coming to this plug-in, it looks like it is failing at compile time
https://github.com/grafana/grafana/blob/43033ddf7471bb005a8d24f4fda137441043cd2c/public/app/features/plugins/plugin_component.ts#L223

In the Web page:

An unexpected error happened: TypeError: this.events is undefined

image

In the browser console:

Plugin component error Error: [$injector:unpr] Unknown provider: variableSrvProvider <- variableSrv
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=variableSrvProvider%20%3C-%20variableSrv
    Angular 11
        i
        injector
        a
        u
        a
        s
        invoke
        get
        it
        ct
        ut
    f plugin_component.ts:219
    f plugin_component.ts:254
    link plugin_component.ts:262
plugin_component.ts:265:18

Display time in popup/tooltip

I've been trying to display the date/time in either the popup or the tooltip associated with a marker in a display based on influx data. I can achieve this by for example by adding the "time" field and giving it the alias "popup", but this just shows a Unix timestamp.

With a table visualisation, I can produce data including a timestamp in a readable format either by (a) using a unit Override, or (b) specifying the "popup" alias in a Transform instead of in the Query. But the format is lost when I switch back to map view.

Am I missing something?

This refers to the same issue:
#21 (comment)

PS Excellent plugin, by the way.

Re-centre map

I did a very simple implementation where I re-centre the map after data points have been retrieved. It is probably best to make this a configuration option, but for my case this is good enough.

master...sptrakesh:master

Wrong option name in panel options

In panel options->track map, the title option "Custom latitude name" is duplicated. It's only necessary to change the name in module.ts since path is ok.

builder
  .addTextInput({
    path: 'coordinates.customLatitudeColumnName',
    name: 'Custom latitude column name',
    defaultValue: '',
  })
  .addTextInput({
    path: 'coordinates.customLongitudeColumnName',
    name: 'Custom latitude column name',
    defaultValue: '',
  })

Feature suggestion: Live and non-live tracks

A feature first suggested here #51. It was not finished, so it's been moved to this separate issue.

  • Concept of a "non-live" track, where lat/lon data is null for the latest timestamp, but exists within the panel's time window.
  • Paused AntPath for "non-live" tracks
  • Only show markers for "live" tracks

Some todos with the comment Feature "Live track" are sprinkled around the project if someone wants to continue working on it.

HexbinLayer not updating to new time range

If I select a new time range, I get a red exclamation mark saying "L.HexbinLayer is not a constructor". After refreshing the whole website, the hexbin layer works again.

react-dom.production.min.js:216 TypeError: L.HexbinLayer is not a constructor
    at Object.L.hexbinLayer (react-leaflet-d3.min.js:3)
    at e.value (react-leaflet-d3.min.js:3)
    at e [as constructor] (MapLayer.js:23)
    at new e (react-leaflet-d3.min.js:3)
    at vo (react-dom.production.min.js:135)
    at za (react-dom.production.min.js:181)
    at Uu (react-dom.production.min.js:269)
    at ks (react-dom.production.min.js:250)
    at ws (react-dom.production.min.js:250)
    at _s (react-dom.production.min.js:250)

Marker size based on number of records in cluster

I am using the trackmap panel in a dashboard to explore a GBIF dataset. Using the following query I can zoom in to streetlevel, and show the number of records in the tooltip for each cluster.

WITH a AS (
SELECT
eventdate AS time,
decimallatitude,
decimallongitude,
geom,
COUNT(*) OVER() AS cnt
FROM explore.gbif
WHERE $__timeFilter(eventdate)
AND decimallatitude >= $minLat
AND decimallatitude <= $maxLat
AND decimallongitude >= $minLon
AND decimallongitude <= $maxLon
), b AS (
SELECT
time,
decimallatitude,
decimallongitude,
ST_ClusterKMeans(geom, LEAST(cnt::integer, 200)) OVER() AS clusters
FROM a
)
SELECT
clusters,
COUNT(clusters) AS tooltip,
AVG(decimallatitude) AS latitude,
AVG(decimallongitude) AS longitude
FROM b
GROUP BY 1
ORDER BY 1;

Is it possible to use the number of records in a cluster to set the size of the marker? Or an option to use circles with sizes depending on the number of records in a cluster, like available in the worldmap panel?

clusters

Maximum zoom using LEAST and COUNT OVER():
maxzoom

How to add routing feature?

Hi Team,

Kindly let me know the method to add routing feature in this trackmap-panel.
I have read about Routing-Machine but how to add the code within this source code.
Kindly assist.

Best Regards,

Sujan

Data from InfluxDB

Not sure if this a support or feature request. I'm trying to visualize track data from an InfluxDB source. The data is stored in "longitude" and "latitude". I have tried the following queries without success:

SELECT "latitude" as lat, "longitude" as lon FROM "device_tracker.stefan" WHERE $timeFilter

time | lat | lon
2019-09-22T12:49:40+03:00 | 61.255785 | 24.051843333333
2019-09-22T12:54:41+03:00 | 61.259143333333 | 24.048593333333
2019-09-22T12:59:42+03:00 | 61.26173 | 24.045255
2019-09-22T13:04:43+03:00 | 61.262641666667 | 24.039211666667
2019-09-22T13:14:44+03:00 | 61.266065 | 24.031786666667
...

SELECT "latitude" as lat, "longitude" as lon,"time" as time_index FROM "device_tracker.stefan" WHERE $timeFilter

time_index | lat | lon
1569144879097 | 61.255483333333 | 24.055775
1569145180116 | 61.255128333333 | 24.055998333333
1569145780115 | 61.255785 | 24.051843333333
1569146081098 | 61.259143333333 | 24.048593333333
1569146382109 | 61.26173 | 24.045255
...

I'm not sure in which format the plugin is expecting the data. Would you kindly advise? In case, it's not yet possible to use data from InfluxDB, please consider this a feature request.

Ant-Path is not chronologically connected

The path jumps around when a vehicule is in proximity of its own path.
When the vehicule is on a linear or near linear path it looks ok.

image

Am I missing a configuration item to get it to work properly?

Trackmap not working on Grafana 7.5.5

I have installed your cool Trackmap plugin successfully on Grafana cloud 7.5.5 and also local installation, but when I try to crate a panel I receive the error:

<TypeError: undefined is not an object (evaluating 'this.events.emit')>

Support from Grafana means: "It seems the alexandra-trackmap-panel plugin isn't compatible with the latest version of Grafana."

Can you please advise?

Changing marker icon

Hi

I am using version 2.2.1 (from master) and i a trying to change the marker icon for Antpath with markers' visualization type

I replace marker.png in both src/img (as stated in the documentation) ans dist/img but the marker icon stays the sme

Could you please check it?

Not Working

I tried to install and use this plugin, but sadly if i select it from the menu i get the following error.
click on track map
image
then
image

Grafana Version 7.1.5 (commit: 9893b8c53d, branch: HEAD)
TrackMap Version 1.2.5

Do not see location on map

This is most likely a question and not necessarily a bug. I followed the documentation for displaying NGSIv2 data, and through the query inspector and datasource logs I think I see the data being returned as it is supposed to be formatted. However I do not see any points on the map.

Related question is is there a way to automatically have the map centre itself based on range of points being displayed?

[{
	"columns": [{
		"text": "location",
		"type": "geo:json"
	}],
	"rows": [{
		"location": {
			"type": "geo:json",
			"value": {
				"type": "Point",
				"coordinates": [39.2866544, -76.5896193]
			}
		}
	}, {
		"location": {
			"type": "geo:json",
			"value": {
				"type": "Point",
				"coordinates": [39.286594, -76.5894559]
			}
		}
	}],
	"type": "table"
}]

Feature suggestion: change view via grafana template variable

Dear all,

Currently, you have to be in panel edit mode to change the view from e.g. markers to heatmap. Would it be possible to do this through a grafana template variable, so users with viewing role can also change the view type?

Kind regards,
Dennis

Grafana v8.3.4 plugin disabled

In Grafana v8.3.4 this plugin is disabled because of missing signature. It can't be enabled.

Plugin disabled

Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that there is no signature for this plugin. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.

Tracking multiple items

Hi.

Is it possible to track multiple items ?
I have 3 ships that I'm tracking, data is stored as:
Timestamp, Imo (ship identifier), Name, Lat, Lon

map dont show the points

Hi!

Im trying to use the plugin and make your example to use but it doesnt work the response its like this.

image

and my query is:

SELECT time, latitude as lat, longitude as lon
FROM doc.datasource
WHERE $__timeFilter(time)
ORDER BY time

where the datasource has the next structure

zip | city | states | latitude | longitude | time | daylight
71937 | Cove | AR | 34.398483 | -94.39398 | 1571306316 | 1

im using cratedb and my model is

create table datasource (
zip text,
city text,
states text,
latitude double precision,
longitude double precision,
time timestamp without time zone,
daylight text
);

Plugin crashes when only lat or long is received

2 timeseries metrics, latitude and longitude, are queried from Prometheus. Data is returned, but we currently have a quality problem with a source of data that is feeding Prometheus which causes missing values of either lat or lon. Switching the display from track map to graph made it easy to validate the quality problem.
Setting manual values works.
Selecting a timeframe that does not have any inconsistent data works.

The plugin should ignore values and not crash(Error message: "latlng is Null") when only lat or long is available in the time slot.

Unexpected error when running

I've tried running the panel from docker on both macOS and Raspbian, like this:

docker run -p 3000:3000 --name grafana -e "GF_INSTALL_PLUGINS=alexandra-trackmap-panel" grafana/grafana

This currently runs grafana 7.1.5.

In both OS-es the panel installs just fine (it's available in the visualisation tab) but when I select it I get the error below. I'm fairly new to Grafana, what can I do to troubleshoot / fix this?

Kind regards,
Martijn

An unexpected error happened
TypeError: undefined is not an object (evaluating 'this.events.emit')

in t
in x
in Qr
in div
in div
in t
in t
in div
in Wa
in div
in div
in uo
in div
in t
in div
in t
in div
in div
in t
in x
in div
in t
in x
in r
in Unknown
in t
in Unknown
in h
in Unknown
in Unknown
in t
in t
in l

Filter by geographical displayed extent

Hi,

first: very nice plugin !
second: is there a way to use the displayed extent in the query, something like that:

``SELECT time_index, latitude as lat, longitude as lon
FROM doc.table_name
WHERE $__timeFilter(time_index)
AND lat >= $minLat
AND lat <= $maxLat
AND lon >= $minLong
AND lon <= $maxLong
ORDER BY time_index

I have a DB with billions of locations so retrieving only what is viewed would make this plugin usable.

Thanks !

"Zoom map to fit data bounds" option not zooming

Hi,
I have the last version of the plugin (just downloaded) running on Grafana 7.5.5.
When I center in the first point, it zooms there according to the zoom parameters. Same for the last point.
However, when using the option "Zoom map to fit data bounds", the map remains zoomed over a place in Denmark.
I would expect the map to zoom around the area where there are points. Isn't that what should happen or it is not working as expected?
Regards,
Daniel

Map is not loading

The plugin is configured correctly and draws the locations on the map. Unfortunately the open street map layer remains empty as if the data from osm could not be fetched.

The dev console (firefox) does not show any errors.

2020-02-17-203652_580x587_escrotum

More than one trace on the same map

I'm using InfluxDB to get the data.
Adding one query like this:
SELECT mean("latitude") AS "lat", mean("longitude") AS "lon" FROM "track_rp"."location" WHERE ("device" = 'device-1') AND $timeFilter GROUP BY time($__interval) fill(none)
works fine.
When I add a second query:
SELECT mean("latitude") AS "lat", mean("longitude") AS "lon" FROM "track_rp"."location" WHERE ("device" = 'device-2') AND $timeFilter GROUP BY time($__interval) fill(none)

I can't view both on the same map. If I disable one of them I get the other one displayed correctly.
Is there a way to have 2 (or more) traces displayed concurrently?

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.