Plugins 〉Foursquare Studio Panel
The Foursquare Studio Panel plugin has been deprecated and is no longer maintained.
Foursquare Studio Panel
Foursquare Studio Panel
The Foursquare Studio Panel Plugin enables you to add Unfolded Studio Maps to your Grafana dashboard.
Features
Visualize your geospatial data in your Grafana dashboard as:
- Points on the map
- A line (LineString) that connects the points based on the passed timestamp
- TripLayer that allows you to animate the received data based on the passed timestamp
- A GeoJSON layer
Save your map configuration in the Grafana instance so you don't lose your map settings when the data refreshes.
Save your map in the Foursquare Cloud at any time with the data from the Grafana queries
Installation
See https://grafana.com/docs/grafana/latest/administration/plugin-management/#install-a-plugin for help with the installation process.
Supported version of Grafana is
7.0+
Usage
Displaying data as Points on the map
Visualizing the data as Points on the map doesn't require any time
field only the location. You need to provide the values for the latitude
and longitude
values and you need to name these values exactly like that in the query. The order of the properties isn't important.
An example of a query for getting the latitude and longitude against a PostgreSQL (with PostGIS) database:
SELECT long AS longitude,
lat AS latitude
FROM table_name
For example it would be a similar query if you are using the geometry data type in PostGIS:
SELECT ST_X (ST_Transform (geom, 4326)) AS longitude,
ST_Y (ST_Transform (geom, 4326)) AS latitude
FROM table_name
If you want to visualize more properties in the tooltip of the created points, you just need to add that data to the query:
SELECT ST_X (ST_Transform (geom, 4326)) AS longitude,
ST_Y (ST_Transform (geom, 4326)) AS latitude,
name,
borough,
date_created as time
FROM nyc_subway_stations
Display a line that connects the points based on the passed timestamp
Similar to the creation of Points, to create a line that connects the points you need to provide the time
value (as Unix timestamp) in the ascending order for the respective row. Keep in mind to name the properties in the query as latitude
, longitude
and time
.
To show the line you need to toggle the Create line path from points
to true
in the panel options.
SELECT ST_X (ST_Transform (geom, 4326)) AS longitude,
ST_Y (ST_Transform (geom, 4326)) AS latitude,
date_created as time
FROM nyc_subway_stations
ORDER BY time
Animate the data using the TripLayer
If you want to leverage more advanced features of Unfolded Studio you can animate the time-based data by toggling the Enable animation
to true
in the panel options. To enable this option, Create line path from points
must be set to true
in the panel options. Same query as in the line creation should be provided.
This will create a TripLayer on the map and add a timeline animation control on the map. To customize this control see our official documentation.
SELECT long AS longitude,
lat AS latitude,
date_created as time
FROM nyc_subway_stations
ORDER BY table_name
Display a GeoJSON object
If you are able to leverage your database to get a single GeoJSON object, you can provide it to the plugin to be displayed on the map. Keep in mind to name the value as geojson_layer
.
An example of a query for getting the GeoJSON LineString
object against a PostgreSQL (with PostGIS) database:
SELECT ST_AsGeoJSON(ST_MakeLine(ST_Transform(geom, 4326) ORDER BY date_created)) AS geojson_layer
FROM table_name
An example of a query for getting the custom GeoJSON feature object with selected properties against a PostgreSQL (with PostGIS) database. This query will include all properties except for gid
, geom
values. Keep in mind to name the value as geojson_layer
.
SELECT jsonb_build_object(
'type', 'FeatureCollection',
'features', jsonb_agg(features.feature)
) as geojson_layer
FROM (
SELECT jsonb_build_object(
'type', 'Feature',
'id', gid,
'geometry', ST_AsGeoJSON(ST_Transform(geom, 4326))::jsonb,
'properties', to_jsonb(inputs) - 'gid' - 'geom'
) AS feature
FROM (SELECT * FROM nyc_subway_stations) inputs) features;
In case you have a GeoJSON object for each individual Point in the row, you can just create a simple query as when you are creating a regular point, just provide the geojson
instead of the latitude
and longitude
values. In this case name the property value as geojson
and not as geojson_layer
.
SELECT ST_AsGeoJSON(ST_Transform(geom, 4326)) AS geojson
FROM nyc_subway_stations
Save your Map Configuration
Any changes made in Unfolded Studio (layers, filters, interactions, base map settings) can be saved in your Grafana instance, and they will be applied when the plugin is initialized.
For example if you changed the Base Map Style
from Dark
to Light
and you want to save that setting you need to:
- Click the
Save
button under theSave map configuration
section
- Apply that change with clicking
Save
in the top right corner of your Grafana panel settings to confirm your changes
Save Grafana Maps to your Foursquare Cloud Account
In case you want to save and share maps visible in your Grafana Panel, you have the ability to save a map (along with any data from the panel's queries) to your Unfolded account.
Required steps to save your map:
- Log in to your account in Unfolded Studio
- Copy your Access Token
- Go to your Foursquare Studio Panel Plugin settings
- Click on
Save map to Foursquare Cloud
button - Paste the token in the
Add Access Token
field - Optionally you can also add map name and description values
If the request is successful you will get the saved map URL at the bottom of the section.
Keep in mind that the created map is still private and you would have to publish it in Unfolded Studio to be able to share it publicly.
Add multiple queries
Plugin allows you to add multiple queries where the result of each query will be added as a separate dataset and layer in the Foursquare Studio Panel.
Learn more
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
.h4 . .mb-0 }
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing Foursquare Studio Panel on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Panel
Use the grafana-cli tool to install Foursquare Studio Panel from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Add the Panel to a Dashboard
Installed panels are available immediately in the Dashboards section in your Grafana main menu, and can be added like any other core panel in Grafana.
To see a list of installed panels, click the Plugins item in the main menu. Both core panels and installed panels will appear.
Changelog
1.0.1
Plugin updated to use v1 of Studio Map SDK.
1.0.0
Initial release.