@inflexa-ai/harness 0.20.0 → 0.21.1
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/dist/agents/conversation-agent.d.ts +26 -14
- package/dist/agents/conversation-agent.js +12 -23
- package/dist/agents/report-session-agent.d.ts +31 -5
- package/dist/agents/report-session-agent.js +35 -9
- package/dist/app/chat-turn.js +3 -1
- package/dist/app/message-assembly.d.ts +15 -1
- package/dist/app/message-assembly.js +22 -8
- package/dist/app/report-session-runtime.d.ts +21 -4
- package/dist/app/report-session-runtime.js +53 -6
- package/dist/app/spawn-report-session.d.ts +174 -17
- package/dist/app/spawn-report-session.js +233 -21
- package/dist/contracts/chat-events.d.ts +7 -2
- package/dist/contracts/message.d.ts +10 -0
- package/dist/contracts/report-blocks.d.ts +743 -19
- package/dist/contracts/report-blocks.js +186 -11
- package/dist/contracts/report-reference.d.ts +88 -0
- package/dist/contracts/report-reference.js +48 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +20 -0
- package/dist/lib/chrome.d.ts +26 -6
- package/dist/lib/chrome.js +99 -32
- package/dist/lib/eyes.d.ts +57 -0
- package/dist/lib/eyes.js +45 -0
- package/dist/lib/page-capture.d.ts +14 -0
- package/dist/lib/page-capture.js +56 -2
- package/dist/loop/run-agent.js +58 -23
- package/dist/loop/tool-detail.d.ts +19 -2
- package/dist/loop/tool-detail.js +35 -2
- package/dist/memory/content-to-cortex.d.ts +3 -2
- package/dist/memory/content-to-cortex.js +21 -12
- package/dist/memory/conversation-display-replay.js +14 -7
- package/dist/memory/thread-history.d.ts +60 -3
- package/dist/memory/thread-history.js +55 -16
- package/dist/memory/thread-store.d.ts +11 -1
- package/dist/memory/thread-store.js +12 -2
- package/dist/prompts/conversation.d.ts +1 -1
- package/dist/prompts/conversation.js +23 -6
- package/dist/prompts/report-session.d.ts +1 -1
- package/dist/prompts/report-session.js +190 -9
- package/dist/report-model/authoring-grammar.d.ts +463 -0
- package/dist/report-model/authoring-grammar.js +77 -0
- package/dist/report-model/block-walk.d.ts +57 -14
- package/dist/report-model/block-walk.js +116 -11
- package/dist/report-model/draft-finish.d.ts +22 -4
- package/dist/report-model/draft-finish.js +39 -7
- package/dist/report-model/draft-operations.d.ts +3 -0
- package/dist/report-model/draft-operations.js +19 -5
- package/dist/report-model/draft-read.d.ts +8 -5
- package/dist/report-model/draft-read.js +21 -5
- package/dist/report-model/fixture-resolver.js +15 -4
- package/dist/report-model/pin-snapshot.d.ts +24 -6
- package/dist/report-model/pin-snapshot.js +204 -6
- package/dist/report-model/production-resolver.js +15 -4
- package/dist/report-model/reference-resolver.d.ts +50 -1
- package/dist/report-model/reference-resolver.js +94 -1
- package/dist/report-model/reference-stamp.d.ts +45 -0
- package/dist/report-model/reference-stamp.js +173 -0
- package/dist/report-model/structural-validation.d.ts +4 -1
- package/dist/report-model/structural-validation.js +48 -3
- package/dist/report-model/validate.d.ts +1 -1
- package/dist/report-model/validate.js +1 -1
- package/dist/report-render/asset-lookup.d.ts +19 -0
- package/dist/report-render/asset-lookup.js +37 -0
- package/dist/report-render/assets.d.ts +45 -1
- package/dist/report-render/assets.js +65 -6
- package/dist/report-render/chart-presets.d.ts +102 -0
- package/dist/report-render/chart-presets.js +205 -0
- package/dist/report-render/chart.d.ts +112 -10
- package/dist/report-render/chart.js +1164 -41
- package/dist/report-render/design.d.ts +99 -0
- package/dist/report-render/design.js +289 -107
- package/dist/report-render/number-format.d.ts +117 -0
- package/dist/report-render/number-format.js +479 -0
- package/dist/report-render/page.d.ts +121 -5
- package/dist/report-render/page.js +689 -7
- package/dist/report-render/references.d.ts +70 -16
- package/dist/report-render/references.js +54 -22
- package/dist/report-render/render.d.ts +23 -5
- package/dist/report-render/render.js +81 -22
- package/dist/report-render/table-data.d.ts +92 -0
- package/dist/report-render/table-data.js +129 -0
- package/dist/report-render/types.d.ts +15 -0
- package/dist/report-render/value-bridge.js +6 -2
- package/dist/report-render/views/chart-view.d.ts +12 -5
- package/dist/report-render/views/chart-view.js +14 -8
- package/dist/report-render/views/page-view.d.ts +36 -15
- package/dist/report-render/views/page-view.js +45 -23
- package/dist/report-render/views/prose.d.ts +12 -2
- package/dist/report-render/views/prose.js +29 -7
- package/dist/report-render/views/references-view.d.ts +22 -8
- package/dist/report-render/views/references-view.js +101 -13
- package/dist/report-render/views/values.d.ts +128 -13
- package/dist/report-render/views/values.js +199 -18
- package/dist/runtime/assemble.d.ts +39 -5
- package/dist/runtime/assemble.js +47 -6
- package/dist/sandbox/client.d.ts +10 -1
- package/dist/sandbox/create-sandbox.d.ts +9 -4
- package/dist/sandbox/create-sandbox.js +22 -16
- package/dist/sandbox/docker-client.js +10 -7
- package/dist/sandbox/mount-plan.d.ts +45 -7
- package/dist/sandbox/mount-plan.js +43 -5
- package/dist/sandbox/types.d.ts +6 -0
- package/dist/state/init.js +38 -9
- package/dist/state/report-session-state.d.ts +42 -1
- package/dist/state/report-session-state.js +70 -2
- package/dist/state/report-versions.d.ts +22 -17
- package/dist/state/report-versions.js +48 -35
- package/dist/state/snapshot-parse.js +16 -1
- package/dist/tools/define-tool.d.ts +32 -0
- package/dist/tools/define-tool.js +4 -0
- package/dist/tools/detail-resolver.d.ts +7 -2
- package/dist/tools/detail-resolver.js +7 -2
- package/dist/tools/iterate-report.d.ts +1 -1
- package/dist/tools/report/preview-snapshot.js +1 -0
- package/dist/tools/report-authoring/authoring-tools.d.ts +15 -6
- package/dist/tools/report-authoring/authoring-tools.js +99 -18
- package/dist/tools/report-session/derive-table.d.ts +162 -0
- package/dist/tools/report-session/derive-table.js +459 -0
- package/dist/tools/report-session/examine-page.d.ts +48 -18
- package/dist/tools/report-session/examine-page.js +204 -24
- package/dist/tools/report-session/index.d.ts +2 -0
- package/dist/tools/report-session/index.js +2 -0
- package/dist/tools/report-session/list-artifacts.d.ts +97 -0
- package/dist/tools/report-session/list-artifacts.js +197 -0
- package/dist/tools/report-session/preview-report.d.ts +6 -0
- package/dist/tools/report-session/preview-report.js +180 -28
- package/dist/tools/report-session/record-version.d.ts +22 -10
- package/dist/tools/report-session/record-version.js +99 -14
- package/dist/tools/start-report-session.d.ts +115 -0
- package/dist/tools/start-report-session.js +179 -0
- package/dist/workspace/paths.d.ts +50 -0
- package/dist/workspace/paths.js +63 -0
- package/package.json +2 -1
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The preset expansion of the chart grammar.
|
|
3
|
+
*
|
|
4
|
+
* A preset is sugar over the composition. `expandPreset` gives the composition of one preset, thus the
|
|
5
|
+
* derivation reads one shape and the two paths cannot drift.
|
|
6
|
+
*
|
|
7
|
+
* Each default of a preset is a declared constant of this module, and a declared threshold pair replaces
|
|
8
|
+
* one. A guide line carries such a value, and a guide is never a plotted value. The expansion estimates
|
|
9
|
+
* nothing: the `km` preset plots the precomputed survival columns as they are, and it fits no curve.
|
|
10
|
+
*
|
|
11
|
+
* A preset can also carry a classification. The classification reads the plotted pair of one row against
|
|
12
|
+
* the same values that the guides carry, thus the color split lands on the drawn lines. It reads one row
|
|
13
|
+
* at a time, and it computes no aggregate.
|
|
14
|
+
*
|
|
15
|
+
* A preset declares its own transform on the channel that it transforms. Thus it reads the column of that
|
|
16
|
+
* channel and it drops an authored transform there, and no value takes the transform two times.
|
|
17
|
+
*/
|
|
18
|
+
import { channelColumn, channelTransform, } from "../contracts/report-blocks.js";
|
|
19
|
+
/** The four chart types that expand into a composition. */
|
|
20
|
+
export const PRESET_CHART_TYPES = ["volcano", "manhattan", "ma", "km"];
|
|
21
|
+
/** The default p-value threshold of a volcano. The guide line sits at the transformed value of it. */
|
|
22
|
+
export const VOLCANO_P_THRESHOLD = 0.05;
|
|
23
|
+
/** The default effect threshold of a volcano. One guide line sits at each side of zero. */
|
|
24
|
+
export const VOLCANO_EFFECT_THRESHOLD = 1;
|
|
25
|
+
/** The genome-wide significance threshold of a Manhattan plot. */
|
|
26
|
+
export const MANHATTAN_P_THRESHOLD = 5e-8;
|
|
27
|
+
/** The baseline of an MA plot. A point above it rose, and a point below it fell. */
|
|
28
|
+
export const MA_BASELINE = 0;
|
|
29
|
+
/**
|
|
30
|
+
* The x title of a volcano. The two effect guides sit at `±1`, which is a log2 claim, thus the preset states
|
|
31
|
+
* the same quantity in words.
|
|
32
|
+
*/
|
|
33
|
+
const LOG2_EFFECT_TITLE = "log2 fold change";
|
|
34
|
+
/** The y title of a preset that transforms its p column. The minus sign is the character, not a hyphen. */
|
|
35
|
+
const NEG_LOG10_P_TITLE = "−log10(p)";
|
|
36
|
+
/**
|
|
37
|
+
* The three category names of a volcano.
|
|
38
|
+
*
|
|
39
|
+
* The two signal names state the side of the effect axis. The null name reads as the standard legend of a
|
|
40
|
+
* volcano, and the muted rule of the renderer reads the same text.
|
|
41
|
+
*/
|
|
42
|
+
const VOLCANO_DOWN = "Down";
|
|
43
|
+
const VOLCANO_UP = "Up";
|
|
44
|
+
const VOLCANO_NULL = "Not significant";
|
|
45
|
+
/** True when the chart type expands into a composition. */
|
|
46
|
+
export function isPresetChartType(chartType) {
|
|
47
|
+
// The array holds the four preset members, thus the test never reads a base type as a preset.
|
|
48
|
+
return PRESET_CHART_TYPES.includes(chartType);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Expand one preset into a composition.
|
|
52
|
+
*
|
|
53
|
+
* `x` and `y` are the two channels that every preset demands. The caller resolves them from the encoding
|
|
54
|
+
* and refuses an absent one, thus this function is total and it needs no failure channel. `encoding`
|
|
55
|
+
* supplies the optional `group` and `label` channels.
|
|
56
|
+
*
|
|
57
|
+
* `thresholds` carries the pair that the author declared. The volcano is the one preset that reads it, and
|
|
58
|
+
* an absent pair gives the two constants of this module.
|
|
59
|
+
*/
|
|
60
|
+
export function expandPreset(preset, x, y, encoding, thresholds) {
|
|
61
|
+
switch (preset) {
|
|
62
|
+
case "volcano":
|
|
63
|
+
return volcano(x, y, encoding, thresholds);
|
|
64
|
+
case "manhattan":
|
|
65
|
+
return manhattan(x, y, encoding);
|
|
66
|
+
case "ma":
|
|
67
|
+
return ma(x, y, encoding);
|
|
68
|
+
case "km":
|
|
69
|
+
return km(x, y, encoding);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The effect on x, the transformed p-value on y, three guide lines, and the three-way classification.
|
|
74
|
+
*
|
|
75
|
+
* The two effect guides sit at each side of zero, and the p guide sits at the transformed significance. The
|
|
76
|
+
* expression of the guide is the expression of the `neg_log10` transform, thus the guide and the points
|
|
77
|
+
* share one scale. The classification reads the same two numbers, thus the color split lands on the lines.
|
|
78
|
+
*/
|
|
79
|
+
function volcano(x, y, encoding, thresholds) {
|
|
80
|
+
const pColumn = channelColumn(y);
|
|
81
|
+
const significance = thresholds?.significance ?? VOLCANO_P_THRESHOLD;
|
|
82
|
+
const effect = thresholds?.effect ?? VOLCANO_EFFECT_THRESHOLD;
|
|
83
|
+
return {
|
|
84
|
+
composition: {
|
|
85
|
+
series: [
|
|
86
|
+
{
|
|
87
|
+
form: "scatter",
|
|
88
|
+
encoding: { x, y: { column: pColumn, transform: "neg_log10" }, ...optionalChannels(encoding) },
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
annotations: [
|
|
92
|
+
{ kind: "reference-line", axis: "y", value: -Math.log10(significance), label: `p ${significance}` },
|
|
93
|
+
{ kind: "reference-line", axis: "x", value: -effect },
|
|
94
|
+
{ kind: "reference-line", axis: "x", value: effect },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
classification: volcanoClassification(significance, effect),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The three-way split of a volcano, one row at a time.
|
|
102
|
+
*
|
|
103
|
+
* The significance cut is the value of the y guide, thus the test compares the plotted y against the drawn
|
|
104
|
+
* line. The effect cuts are the two x guides, and the test compares the plotted x against them. A point on
|
|
105
|
+
* a guide takes the null category, thus a guide belongs to neither side of itself.
|
|
106
|
+
*
|
|
107
|
+
* The down category emits first. The palette of the theme opens with the down color and the up color of the
|
|
108
|
+
* design tokens, thus each side takes its conventional color from the palette order alone.
|
|
109
|
+
*
|
|
110
|
+
* The rule states the same two cuts as plain data. A chart that ships no row builds its series in the
|
|
111
|
+
* browser from the rule, thus the two splits read one pair of numbers.
|
|
112
|
+
*/
|
|
113
|
+
function volcanoClassification(significance, effect) {
|
|
114
|
+
const cut = -Math.log10(significance);
|
|
115
|
+
return {
|
|
116
|
+
categories: [
|
|
117
|
+
{ name: VOLCANO_DOWN, muted: false },
|
|
118
|
+
{ name: VOLCANO_UP, muted: false },
|
|
119
|
+
{ name: VOLCANO_NULL, muted: true },
|
|
120
|
+
],
|
|
121
|
+
rule: { kind: "volcano", cut, effect },
|
|
122
|
+
categoryOf: (plottedX, plottedY) => {
|
|
123
|
+
if (plottedX === null || plottedY === null)
|
|
124
|
+
return undefined;
|
|
125
|
+
if (plottedY <= cut)
|
|
126
|
+
return VOLCANO_NULL;
|
|
127
|
+
if (plottedX < -effect)
|
|
128
|
+
return VOLCANO_DOWN;
|
|
129
|
+
if (plottedX > effect)
|
|
130
|
+
return VOLCANO_UP;
|
|
131
|
+
return VOLCANO_NULL;
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** The genome position on x, the transformed p-value on y, and the genome-wide guide line. */
|
|
136
|
+
function manhattan(x, y, encoding) {
|
|
137
|
+
const pColumn = channelColumn(y);
|
|
138
|
+
return {
|
|
139
|
+
composition: {
|
|
140
|
+
series: [
|
|
141
|
+
{
|
|
142
|
+
form: "scatter",
|
|
143
|
+
encoding: { x, y: { column: pColumn, transform: "neg_log10" }, ...optionalChannels(encoding) },
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
annotations: [{ kind: "reference-line", axis: "y", value: -Math.log10(MANHATTAN_P_THRESHOLD), label: `p ${MANHATTAN_P_THRESHOLD}` }],
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/** The mean level on x, the effect on y, and the baseline guide line. */
|
|
151
|
+
function ma(x, y, encoding) {
|
|
152
|
+
return {
|
|
153
|
+
composition: {
|
|
154
|
+
series: [{ form: "scatter", encoding: { x, y, ...optionalChannels(encoding) } }],
|
|
155
|
+
annotations: [{ kind: "reference-line", axis: "y", value: MA_BASELINE }],
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The time on x and the precomputed survival on y, as one step series for each arm.
|
|
161
|
+
*
|
|
162
|
+
* A survival curve holds its value between two events, thus the step form is the honest one. The quick
|
|
163
|
+
* path carries two channels for the two axes and no channel for a confidence bound. Thus a band around a
|
|
164
|
+
* curve is a composition, where an `area` series names the upper bound on `y` and the lower bound on `y0`.
|
|
165
|
+
*/
|
|
166
|
+
function km(x, y, encoding) {
|
|
167
|
+
return {
|
|
168
|
+
composition: {
|
|
169
|
+
series: [{ form: "step", encoding: { x, y, ...optionalChannels(encoding) } }],
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The semantic axis titles that one preset states.
|
|
175
|
+
*
|
|
176
|
+
* A preset knows its own quantities, thus it names them in words. A volcano plots a log2 effect against the
|
|
177
|
+
* transformed p, and a manhattan plots a genome position against the same transformed p. The `ma` and the
|
|
178
|
+
* `km` presets name nothing, because neither axis of them carries a fixed quantity.
|
|
179
|
+
*
|
|
180
|
+
* A channel that carries an authored transform plots a derived quantity, thus the semantic title would
|
|
181
|
+
* state the wrong one. Such a channel takes no title, and the derived name of the renderer states the true
|
|
182
|
+
* quantity. The y channel of a volcano and of a manhattan takes the transform of the preset itself, thus
|
|
183
|
+
* its title is exact.
|
|
184
|
+
*
|
|
185
|
+
* The titles rank under a declared column label. Thus they ride beside the composition and never inside its
|
|
186
|
+
* `axes` field, where an agent title sits and where they would outrank the label.
|
|
187
|
+
*/
|
|
188
|
+
export function presetAxisTitles(preset, x) {
|
|
189
|
+
switch (preset) {
|
|
190
|
+
case "volcano":
|
|
191
|
+
return { ...(channelTransform(x) === undefined ? { x: LOG2_EFFECT_TITLE } : {}), y: NEG_LOG10_P_TITLE };
|
|
192
|
+
case "manhattan":
|
|
193
|
+
return { y: NEG_LOG10_P_TITLE };
|
|
194
|
+
case "ma":
|
|
195
|
+
case "km":
|
|
196
|
+
return {};
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** The two optional channels that every preset carries through from the quick-path encoding. */
|
|
200
|
+
function optionalChannels(encoding) {
|
|
201
|
+
return {
|
|
202
|
+
...(encoding.group !== undefined ? { group: encoding.group } : {}),
|
|
203
|
+
...(encoding.label !== undefined ? { label: encoding.label } : {}),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The chart derivation of the report page.
|
|
3
3
|
*
|
|
4
|
-
* A chart block binds one whole-table artifact and
|
|
5
|
-
*
|
|
6
|
-
* markup lives beside this file, and it wraps the option that this derivation gives.
|
|
4
|
+
* A chart block binds one whole-table artifact, and it carries the quick path or the composition.
|
|
5
|
+
* `deriveChartOption` turns that grammar and the resolved rows into one ECharts option object. The chart
|
|
6
|
+
* container markup lives beside this file, and it wraps the option that this derivation gives.
|
|
7
|
+
*
|
|
8
|
+
* The derivation reads one shape. A preset expands into a composition before the derivation
|
|
9
|
+
* (`chart-presets.ts`), and each base chart type keeps its own fixed rule. Thus the two paths cannot
|
|
10
|
+
* drift.
|
|
7
11
|
*
|
|
8
12
|
* The renderer computes no aggregate. Each plotted number stays traceable to one cell of the evidence
|
|
9
|
-
* artifact. A pie or a heatmap arrives one row per category or per
|
|
10
|
-
* repeated pair is a refusal and not a silent sum.
|
|
13
|
+
* artifact, or to a per-row transform of one cell. A pie or a heatmap arrives one row per category or per
|
|
14
|
+
* cell, thus a repeated category or a repeated pair is a refusal and not a silent sum.
|
|
11
15
|
*
|
|
12
16
|
* The derivation is deterministic. Every object builds in one fixed key order, and the code reads no
|
|
13
17
|
* clock, no random value, and no locale. A string comparison uses the code-unit order (`<`) and never
|
|
14
18
|
* `localeCompare`, thus the same rows give the same bytes on every host.
|
|
19
|
+
*
|
|
20
|
+
* The option rides to the page as inline JSON. Thus no axis label and no tooltip can carry a function
|
|
21
|
+
* formatter, and every formatter here is a static template of the chart runtime. As a result the
|
|
22
|
+
* derivation bounds the tick precision of the one axis whose unit it declares itself, and every other
|
|
23
|
+
* value axis keeps the tick values that ECharts computes.
|
|
15
24
|
*/
|
|
16
25
|
import { type Result } from "neverthrow";
|
|
17
|
-
import type
|
|
26
|
+
import { type ChartBlock, type ChartTransform } from "../contracts/report-blocks.js";
|
|
27
|
+
import { type PresetRule } from "./chart-presets.js";
|
|
18
28
|
import type { RenderProblem } from "./types.js";
|
|
19
29
|
/** One cell of a resolved row. A cell is one string or one number. */
|
|
20
|
-
type Cell = string | number;
|
|
30
|
+
export type Cell = string | number;
|
|
21
31
|
/** One resolved row of the bound table, keyed by column name. */
|
|
22
32
|
export type ChartRow = Record<string, Cell>;
|
|
23
33
|
/** The derived option object, ready for `normalizeEchartSpec` and the inline JSON. */
|
|
@@ -26,8 +36,100 @@ export type EchartOption = Record<string, unknown>;
|
|
|
26
36
|
* Derive the ECharts option for a chart block, then pass it through `normalizeEchartSpec`.
|
|
27
37
|
*
|
|
28
38
|
* The normalizer owns the bottom legend, the save action, and the axis-label discipline. Thus the
|
|
29
|
-
* derivation sets no `title`, no `legend`, no `toolbox
|
|
30
|
-
*
|
|
39
|
+
* derivation sets no `title`, no `legend`, and no `toolbox`. The theme palette assigns the series colors by
|
|
40
|
+
* their order, and the null category of a preset is the one series that names a color of its own.
|
|
41
|
+
*
|
|
42
|
+
* The axis of a channel names the label that the binding declares for its column. The semantic title of a
|
|
43
|
+
* preset answers next, and the raw column name answers last.
|
|
31
44
|
*/
|
|
32
45
|
export declare function deriveChartOption(block: ChartBlock, rows: readonly ChartRow[], columns?: readonly string[]): Result<EchartOption, RenderProblem>;
|
|
33
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Derive the option of one chart, and read the shared payload of its artifact where the inline form grows
|
|
48
|
+
* too large.
|
|
49
|
+
*
|
|
50
|
+
* A chart under the bound keeps its inline data, byte for byte as `deriveChartOption` gives it. Past the
|
|
51
|
+
* bound the series carry no row, and the option states how the page builds each series from the columnar
|
|
52
|
+
* payload of the artifact. Thus one dense chart costs the page one option and no second copy of the rows.
|
|
53
|
+
*
|
|
54
|
+
* A quick path of a type that draws one point for one row takes a second pass past the bound. The base rule
|
|
55
|
+
* of such a type builds a bare pair and it collects no descriptor, and the one-series composition plots the
|
|
56
|
+
* same points with the build beside them. The second pass runs past the bound alone, thus a chart under the
|
|
57
|
+
* bound keeps its bytes.
|
|
58
|
+
*
|
|
59
|
+
* A chart whose series holds a value that no cell gives stays inline whatever its size. A binned count, a
|
|
60
|
+
* five-number summary, an addressed pair, and the upper half of a band are each such a value, thus no
|
|
61
|
+
* descriptor can state one.
|
|
62
|
+
*/
|
|
63
|
+
export declare function deriveChartRender(block: ChartBlock, rows: readonly ChartRow[], columns: readonly string[] | undefined, target: ChartPayloadTarget): Result<ChartRender, RenderProblem>;
|
|
64
|
+
/**
|
|
65
|
+
* The label of one named point. `{b}` is the name of the item, thus the label needs no function.
|
|
66
|
+
*
|
|
67
|
+
* A page-side series build writes the same member onto a flagged point, thus one constant answers for the
|
|
68
|
+
* inline form and the payload form alike.
|
|
69
|
+
*/
|
|
70
|
+
export declare const POINT_LABEL: EchartOption;
|
|
71
|
+
/**
|
|
72
|
+
* One column that a page-side series build reads: the place of the column in the payload, and the per-row
|
|
73
|
+
* transform of the channel.
|
|
74
|
+
*/
|
|
75
|
+
export interface ChartColumnSource {
|
|
76
|
+
readonly column: number;
|
|
77
|
+
readonly transform?: ChartTransform;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* One runtime series, as the page builds it from the columnar payload.
|
|
81
|
+
*
|
|
82
|
+
* `value` is the group value of a split by a group channel, and `category` is the place of a preset
|
|
83
|
+
* category. A series takes one of the two, or neither when it holds every row.
|
|
84
|
+
*
|
|
85
|
+
* `label` names the column that names each point, and `flags` names the rows that carry a point label. The
|
|
86
|
+
* flags are row places of the payload, thus a split carries the flags of its own rows alone.
|
|
87
|
+
*
|
|
88
|
+
* `sort` states that the form draws along the x axis, and `swap` states that the pair leads with the value
|
|
89
|
+
* of a horizontal bar.
|
|
90
|
+
*/
|
|
91
|
+
export interface ChartSeriesSource {
|
|
92
|
+
readonly x: ChartColumnSource;
|
|
93
|
+
readonly y: ChartColumnSource;
|
|
94
|
+
readonly group?: ChartColumnSource;
|
|
95
|
+
readonly value?: Cell;
|
|
96
|
+
readonly category?: number;
|
|
97
|
+
readonly label?: number;
|
|
98
|
+
readonly flags?: readonly number[];
|
|
99
|
+
readonly sort?: boolean;
|
|
100
|
+
readonly swap?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The data source of one chart: the payload that it reads, the classification rule where a preset splits
|
|
104
|
+
* the rows, and one descriptor for each runtime series in series order.
|
|
105
|
+
*/
|
|
106
|
+
export interface ChartDataSource {
|
|
107
|
+
readonly payload: string;
|
|
108
|
+
readonly rule?: PresetRule;
|
|
109
|
+
readonly series: readonly ChartSeriesSource[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The member of the option that carries the data source.
|
|
113
|
+
*
|
|
114
|
+
* The chart runtime reads no member of this name, and the page bootstrap removes it before it sets the
|
|
115
|
+
* option. The name leads with two underscores, thus no reader mistakes it for a field of the runtime.
|
|
116
|
+
*/
|
|
117
|
+
export declare const CHART_SOURCE_MEMBER = "__reportData";
|
|
118
|
+
/** The payload that a dense chart reads: the key of the registry, and the columns of the payload. */
|
|
119
|
+
export interface ChartPayloadTarget {
|
|
120
|
+
readonly key: string;
|
|
121
|
+
readonly columns: readonly string[];
|
|
122
|
+
}
|
|
123
|
+
/** The option of one chart, and whether it reads the registered payload of its artifact. */
|
|
124
|
+
export interface ChartRender {
|
|
125
|
+
readonly option: EchartOption;
|
|
126
|
+
readonly readsPayload: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The transformed value of one column, one entry for each row. A row with no usable cell gives `null`.
|
|
130
|
+
*
|
|
131
|
+
* The page-side series build holds the twin of this function, because a chart that reads the payload
|
|
132
|
+
* transforms its columns in the browser. A shared test vector runs the two over one set of cells, thus the
|
|
133
|
+
* two cannot give different numbers in silence.
|
|
134
|
+
*/
|
|
135
|
+
export declare function transformColumn(rows: readonly ChartRow[], column: string, transform: ChartTransform): (number | null)[];
|