@peter.prib/renderengine 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/renderengine-workspace.umd.js +19 -12
- package/dist/renderengine.umd.js +17 -10
- package/{REFERENCE.md → documentation/REFERENCE.md} +1 -0
- package/package.json +2 -2
- package/src/bian.js +1 -1
- package/src/chartCatalog.js +1 -1
- package/src/charting/table/TableView.js +6 -1
- package/src/charting/table/TableViewChart.js +3 -1
- package/src/datawindow/BoundedWindow.js +1 -1
- package/src/datawindow/GraphDataWindow.js +1 -1
- package/src/index.js +2 -2
- package/src/kernelExpr.js +2 -2
- package/src/workspace/index.js +1 -1
- package/src/workspace/parts/ChartPart.js +1 -1
- package/src/workspace.js +1 -1
package/README.md
CHANGED
|
@@ -268,11 +268,11 @@ you can also build, check, score, search, report on and export models with no UI
|
|
|
268
268
|
|
|
269
269
|
| Document | What it covers |
|
|
270
270
|
|---|---|
|
|
271
|
-
| `REFERENCE.md` | The API: chart methods and options, the editors, models, commands, file formats |
|
|
272
|
-
| `WORKSPACE_ARCHITECTURE.md` | The `<ws-workspace>` shell: parts, layout, context bus, work area |
|
|
273
|
-
| `ARCHITECTURE.md` | Module layout and the chart-type catalog |
|
|
274
|
-
| `LLM_ARCHIMATE_GUIDE.md` | Generating valid ArchiMate model data, with a prompt template |
|
|
275
|
-
| `tasks.md` | What's still to come |
|
|
271
|
+
| `documentation/REFERENCE.md` | The API: chart methods and options, the editors, models, commands, file formats |
|
|
272
|
+
| `documentation/WORKSPACE_ARCHITECTURE.md` | The `<ws-workspace>` shell: parts, layout, context bus, work area |
|
|
273
|
+
| `documentation/ARCHITECTURE.md` | Module layout and the chart-type catalog |
|
|
274
|
+
| `documentation/LLM_ARCHIMATE_GUIDE.md` | Generating valid ArchiMate model data, with a prompt template |
|
|
275
|
+
| `documentation/tasks.md` | What's still to come |
|
|
276
276
|
|
|
277
277
|
## Build and test
|
|
278
278
|
|
|
@@ -6444,7 +6444,7 @@
|
|
|
6444
6444
|
// Copyright 2026 Jaroslav Peter Prib, Purveyor of Excellence
|
|
6445
6445
|
/**
|
|
6446
6446
|
* Single source of truth for "what chart types does RenderEngine support" —
|
|
6447
|
-
* see ARCHITECTURE.md's "Chart-type catalog" section for the full story.
|
|
6447
|
+
* see documentation/ARCHITECTURE.md's "Chart-type catalog" section for the full story.
|
|
6448
6448
|
*
|
|
6449
6449
|
* This is not just a flat {key,label} list. Chart types share real,
|
|
6450
6450
|
* composable capabilities — every one of them takes a title; several accept
|
|
@@ -16346,7 +16346,7 @@
|
|
|
16346
16346
|
* not once per query. Kept as a standalone copy rather than a shared
|
|
16347
16347
|
* dependency — the two repos have no package link today, and this grammar is
|
|
16348
16348
|
* small enough that duplicating it costs less than a cross-repo dependency
|
|
16349
|
-
* would. See renderengine's own `tasks.md` for why this exists, and
|
|
16349
|
+
* would. See renderengine's own `documentation/tasks.md` for why this exists, and
|
|
16350
16350
|
* sqlengine's `documentation/kernel-language.md` for the full grammar
|
|
16351
16351
|
* reference this is a subset of.
|
|
16352
16352
|
*
|
|
@@ -16357,7 +16357,7 @@
|
|
|
16357
16357
|
*
|
|
16358
16358
|
* NO GPU/WASM/WebNN TARGETS HERE, unlike the sqlengine original — renderengine
|
|
16359
16359
|
* has no compute-backend concept and nothing has measured a need for one for
|
|
16360
|
-
* per-point chart encodings (see tasks.md's "Gated on a measurement" entry).
|
|
16360
|
+
* per-point chart encodings (see documentation/tasks.md's "Gated on a measurement" entry).
|
|
16361
16361
|
* This only ever emits JavaScript.
|
|
16362
16362
|
*/
|
|
16363
16363
|
|
|
@@ -18070,8 +18070,9 @@
|
|
|
18070
18070
|
* @param {object} [options.menus] the host's own items: { cell, row, column, table } → items
|
|
18071
18071
|
* @param {function} [options.copy] writes text to the clipboard (navigator.clipboard by default)
|
|
18072
18072
|
* @param {ChartChooser} [options.chooser]
|
|
18073
|
+
* @param {function} [options.highlight] row → true for a row drawn highlighted (a host's selection)
|
|
18073
18074
|
*/
|
|
18074
|
-
constructor(rows, { columns = null, complete = true, pageSize = 50, onChange = null, menus = {}, copy = null, chooser = null } = {}) {
|
|
18075
|
+
constructor(rows, { columns = null, complete = true, pageSize = 50, onChange = null, menus = {}, copy = null, chooser = null, highlight = null } = {}) {
|
|
18075
18076
|
this.rows = rows;
|
|
18076
18077
|
this.columns = ChartChooser.describe(rows, columns);
|
|
18077
18078
|
this.complete = complete;
|
|
@@ -18080,6 +18081,7 @@
|
|
|
18080
18081
|
this.menus = menus;
|
|
18081
18082
|
this.copy = copy ?? TableView.clipboard;
|
|
18082
18083
|
this.chooser = chooser ?? new ChartChooser();
|
|
18084
|
+
this.highlight = highlight;
|
|
18083
18085
|
this.sort = null; // { column, direction: 'asc' | 'desc' }
|
|
18084
18086
|
this.filters = []; // { column, op, value }
|
|
18085
18087
|
this.hidden = new Set();
|
|
@@ -18094,6 +18096,9 @@
|
|
|
18094
18096
|
|
|
18095
18097
|
visibleColumns() { return this.columns.filter(c => !this.hidden.has(c.name)); }
|
|
18096
18098
|
|
|
18099
|
+
/** Whether a row is drawn highlighted: the host's `highlight` says (its selection, say). */
|
|
18100
|
+
isHighlighted(row) { return this.highlight?.(row) === true; }
|
|
18101
|
+
|
|
18097
18102
|
filtered() {
|
|
18098
18103
|
return this.filters.length === 0 ? this.rows
|
|
18099
18104
|
: this.rows.filter(r => this.filters.every(f => FILTER_OPS[f.op](r[f.column], f.value)));
|
|
@@ -18295,6 +18300,7 @@
|
|
|
18295
18300
|
static GUTTER_W = 44;
|
|
18296
18301
|
static MENU_GLYPH = '▾';
|
|
18297
18302
|
static TABLE_GLYPH = '⋮';
|
|
18303
|
+
static HIGHLIGHT_FILL = '#fdeeb5';
|
|
18298
18304
|
|
|
18299
18305
|
/**
|
|
18300
18306
|
* @param renderer
|
|
@@ -18351,7 +18357,8 @@
|
|
|
18351
18357
|
|
|
18352
18358
|
// Rows: a number in the gutter (row menu), a cell per column (cell menu).
|
|
18353
18359
|
view.pageRows().forEach(({ row, index }, r) => {
|
|
18354
|
-
if (
|
|
18360
|
+
if (view.isHighlighted(row)) this.renderer.rect(box.x, top, box.width, ROW_H, TableViewChart.HIGHLIGHT_FILL, null);
|
|
18361
|
+
else if (r % 2 === 1) this.renderer.rect(box.x, top, box.width, ROW_H, TableChart.STRIPE_FILL, null);
|
|
18355
18362
|
const number = this._text(String(index + 1), box.x + gutter - PAD_X, top, { textAnchor: 'end', fill: '#999', fontSize: '11px' });
|
|
18356
18363
|
this._on(interactive, [number], (e) => this.showMenu(e.clientX, e.clientY, view.rowMenu(row)), 'Row menu');
|
|
18357
18364
|
columns.forEach((c, i) => {
|
|
@@ -22884,7 +22891,7 @@
|
|
|
22884
22891
|
* Abstract base for "own a bounded collection, push one more item, drop the
|
|
22885
22892
|
* oldest once past a cap" — the one behavior every streamable chart data
|
|
22886
22893
|
* shape shares, however differently each stores its collection(s). See
|
|
22887
|
-
* ARCHITECTURE.md's "Data windows — streaming" section for the concrete
|
|
22894
|
+
* documentation/ARCHITECTURE.md's "Data windows — streaming" section for the concrete
|
|
22888
22895
|
* subtypes and why each exists as its own class rather than a branch here.
|
|
22889
22896
|
*/
|
|
22890
22897
|
class BoundedWindow {
|
|
@@ -23008,7 +23015,7 @@
|
|
|
23008
23015
|
|
|
23009
23016
|
/**
|
|
23010
23017
|
* A nodes+edges pair — the shape behind `graphDiagram`/`graphDiagram3D`.
|
|
23011
|
-
* Not a `CHART_CATALOG` entry (see ARCHITECTURE.md), so it isn't dispatched
|
|
23018
|
+
* Not a `CHART_CATALOG` entry (see documentation/ARCHITECTURE.md), so it isn't dispatched
|
|
23012
23019
|
* through `createDataWindow`/`streamShape`; `RenderEngine.addGraphNode`
|
|
23013
23020
|
* constructs it directly. Trimming drops the oldest nodes FIFO, then any
|
|
23014
23021
|
* edge left dangling off a removed node — dropping nodes without this would
|
|
@@ -47329,7 +47336,7 @@
|
|
|
47329
47336
|
* (github.com/bian-official/public, Apache-2.0) for the names control records
|
|
47330
47337
|
* have and, where a pattern aggregates two creating terms (Monitor: evaluate
|
|
47331
47338
|
* and initiate), the one its APIs use. Every value is BIAN's; `inferred` is
|
|
47332
|
-
* kept for a value that is not. See BIAN_ALIGNMENT.md.
|
|
47339
|
+
* kept for a value that is not. See documentation/BIAN_ALIGNMENT.md.
|
|
47333
47340
|
*/
|
|
47334
47341
|
|
|
47335
47342
|
/** One way a service domain behaves: what it does to its asset, and the record it keeps of it. */
|
|
@@ -54507,7 +54514,7 @@ ${theirs}` : theirs;
|
|
|
54507
54514
|
/**
|
|
54508
54515
|
* Renders an arc gauge: a half circle (or any start angle and sweep) filled to the value.
|
|
54509
54516
|
* @param {number|{value:number, target?:number}} value The value (0-100 unless options.min/max are given).
|
|
54510
|
-
* @param {object} [options] The gauge options (see REFERENCE.md, Gauges), cx, cy, r, thickness, startAngle, sweep, cap.
|
|
54517
|
+
* @param {object} [options] The gauge options (see documentation/REFERENCE.md, Gauges), cx, cy, r, thickness, startAngle, sweep, cap.
|
|
54511
54518
|
*/
|
|
54512
54519
|
arcGauge(value, options = {}) {
|
|
54513
54520
|
this._renderGauge(ArcGauge, 'arcGauge', value, options);
|
|
@@ -55442,7 +55449,7 @@ ${theirs}` : theirs;
|
|
|
55442
55449
|
/**
|
|
55443
55450
|
* Appends one data point to a registered chart's data and re-renders it,
|
|
55444
55451
|
* keeping at most `maxPoints` (oldest dropped first) — see
|
|
55445
|
-
* REFERENCE.md's "Dynamically adding data points in a bounded window".
|
|
55452
|
+
* documentation/REFERENCE.md's "Dynamically adding data points in a bounded window".
|
|
55446
55453
|
* Delegates the actual shape-aware append/trim to a `datawindow/`
|
|
55447
55454
|
* class, selected via the chart's `CHART_CATALOG` `streamShape`; the
|
|
55448
55455
|
* window instance is cached per `id` so repeated calls keep growing the
|
|
@@ -55596,7 +55603,7 @@ ${theirs}` : theirs;
|
|
|
55596
55603
|
return this.chartOptions;
|
|
55597
55604
|
}
|
|
55598
55605
|
|
|
55599
|
-
/** Append a point to a bounded window — see REFERENCE.md's streaming section. */
|
|
55606
|
+
/** Append a point to a bounded window — see documentation/REFERENCE.md's streaming section. */
|
|
55600
55607
|
addDataPoint(pointOrFactory, opts) {
|
|
55601
55608
|
this.engine?.addDataPoint(this.chartId, pointOrFactory, opts);
|
|
55602
55609
|
}
|
|
@@ -58929,7 +58936,7 @@ th { color: #555; font-weight: 500; }
|
|
|
58929
58936
|
* a shell that may only ever host adapted panels. Call
|
|
58930
58937
|
* `registerBuiltinParts(ws)` for the standard set, or register individually.
|
|
58931
58938
|
*
|
|
58932
|
-
* See WORKSPACE_ARCHITECTURE.md for the design.
|
|
58939
|
+
* See documentation/WORKSPACE_ARCHITECTURE.md for the design.
|
|
58933
58940
|
*/
|
|
58934
58941
|
|
|
58935
58942
|
defineWorkspace();
|
package/dist/renderengine.umd.js
CHANGED
|
@@ -1023,7 +1023,7 @@
|
|
|
1023
1023
|
// Copyright 2026 Jaroslav Peter Prib, Purveyor of Excellence
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Single source of truth for "what chart types does RenderEngine support" —
|
|
1026
|
-
* see ARCHITECTURE.md's "Chart-type catalog" section for the full story.
|
|
1026
|
+
* see documentation/ARCHITECTURE.md's "Chart-type catalog" section for the full story.
|
|
1027
1027
|
*
|
|
1028
1028
|
* This is not just a flat {key,label} list. Chart types share real,
|
|
1029
1029
|
* composable capabilities — every one of them takes a title; several accept
|
|
@@ -11218,7 +11218,7 @@
|
|
|
11218
11218
|
* not once per query. Kept as a standalone copy rather than a shared
|
|
11219
11219
|
* dependency — the two repos have no package link today, and this grammar is
|
|
11220
11220
|
* small enough that duplicating it costs less than a cross-repo dependency
|
|
11221
|
-
* would. See renderengine's own `tasks.md` for why this exists, and
|
|
11221
|
+
* would. See renderengine's own `documentation/tasks.md` for why this exists, and
|
|
11222
11222
|
* sqlengine's `documentation/kernel-language.md` for the full grammar
|
|
11223
11223
|
* reference this is a subset of.
|
|
11224
11224
|
*
|
|
@@ -11229,7 +11229,7 @@
|
|
|
11229
11229
|
*
|
|
11230
11230
|
* NO GPU/WASM/WebNN TARGETS HERE, unlike the sqlengine original — renderengine
|
|
11231
11231
|
* has no compute-backend concept and nothing has measured a need for one for
|
|
11232
|
-
* per-point chart encodings (see tasks.md's "Gated on a measurement" entry).
|
|
11232
|
+
* per-point chart encodings (see documentation/tasks.md's "Gated on a measurement" entry).
|
|
11233
11233
|
* This only ever emits JavaScript.
|
|
11234
11234
|
*/
|
|
11235
11235
|
|
|
@@ -12942,8 +12942,9 @@
|
|
|
12942
12942
|
* @param {object} [options.menus] the host's own items: { cell, row, column, table } → items
|
|
12943
12943
|
* @param {function} [options.copy] writes text to the clipboard (navigator.clipboard by default)
|
|
12944
12944
|
* @param {ChartChooser} [options.chooser]
|
|
12945
|
+
* @param {function} [options.highlight] row → true for a row drawn highlighted (a host's selection)
|
|
12945
12946
|
*/
|
|
12946
|
-
constructor(rows, { columns = null, complete = true, pageSize = 50, onChange = null, menus = {}, copy = null, chooser = null } = {}) {
|
|
12947
|
+
constructor(rows, { columns = null, complete = true, pageSize = 50, onChange = null, menus = {}, copy = null, chooser = null, highlight = null } = {}) {
|
|
12947
12948
|
this.rows = rows;
|
|
12948
12949
|
this.columns = ChartChooser.describe(rows, columns);
|
|
12949
12950
|
this.complete = complete;
|
|
@@ -12952,6 +12953,7 @@
|
|
|
12952
12953
|
this.menus = menus;
|
|
12953
12954
|
this.copy = copy ?? TableView.clipboard;
|
|
12954
12955
|
this.chooser = chooser ?? new ChartChooser();
|
|
12956
|
+
this.highlight = highlight;
|
|
12955
12957
|
this.sort = null; // { column, direction: 'asc' | 'desc' }
|
|
12956
12958
|
this.filters = []; // { column, op, value }
|
|
12957
12959
|
this.hidden = new Set();
|
|
@@ -12966,6 +12968,9 @@
|
|
|
12966
12968
|
|
|
12967
12969
|
visibleColumns() { return this.columns.filter(c => !this.hidden.has(c.name)); }
|
|
12968
12970
|
|
|
12971
|
+
/** Whether a row is drawn highlighted: the host's `highlight` says (its selection, say). */
|
|
12972
|
+
isHighlighted(row) { return this.highlight?.(row) === true; }
|
|
12973
|
+
|
|
12969
12974
|
filtered() {
|
|
12970
12975
|
return this.filters.length === 0 ? this.rows
|
|
12971
12976
|
: this.rows.filter(r => this.filters.every(f => FILTER_OPS[f.op](r[f.column], f.value)));
|
|
@@ -13167,6 +13172,7 @@
|
|
|
13167
13172
|
static GUTTER_W = 44;
|
|
13168
13173
|
static MENU_GLYPH = '▾';
|
|
13169
13174
|
static TABLE_GLYPH = '⋮';
|
|
13175
|
+
static HIGHLIGHT_FILL = '#fdeeb5';
|
|
13170
13176
|
|
|
13171
13177
|
/**
|
|
13172
13178
|
* @param renderer
|
|
@@ -13223,7 +13229,8 @@
|
|
|
13223
13229
|
|
|
13224
13230
|
// Rows: a number in the gutter (row menu), a cell per column (cell menu).
|
|
13225
13231
|
view.pageRows().forEach(({ row, index }, r) => {
|
|
13226
|
-
if (
|
|
13232
|
+
if (view.isHighlighted(row)) this.renderer.rect(box.x, top, box.width, ROW_H, TableViewChart.HIGHLIGHT_FILL, null);
|
|
13233
|
+
else if (r % 2 === 1) this.renderer.rect(box.x, top, box.width, ROW_H, TableChart.STRIPE_FILL, null);
|
|
13227
13234
|
const number = this._text(String(index + 1), box.x + gutter - PAD_X, top, { textAnchor: 'end', fill: '#999', fontSize: '11px' });
|
|
13228
13235
|
this._on(interactive, [number], (e) => this.showMenu(e.clientX, e.clientY, view.rowMenu(row)), 'Row menu');
|
|
13229
13236
|
columns.forEach((c, i) => {
|
|
@@ -17756,7 +17763,7 @@
|
|
|
17756
17763
|
* Abstract base for "own a bounded collection, push one more item, drop the
|
|
17757
17764
|
* oldest once past a cap" — the one behavior every streamable chart data
|
|
17758
17765
|
* shape shares, however differently each stores its collection(s). See
|
|
17759
|
-
* ARCHITECTURE.md's "Data windows — streaming" section for the concrete
|
|
17766
|
+
* documentation/ARCHITECTURE.md's "Data windows — streaming" section for the concrete
|
|
17760
17767
|
* subtypes and why each exists as its own class rather than a branch here.
|
|
17761
17768
|
*/
|
|
17762
17769
|
class BoundedWindow {
|
|
@@ -17880,7 +17887,7 @@
|
|
|
17880
17887
|
|
|
17881
17888
|
/**
|
|
17882
17889
|
* A nodes+edges pair — the shape behind `graphDiagram`/`graphDiagram3D`.
|
|
17883
|
-
* Not a `CHART_CATALOG` entry (see ARCHITECTURE.md), so it isn't dispatched
|
|
17890
|
+
* Not a `CHART_CATALOG` entry (see documentation/ARCHITECTURE.md), so it isn't dispatched
|
|
17884
17891
|
* through `createDataWindow`/`streamShape`; `RenderEngine.addGraphNode`
|
|
17885
17892
|
* constructs it directly. Trimming drops the oldest nodes FIFO, then any
|
|
17886
17893
|
* edge left dangling off a removed node — dropping nodes without this would
|
|
@@ -43336,7 +43343,7 @@
|
|
|
43336
43343
|
* (github.com/bian-official/public, Apache-2.0) for the names control records
|
|
43337
43344
|
* have and, where a pattern aggregates two creating terms (Monitor: evaluate
|
|
43338
43345
|
* and initiate), the one its APIs use. Every value is BIAN's; `inferred` is
|
|
43339
|
-
* kept for a value that is not. See BIAN_ALIGNMENT.md.
|
|
43346
|
+
* kept for a value that is not. See documentation/BIAN_ALIGNMENT.md.
|
|
43340
43347
|
*/
|
|
43341
43348
|
|
|
43342
43349
|
/** One way a service domain behaves: what it does to its asset, and the record it keeps of it. */
|
|
@@ -50574,7 +50581,7 @@ ${theirs}` : theirs;
|
|
|
50574
50581
|
/**
|
|
50575
50582
|
* Renders an arc gauge: a half circle (or any start angle and sweep) filled to the value.
|
|
50576
50583
|
* @param {number|{value:number, target?:number}} value The value (0-100 unless options.min/max are given).
|
|
50577
|
-
* @param {object} [options] The gauge options (see REFERENCE.md, Gauges), cx, cy, r, thickness, startAngle, sweep, cap.
|
|
50584
|
+
* @param {object} [options] The gauge options (see documentation/REFERENCE.md, Gauges), cx, cy, r, thickness, startAngle, sweep, cap.
|
|
50578
50585
|
*/
|
|
50579
50586
|
arcGauge(value, options = {}) {
|
|
50580
50587
|
this._renderGauge(ArcGauge, 'arcGauge', value, options);
|
|
@@ -51509,7 +51516,7 @@ ${theirs}` : theirs;
|
|
|
51509
51516
|
/**
|
|
51510
51517
|
* Appends one data point to a registered chart's data and re-renders it,
|
|
51511
51518
|
* keeping at most `maxPoints` (oldest dropped first) — see
|
|
51512
|
-
* REFERENCE.md's "Dynamically adding data points in a bounded window".
|
|
51519
|
+
* documentation/REFERENCE.md's "Dynamically adding data points in a bounded window".
|
|
51513
51520
|
* Delegates the actual shape-aware append/trim to a `datawindow/`
|
|
51514
51521
|
* class, selected via the chart's `CHART_CATALOG` `streamShape`; the
|
|
51515
51522
|
* window instance is cached per `id` so repeated calls keep growing the
|
|
@@ -1137,6 +1137,7 @@ const view = new RenderEngine(container, { rendererType: 'svg' }).resultView(row
|
|
|
1137
1137
|
complete: true, // false when the rows are only part of the answer (a top N)
|
|
1138
1138
|
pageSize: 50,
|
|
1139
1139
|
menus: { row: ({ row }) => [{ label: 'Open order', action: () => open(row.id) }] },
|
|
1140
|
+
highlight: (row) => row.id === selectedId, // rows drawn highlighted: the host's selection
|
|
1140
1141
|
});
|
|
1141
1142
|
```
|
|
1142
1143
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peter.prib/renderengine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "ArchiMate modeller, diagram editor and chart library for the browser, with no runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"examples/diagram-editor.html",
|
|
21
21
|
"examples/data-model.html",
|
|
22
22
|
"README.md",
|
|
23
|
-
"REFERENCE.md",
|
|
23
|
+
"documentation/REFERENCE.md",
|
|
24
24
|
"LICENSE"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
package/src/bian.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* (github.com/bian-official/public, Apache-2.0) for the names control records
|
|
13
13
|
* have and, where a pattern aggregates two creating terms (Monitor: evaluate
|
|
14
14
|
* and initiate), the one its APIs use. Every value is BIAN's; `inferred` is
|
|
15
|
-
* kept for a value that is not. See BIAN_ALIGNMENT.md.
|
|
15
|
+
* kept for a value that is not. See documentation/BIAN_ALIGNMENT.md.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
/** One way a service domain behaves: what it does to its asset, and the record it keeps of it. */
|
package/src/chartCatalog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2026 Jaroslav Peter Prib, Purveyor of Excellence
|
|
2
2
|
/**
|
|
3
3
|
* Single source of truth for "what chart types does RenderEngine support" —
|
|
4
|
-
* see ARCHITECTURE.md's "Chart-type catalog" section for the full story.
|
|
4
|
+
* see documentation/ARCHITECTURE.md's "Chart-type catalog" section for the full story.
|
|
5
5
|
*
|
|
6
6
|
* This is not just a flat {key,label} list. Chart types share real,
|
|
7
7
|
* composable capabilities — every one of them takes a title; several accept
|
|
@@ -51,8 +51,9 @@ export class TableView {
|
|
|
51
51
|
* @param {object} [options.menus] the host's own items: { cell, row, column, table } → items
|
|
52
52
|
* @param {function} [options.copy] writes text to the clipboard (navigator.clipboard by default)
|
|
53
53
|
* @param {ChartChooser} [options.chooser]
|
|
54
|
+
* @param {function} [options.highlight] row → true for a row drawn highlighted (a host's selection)
|
|
54
55
|
*/
|
|
55
|
-
constructor(rows, { columns = null, complete = true, pageSize = 50, onChange = null, menus = {}, copy = null, chooser = null } = {}) {
|
|
56
|
+
constructor(rows, { columns = null, complete = true, pageSize = 50, onChange = null, menus = {}, copy = null, chooser = null, highlight = null } = {}) {
|
|
56
57
|
this.rows = rows;
|
|
57
58
|
this.columns = ChartChooser.describe(rows, columns);
|
|
58
59
|
this.complete = complete;
|
|
@@ -61,6 +62,7 @@ export class TableView {
|
|
|
61
62
|
this.menus = menus;
|
|
62
63
|
this.copy = copy ?? TableView.clipboard;
|
|
63
64
|
this.chooser = chooser ?? new ChartChooser();
|
|
65
|
+
this.highlight = highlight;
|
|
64
66
|
this.sort = null; // { column, direction: 'asc' | 'desc' }
|
|
65
67
|
this.filters = []; // { column, op, value }
|
|
66
68
|
this.hidden = new Set();
|
|
@@ -75,6 +77,9 @@ export class TableView {
|
|
|
75
77
|
|
|
76
78
|
visibleColumns() { return this.columns.filter(c => !this.hidden.has(c.name)); }
|
|
77
79
|
|
|
80
|
+
/** Whether a row is drawn highlighted: the host's `highlight` says (its selection, say). */
|
|
81
|
+
isHighlighted(row) { return this.highlight?.(row) === true; }
|
|
82
|
+
|
|
78
83
|
filtered() {
|
|
79
84
|
return this.filters.length === 0 ? this.rows
|
|
80
85
|
: this.rows.filter(r => this.filters.every(f => FILTER_OPS[f.op](r[f.column], f.value)));
|
|
@@ -16,6 +16,7 @@ export class TableViewChart extends TableChart {
|
|
|
16
16
|
static GUTTER_W = 44;
|
|
17
17
|
static MENU_GLYPH = '▾';
|
|
18
18
|
static TABLE_GLYPH = '⋮';
|
|
19
|
+
static HIGHLIGHT_FILL = '#fdeeb5';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @param renderer
|
|
@@ -72,7 +73,8 @@ export class TableViewChart extends TableChart {
|
|
|
72
73
|
|
|
73
74
|
// Rows: a number in the gutter (row menu), a cell per column (cell menu).
|
|
74
75
|
view.pageRows().forEach(({ row, index }, r) => {
|
|
75
|
-
if (
|
|
76
|
+
if (view.isHighlighted(row)) this.renderer.rect(box.x, top, box.width, ROW_H, TableViewChart.HIGHLIGHT_FILL, null);
|
|
77
|
+
else if (r % 2 === 1) this.renderer.rect(box.x, top, box.width, ROW_H, TableChart.STRIPE_FILL, null);
|
|
76
78
|
const number = this._text(String(index + 1), box.x + gutter - PAD_X, top, { textAnchor: 'end', fill: '#999', fontSize: '11px' });
|
|
77
79
|
this._on(interactive, [number], (e) => this.showMenu(e.clientX, e.clientY, view.rowMenu(row)), 'Row menu');
|
|
78
80
|
columns.forEach((c, i) => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Abstract base for "own a bounded collection, push one more item, drop the
|
|
3
3
|
* oldest once past a cap" — the one behavior every streamable chart data
|
|
4
4
|
* shape shares, however differently each stores its collection(s). See
|
|
5
|
-
* ARCHITECTURE.md's "Data windows — streaming" section for the concrete
|
|
5
|
+
* documentation/ARCHITECTURE.md's "Data windows — streaming" section for the concrete
|
|
6
6
|
* subtypes and why each exists as its own class rather than a branch here.
|
|
7
7
|
*/
|
|
8
8
|
export class BoundedWindow {
|
|
@@ -2,7 +2,7 @@ import { BoundedWindow } from './BoundedWindow.js';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A nodes+edges pair — the shape behind `graphDiagram`/`graphDiagram3D`.
|
|
5
|
-
* Not a `CHART_CATALOG` entry (see ARCHITECTURE.md), so it isn't dispatched
|
|
5
|
+
* Not a `CHART_CATALOG` entry (see documentation/ARCHITECTURE.md), so it isn't dispatched
|
|
6
6
|
* through `createDataWindow`/`streamShape`; `RenderEngine.addGraphNode`
|
|
7
7
|
* constructs it directly. Trimming drops the oldest nodes FIFO, then any
|
|
8
8
|
* edge left dangling off a removed node — dropping nodes without this would
|
package/src/index.js
CHANGED
|
@@ -1819,7 +1819,7 @@ export class RenderEngine {
|
|
|
1819
1819
|
/**
|
|
1820
1820
|
* Renders an arc gauge: a half circle (or any start angle and sweep) filled to the value.
|
|
1821
1821
|
* @param {number|{value:number, target?:number}} value The value (0-100 unless options.min/max are given).
|
|
1822
|
-
* @param {object} [options] The gauge options (see REFERENCE.md, Gauges), cx, cy, r, thickness, startAngle, sweep, cap.
|
|
1822
|
+
* @param {object} [options] The gauge options (see documentation/REFERENCE.md, Gauges), cx, cy, r, thickness, startAngle, sweep, cap.
|
|
1823
1823
|
*/
|
|
1824
1824
|
arcGauge(value, options = {}) {
|
|
1825
1825
|
this._renderGauge(ArcGauge, 'arcGauge', value, options);
|
|
@@ -2754,7 +2754,7 @@ export class RenderEngine {
|
|
|
2754
2754
|
/**
|
|
2755
2755
|
* Appends one data point to a registered chart's data and re-renders it,
|
|
2756
2756
|
* keeping at most `maxPoints` (oldest dropped first) — see
|
|
2757
|
-
* REFERENCE.md's "Dynamically adding data points in a bounded window".
|
|
2757
|
+
* documentation/REFERENCE.md's "Dynamically adding data points in a bounded window".
|
|
2758
2758
|
* Delegates the actual shape-aware append/trim to a `datawindow/`
|
|
2759
2759
|
* class, selected via the chart's `CHART_CATALOG` `streamShape`; the
|
|
2760
2760
|
* window instance is cached per `id` so repeated calls keep growing the
|
package/src/kernelExpr.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* not once per query. Kept as a standalone copy rather than a shared
|
|
12
12
|
* dependency — the two repos have no package link today, and this grammar is
|
|
13
13
|
* small enough that duplicating it costs less than a cross-repo dependency
|
|
14
|
-
* would. See renderengine's own `tasks.md` for why this exists, and
|
|
14
|
+
* would. See renderengine's own `documentation/tasks.md` for why this exists, and
|
|
15
15
|
* sqlengine's `documentation/kernel-language.md` for the full grammar
|
|
16
16
|
* reference this is a subset of.
|
|
17
17
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* NO GPU/WASM/WebNN TARGETS HERE, unlike the sqlengine original — renderengine
|
|
24
24
|
* has no compute-backend concept and nothing has measured a need for one for
|
|
25
|
-
* per-point chart encodings (see tasks.md's "Gated on a measurement" entry).
|
|
25
|
+
* per-point chart encodings (see documentation/tasks.md's "Gated on a measurement" entry).
|
|
26
26
|
* This only ever emits JavaScript.
|
|
27
27
|
*/
|
|
28
28
|
|
package/src/workspace/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* a shell that may only ever host adapted panels. Call
|
|
13
13
|
* `registerBuiltinParts(ws)` for the standard set, or register individually.
|
|
14
14
|
*
|
|
15
|
-
* See WORKSPACE_ARCHITECTURE.md for the design.
|
|
15
|
+
* See documentation/WORKSPACE_ARCHITECTURE.md for the design.
|
|
16
16
|
*/
|
|
17
17
|
import { Workspace, WORKSPACE_TAG, WORKSPACE_SCHEMA_VERSION, defineWorkspace } from './Workspace.js';
|
|
18
18
|
import { ContextBus } from './ContextBus.js';
|
|
@@ -103,7 +103,7 @@ export class ChartPart extends Part {
|
|
|
103
103
|
return this.chartOptions;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
/** Append a point to a bounded window — see REFERENCE.md's streaming section. */
|
|
106
|
+
/** Append a point to a bounded window — see documentation/REFERENCE.md's streaming section. */
|
|
107
107
|
addDataPoint(pointOrFactory, opts) {
|
|
108
108
|
this.engine?.addDataPoint(this.chartId, pointOrFactory, opts);
|
|
109
109
|
}
|
package/src/workspace.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* never actually contributed any UI. It could not express either target
|
|
8
8
|
* consumer — sqlengine workbench's sidebar+main+tool-panels, or its 12-column
|
|
9
9
|
* dashboard grid — so it was replaced by the part/layout/context model in
|
|
10
|
-
* `src/workspace/`. See WORKSPACE_ARCHITECTURE.md.
|
|
10
|
+
* `src/workspace/`. See documentation/WORKSPACE_ARCHITECTURE.md.
|
|
11
11
|
*
|
|
12
12
|
* Kept as a re-export so `import '.../src/workspace.js'` still registers the
|
|
13
13
|
* `<ws-workspace>` element. Both files defining the same tag would otherwise
|