Create a Table Visualization

Creating a Table visualization requires configuring one or more layers. You can use the existing base type templates for a table.

Here is an example of making a table visualization:

  1. Add a <config> section and make it dependent on the base type template for a table:

    {
    	"depends_on" : [ "table-template"]
    }
  2. Add a query to your layer file to acquire the data:

    <query name="myquery">
    SELECT name, division, total FROM mytable
    </query>
  3. Add a step to your <pipeline> to execute the query:

    {
    	"steps" : [
    	    {
    	        "action" : "bigquery_query",
    	        "query_name" : "myquery" 
    	    }
    	]
    }
  4. Add rules to your <mappings> to map the attributes for the table including the widths and column headings. Note: The table-template automatically maps the entire table into the figure so you will not see a mapping rule for that.

    {
    
    "rules" : [
        {
            "attribute" : "column_widths",
            "value" : [ "20%", "80%" ]
        },
        {
            "attribute" : "headings",
            "value" : ["Name", "Division", "Total"]
        }
    ]
    }
  5. Add the visualization tag to your HTML page.