Connecting specific features

Connecting Yandex Maps

DataLens features an embedded simple world map. For geoanalytics use cases, see our demo dashboard.

Administrator tasks

  1. Get an API key.

    Your organization must obtain an API key for the JavaScript API and Geocoding API. This is a commercial product subject to an individual agreement.

    Note

    If no key is provided, the function will work until it exhausts the daily free request limit.

  2. Activate the feature. There are two ways to do this:

    • Basic

      To enable Maps, add two parameters during initialization:

      ./init.sh --yandex-map --yandex-map-token <your_Yandex_Maps_API_key>
      
    • With individual values file

      Make sure the configuration in values.yaml is complete.

1. Configure values.yaml.

If using a key, specify it in the DataLens configuration.

```yaml
# In your `values.yaml` file
features:
yandex_map:
    enabled: true
    token: 'YOUR_YANDEX_MAPS_API_KEY' # if you are not using a key, delete this line
```
  1. Applying the configuration.

    Run ./init.sh --values <your_file>.yaml to apply the changes.

After that, users will see an option to select Yandex Maps layers in their map settings.

Editor

Editor is a sandbox tool for advanced users and developers, enabling visualizations beyond the standard types.

How it works

  • Users write JavaScript code.

  • In their code, they can use third-party libraries for complex charts or Gravity UI Charts which DataLens uses internally.

  • Data for visualization can come from a dataset or JSON API connector.

For examples of how you can use Editor, see the DataLens Editor demo dashboard.

For an example of building tables based on a dataset, see "Creating a table based on a dataset".

For an example of building a table via API Connector, see "Creating a table via API".

Administrator tasks

Editor is activated similarly to other features using the --editor parameter.

After that, users will see a new chart type, Editor, in their chart creation menu. Administrators do not need to write Editor code; they simply need to provide their users with this feature.

API Connector

API Connector enables connecting to any HTTP API directly from DataLens and use the retrieved data to build Editor charts.

It can do the following:

  • Send GET and POST requests to any available API.
  • Work over HTTP and HTTPS.
  • Provide public headers: Accept-Charset, Accept-Encoding, Accept-Language, and Prefer.
  • Provide private (encrypted) headers for authentication: Authorization, X-Api-Key, X-ClickHouse-User, and X-ClickHouse-Key.

Note

API Connector becomes available after enabling Editor.

How to try

  1. In the workbook, click Create → Connection.
  2. Under Files and services, select API Connector.
  3. Specify the host, port, endpoint path, and allowed methods.
  4. If needed, add authorization headers: they will be stored in encrypted form.
  5. Save the connection and use it in Editor charts.

For more details, see Creating an API Connector connection.

Use case

An analyst asks you to enable the Satellite map layer in DataLens. To do this, which of the following is required?

  • Activate features.editor.enabled: true.
  • Get a commercial Yandex Maps API key and add it to values.yaml.
  • Increase the number of data-api pod replicas.
  • Create a connection to a database containing geocoordinates.
Find out the answer
  • Activate features.editor.enabled: true.

    Incorrect. Editor is a dedicated feature for custom visualizations, unrelated to Yandex Maps.

  • Get a commercial Yandex Maps API key and add it to values.yaml.

    Correct. The Satellite and Hybrid layers are provided under the commercial Yandex Maps API, for which you need a key.

  • Increase the number of data-api pod replicas.

    Incorrect. Map layer availability is unrelated to data-api performance.

  • Create a connection to a database containing geocoordinates.

    Incorrect. While you need geospatial data to render a chart with a map, it is not required to enable map layers in the UI.

Results

Now you know how to enhance the DataLens default capabilities by providing your users with access to Yandex Maps and Chart Editor. As an administrator, your job is to activate and configure the platform, so that analysts can create content.