Skip to content

Commit

Permalink
Include menu item actions in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
motin committed Apr 17, 2019
1 parent 411bf0c commit 966bcb1
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
2 changes: 1 addition & 1 deletion INTRO.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Gsheets `GM_*` Functions

Gapminder-specific custom functions for Google Spreadsheets.
Gapminder-specific custom functions and related menu item actions for Google Spreadsheets.
47 changes: 46 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Gsheets `GM_*` Functions
========================

Gapminder-specific custom functions for Google Spreadsheets.
Gapminder-specific custom functions and related menu item actions for Google Spreadsheets.

## Index

Expand All @@ -20,6 +20,8 @@ Gapminder-specific custom functions for Google Spreadsheets.
* [GM_NAME](#gm_name)
* [GM_PER_CAP](#gm_per_cap)
* [GM_UNPIVOT](#gm_unpivot)
* [menuRefreshDataDependencies](#menurefreshdatadependencies)
* [menuValidateDatasetSpreadsheet](#menuvalidatedatasetspreadsheet)

---

Expand Down Expand Up @@ -341,4 +343,47 @@ Unpivots a standard pivoted Gapminder table \[geo, name, ...time-values-across-c
A two-dimensional array containing the cell/column contents described above in the summary.

___
<a id="menurefreshdatadependencies"></a>

### menuRefreshDataDependencies

**menuRefreshDataDependencies**(): `void`

*Defined in [menuRefreshDataDependencies.ts:21](https://github.com/Gapminder/gsheets-gm-functions/blob/v0.7.0/src/menuRefreshDataDependencies.ts#L21)*

Menu item action for "Gapminder Data -> Import/refresh data dependencies"

Imports data sets from the fasttrack catalog to the current spreadsheet, allowing GM\_-functions to reference local data instead of importing data on-the-fly.

Details:

* Creates the data-dependencies spreadsheet if it doesn't exist
* Verifies that the first headers of the data-dependencies spreadsheet are as expected
* Does not attempt to import data with bad catalog status
* Communicates import status as the import progresses

**Returns:** `void`

___
<a id="menuvalidatedatasetspreadsheet"></a>

### menuValidateDatasetSpreadsheet

**menuValidateDatasetSpreadsheet**(): `void`

*Defined in [menuValidateDatasetSpreadsheet.ts:36](https://github.com/Gapminder/gsheets-gm-functions/blob/v0.7.0/src/menuValidateDatasetSpreadsheet.ts#L36)*

Menu item action for "Gapminder Data -> Validate this dataset spreadsheet"

Validates if the dataset spreadsheet conforms to the comments found in [the template](https://docs.google.com/spreadsheets/d/1ObY2k1SDDEwMfeM5jhQW8hIMcEpo8Oo0qclLZ3L6ByA/edit) and writes the validation results in the Validation table at the bottom of the About sheet.

Details:

* Checks the row headers of the output sheets (the so called "data-countries-etc/world/region-by-year")
* Checks the about sheet (to see if it follows the requirements in col A in the template)
* Checks that filter mode is not turned on in data sheets (since it breaks the CSV endpoint)

**Returns:** `void`

___

11 changes: 10 additions & 1 deletion src/menuRefreshDataDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import { getConceptDataCatalogEntry } from "./gsheetsData/conceptData";
import { getFasttrackCatalogDataPointsList } from "./gsheetsData/fastttrackCatalog";

/**
* @hidden
* Menu item action for "Gapminder Data -> Import/refresh data dependencies"
*
* Imports data sets from the fasttrack catalog to the current spreadsheet,
* allowing GM_-functions to reference local data instead of importing data on-the-fly.
*
* Details:
* - Creates the data-dependencies spreadsheet if it doesn't exist
* - Verifies that the first headers of the data-dependencies spreadsheet are as expected
* - Does not attempt to import data with bad catalog status
* - Communicates import status as the import progresses
*/
export function menuRefreshDataDependencies() {
const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
Expand Down
11 changes: 10 additions & 1 deletion src/menuValidateDatasetSpreadsheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ interface DataSheetMetadata {
}

/**
* @hidden
* Menu item action for "Gapminder Data -> Validate this dataset spreadsheet"
*
* Validates if the dataset spreadsheet conforms to the comments found in
* [the template](https://docs.google.com/spreadsheets/d/1ObY2k1SDDEwMfeM5jhQW8hIMcEpo8Oo0qclLZ3L6ByA/edit)
* and writes the validation results in the Validation table at the bottom of the About sheet.
*
* Details:
* - Checks the row headers of the output sheets (the so called "data-countries-etc/world/region-by-year")
* - Checks the about sheet (to see if it follows the requirements in col A in the template)
* - Checks that filter mode is not turned on in data sheets (since it breaks the CSV endpoint)
*/
export function menuValidateDatasetSpreadsheet() {
const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
Expand Down

0 comments on commit 966bcb1

Please sign in to comment.