Skip to content

Commit

Permalink
External links (#489)
Browse files Browse the repository at this point in the history
* troubleshooting API

* Revert to gerund

Though the style guide says to just use imperatives, "get started" just sounds weird. Also this is more consistent with "troubleshooting"

* merge

* make external links open in a new browser window

* Merging

* add disclaimer about BQ and remove references from elsewhere

* revert changes
  • Loading branch information
kmoscoe authored Aug 26, 2024
1 parent 0a38953 commit 72cc344
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 59 deletions.
2 changes: 1 addition & 1 deletion api/rest/v2/sparql.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ published: true
# /v2/sparql

This endpoint makes it possible to query the Data Commons knowledge graph using
[SPARQL](https://www.w3.org/TR/rdf-sparql-query/). SPARQL is a query language developed to retrieve data from [RDF graph](https://en.wikipedia.org/wiki/Resource_Description_Framework) content on the web. It leverages the graph structure innate in the data it
[SPARQL](https://www.w3.org/TR/rdf-sparql-query/){: target="_blank"}. SPARQL is a query language developed to retrieve data from [RDF graph](https://en.wikipedia.org/wiki/Resource_Description_Framework){: target="_blank"} content on the web. It leverages the graph structure innate in the data it
queries to return specific information.

> **Note:** Data Commons only supports a limited subset of SPARQL functionality at this time: specifically, only the keywords `WHERE`, `ORDER BY`, `DISTINCT`, and `LIMIT` are supported.
Expand Down
2 changes: 1 addition & 1 deletion api/sheets/get_name.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The `=DCGETNAME(dcids)` formula returns the names associated with given [DCIDs](

The names associated with given node DCIDs to a cell or a range of cells.

> **Note**: It’s best to minimize the number of function calls to `=DCGETNAME(dcids)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [*per custom function call*](https://developers.google.com/apps-script/guides/sheets/functions#optimization). If your sheet contains thousands of separate calls to `=DCGETNAME(dcids)` you can expect it to be slow and return with errors.
> **Note**: It’s best to minimize the number of function calls to `=DCGETNAME(dcids)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [*per custom function call*](https://developers.google.com/apps-script/guides/sheets/functions#optimization){: target="_blank"}. If your sheet contains thousands of separate calls to `=DCGETNAME(dcids)` you can expect it to be slow and return with errors.
## Examples

Expand Down
4 changes: 2 additions & 2 deletions api/sheets/get_property.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ The `=DCPROPERTY(dcids, property)` formula returns values associated with the gi
### Required Arguments

* `dcids`: A list of [Place](/glossary.html#place) nodes, identified by their [DCIDs](/glossary.html#dcid).
* `property`: The property whose value you are interested in, such as “name” for the name of a node, or “typeOf” for the type of a node. If you aren’t sure what properties are available for a particular DCID, you can use the [Data Commons Knowledge Graph](https://datacommons.org/browser/)
* `property`: The property whose value you are interested in, such as “name” for the name of a node, or “typeOf” for the type of a node. If you aren’t sure what properties are available for a particular DCID, you can use the [Data Commons Knowledge Graph](https://datacommons.org/browser/){: target="_blank"}.
to look up the DCID of interest and see what properties it is associated with.

## Returns

The values of the property label for the specified DCIDs.

> **Note**:
> It’s best to minimize the number of function calls to `=DCPROPERTY(dcids, property)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [*per custom function call*](https://developers.google.com/apps-script/guides/sheets/functions#optimization). If your sheet contains thousands of separate calls to `=DCPROPERTY(dcids, property)` you can expect it to be slow and return with errors.
> It’s best to minimize the number of function calls to `=DCPROPERTY(dcids, property)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [*per custom function call*](https://developers.google.com/apps-script/guides/sheets/functions#optimization){: target="_blank"}. If your sheet contains thousands of separate calls to `=DCPROPERTY(dcids, property)` you can expect it to be slow and return with errors.
## Examples

Expand Down
8 changes: 4 additions & 4 deletions api/sheets/get_variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grand_parent: API

# Getting the Value of a Statistical Variable at a Given Place and Time

The`=DCGET(dcids, variable, date)` formula returns the measurements of a specified [statistical variable](/glossary.html#variable) at a given place and optional time based on a list of parent [Place](https://datacommons.org/browser/Place) [DCIDs](/glossary.html#dcid). A complete list of variables can be found in the [Statistical Variable Explorer](https://datacommons.org/tools/statvar).
The`=DCGET(dcids, variable, date)` formula returns the measurements of a specified [statistical variable](/glossary.html#variable) at a given place and optional time based on a list of parent [Place](https://datacommons.org/browser/Place){: target="_blank"} [DCIDs](/glossary.html#dcid). A complete list of variables can be found in the [Statistical Variable Explorer](https://datacommons.org/tools/statvar){: target="_blank"}.

> **Note**: Be sure to follow the instructions for [Installing and Enabling the Sheets Add-On](/api/sheets/) before using this formula.
Expand All @@ -25,17 +25,17 @@ The`=DCGET(dcids, variable, date)` formula returns the measurements of a specifi

### Optional Arguments

`date`: The date or dates of interest. If this argument is not specified, the API returns the latest variable observation. You can specify this argument as a single value, row, or column. All dates must be in ISO 8601 format (such as 2017, “2017”, “2017-12”) or as a Google sheets [date value](https://support.google.com/docs/answer/3092969?hl=en).
`date`: The date or dates of interest. If this argument is not specified, the API returns the latest variable observation. You can specify this argument as a single value, row, or column. All dates must be in ISO 8601 format (such as 2017, “2017”, “2017-12”) or as a Google sheets [date value](https://support.google.com/docs/answer/3092969?hl=en){: target="_blank"}.

## Returns

The value of the variable at those places on the specified date or on the latest available date, if no date is specified.

> **Note**: It’s best to minimize the number of function calls to `=DCGET(dcids, variable, date)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [per custom function call](https://developers.google.com/apps-script/guides/sheets/functions#optimization). If your sheet contains thousands of separate calls to `=DCGET(dcids, variable, date)` you can expect it to be slow and return with errors.
> **Note**: It’s best to minimize the number of function calls to `=DCGET(dcids, variable, date)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [per custom function call](https://developers.google.com/apps-script/guides/sheets/functions#optimization){: target="_blank"}. If your sheet contains thousands of separate calls to `=DCGET(dcids, variable, date)` you can expect it to be slow and return with errors.
## Examples

This section contains examples of using the `=DCGET(dcids, variable, date)` formula to returns lists of [statistical variable](/glossary.html#variable) such as "Count_Person" and "Median_Income_Person". A complete list of variables can be found in the [Statistical Variable Explorer](https://datacommons.org/tools/statvar).
This section contains examples of using the `=DCGET(dcids, variable, date)` formula to returns lists of [statistical variable](/glossary.html#variable) such as "Count_Person" and "Median_Income_Person". A complete list of variables can be found in the [Statistical Variable Explorer](https://datacommons.org/tools/statvar){: target="_blank"}.

### Example 1: Get the Total Population of Hawaii in 2017

Expand Down
6 changes: 3 additions & 3 deletions api/sheets/places_in.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grand_parent: API

# Retrieving Places Contained Within Another Place

The `=DCPLACESIN(dcids, placeType)` formula returns lists of child places from a list of parent [Place](https://datacommons.org/browser/Place) [DCIDs](https://docs.datacommons.org/glossary.html#dcid). It only returns children with a place type that matches the `placeType` parameter, such as [State](https://datacommons.org/browser/State), [Country](https://datacommons.org/browser/Country), and so on.
The `=DCPLACESIN(dcids, placeType)` formula returns lists of child places from a list of parent [Place](https://datacommons.org/browser/Place){: target="_blank"} [DCIDs](/glossary.html#dcid). It only returns children with a place type that matches the `placeType` parameter, such as [State](https://datacommons.org/browser/State){: target="_blank"}, [Country](https://datacommons.org/browser/Country){: target="_blank"}, and so on.

> **Note**: Be sure to follow the instructions for [Installing and Enabling the Sheets Add-On](/api/sheets/) before using this formula.
Expand All @@ -25,10 +25,10 @@ The `=DCPLACESIN(dcids, placeType)` formula returns lists of child places from a

## Returns

Lists of child places from a list of parent [Place](https://datacommons.org/browser/Place) [DCIDs](https://docs.datacommons.org/glossary.html#dcid). Returns a list of child places of the specified place DCIDs, of the specified place type.
Lists of child places from a list of parent [Place](https://datacommons.org/browser/Place){: target="_blank"} [DCIDs](/glossary.html#dcid). Returns a list of child places of the specified place DCIDs, of the specified place type.

> **Note**:
> It’s best to minimize the number of function calls to `=DCPLACESIN(dcids, placeType)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [*per custom function call*](https://developers.google.com/apps-script/guides/sheets/functions#optimization). If your sheet contains many separate calls to `=DCPLACESIN(dcids, placeType)` you can expect it to be slow and return with errors.
> It’s best to minimize the number of function calls to `=DCPLACESIN(dcids, placeType)` by using a single call to get the names for a column of nodes. This is because a spreadsheet will make one call to a Google server [*per custom function call*](https://developers.google.com/apps-script/guides/sheets/functions#optimization){: target="_blank"}. If your sheet contains many separate calls to `=DCPLACESIN(dcids, placeType)` you can expect it to be slow and return with errors.
## Examples

Expand Down
2 changes: 1 addition & 1 deletion api/web_components/bar.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ permalink: /api/web_components/bar
| apiRoot | string | Domain to make data fetch API calls from. Used primarily for fetching data from custom DCs.<br /><br />Default: `https://datacommons.org`. |
| defaultVariableName | string | To be used with `variableNameRegex`. If specified and no variable name is extracted out with the regex, use this as the variable name. e.g., if the variableNameRegex is "(.*?)(?=:)", and the defaultVariableName is "Total", for a variable named "variable 1", it will become "Total". |
| placeNameProp | string | Optionally specify the property to use to get the place names. |
| showExploreMore | boolean | Include to show "Explore more" link in the footer, which takes the user to Datacommons.org's [visualization tools](https://datacommons.org/tools/visualization). |
| showExploreMore | boolean | Include to show "Explore more" link in the footer, which takes the user to Datacommons.org's [visualization tools](https://datacommons.org/tools/visualization){: target="_blank"}. |
| variableNameRegex | string | Optionally specify regex to use to extract out variable name. e.g., if the variableNameRegex is "(.*?)(?=:)", only the part before a ":" will be used for variable names. So "variable 1: test" will become "variable 1". |
| yAxisMargin | number | Set size (in px) of y-axis' margin to fit the axis label text. Default: 60px. |
{: .doc-table }
Expand Down
2 changes: 1 addition & 1 deletion api/web_components/highlight.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ variable value from a specific variable about a single place.

| Name | Type | Description |
| ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| date | string | Specific date to show data for. ISO 8601 format (e.g. "YYYY", "YYYY-MM", "YYYY-MM-DD").<br /><br />Note: Ensure your variable has data available at the specified date using the [Stat Var Explorer](https://datacommons.org/tools/statvar)<br /><br />Default: Most recent data available. |
| date | string | Specific date to show data for. ISO 8601 format (e.g. "YYYY", "YYYY-MM", "YYYY-MM-DD").<br /><br />Note: Ensure your variable has data available at the specified date using the [Stat Var Explorer](https://datacommons.org/tools/statvar){: target="_blank"}<br /><br />Default: Most recent data available. |
| unit | string | Unit the variable is measured in. |
{: .doc-table }

Expand Down
18 changes: 8 additions & 10 deletions api/web_components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ visualizations in your web application.

Include `datacommons.js` in your html's
`<head>...</head>` tag. Then use Data Commons
[web component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
[web component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components){: target="_blank"}
tags (e.g. `datacommons-line`) to add embedded data visualizations.

For example, to embed a line chart:
Expand All @@ -53,7 +53,7 @@ For example, to embed a line chart:
```

See a live version of this example you can play around with in
[Playground](https://lit.dev/playground/#gist=c0c88276739f4f6061807cc943937a14)
[Playground](https://lit.dev/playground/#gist=c0c88276739f4f6061807cc943937a14){: target="_blank"}
([source](/assets/examples/web-components/line-chart.html)).

## Components
Expand All @@ -70,9 +70,9 @@ See a live version of this example you can play around with in

## Code Playground Examples

- [Static page with all chart types playground](https://lit.dev/playground/#gist=822ce6018bb41113c866d703760c1def)
- [Static page with all chart types playground](https://lit.dev/playground/#gist=822ce6018bb41113c866d703760c1def){: target="_blank"}
([source](/assets/examples/web-components/all-charts.html))
- [Dynamically updating charts playground](https://lit.dev/playground/#gist=9e3ac88e162248f849dd276ff5895ad0)
- [Dynamically updating charts playground](https://lit.dev/playground/#gist=9e3ac88e162248f849dd276ff5895ad0){: target="_blank"}
([source](/assets/examples/web-components/dynamic-map.html))

## Variables and places
Expand All @@ -84,12 +84,10 @@ places. Variables and places are identified by

To look up a DCID for an entity or variable, see the different methods described in [this page](/data_model.html#find-dcid).

To find places available for a statistical variable, see [this page](/data_mode.html#find-places).

## Styling

Custom styles are supported through
[CSS shadow parts](https://developer.mozilla.org/en-US/docs/Web/CSS/::part).
[CSS shadow parts](https://developer.mozilla.org/en-US/docs/Web/CSS/::part){: target="_blank"}.

<div markdown="span" class="alert alert-danger" role="alert">
<span class="material-icons exclamation-icon">priority_high</span>
Expand Down Expand Up @@ -126,7 +124,7 @@ Additionally, the following css variables are supported:
### Styling Example

See a live version of this example you can play around with in
[Playground](https://lit.dev/playground/#gist=719f5d71c2823ac3e58f504cb6ceccd3)
[Playground](https://lit.dev/playground/#gist=719f5d71c2823ac3e58f504cb6ceccd3){: target="_blank"}
([source](/assets/examples/web-components/map-styles.html)).

```html
Expand Down Expand Up @@ -180,10 +178,10 @@ See a live version of this example you can play around with in

## License

[Apache 2.0](https://github.com/datacommonsorg/website/blob/master/packages/web-components/LICENSE)
[Apache 2.0](https://github.com/datacommonsorg/website/blob/master/packages/web-components/LICENSE){: target="_blank"}

## Support

For general questions or issues, please open an issue on our
[issues](https://github.com/datacommonsorg/website/issues) page. For all other
[issues](https://github.com/datacommonsorg/website/issues){: target="_blank"} page. For all other
questions, please send an email to `[email protected]`.
2 changes: 1 addition & 1 deletion api/web_components/line.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ permalink: /api/web_components/line
| apiRoot | string | Domain to make data fetch API calls from. Used primarily for fetching data from custom DCs.<br /><br />Default: `https://datacommons.org`. |
| defaultVariableName | string | To be used with `variableNameRegex`. If specified and no variable name is extracted out with the regex, use this as the variable name. e.g., if the variableNameRegex is "(.*?)(?=:)", and the defaultVariableName is "Total", for a variable named "variable 1", it will become "Total". |
| placeNameProp | string | Optionally specify the property to use to get the place names. |
| showExploreMore | boolean | Include to show "Explore more" link in the footer, which takes the user to Datacommons.org's [visualization tools](https://datacommons.org/tools/visualization). |
| showExploreMore | boolean | Include to show "Explore more" link in the footer, which takes the user to Datacommons.org's [visualization tools](https://datacommons.org/tools/visualization){: target="_blank"}. |
| variableNameRegex | string | Optionally specify regex to use to extract out variable name. e.g., if the variableNameRegex is "(.*?)(?=:)", only the part before a ":" will be used for variable names. So "variable 1: test" will become "variable 1". |
{: .doc-table }

Expand Down
Loading

0 comments on commit 72cc344

Please sign in to comment.