Level Generator features

更新时间:
复制 MD 格式

The Level Generator is a tool for creating hierarchical data for custom drill-down areas. This topic describes its features.

Access the Level Generator

Click DataV.GeoAtlas Geo Tools to open the Level Generator page.

Interface overview

The Level Generator interface has two main panels: the map panel and the level tree panel.image

  • The map panel on the left displays and lets you browse level data. Its interaction logic is the same as that of the range selector.

  • The level tree panel on the right supports operations such as viewing examples, binding data, and importing and exporting level data.

Quick start

The Level Generator includes a simple example that shows the drill-down hierarchy for the administrative regions of Jiangsu, Zhejiang, and Shanghai.

2025-06-12_10-20-35

Example operations:

  1. In the upper-right corner of the level tree panel, click Don't know how? Click to view example to add the Jiangsu-Zhejiang-Shanghai area data to the panel.

  2. Click a node title in the panel to locate the corresponding area in the map panel on the left.

    Note

    To the right of each node, you can find operations such as binding or unbinding geographic data and renaming.

  3. In the map panel on the left, click an administrative region to drill down to its sub-regions. Click outside the region to return to the parent view. When you hover over a region, its title and filter interaction style are displayed.

    Note

    The map panel in the Level Generator functions similarly to the range selector.

Panel features

Map panel

Feature

Description

View level geographic data style

In the map panel, a selected node is indicated by a thick, black, solid outline. Child nodes within the selected node are indicated by a light-colored dashed line.image

Drill down and drill up

Click a sub-region to drill down. Click the empty area outside the drilled-down region to return to the parent view.

Level tree panel

Feature

Description

View example

Click Don't know how? Click to view example in the upper-right corner of the level tree panel to add the Jiangsu-Zhejiang-Shanghai area drill-down example to the panel. The example data contains the administrative region levels for Jiangsu, Zhejiang, and Shanghai, down to the district and county level. Click Reset to restore the default empty node.{2F6C1379-657E-4BB7-AD0F-2D725518B4BB}

Note

The example level data can be exported directly to your local machine.

Level tree node

In the level tree panel, each row is a level node. Each node contains five types of node information: title, treeID, geographic data, child nodes, and parent node.

Note

You can customize the title, geographic data, child nodes, and parent node. The treeID cannot be changed manually. It is automatically calculated by the level panel.

Unbind and bind data

  • Unbind geographic information: A small green dot and the unbind data icon to the right of a node indicate that the node has geographic information. Click the 解绑图标 icon, and then click Confirm in the pop-up window to unbind the geographic information from the current node.

  • Bind geographic information: A small red dot and the bind data icon to the right of a node indicate that the node has no geographic information. Click the 绑定数据 icon. In the pop-up window, select one of two types of geographic data: Administrative Region Dataset or Custom Data.

    • Administrative Region Dataset: If you select this type, you can enter a custom value or select a built-in administrative region from the drop-down list. You can also choose whether to add all descendant nodes at the same time. Click Confirm to complete the data binding.

    • Custom Data: If you select this type, you can upload an existing GeoJSON file. Click Confirm to complete the data binding.

Rename node

Click the 重命名 icon to the right of the node and enter a custom name for the node.

Batch import child nodes

Click the {7BA830BD-8E89-4DEC-AF09-47CD2EB9A590} icon to the right of the node to batch import child node data in GeoJSON format.

Add child node

Click the 新增子节点 icon to the right of the node to add a new child node under the current node.

Delete node

Click the 删除 icon to the right of the node to delete the current node.

Important

When you delete a parent node, its child nodes are also deleted. The root node cannot be deleted.

Change node level

Select a node and drag it to adjust its level in the panel.

Import level

Click the Import Level (JSON) button at the bottom of the level tree panel and select a local level data file. TopoJSON format is supported.

Export Level (DataV Proprietary)

Click the Export Level (DataV Proprietary) button at the bottom of the level tree panel to export a level data file and a level mapping file. The geographic fields in the level data file are compressed and can be used in DataV components, such as the Basic Flat Map component. The level mapping file contains a list of mappings for node IDs, node names, and parent nodes.

Export Level (Open Format)

