@inflexa-ai/harness 0.42.2 → 0.43.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/README.md +2 -2
- package/dist/agents/sandbox/shared.d.ts +1 -6
- package/dist/agents/sandbox/shared.js +0 -15
- package/dist/app/chat-turn.js +13 -1
- package/dist/config/environment-stores.d.ts +4 -2
- package/dist/contracts/chat-events.d.ts +9 -1
- package/dist/contracts/chat-frame.d.ts +3 -3
- package/dist/contracts/chat-frame.js +8 -3
- package/dist/contracts/chat-parts.d.ts +4 -1
- package/dist/contracts/data-profile.d.ts +4 -6
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/report-blocks.d.ts +1364 -75
- package/dist/contracts/report-blocks.js +221 -29
- package/dist/contracts/report-reference.js +1 -1
- package/dist/contracts/schemas/chat-events.d.ts +13 -0
- package/dist/contracts/schemas/chat-events.js +5 -0
- package/dist/contracts/schemas/chat-parts.d.ts +2 -2
- package/dist/contracts/schemas/index.d.ts +1 -1
- package/dist/contracts/schemas/index.js +1 -1
- package/dist/execution/input-signature.d.ts +7 -13
- package/dist/execution/input-signature.js +0 -0
- package/dist/execution/run-canceler.d.ts +3 -2
- package/dist/execution/run-canceler.js +3 -2
- package/dist/execution/run-event-stream.d.ts +16 -2
- package/dist/execution/run-event-stream.js +54 -3
- package/dist/index.d.ts +1 -8
- package/dist/index.js +5 -16
- package/dist/input-scan/enrich.d.ts +0 -2
- package/dist/input-scan/enrich.js +0 -1
- package/dist/lib/metrics.js +6 -7
- package/dist/lib/otel-spans.d.ts +4 -9
- package/dist/lib/otel-spans.js +3 -8
- package/dist/loop/run-agent.d.ts +4 -2
- package/dist/loop/run-agent.js +38 -23
- package/dist/memory/thread-history.d.ts +1 -1
- package/dist/prompts/report-session.d.ts +1 -1
- package/dist/prompts/report-session.js +17 -0
- package/dist/provenance/exec-frame.d.ts +1 -1
- package/dist/report-model/authoring-grammar.d.ts +416 -17
- package/dist/report-model/authoring-grammar.js +25 -4
- package/dist/report-model/block-walk.d.ts +20 -4
- package/dist/report-model/block-walk.js +64 -7
- package/dist/report-model/draft-finish.d.ts +6 -2
- package/dist/report-model/draft-finish.js +6 -1
- package/dist/report-model/production-resolver.d.ts +8 -0
- package/dist/report-model/production-resolver.js +1 -1
- package/dist/report-model/validate.d.ts +20 -10
- package/dist/report-model/validate.js +29 -13
- package/dist/report-render/chart-export.d.ts +52 -0
- package/dist/report-render/chart-export.js +192 -0
- package/dist/report-render/chart-presets.d.ts +46 -47
- package/dist/report-render/chart-presets.js +31 -101
- package/dist/report-render/chart-renderers.d.ts +163 -0
- package/dist/report-render/chart-renderers.js +1055 -0
- package/dist/report-render/chart-toolbox.d.ts +124 -0
- package/dist/report-render/chart-toolbox.js +595 -0
- package/dist/report-render/chart.d.ts +60 -27
- package/dist/report-render/chart.js +2323 -524
- package/dist/report-render/design.d.ts +476 -16
- package/dist/report-render/design.js +390 -56
- package/dist/report-render/figures/common.d.ts +321 -0
- package/dist/report-render/figures/common.js +759 -0
- package/dist/report-render/figures/dendrogram.d.ts +36 -0
- package/dist/report-render/figures/dendrogram.js +130 -0
- package/dist/report-render/figures/dense.d.ts +111 -0
- package/dist/report-render/figures/dense.js +204 -0
- package/dist/report-render/figures/dotplot.d.ts +28 -0
- package/dist/report-render/figures/dotplot.js +234 -0
- package/dist/report-render/figures/embedding.d.ts +43 -0
- package/dist/report-render/figures/embedding.js +360 -0
- package/dist/report-render/figures/equal-units.d.ts +101 -0
- package/dist/report-render/figures/equal-units.js +215 -0
- package/dist/report-render/figures/forest.d.ts +20 -0
- package/dist/report-render/figures/forest.js +398 -0
- package/dist/report-render/figures/gsea.d.ts +30 -0
- package/dist/report-render/figures/gsea.js +391 -0
- package/dist/report-render/figures/heatmap.d.ts +40 -0
- package/dist/report-render/figures/heatmap.js +395 -0
- package/dist/report-render/figures/index.d.ts +135 -0
- package/dist/report-render/figures/index.js +100 -0
- package/dist/report-render/figures/km.d.ts +16 -0
- package/dist/report-render/figures/km.js +406 -0
- package/dist/report-render/figures/label-room.d.ts +130 -0
- package/dist/report-render/figures/label-room.js +341 -0
- package/dist/report-render/figures/locuszoom.d.ts +50 -0
- package/dist/report-render/figures/locuszoom.js +675 -0
- package/dist/report-render/figures/lollipop.d.ts +16 -0
- package/dist/report-render/figures/lollipop.js +247 -0
- package/dist/report-render/figures/ma.d.ts +20 -0
- package/dist/report-render/figures/ma.js +114 -0
- package/dist/report-render/figures/manhattan.d.ts +60 -0
- package/dist/report-render/figures/manhattan.js +343 -0
- package/dist/report-render/figures/oncoprint.d.ts +41 -0
- package/dist/report-render/figures/oncoprint.js +420 -0
- package/dist/report-render/figures/pca.d.ts +37 -0
- package/dist/report-render/figures/pca.js +241 -0
- package/dist/report-render/figures/qq.d.ts +30 -0
- package/dist/report-render/figures/qq.js +182 -0
- package/dist/report-render/figures/roc.d.ts +17 -0
- package/dist/report-render/figures/roc.js +116 -0
- package/dist/report-render/figures/sankey.d.ts +48 -0
- package/dist/report-render/figures/sankey.js +353 -0
- package/dist/report-render/figures/upset.d.ts +60 -0
- package/dist/report-render/figures/upset.js +316 -0
- package/dist/report-render/figures/volcano.d.ts +25 -0
- package/dist/report-render/figures/volcano.js +166 -0
- package/dist/report-render/hybrid-svg.d.ts +75 -0
- package/dist/report-render/hybrid-svg.js +504 -0
- package/dist/report-render/number-format.d.ts +19 -0
- package/dist/report-render/number-format.js +25 -1
- package/dist/report-render/page.d.ts +41 -4
- package/dist/report-render/page.js +247 -12
- package/dist/report-render/render.d.ts +13 -4
- package/dist/report-render/render.js +37 -6
- package/dist/report-render/types.d.ts +23 -2
- package/dist/report-render/value-bridge.d.ts +38 -3
- package/dist/report-render/value-bridge.js +137 -6
- package/dist/report-render/views/chart-view.d.ts +42 -6
- package/dist/report-render/views/chart-view.js +70 -9
- package/dist/report-render/views/page-view.js +9 -10
- package/dist/runtime/assemble.js +2 -2
- package/dist/sandbox/client.d.ts +23 -32
- package/dist/sandbox/client.js +3 -11
- package/dist/sandbox/create-sandbox.d.ts +9 -24
- package/dist/sandbox/create-sandbox.js +15 -30
- package/dist/sandbox/docker-client.d.ts +12 -22
- package/dist/sandbox/docker-client.js +29 -43
- package/dist/sandbox/exec.d.ts +58 -0
- package/dist/sandbox/exec.js +197 -0
- package/dist/sandbox/identity.d.ts +5 -5
- package/dist/sandbox/identity.js +7 -10
- package/dist/sandbox/k8s-client.d.ts +4 -10
- package/dist/sandbox/k8s-client.js +5 -12
- package/dist/sandbox/liveness.d.ts +5 -12
- package/dist/sandbox/liveness.js +5 -12
- package/dist/sandbox/notification-sweep.d.ts +4 -7
- package/dist/sandbox/notification-sweep.js +4 -7
- package/dist/sandbox/reaper.d.ts +3 -3
- package/dist/sandbox/reaper.js +3 -3
- package/dist/sandbox/sandbox-error.d.ts +10 -11
- package/dist/sandbox/sandbox-error.js +10 -11
- package/dist/sandbox/sandbox-step-translate.d.ts +1 -1
- package/dist/sandbox/sandbox-step-translate.js +1 -1
- package/dist/sandbox/types.d.ts +31 -99
- package/dist/sandbox/types.js +17 -84
- package/dist/state/active-sandboxes.d.ts +7 -32
- package/dist/state/active-sandboxes.js +11 -46
- package/dist/state/index.d.ts +1 -2
- package/dist/state/index.js +1 -1
- package/dist/state/migrations/20261005120000_drop_the_active_exec_tracking.d.ts +7 -0
- package/dist/state/migrations/20261005120000_drop_the_active_exec_tracking.js +12 -0
- package/dist/state/migrations/index.js +2 -0
- package/dist/state/schema.d.ts +1 -5
- package/dist/state/schema.js +1 -6
- package/dist/state/step-executions.js +1 -2
- package/dist/tasks/data-profile.js +7 -20
- package/dist/tasks/derive-table-exec.d.ts +4 -14
- package/dist/tasks/derive-table-exec.js +9 -24
- package/dist/tasks/extract-values.d.ts +2 -2
- package/dist/tasks/extract-values.js +4 -7
- package/dist/tools/define-tool.d.ts +56 -13
- package/dist/tools/define-tool.js +28 -1
- package/dist/tools/execute-analysis.js +3 -3
- package/dist/tools/report-session/derive-table.d.ts +8 -9
- package/dist/tools/report-session/derive-table.js +3 -4
- package/dist/tools/report-session/preview-report.js +4 -49
- package/dist/tools/sandbox/list-available-packages.d.ts +1 -1
- package/dist/tools/sandbox/list-available-packages.js +5 -4
- package/dist/tools/workspace/edit-file.d.ts +5 -4
- package/dist/tools/workspace/edit-file.js +10 -13
- package/dist/tools/workspace/execute-command.d.ts +27 -42
- package/dist/tools/workspace/execute-command.js +42 -38
- package/dist/tools/workspace/index.d.ts +5 -6
- package/dist/tools/workspace/index.js +5 -6
- package/dist/tools/workspace/mutator.d.ts +43 -8
- package/dist/tools/workspace/mutator.js +45 -34
- package/dist/tools/workspace/run-exec.d.ts +3 -12
- package/dist/tools/workspace/run-exec.js +7 -24
- package/dist/tools/workspace/scan-inputs.d.ts +0 -3
- package/dist/tools/workspace/scan-inputs.js +0 -1
- package/dist/tools/workspace/write-file.d.ts +12 -3
- package/dist/tools/workspace/write-file.js +17 -13
- package/dist/workflows/sandbox-step.d.ts +7 -11
- package/dist/workflows/sandbox-step.js +24 -27
- package/package.json +5 -3
- package/dist/sandbox/await-exec.d.ts +0 -143
- package/dist/sandbox/await-exec.js +0 -417
- package/dist/sandbox/deliver-exec-event.d.ts +0 -25
- package/dist/sandbox/deliver-exec-event.js +0 -29
- package/dist/sandbox/digest.d.ts +0 -14
- package/dist/sandbox/digest.js +0 -17
- package/dist/sandbox/exec-id.d.ts +0 -12
- package/dist/sandbox/exec-id.js +0 -20
- package/dist/sandbox/hmac.d.ts +0 -62
- package/dist/sandbox/hmac.js +0 -72
- package/dist/sandbox/submit-exec.d.ts +0 -38
- package/dist/sandbox/submit-exec.js +0 -80
- package/dist/sandbox/watchdog.d.ts +0 -71
- package/dist/sandbox/watchdog.js +0 -161
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared parts of each chart: the axis builders, the guide lines, the statistics text, the color scale,
|
|
3
|
+
* the size legend, the categorical palette, and the legend icons.
|
|
4
|
+
*
|
|
5
|
+
* The shared chart path of `chart.ts` and each figure module read these helpers, and no figure writes an axis
|
|
6
|
+
* style of its own. Thus each rule of a publication figure holds in one place, and each chart of a page obeys
|
|
7
|
+
* it:
|
|
8
|
+
*
|
|
9
|
+
* - The y title turns 90 degrees and sits in the middle beside its axis. The x title sits in the middle under
|
|
10
|
+
* its axis.
|
|
11
|
+
* - A category axis shows a title only where the block declares one. A value axis always shows a title.
|
|
12
|
+
* - A guide line is thin, gray, and dashed. Its label sits inside the plot at the far end of the line, thus it
|
|
13
|
+
* never covers a tick label.
|
|
14
|
+
* - A continuous color scale prints its title and its two ends as static text, and it shows no drag control.
|
|
15
|
+
* - Eight categories or fewer take the Okabe-Ito palette, and more take the wide palette.
|
|
16
|
+
* - A legend icon matches the form of its series.
|
|
17
|
+
*
|
|
18
|
+
* Each helper gives plain data, because the option rides to the page as inline JSON.
|
|
19
|
+
*/
|
|
20
|
+
import { type Result } from "neverthrow";
|
|
21
|
+
import { type ChannelOrder, type ChartEncoding, type ChartTransform } from "../../contracts/report-blocks.js";
|
|
22
|
+
import { type ArtifactTableReference, type ColumnMeaning } from "../../contracts/report-reference.js";
|
|
23
|
+
import type { Cell, ChartRow, EchartOption } from "../chart.js";
|
|
24
|
+
import type { RenderProblem } from "../types.js";
|
|
25
|
+
/** The display labels that a bound table declares, keyed by the raw column name. */
|
|
26
|
+
export type ColumnLabels = ArtifactTableReference["columnLabels"];
|
|
27
|
+
/** The column meanings that a bound table declares, keyed by the raw column name. */
|
|
28
|
+
export type ColumnMeanings = ArtifactTableReference["columnMeanings"];
|
|
29
|
+
/** A typed `invalid-chart-input` problem that names the block and the cause. */
|
|
30
|
+
export declare function chartProblem(blockId: string, detail: string): RenderProblem;
|
|
31
|
+
/** Convert one cell to a finite number, or `null` when it is absent or not numeric. */
|
|
32
|
+
export declare function toNumber(cell: Cell | null | undefined): number | null;
|
|
33
|
+
/**
|
|
34
|
+
* The legend text of one category value: the value with each underscore as a space.
|
|
35
|
+
*
|
|
36
|
+
* An analysis column carries a machine category such as `up_in_nonresponders`, and a legend reads for a
|
|
37
|
+
* person. The replacement reads no locale, thus the same value gives the same text on every host. The raw
|
|
38
|
+
* value stays in the data rows, thus the provenance loses nothing.
|
|
39
|
+
*/
|
|
40
|
+
export declare function categoryName(value: Cell): string;
|
|
41
|
+
/**
|
|
42
|
+
* The lane of each span in turn, for at most `count` spans: the lowest lane whose last span ends under the start
|
|
43
|
+
* of the next span, else a new lane under the others.
|
|
44
|
+
*
|
|
45
|
+
* A tree over the lanes holds the least end of each range of lanes, thus the lowest free lane takes one walk down
|
|
46
|
+
* the tree, and a track of many overlapping spans takes linear-logarithmic time. A lane that holds no span yet
|
|
47
|
+
* ends at minus infinity, thus the lowest such lane is the next new lane.
|
|
48
|
+
*/
|
|
49
|
+
export declare function firstFreeLanes(count: number): (start: number, end: number) => number;
|
|
50
|
+
/** The distinct values in first-appearance order. */
|
|
51
|
+
export declare function firstAppearance<T>(values: readonly T[]): T[];
|
|
52
|
+
/** True when the column exists in the declared header, or in one row at least. */
|
|
53
|
+
export declare function columnPresent(column: string, rows: readonly Record<string, Cell>[], columns: readonly string[] | undefined): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Compare two cells for a sort by x, and for a rank rule.
|
|
56
|
+
*
|
|
57
|
+
* A pair that both hold a finite number compares by that number. A text-backed table gives each cell as a
|
|
58
|
+
* string, thus a code-unit order would put `"10"` between `"1"` and `"2"` and a time axis would run out of
|
|
59
|
+
* order. Any other pair compares by the code-unit order of the string form.
|
|
60
|
+
*
|
|
61
|
+
* The comparison never calls `localeCompare`, thus the order stays the same on every host.
|
|
62
|
+
*/
|
|
63
|
+
export declare function compareCell(a: Cell, b: Cell): number;
|
|
64
|
+
/**
|
|
65
|
+
* Sort the categories of one channel by the value of its order column.
|
|
66
|
+
*
|
|
67
|
+
* The key of a category is the cell of the order column in each row of that category, and it must be one
|
|
68
|
+
* value across those rows. A category whose rows disagree has no one place, thus it refuses and names the
|
|
69
|
+
* category. The compare of the sort reads two numbers as numbers and anything else as text. The sort is
|
|
70
|
+
* stable and a descending order negates the compare, thus a tie keeps the first appearance in both
|
|
71
|
+
* directions.
|
|
72
|
+
*
|
|
73
|
+
* `categoryAt` gives the category of one row, or no value for a row that draws none, and `keyAt` gives the
|
|
74
|
+
* cell of the order column of one row. The categories and the rows match by their text, thus a category list
|
|
75
|
+
* of strings and a column of numbers still meet. A row that lacks the order cell gives its category no place,
|
|
76
|
+
* thus it refuses.
|
|
77
|
+
*/
|
|
78
|
+
export declare function orderCategories<T extends Cell>(blockId: string, rowCount: number, categoryAt: (index: number) => Cell | null | undefined, categories: readonly T[], order: ChannelOrder | undefined, keyAt: (index: number) => Cell | undefined): Result<T[], RenderProblem>;
|
|
79
|
+
/**
|
|
80
|
+
* Sort the categories of one quick-path channel that reads a plain column, by the order of that channel.
|
|
81
|
+
* The row of each category reads the category column and the order column of the same row.
|
|
82
|
+
*/
|
|
83
|
+
export declare function orderQuickCategories(blockId: string, rows: readonly ChartRow[], column: string, order: ChannelOrder | undefined): Result<Cell[], RenderProblem>;
|
|
84
|
+
/** One channel of the quick-path encoding that names one column. */
|
|
85
|
+
export type ColumnChannel = Exclude<keyof ChartEncoding, "label" | "tracks">;
|
|
86
|
+
/** The table that a figure reads a channel from: the block, the rows, and the declared column order. */
|
|
87
|
+
export interface ChannelSource {
|
|
88
|
+
readonly blockId: string;
|
|
89
|
+
readonly rows: readonly ChartRow[];
|
|
90
|
+
readonly columns?: readonly string[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The column of one channel that a figure reads as a plain column, or `undefined` where the block names no
|
|
94
|
+
* such channel.
|
|
95
|
+
*
|
|
96
|
+
* A figure reads the cells of such a channel as they are. Thus a transform or an order on the channel would
|
|
97
|
+
* do nothing, and it refuses. A column that no row holds refuses, as it does on every other chart.
|
|
98
|
+
*/
|
|
99
|
+
export declare function plainColumn(figure: string, encoding: ChartEncoding, channel: ColumnChannel, source: ChannelSource): Result<string | undefined, RenderProblem>;
|
|
100
|
+
/** The column of one channel that a figure demands, read as a plain column. An absent channel refuses. */
|
|
101
|
+
export declare function demandedColumn(figure: string, encoding: ChartEncoding, channel: ColumnChannel, source: ChannelSource): Result<string, RenderProblem>;
|
|
102
|
+
/**
|
|
103
|
+
* The transformed value of one column, one entry for each row. A row with no usable cell gives `null`.
|
|
104
|
+
*
|
|
105
|
+
* The page-side series build holds the twin of this function, because a chart that reads the payload
|
|
106
|
+
* transforms its columns in the browser. A shared test vector runs the two over one set of cells, thus the
|
|
107
|
+
* two cannot give different numbers in silence.
|
|
108
|
+
*/
|
|
109
|
+
export declare function transformColumn(rows: readonly ChartRow[], column: string, transform: ChartTransform): (number | null)[];
|
|
110
|
+
/**
|
|
111
|
+
* The distance in pixels between the x axis line and its name.
|
|
112
|
+
*
|
|
113
|
+
* The name sits under the middle of the axis, thus the gap must clear the axis labels below the line. The
|
|
114
|
+
* value is a fixed constant, thus the derivation stays deterministic.
|
|
115
|
+
*/
|
|
116
|
+
export declare const X_AXIS_NAME_GAP = 34;
|
|
117
|
+
/**
|
|
118
|
+
* The distance in pixels between the tick labels of the y axis and its name.
|
|
119
|
+
*
|
|
120
|
+
* The chart runtime moves a name that overlaps the tick labels past them, and the gap then counts from the
|
|
121
|
+
* labels. Thus a long tick label never runs under the title.
|
|
122
|
+
*/
|
|
123
|
+
export declare const Y_AXIS_NAME_GAP = 10;
|
|
124
|
+
/**
|
|
125
|
+
* The name fields of one axis, or no field where the axis carries no title.
|
|
126
|
+
*
|
|
127
|
+
* The x title sits under the middle of the axis. The y title turns 90 degrees and sits in the middle beside
|
|
128
|
+
* the axis, thus it reads along the axis and it takes no width from the plot.
|
|
129
|
+
*/
|
|
130
|
+
export declare function axisNameFields(axis: "x" | "y", title: string | undefined): EchartOption;
|
|
131
|
+
/**
|
|
132
|
+
* The title of a quantity under one per-row transform, for example `log10(Normalized count)` or
|
|
133
|
+
* `−log10(Adjusted p-value)`. The minus sign is the character, not a hyphen.
|
|
134
|
+
*/
|
|
135
|
+
export declare function transformedTitle(transform: ChartTransform, base: string): string;
|
|
136
|
+
/**
|
|
137
|
+
* The labels of a bound table with one more entry for each transformed channel whose column declares a label.
|
|
138
|
+
* The derived name of the channel maps to the label inside the transform, thus an axis over the channel reads
|
|
139
|
+
* `log10(Normalized count)` and never `log10(normalized_count)`. A derived name that the table declares itself
|
|
140
|
+
* keeps its own label, and a column with no label keeps the derived name.
|
|
141
|
+
*/
|
|
142
|
+
export declare function withTransformedLabels(labels: ColumnLabels, channels: ReadonlyArray<{
|
|
143
|
+
readonly name: string;
|
|
144
|
+
readonly column: string;
|
|
145
|
+
readonly transform?: ChartTransform;
|
|
146
|
+
}>): ColumnLabels;
|
|
147
|
+
/**
|
|
148
|
+
* The title of a value axis that reads one column, most specific first: the declared label of the column, the
|
|
149
|
+
* semantic title of the preset, then the raw column name.
|
|
150
|
+
*
|
|
151
|
+
* A declared label answers for this one column of this one artifact, and a preset title answers for every
|
|
152
|
+
* chart of its kind. Thus the label outranks the preset. The caller resolves an agent axes title over this
|
|
153
|
+
* whole chain, because that title names this one axis of this one block.
|
|
154
|
+
*/
|
|
155
|
+
export declare function valueAxisTitle(labels: ColumnLabels, column: string, preset?: string): string;
|
|
156
|
+
/**
|
|
157
|
+
* The title of a category axis, or `undefined` where the block declares none.
|
|
158
|
+
*
|
|
159
|
+
* The category names already state what the axis holds, and a raw column name such as `cluster` or `sample`
|
|
160
|
+
* repeats them in machine text. Thus a category axis carries a title only where the author declared one: an
|
|
161
|
+
* axes title of the block, or the label of the column.
|
|
162
|
+
*/
|
|
163
|
+
export declare function categoryAxisTitle(labels: ColumnLabels, column: string, declared?: string): string | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* One value axis: the axis type, a fitted range where the chart asks for one, and the name fields.
|
|
166
|
+
*
|
|
167
|
+
* `scale` fits the range to the data, and a bar leaves it out because a bar measures from zero. `log` gives
|
|
168
|
+
* the logarithmic axis type.
|
|
169
|
+
*/
|
|
170
|
+
export declare function valueAxis(axis: "x" | "y", title: string, fields?: {
|
|
171
|
+
scale?: boolean;
|
|
172
|
+
log?: boolean;
|
|
173
|
+
min?: number;
|
|
174
|
+
max?: number;
|
|
175
|
+
}): EchartOption;
|
|
176
|
+
/**
|
|
177
|
+
* One category axis: the categories in their order, the direction, and the declared title alone.
|
|
178
|
+
*
|
|
179
|
+
* `topDown` inverts a y axis. The chart runtime draws the first category of a y axis at the origin, thus a
|
|
180
|
+
* table that reads top-down needs the inverted axis to put its first row at the top.
|
|
181
|
+
*/
|
|
182
|
+
export declare function categoryAxis(axis: "x" | "y", categories: readonly Cell[], fields?: {
|
|
183
|
+
title?: string;
|
|
184
|
+
topDown?: boolean;
|
|
185
|
+
}): EchartOption;
|
|
186
|
+
/** The stroke of each guide line. */
|
|
187
|
+
export declare const GUIDE_LINE_STYLE: EchartOption;
|
|
188
|
+
/**
|
|
189
|
+
* The label place of each guide line: inside the plot, at the far end of the line.
|
|
190
|
+
*
|
|
191
|
+
* A vertical line ends at the top of the plot and a horizontal line ends at the right edge. Both ends lie away
|
|
192
|
+
* from the tick labels, thus a guide label never covers a tick.
|
|
193
|
+
*/
|
|
194
|
+
export declare const GUIDE_LABEL_POSITION = "insideEndTop";
|
|
195
|
+
/**
|
|
196
|
+
* One guide line of a mark member: a constant on one axis, and its label.
|
|
197
|
+
*
|
|
198
|
+
* A guide with no text shows no label. The runtime would print the constant there, and a bare number beside a
|
|
199
|
+
* line reads as a plotted value.
|
|
200
|
+
*/
|
|
201
|
+
export declare function guideLine(axis: "x" | "y", value: number, label?: string): EchartOption;
|
|
202
|
+
/** The mark member of some guide lines, in the one guide style. */
|
|
203
|
+
export declare function guideMarkLine(lines: readonly EchartOption[]): EchartOption;
|
|
204
|
+
/**
|
|
205
|
+
* One statistic that a figure prints: the label of the block, the resolved value, and the shown text of the
|
|
206
|
+
* value.
|
|
207
|
+
*/
|
|
208
|
+
export interface FigureStatistic {
|
|
209
|
+
readonly label: string;
|
|
210
|
+
readonly value: string | number;
|
|
211
|
+
readonly text: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The shown text of one statistic, in the number format of its column, with the power of ten of a figure, and
|
|
215
|
+
* the unit of its reference after it.
|
|
216
|
+
*
|
|
217
|
+
* The kind follows the column of the locator, as a table cell does. Thus a p-value prints in the scientific
|
|
218
|
+
* form, for example `1.3 × 10⁻³`, and a stored zero of a p-value prints the below-resolution form and never a
|
|
219
|
+
* bare zero. A percent sign joins its value, for example `27.5%`, and every other unit follows a space, for
|
|
220
|
+
* example `426 days`.
|
|
221
|
+
*/
|
|
222
|
+
export declare function statisticText(value: string | number, column: string, unit?: string): string;
|
|
223
|
+
/** The four corners of a plot where a figure prints its statistics. */
|
|
224
|
+
export type PlotCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
225
|
+
/**
|
|
226
|
+
* The statistics of a figure as one text element inside the plot: one line for each statistic, in block
|
|
227
|
+
* order, in the form `label = value`.
|
|
228
|
+
*
|
|
229
|
+
* A `graphic` element sits at a place of the chart and reads no data coordinate, thus the figure names the
|
|
230
|
+
* corner that its field uses. A figure with no statistic gives no element.
|
|
231
|
+
*/
|
|
232
|
+
export declare function statisticsGraphic(statistics: readonly FigureStatistic[], corner: PlotCorner): EchartOption[];
|
|
233
|
+
/** The inset of a statistics text from its data corner, in pixels. */
|
|
234
|
+
export declare const STATISTICS_POINT_INSET_PX = 8;
|
|
235
|
+
/**
|
|
236
|
+
* The statistics of a figure as the label of one point of no size at a corner of the data: one line for each
|
|
237
|
+
* statistic, in block order, in the form `label = value`.
|
|
238
|
+
*
|
|
239
|
+
* A `graphic` element sits at a place of the container, and a plot whose size follows the container moves
|
|
240
|
+
* away from it. A point sits in the data, thus its label stays at the corner of the plot in every container
|
|
241
|
+
* and in every export. The corner names the side of the point that the text takes. The label reads the text
|
|
242
|
+
* from the name of the point, thus no character of a statistic reads as a template of the chart runtime. A
|
|
243
|
+
* figure with no statistic gives no series.
|
|
244
|
+
*/
|
|
245
|
+
export declare function statisticsSeries(statistics: readonly FigureStatistic[], point: readonly [number, number], corner: PlotCorner): EchartOption[];
|
|
246
|
+
/** The range and the ramp of one continuous color. */
|
|
247
|
+
export interface ContinuousScale {
|
|
248
|
+
readonly min: number;
|
|
249
|
+
readonly max: number;
|
|
250
|
+
readonly ramp: readonly string[];
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* The scale of one continuous color over its values.
|
|
254
|
+
*
|
|
255
|
+
* A column whose values cross zero takes the diverging ramp, centered on zero, thus a negative value and a
|
|
256
|
+
* positive value of one size read as two colors of one strength. Every other column takes the sequential
|
|
257
|
+
* ramp over its own range. The extent reads the values in one pass, thus a large column never spreads onto
|
|
258
|
+
* the call stack.
|
|
259
|
+
*/
|
|
260
|
+
export declare function continuousScale(values: readonly number[]): ContinuousScale;
|
|
261
|
+
/** The shown text of one end of a scale over one column, in the number format of that column, with the power of ten of a figure. */
|
|
262
|
+
export declare function scaleEndText(end: number, column: string, meaning?: ColumnMeaning): string;
|
|
263
|
+
/**
|
|
264
|
+
* The members of one continuous color map: the range, the place at the right edge of the plot, the title and
|
|
265
|
+
* the two ends as static text, and the ramp.
|
|
266
|
+
*
|
|
267
|
+
* The map shows no drag control, because a figure is a still image and a handle would print its own raw
|
|
268
|
+
* value. The number helper formats each end, thus the scale and a table cell of one column read alike. The
|
|
269
|
+
* title and the upper end share the top text, one line each, and the lower end sits under the bar.
|
|
270
|
+
*/
|
|
271
|
+
export declare function colorScale(scale: ContinuousScale, title: string, column: string, meaning?: ColumnMeaning): EchartOption;
|
|
272
|
+
/**
|
|
273
|
+
* The size legend of a size channel: the title, and three reference circles with their values.
|
|
274
|
+
*
|
|
275
|
+
* The circles show the smallest value, the middle of the range, and the largest value, at the symbol size
|
|
276
|
+
* that the size map gives each one. The number helper formats each value. The legend is one `graphic` group,
|
|
277
|
+
* thus a figure places it where its field puts it. A range of one value gives one circle.
|
|
278
|
+
*/
|
|
279
|
+
export declare function sizeLegend(range: {
|
|
280
|
+
readonly min: number;
|
|
281
|
+
readonly max: number;
|
|
282
|
+
}, title: string, column: string, place: EchartOption, meaning?: ColumnMeaning): EchartOption;
|
|
283
|
+
/** The categorical palette of a chart that draws `count` categories. */
|
|
284
|
+
export declare function categoricalPalette(count: number): readonly string[];
|
|
285
|
+
/**
|
|
286
|
+
* The count of lines that the entries of a horizontal legend fill at one width, at one text size. An entry is
|
|
287
|
+
* the icon of the text size, the gap to its text, and the text. The entries fill each line in order, one item
|
|
288
|
+
* gap apart. The export estimates the lines of a legend with the same rule.
|
|
289
|
+
*/
|
|
290
|
+
export declare function legendLineCount(entries: readonly string[], widthPx: number, textPx: number): number;
|
|
291
|
+
/** The height of one line of a legend at one text size, in pixels: the text and the item gap under it. */
|
|
292
|
+
export declare function legendLinePx(textPx: number, itemGapPx?: number): number;
|
|
293
|
+
/**
|
|
294
|
+
* The legend icon of a line and of a step: a flat bar of eight units by one. The legend keeps the aspect of
|
|
295
|
+
* the path, thus the icon draws as a short line at the width of one legend item.
|
|
296
|
+
*/
|
|
297
|
+
export declare const LINE_LEGEND_ICON = "path://M0,0H8V1H0Z";
|
|
298
|
+
/** The legend icon of a bar, an area, a box, and a shape: a filled square. */
|
|
299
|
+
export declare const AREA_LEGEND_ICON = "rect";
|
|
300
|
+
/** The legend icon of a point. */
|
|
301
|
+
export declare const POINT_LEGEND_ICON = "circle";
|
|
302
|
+
/** The legend icon of one runtime series, by its form. */
|
|
303
|
+
export declare function legendIconOf(series: EchartOption): string;
|
|
304
|
+
/**
|
|
305
|
+
* The figure rules that read the whole option: the wide palette past eight categories, the icon of each
|
|
306
|
+
* legend entry, and the title of each axis off its labels.
|
|
307
|
+
*
|
|
308
|
+
* The derivation and each figure module give an option, and this pass runs on it after the layout discipline.
|
|
309
|
+
* An option that states its own palette keeps it.
|
|
310
|
+
*/
|
|
311
|
+
export declare function applyFigureRules(option: EchartOption): EchartOption;
|
|
312
|
+
/**
|
|
313
|
+
* The option member in which a figure states the height of the page chart body that it needs, in pixels.
|
|
314
|
+
*
|
|
315
|
+
* A figure of many rows, for example a heatmap of many genes, needs a body taller than the default body to
|
|
316
|
+
* print each row name. The chart runtime reads no such field, and the render takes the member off the option
|
|
317
|
+
* before the option reaches the page or the export.
|
|
318
|
+
*/
|
|
319
|
+
export declare const FIGURE_BODY_MEMBER = "reportFigureBodyPx";
|
|
320
|
+
/** One option with the height of the chart body that its figure needs, bounded by the largest body. */
|
|
321
|
+
export declare function withFigureBody(option: EchartOption, bodyPx: number): EchartOption;
|