Skip to content

Commit

Permalink
docs: Fix table formatting (#3014)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed May 17, 2024
1 parent 490219e commit b34eb72
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/modules/core/api-reference/create-data-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Parses data asynchronously either using the provided source or sources, or using

- `data`: loaded data or an object that allows data to be loaded. See table below for valid input types for this parameter.
- `sources` - can be a single source or an array of sources. If ommitted, will use the list of pre-registered sources (see `registerLoaders`)
- `options`: See [`LoaderOptions`](./source-options).
- `options`: Passed to the data source.
- `url`: optional, assists in the autoselection of a source if multiple sources are supplied to `source`.

Returns:
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/core/api-reference/select-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ selectSourceSync('filename.pmtiles', [PMTilesSource, MVTSource]); // => PMTilesS

## Functions

### `selectSource(data: String | Blob, ..., sources?: Source[], options?: DataSourceOptions): Promise<Source | null>`
### `selectSource(data: String | Blob, ..., sources?: Source[], options?): Promise<Source | null>`

Selects an appropriate source for a file from a list of candidate sources by examining the `data` parameter, looking at URL extension, mimeType ('Content-Type') and/or an initial data chunk.

Parameters:

- `data` - data to perform autodetection against
- `sources` - can be a single source or an array of sources, or null.
- `options` - See [`DataSourceOptions`](./source-options).
- `options.type` - Force selection to a specific type of source (must still be provided in the source list).
- `options.nothrow`=`false` - Return null instead of throwing exception if no source can be found

Returns:
Expand Down
28 changes: 14 additions & 14 deletions docs/specifications/category-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ The _table_ category loaders supports loading tables in _row-based_, _columnar_

## Table Category Loaders

| Loader | Notes |
| -------------------------------------------------------------- | ---------------------------------- |
| Loader | Notes |
| --------------------------------------------------------------- | ---------------------------------- |
| [`ArrowLoader`](/docs/modules/arrow/api-reference/arrow-loader) | |
| [`CSVLoader`](/docs/modules/csv/api-reference/csv-loader) | |
| [`JSONLoader`](/docs/modules/json/api-reference/json-loader) | Set `options.json.table` to `true` |
Expand Down Expand Up @@ -49,18 +49,18 @@ Using the Arrow API it is possible to work extremely efficiently with very large
loaders.gl provides a range of table accessors.

| Accessor | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------- |
| `getTableLength`(table: Table): number | Returns length (number of rows) in the table |
| `getTableNumCols`(table: Table): number | Returns number of columns in the table |
| `getTableCell`(table: Table, rowIndex: number, columnName: string): unknown | Gets the value in a cell by column name and row index |
| `getTableCellAt`(table: Table, rowIndex: number, columnIndex: number): unknown | Gets the value of a cell by column index and row index |
| `getTableRowShape`(table: Table): 'array-row-table' | 'object-row-table' | Gets the shape of each table row |
| `getTableColumnIndex`(table: Table, columnName: string): number | Gets the index of a named column |
| `getTableColumnName`(table: Table, columnIndex: number): string | Gets the name of a column by index |
| `getTableRowAsObject`(table: Table, rowIndex: number, target?: unknown[], copy?: 'copy'): | Gets a row from the table. Parameters contol whether a new object is minted or reused. |
| `getTableRowAsArray`(table: Table, rowIndex: number, target?: unknown[], copy?: 'copy'): unknown[] | Gets a row from the table. Parameters contol whether a new array is minted or reused. |
| `makeArrayRowTable`(table: Table): ArrayRowTable | Copies a table into 'array-row-table' format. |
| `makeObjectRowTable`(table: Table): ObjectRowTable | Copies a table into 'object-row-table' format |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `getTableLength(table: Table): number` | Returns length (number of rows) in the table |
| `getTableNumCols(table: Table): number` | Returns number of columns in the table |
| `getTableCell(table: Table, rowIndex: number, columnName: string): unknown` | Gets the value in a cell by column name and row index |
| `getTableCellAt(table: Table, rowIndex: number, columnIndex: number): unknown` | Gets the value of a cell by column index and row index |
| `getTableRowShape(table: Table): 'array-row-table' \| 'object-row-table'` | Gets the shape of each table row |
| `getTableColumnIndex(table: Table, columnName: string): number` | Gets the index of a named column |
| `getTableColumnName(table: Table, columnIndex: number): string` | Gets the name of a column by index |
| `getTableRowAsObject(table: Table, rowIndex: number, target?: unknown[], copy?: 'copy')` | Gets a row from the table. Parameters contol whether a new object is minted or reused. |
| `getTableRowAsArray(table: Table, rowIndex: number, target?: unknown[], copy?: 'copy'): unknown[]` | Gets a row from the table. Parameters contol whether a new array is minted or reused. |
| `makeArrayRowTable(table: Table): ArrayRowTable` | Copies a table into 'array-row-table' format. |
| `makeObjectRowTable(table: Table): ObjectRowTable` | Copies a table into 'object-row-table' format |

## Apache Arrow support

Expand Down
2 changes: 1 addition & 1 deletion docs/whats-new.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ A major release that brings:
**@loaders.gl/parquet**

- The [`ParquetLoader`](/docs/modules/parquet/api-reference/parquet-loader) now supports loading [GeoParquet](/docs/modules/parquet/formats/geoparquet) files.
- New [GeoParquet example](/examples/geoparquet).
- New [GeoParquet example](/examples/geospatial/geoparquet).

**@loaders.gl/mvt**

Expand Down

0 comments on commit b34eb72

Please sign in to comment.