Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Let's have a look at the available data before we define the corresponding dataset object.

...

NameTitleData type
customer_idCustomer IDinteger
neighborhood_codeNeighborhood codestring
cityCustomer's citystring
addressCustomer's addressstring
sexCustomer's sexstring
age_groupCustomer's age groupstring
latAddress latitudelatitude
lngAddress longitudelongitude

...

Now, to the ref object. The type of the dataset is dwh, and the subtype is geometryPoint, because the table represents customers' addreses (points) that have a latitude and longitude. The table's primaryKey is the customer_id property. In the visualizations object, we say that we want to visualize it as a dotmap and a heatmap (the only two available for geometryPoint). The dataset is not categorizable by default, and none of its properties are filterable, as they will not appear in filters (more about filters later). It's data are also not allowed to be searched by full text search - fullTextIndex property.

The zoom object at the end can be used to modify the zoom levels for the dotmap visualization. This can be handy when there's a lot of dots, which could be a performance problem.

...

Code Block
titleCustomers dataset syntax
{
    "name": "customers",
    "type": "dataset",
    "title": "Customers",
    "description": "Customers registered in the loyalty program.",
    "properties": {
        "featureTitle": {
            "type": "property",
            "value": "customer_id"
        },
        "featureSubtitle": {
            "type": "property",
            "value": "address"
        }
    },
    "ref": {
        "type": "dwh",
        "subtype": "geometryPoint",
        "visualizations": [
            {
                "type": "dotmap"
            },
            {
                "type": "heatmap"
            }
        ],
        "primaryKey": "customer_id",
        "categorizable": true,
        "fullTextIndex": false,
        "properties": [
            {
                "name": "customer_id",
                "title": "Customer ID",
                "column": "customer_id",
                "type": "integer",
                "filterable": false
            },
            {
                "name": "neighborhood_code",
                "title": "Neighborhood code",
                "column": "neighborhood_code",
                "type": "string",
                "filterable": false
            },
            {
                "name": "city",
                "title": "City",
                "column": "city",
                "type": "string",
                "filterable": false
            },
            {
                "name": "address",
                "title": "Aaddress",
                "column": "address",
                "type": "string",
                "filterable": false
            },
            {
                "name": "sex",
                "title": "Sex",
                "column": "sex",
                "type": "string",
                "filterable": true
            },
            {
                "name": "age_group",
                "title": "Age group",
                "column": "age_group",
                "type": "string",
                "filterable": true
            },
            {
                "name": "lat",
                "title": "Address latitude",
                "column": "lat",
                "type": "latitude",
                "filterable": false
            },
            {
                "name": "lng",
                "title": "Address longitude",
                "column": "lng",
                "type": "longitude",
                "filterable": false
            }
        ],
        "zoom": {
            "min": 7,
            "optimal": 9,
            "max": 18
        }
    }
}

...