Skip to content

Commit 8d00263

Browse files
committed
docs: update docs with latest changes for the table plugin
1 parent a0dfead commit 8d00263

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

docs/developer-guide.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,19 @@ const yasr = new Yasr(document.getElementById('yasr'), {
12761276
plugins: {
12771277
table: {
12781278
priority: 10,
1279-
pageSize: 50
1279+
// Table plugin options (see @matdata/yasgui-table-plugin)
1280+
displayConfig: {
1281+
uriDisplayMode: 'abbreviated', // 'full' | 'abbreviated'
1282+
showDatatypes: false, // Show XSD datatype annotations
1283+
ellipsisMode: false, // Truncate long cell content
1284+
smartFormatters: true, // Auto-format by XSD type & variable name suffix
1285+
uriLinkPrefix: '', // Prepend a URL prefix to every URI link
1286+
},
1287+
persistenceEnabled: true,
1288+
// Transform a URI into a custom href (overridden by user-set uriLinkPrefix)
1289+
uriHrefAdapter: (uri) => `https://browser.example.org/?uri=${encodeURIComponent(uri)}`,
1290+
// Transform an entire binding set before rendering (e.g. add computed columns)
1291+
bindingSetAdapter: (bindingSet) => bindingSet,
12801292
},
12811293
graph: {
12821294
priority: 5

docs/user-guide.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,19 +1308,28 @@ Displays SELECT query results in an interactive, high-performance table with adv
13081308
- **Datatypes**: Show/hide datatype annotations on literals (e.g., `"42"^^xsd:integer`)
13091309
- **Ellipsis Mode**: Truncate long cell content with "..." (hover for tooltip or click for modal)
13101310
- **Fit Controls**: Fit table to data width or window width
1311+
- **Smart Formatters**: Automatically format cell values based on XSD datatype or variable name suffix:
1312+
- `xsd:boolean` literals render as ✔ (true) or ✘ (false)
1313+
- Variable name suffixes trigger Tabulator-style formatters: `*stars` → star rating, `*percent` → progress bar, `*image` → inline image, `*color`/`*colour` → colour swatch, `*description` → multiline text
1314+
- Can be toggled on/off via the **Smart** toggle in the display controls (enabled by default)
1315+
- **URI Link Prefix**: Set a custom URL prefix that is prepended to every URI link — useful for pointing all URIs to a faceted browser or external lookup tool
1316+
- **Quick Reference**: A `?` icon in the toolbar opens an in-place quick reference card listing all features and keyboard shortcuts
13111317

13121318
**Controls:**
13131319

13141320
- **Search**: Text field to filter rows in real-time with highlighted matches
13151321
- **URI Display**: Toggle between abbreviated (prefix:localName) and full URI display
13161322
- **Datatypes**: Toggle visibility of datatype annotations on literal values
13171323
- **Ellipsis**: Toggle content truncation for long values (hover shows tooltip)
1324+
- **Smart**: Toggle smart formatters on/off (XSD datatype & variable-name formatters)
1325+
- **Link Prefix**: Enter a URL prefix to be prepended to every URI link (e.g., `https://browser.example.org/?uri=`); clear the field to restore the default link behaviour
13181326
- **Fit to Data**: Resize columns to show all content without truncation
13191327
- **Fit to Window**: Resize columns proportionally to fill viewport width
13201328
- **Copy as Markdown**: Copy entire table in Markdown format with visual confirmation
13211329
- **Copy as CSV**: Copy entire table as comma-separated values with visual confirmation
13221330
- **Copy as TSV**: Copy entire table as tab-delimited values with visual confirmation
13231331
- **Download CSV**: Access via YASR's download button for CSV file export
1332+
- **Quick Reference (?)**: Opens a modal with a concise overview of all available features
13241333

13251334
**Best For:**
13261335

@@ -1329,20 +1338,23 @@ Displays SELECT query results in an interactive, high-performance table with adv
13291338
- Interactive data analysis with sorting and filtering
13301339
- Sharing results in documentation (Markdown/CSV/TSV)
13311340
- Extracting specific data subsets via cell selection
1341+
- Datasets containing ratings, percentages, images, colours, or boolean flags (smart formatters)
13321342

13331343
**Usage:**
13341344

13351345
- Execute a SELECT query
13361346
- Table plugin activates automatically for SELECT results
13371347
- Click column headers to sort (click again to reverse)
13381348
- Type in search box to filter rows (highlights matches)
1339-
- Hover over cells to see full content in tooltip
1349+
- Hover over cells to see full content in tooltip; double-click to open a modal with the full value
13401350
- Click and drag to select cell ranges, then Ctrl+C to copy
13411351
- Use copy buttons to export entire table in different formats
1342-
- Use fit controls to optimize column widths
1343-
- Toggle URI/datatype/ellipsis controls to customize view
1352+
- Use fit controls to optimise column widths
1353+
- Toggle URI/datatype/ellipsis/smart controls to customise the view
1354+
- Enter a link prefix to redirect URI clicks to a custom browser or lookup tool
13441355
- Use YASR's download button for CSV file export
1345-
- Preferences (column widths, sort state, display options) are saved to localStorage
1356+
- Preferences (column widths, sort state, display options, link prefix) are saved to localStorage
1357+
- Click **?** in the toolbar for a quick overview of all features
13461358

13471359
**More Information:**
13481360
Visit the [Table Plugin Repository](https://github.com/Matdata-eu/yasgui-table-plugin) for detailed documentation.

0 commit comments

Comments
 (0)