> For the complete documentation index, see [llms.txt](https://docs.launchboard.app/cxd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.launchboard.app/cxd/code-web-app-data-visualization/dashboard-template-tutorial/1-first-look-at-template.md).

# 1 - First Look at Template

The dashboard template provides the HTML/CSS/JS needed to get started with web-based data visualization. The template uses the following tools to make things easier for us.

* Google Sheets - This will function as our "database" of tables.
* Structured Query Language (SQL) - SQL will be used to pull the right data from the database for visualizing.
* [Google Charts API](https://developers.google.com/chart/interactive/docs/) - This library will allow us to create charts in our web app.

### Instructions

#### 1 - Create files in a new Repl.it or other code environment.

Use the code from [Getting Started](/cxd/code-web-app-data-visualization/master.md) to create your HTML, Javascript, and CSS files. Verify that the dashboard displays an example bar chart and table.

#### 2 - Review the HTML

Notice the basic page structure for the "cards" that contain elements for the charts. See below for reference.

```markup
<div id='page'>
    <div class="card">
		<div id="chart1"></div>
	</div>
	<div class="card">
		<div id="chart2"></div>
	</div>
</div>
```

#### 3 - Review the CSS

Notice the "card" class that creates the shadow effect you see with the charts.

```css
.card {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4), 0 6px 20px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
  background: white;
}
```

#### 4 - Review the Javascript

* Notice that we load an example table from the "Degrees" tab in [a Google sheet that you can see here](https://docs.google.com/spreadsheets/d/1o60fGIa1USsQTXyYc-Qh-eYQ2TlHaaEC_iSdzJ7WbD4/edit?usp=sharing).
* The function `composeDegreeCharts()` runs automatically once the data is loaded.
* In `composeDegreeCharts()` we create our charts by specifying SQL (more on this later), the chart type, and the HTML element it should be placed.

```javascript
function setup() {
  var degreesLink = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQUwF7K2lCH8CxQPJW-X7NqENwuwUM4eAeNUKw3j6yppO0tipC6yUB2hQPtRBZf19mmVbM5TdkkengZ/pub?gid=1030028695&single=true&output=csv';
  viz.loadTable(degreesLink,"Degrees").then(composeDegreeCharts);
  window.onresize = composeDegreeCharts;
}

function composeDegreeCharts() {
  viz.chart({
    sql:"SELECT Major, StartingMedianSalary FROM Degrees",
    chartType:"BarChart",
    containerId:"chart1"
  });

  viz.chart({
    sql:"SELECT * FROM Degrees",
    chartType:"Table",
    containerId:"chart2"
  });
}

window.onload = setup;

```

That's the quick overview of the template. We will dig into the details and how to customize things next.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.launchboard.app/cxd/code-web-app-data-visualization/dashboard-template-tutorial/1-first-look-at-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