Click the Export Level (Open Format) button at the bottom of the level tree panel to export a level data file and a level mapping file. The data structure is not compressed and can be used directly in external applications.

Examples

This example shows how to create drill-down data for the Beijing-Tianjin-Hebei region. You will obtain boundary data from the Boundary Generator and combine it in the Data Editor. Then, you will bind the data in the Level Generator to build the hierarchy. Finally, you will export the data in the DataV proprietary format. You can then use this data in the Custom Area Drill-down Layer of the Basic Flat Map 4.0 component.

Generate custom data

  1. Click DataV.GeoAtlas Geo Tools to open the Level Generator page.

  2. In the right-hand level tree panel, click the rename icon to the right of the default Root Area node. Change the title to Beijing-Tianjin-Hebei Area.

  3. Click the icon to add a child node to the right of the Beijing-Tianjin-Hebei Area node. Then, bind the geographic datasets for the three administrative regions: Beijing, Tianjin, and Hebei Province, and add all descendant nodes within these regions to create a tree-like level structure.

  4. In the upper-left corner of the page, click Range Selector to open the range selector page. Separately download the data for the Beijing, Tianjin, and Hebei administrative regions. The downloaded data does not include sub-region data.2025-06-09_17-22-37

  5. Click Data Editor at the top of the page. In the Data Editor, upload and merge the data for the Beijing, Tianjin, and Hebei administrative regions. After the data is merged, click Export GeoJSON on the right side of the map panel to download the data.2025-06-09_17-32-18

  6. At the top of the page, click Level Generator to open its page. For the Beijing-Tianjin-Hebei Area root node, click the 绑定数据 icon. Then, select custom data and upload the downloaded Beijing-Tianjin-Hebei data. Click Confirm to complete the data binding.

  7. At the bottom of the level tree panel, click Export Level (DataV Proprietary) to export the level structure data file to your local machine. Upload the two generated files to your server or OSS to generate two new APIs. Alternatively, you can use the sample APIs provided by the system to configure data for the DataV component.

Use the data in a DataV component

You can configure custom drill-down data for the Beijing-Tianjin-Hebei region for a DataV component. This example uses the Basic Flat Map 4.0 component.

  1. Access the DataV console.

  2. On the Workbench page, select any Data Dashboard and click Edit to open the canvas editor.

    Note

    If the Workbench page has no data dashboards, you must create a data dashboard first.

  3. In the left navigation pane, click Component Library. The component management page opens.

  4. Click the image icon to go to the map component list.

  5. Click the Basic Flat Map 4.0 component. In the component configuration panel, add a Custom Area Drill-down Layer sub-component.image

  6. Select the Custom Area Drill-down Layer component. Click the data source panel on the right. Set Data Source Type to API. In the URL editor below, paste the JSON API URL into the data entry box. You can then view the data response.image

    The following is a sample API link.

    https://vis-data-server.oss-cn-hangzhou.aliyuncs.com/TiNqZkTkH1IeUOGTiMC6WgHY6TtG72.json
  7. Select Custom TopoJSON Data API, set Data Source Type to API, and paste the fetched JSON API into the URL editor.

    The following is a sample API link.

    https://vis-data-server.oss-cn-hangzhou.aliyuncs.com/Aj6uSgiyi23D4rMSBEMGRfaIn1W1Jn.json
  8. After you configure the data interface for the Custom Area Drill-down Layer subcomponent, you can view the drill-down levels for the Beijing-Tianjin-Hebei region on the map in the canvas editor. Double-click an administrative region to drill down. The result is shown in the following figure.2025-06-09_17-59-05

Drill-down data structure definition

If you want to use the level data in an external application, refer to the data specification in the following figure for field descriptions.image

The figure above shows a set of JSON data. The root node contains a version field. The other fields are common to each level node and are described as follows.

Field

Description

parent

The treeID of the parent node.

treeID

The ID of the node. It is displayed in an "x-x-x" structure. For example, "1-2-3" indicates the third child node of the second child node of the root node.

name

The name of the node.

treeName

The name and ID of the node.

payload

The payload field is the geographic data field. For the open format, this is TopoJSON. If you are a developer, you can use topojson-client to convert TopoJSON to GeoJSON.

children

A collection of child node data.