@nakafa/aksara-contracts 8.2.0 → 8.4.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/dist/math/boundary.d.ts +9 -0
- package/dist/math/boundary.js +81 -0
- package/dist/math/curve.d.ts +1 -0
- package/dist/math/curve.js +4 -2
- package/dist/math/formula/affine.d.ts +22 -0
- package/dist/math/formula/affine.js +79 -0
- package/dist/math/formula/contour.js +27 -12
- package/dist/math/object.d.ts +12 -0
- package/dist/math/object.js +11 -0
- package/dist/math/plane.d.ts +10 -0
- package/dist/math/plane.js +7 -1
- package/dist/math/space.d.ts +8 -0
- package/dist/math/space.js +5 -1
- package/dist/math/visual.d.ts +239 -212
- package/dist/visual/base/math.d.ts +78 -0
- package/dist/visual/base/math.js +31 -3
- package/dist/visual/base/media.d.ts +67 -0
- package/dist/visual/biology/bacteria.d.ts +268 -0
- package/dist/visual/biology/cell.d.ts +201 -0
- package/dist/visual/biology/climate.d.ts +201 -0
- package/dist/visual/biology/ecology.d.ts +268 -0
- package/dist/visual/biology/physiology.d.ts +201 -0
- package/dist/visual/biology/plant.d.ts +335 -0
- package/dist/visual/card.d.ts +79 -1
- package/dist/visual/card.js +18 -2
- package/dist/visual/catalog.d.ts +14164 -2
- package/dist/visual/catalog.js +4 -0
- package/dist/visual/chemistry/atom.d.ts +201 -0
- package/dist/visual/chemistry/balance.d.ts +335 -0
- package/dist/visual/chemistry/bonding.d.ts +335 -0
- package/dist/visual/chemistry/discovery.d.ts +469 -0
- package/dist/visual/chemistry/electrochemistry.d.ts +134 -0
- package/dist/visual/chemistry/electron.d.ts +134 -0
- package/dist/visual/chemistry/laws.d.ts +268 -0
- package/dist/visual/chemistry/particles.d.ts +335 -0
- package/dist/visual/chemistry/periodic.d.ts +134 -0
- package/dist/visual/chemistry/rate.d.ts +67 -0
- package/dist/visual/chemistry/reaction.d.ts +201 -0
- package/dist/visual/chemistry/titration.d.ts +67 -0
- package/dist/visual/length.d.ts +79 -0
- package/dist/visual/length.js +37 -0
- package/dist/visual/mathematics/chance.d.ts +258 -0
- package/dist/visual/mathematics/chance.js +117 -0
- package/dist/visual/mathematics/chart.d.ts +67 -0
- package/dist/visual/mathematics/charts.d.ts +335 -0
- package/dist/visual/mathematics/function.d.ts +201 -0
- package/dist/visual/mathematics/numeral.d.ts +170 -0
- package/dist/visual/mathematics/numeral.js +85 -0
- package/dist/visual/physics/braking.d.ts +268 -0
- package/dist/visual/physics/circuit.d.ts +268 -0
- package/dist/visual/physics/circular.d.ts +134 -0
- package/dist/visual/physics/dynamics.d.ts +469 -0
- package/dist/visual/physics/efficiency.d.ts +402 -0
- package/dist/visual/physics/electronics.d.ts +201 -0
- package/dist/visual/physics/falling.d.ts +268 -0
- package/dist/visual/physics/field.d.ts +201 -0
- package/dist/visual/physics/fluid.d.ts +268 -0
- package/dist/visual/physics/force.d.ts +335 -0
- package/dist/visual/physics/gravity.d.ts +134 -0
- package/dist/visual/physics/heat.d.ts +201 -0
- package/dist/visual/physics/instrument.d.ts +469 -0
- package/dist/visual/physics/light.d.ts +268 -0
- package/dist/visual/physics/measurement.d.ts +268 -0
- package/dist/visual/physics/motion.d.ts +402 -0
- package/dist/visual/physics/nuclear.d.ts +201 -0
- package/dist/visual/physics/parabolic.d.ts +67 -0
- package/dist/visual/physics/position.d.ts +402 -0
- package/dist/visual/physics/power.d.ts +536 -0
- package/dist/visual/physics/precision.d.ts +469 -0
- package/dist/visual/physics/product.d.ts +268 -0
- package/dist/visual/physics/reading.d.ts +201 -0
- package/dist/visual/physics/record.d.ts +134 -0
- package/dist/visual/physics/relative.d.ts +201 -0
- package/dist/visual/physics/solar.d.ts +402 -0
- package/dist/visual/physics/vector.d.ts +335 -0
- package/dist/visual/physics/velocity.d.ts +469 -0
- package/dist/visual/physics/wave.d.ts +268 -0
- package/dist/visual/politics.d.ts +402 -0
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Array as Arr, Schema } from "effect";
|
|
2
|
+
import { byIds, cardFields, TextSchema, } from "#contracts/visual/card";
|
|
3
|
+
import { answerAt, figure } from "#contracts/visual/entry";
|
|
4
|
+
/** The marble glazes the jar can hold. */
|
|
5
|
+
const MARBLE_COLORS = ["red", "blue", "green", "yellow", "white"];
|
|
6
|
+
/** How a marble drawn first is handled before the second draw. */
|
|
7
|
+
const DRAW_RULES = ["replace", "keep"];
|
|
8
|
+
/** The most marbles the jar holds below its shoulder. */
|
|
9
|
+
const JAR_CAPACITY = 24;
|
|
10
|
+
/** One colour of marble in the jar and how many of it. */
|
|
11
|
+
const MarbleGroupSchema = Schema.Struct({
|
|
12
|
+
color: Schema.Literals(MARBLE_COLORS),
|
|
13
|
+
count: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
14
|
+
});
|
|
15
|
+
/** Whether each colour appears once and the jar holds them all. */
|
|
16
|
+
function fitsJar(groups) {
|
|
17
|
+
const colors = Arr.map(groups, (group) => group.color);
|
|
18
|
+
const total = Arr.reduce(groups, 0, (sum, group) => sum + group.count);
|
|
19
|
+
return Arr.dedupe(colors).length === colors.length && total <= JAR_CAPACITY;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Props of `MarbleDrawLab`: a jar of mixed marbles from which two are drawn
|
|
23
|
+
* one after the other, a thousand times over, with or without putting the
|
|
24
|
+
* first back. A tally board keeps the colours of the last trials. With
|
|
25
|
+
* `event`, the footer reads the probability of each draw, their product, and
|
|
26
|
+
* the share of trials that matched, so it is answer state.
|
|
27
|
+
*/
|
|
28
|
+
function marbleDrawLab(rich) {
|
|
29
|
+
return figure(Schema.Struct({
|
|
30
|
+
...cardFields(rich),
|
|
31
|
+
event: Schema.optionalKey(Schema.Struct({
|
|
32
|
+
first: Schema.Literals(MARBLE_COLORS),
|
|
33
|
+
second: Schema.Literals(MARBLE_COLORS),
|
|
34
|
+
})),
|
|
35
|
+
labels: Schema.Struct({
|
|
36
|
+
both: rich,
|
|
37
|
+
first: rich,
|
|
38
|
+
frequency: rich,
|
|
39
|
+
rule: TextSchema,
|
|
40
|
+
rules: byIds(DRAW_RULES, TextSchema),
|
|
41
|
+
second: rich,
|
|
42
|
+
trials: rich,
|
|
43
|
+
viewLabel: TextSchema,
|
|
44
|
+
}),
|
|
45
|
+
marbles: Schema.NonEmptyArray(MarbleGroupSchema).check(Schema.makeFilter(fitsJar, {
|
|
46
|
+
message: `Expected each colour once and ${JAR_CAPACITY} marbles at most.`,
|
|
47
|
+
})),
|
|
48
|
+
rule: Schema.optionalKey(Schema.Literals(DRAW_RULES)),
|
|
49
|
+
}), answerAt(["event"]));
|
|
50
|
+
}
|
|
51
|
+
/** How many dice the tray rolls at once. */
|
|
52
|
+
const DICE_COUNTS = [1, 2];
|
|
53
|
+
/** The dice a dice lab rolls and the outcome it counts. */
|
|
54
|
+
const DiceTargetSchema = Schema.Struct({
|
|
55
|
+
dice: Schema.Literals(DICE_COUNTS),
|
|
56
|
+
target: Schema.optionalKey(Schema.Int),
|
|
57
|
+
});
|
|
58
|
+
/** Whether the target can show: a face 1 to 6 of one die, or a sum 2 to 12 of two. */
|
|
59
|
+
function canShow({ dice, target }) {
|
|
60
|
+
return target === undefined || (target >= dice && target <= 6 * dice);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Props of `DiceRollLab`: one or two dice rolled three hundred times in a
|
|
64
|
+
* felt tray, each roll adding a chip to its outcome's stack behind it. With
|
|
65
|
+
* `target`, that outcome's stack is highlighted and the footer reads how
|
|
66
|
+
* many rolls showed it, their share, and its probability, so it is answer
|
|
67
|
+
* state.
|
|
68
|
+
*/
|
|
69
|
+
function diceRollLab(rich) {
|
|
70
|
+
return figure(Schema.Struct({
|
|
71
|
+
...cardFields(rich),
|
|
72
|
+
...DiceTargetSchema.fields,
|
|
73
|
+
labels: Schema.Struct({
|
|
74
|
+
frequency: rich,
|
|
75
|
+
hits: rich,
|
|
76
|
+
probability: rich,
|
|
77
|
+
trials: rich,
|
|
78
|
+
viewLabel: TextSchema,
|
|
79
|
+
}),
|
|
80
|
+
}).check(Schema.makeFilter(canShow, {
|
|
81
|
+
message: "Expected a target the dice can show: 1 to 6 for one die, 2 to 12 for two.",
|
|
82
|
+
})), answerAt(["target"]));
|
|
83
|
+
}
|
|
84
|
+
/** The chances a Galton board's pins send a ball right: leaning left, upright, leaning right. */
|
|
85
|
+
const GALTON_BIASES = [0.3, 0.5, 0.7];
|
|
86
|
+
/**
|
|
87
|
+
* Props of `GaltonBoardLab`: a walnut Galton board through whose `rows` rows
|
|
88
|
+
* of pins three hundred balls drop, each pin sending a ball right with
|
|
89
|
+
* `probability`. With `showExpected`, marks on the glass show the counts the
|
|
90
|
+
* binomial formula expects, and the footer reads the mean, the standard
|
|
91
|
+
* deviation and the chance of the most likely bin, so it is answer state.
|
|
92
|
+
*/
|
|
93
|
+
function galtonBoardLab(rich) {
|
|
94
|
+
return figure(Schema.Struct({
|
|
95
|
+
...cardFields(rich),
|
|
96
|
+
labels: Schema.Struct({
|
|
97
|
+
balls: rich,
|
|
98
|
+
expected: rich,
|
|
99
|
+
mean: rich,
|
|
100
|
+
rows: TextSchema,
|
|
101
|
+
spread: rich,
|
|
102
|
+
tilt: TextSchema,
|
|
103
|
+
viewLabel: TextSchema,
|
|
104
|
+
}),
|
|
105
|
+
probability: Schema.Literals(GALTON_BIASES),
|
|
106
|
+
rows: Schema.Int.check(Schema.isBetween({ maximum: 12, minimum: 4 })),
|
|
107
|
+
showExpected: Schema.optionalKey(Schema.Boolean),
|
|
108
|
+
}), answerAt(["showExpected"]));
|
|
109
|
+
}
|
|
110
|
+
/** The probability labs, where a random experiment runs many times. */
|
|
111
|
+
export function chanceVisuals(rich) {
|
|
112
|
+
return {
|
|
113
|
+
DiceRollLab: diceRollLab(rich),
|
|
114
|
+
GaltonBoardLab: galtonBoardLab(rich),
|
|
115
|
+
MarbleDrawLab: marbleDrawLab(rich),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -9,6 +9,73 @@ import { type RichSlot } from "#contracts/visual/card";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function chartProps<E>(rich: RichSlot<E>): import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
11
11
|
readonly description: RichSlot<E>;
|
|
12
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
13
|
+
readonly attrs: {
|
|
14
|
+
readonly latex: string;
|
|
15
|
+
};
|
|
16
|
+
readonly type: "mathInline";
|
|
17
|
+
} | {
|
|
18
|
+
readonly marks?: readonly [{
|
|
19
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
20
|
+
} | {
|
|
21
|
+
readonly attrs: {
|
|
22
|
+
readonly href: string;
|
|
23
|
+
};
|
|
24
|
+
readonly type: "link";
|
|
25
|
+
} | {
|
|
26
|
+
readonly attrs: {
|
|
27
|
+
readonly variant: "success" | "warning" | null;
|
|
28
|
+
};
|
|
29
|
+
readonly type: "highlight";
|
|
30
|
+
}, ...({
|
|
31
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
32
|
+
} | {
|
|
33
|
+
readonly attrs: {
|
|
34
|
+
readonly href: string;
|
|
35
|
+
};
|
|
36
|
+
readonly type: "link";
|
|
37
|
+
} | {
|
|
38
|
+
readonly attrs: {
|
|
39
|
+
readonly variant: "success" | "warning" | null;
|
|
40
|
+
};
|
|
41
|
+
readonly type: "highlight";
|
|
42
|
+
})[]];
|
|
43
|
+
readonly text: string;
|
|
44
|
+
readonly type: "text";
|
|
45
|
+
}, ...({
|
|
46
|
+
readonly attrs: {
|
|
47
|
+
readonly latex: string;
|
|
48
|
+
};
|
|
49
|
+
readonly type: "mathInline";
|
|
50
|
+
} | {
|
|
51
|
+
readonly marks?: readonly [{
|
|
52
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
53
|
+
} | {
|
|
54
|
+
readonly attrs: {
|
|
55
|
+
readonly href: string;
|
|
56
|
+
};
|
|
57
|
+
readonly type: "link";
|
|
58
|
+
} | {
|
|
59
|
+
readonly attrs: {
|
|
60
|
+
readonly variant: "success" | "warning" | null;
|
|
61
|
+
};
|
|
62
|
+
readonly type: "highlight";
|
|
63
|
+
}, ...({
|
|
64
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
65
|
+
} | {
|
|
66
|
+
readonly attrs: {
|
|
67
|
+
readonly href: string;
|
|
68
|
+
};
|
|
69
|
+
readonly type: "link";
|
|
70
|
+
} | {
|
|
71
|
+
readonly attrs: {
|
|
72
|
+
readonly variant: "success" | "warning" | null;
|
|
73
|
+
};
|
|
74
|
+
readonly type: "highlight";
|
|
75
|
+
})[]];
|
|
76
|
+
readonly text: string;
|
|
77
|
+
readonly type: "text";
|
|
78
|
+
})[]], E, never, never>>;
|
|
12
79
|
readonly title: RichSlot<E>;
|
|
13
80
|
/**
|
|
14
81
|
* How the bars of a chart that has bars stand: `apart` leaves a gap between
|
|
@@ -8,6 +8,73 @@ import { type RichSlot } from "#contracts/visual/card";
|
|
|
8
8
|
export declare function chartVisuals<E>(rich: RichSlot<E>): {
|
|
9
9
|
BarChart: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
10
10
|
readonly description: RichSlot<E>;
|
|
11
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
12
|
+
readonly attrs: {
|
|
13
|
+
readonly latex: string;
|
|
14
|
+
};
|
|
15
|
+
readonly type: "mathInline";
|
|
16
|
+
} | {
|
|
17
|
+
readonly marks?: readonly [{
|
|
18
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
19
|
+
} | {
|
|
20
|
+
readonly attrs: {
|
|
21
|
+
readonly href: string;
|
|
22
|
+
};
|
|
23
|
+
readonly type: "link";
|
|
24
|
+
} | {
|
|
25
|
+
readonly attrs: {
|
|
26
|
+
readonly variant: "success" | "warning" | null;
|
|
27
|
+
};
|
|
28
|
+
readonly type: "highlight";
|
|
29
|
+
}, ...({
|
|
30
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
31
|
+
} | {
|
|
32
|
+
readonly attrs: {
|
|
33
|
+
readonly href: string;
|
|
34
|
+
};
|
|
35
|
+
readonly type: "link";
|
|
36
|
+
} | {
|
|
37
|
+
readonly attrs: {
|
|
38
|
+
readonly variant: "success" | "warning" | null;
|
|
39
|
+
};
|
|
40
|
+
readonly type: "highlight";
|
|
41
|
+
})[]];
|
|
42
|
+
readonly text: string;
|
|
43
|
+
readonly type: "text";
|
|
44
|
+
}, ...({
|
|
45
|
+
readonly attrs: {
|
|
46
|
+
readonly latex: string;
|
|
47
|
+
};
|
|
48
|
+
readonly type: "mathInline";
|
|
49
|
+
} | {
|
|
50
|
+
readonly marks?: readonly [{
|
|
51
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
52
|
+
} | {
|
|
53
|
+
readonly attrs: {
|
|
54
|
+
readonly href: string;
|
|
55
|
+
};
|
|
56
|
+
readonly type: "link";
|
|
57
|
+
} | {
|
|
58
|
+
readonly attrs: {
|
|
59
|
+
readonly variant: "success" | "warning" | null;
|
|
60
|
+
};
|
|
61
|
+
readonly type: "highlight";
|
|
62
|
+
}, ...({
|
|
63
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
64
|
+
} | {
|
|
65
|
+
readonly attrs: {
|
|
66
|
+
readonly href: string;
|
|
67
|
+
};
|
|
68
|
+
readonly type: "link";
|
|
69
|
+
} | {
|
|
70
|
+
readonly attrs: {
|
|
71
|
+
readonly variant: "success" | "warning" | null;
|
|
72
|
+
};
|
|
73
|
+
readonly type: "highlight";
|
|
74
|
+
})[]];
|
|
75
|
+
readonly text: string;
|
|
76
|
+
readonly type: "text";
|
|
77
|
+
})[]], E, never, never>>;
|
|
11
78
|
readonly title: RichSlot<E>;
|
|
12
79
|
readonly chartConfig: Schema.$Record<Schema.Trimmed, Schema.Struct<{
|
|
13
80
|
readonly colors: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -40,6 +107,73 @@ export declare function chartVisuals<E>(rich: RichSlot<E>): {
|
|
|
40
107
|
}>, "figure">;
|
|
41
108
|
Chart: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
42
109
|
readonly description: RichSlot<E>;
|
|
110
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
111
|
+
readonly attrs: {
|
|
112
|
+
readonly latex: string;
|
|
113
|
+
};
|
|
114
|
+
readonly type: "mathInline";
|
|
115
|
+
} | {
|
|
116
|
+
readonly marks?: readonly [{
|
|
117
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
118
|
+
} | {
|
|
119
|
+
readonly attrs: {
|
|
120
|
+
readonly href: string;
|
|
121
|
+
};
|
|
122
|
+
readonly type: "link";
|
|
123
|
+
} | {
|
|
124
|
+
readonly attrs: {
|
|
125
|
+
readonly variant: "success" | "warning" | null;
|
|
126
|
+
};
|
|
127
|
+
readonly type: "highlight";
|
|
128
|
+
}, ...({
|
|
129
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
130
|
+
} | {
|
|
131
|
+
readonly attrs: {
|
|
132
|
+
readonly href: string;
|
|
133
|
+
};
|
|
134
|
+
readonly type: "link";
|
|
135
|
+
} | {
|
|
136
|
+
readonly attrs: {
|
|
137
|
+
readonly variant: "success" | "warning" | null;
|
|
138
|
+
};
|
|
139
|
+
readonly type: "highlight";
|
|
140
|
+
})[]];
|
|
141
|
+
readonly text: string;
|
|
142
|
+
readonly type: "text";
|
|
143
|
+
}, ...({
|
|
144
|
+
readonly attrs: {
|
|
145
|
+
readonly latex: string;
|
|
146
|
+
};
|
|
147
|
+
readonly type: "mathInline";
|
|
148
|
+
} | {
|
|
149
|
+
readonly marks?: readonly [{
|
|
150
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
151
|
+
} | {
|
|
152
|
+
readonly attrs: {
|
|
153
|
+
readonly href: string;
|
|
154
|
+
};
|
|
155
|
+
readonly type: "link";
|
|
156
|
+
} | {
|
|
157
|
+
readonly attrs: {
|
|
158
|
+
readonly variant: "success" | "warning" | null;
|
|
159
|
+
};
|
|
160
|
+
readonly type: "highlight";
|
|
161
|
+
}, ...({
|
|
162
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
163
|
+
} | {
|
|
164
|
+
readonly attrs: {
|
|
165
|
+
readonly href: string;
|
|
166
|
+
};
|
|
167
|
+
readonly type: "link";
|
|
168
|
+
} | {
|
|
169
|
+
readonly attrs: {
|
|
170
|
+
readonly variant: "success" | "warning" | null;
|
|
171
|
+
};
|
|
172
|
+
readonly type: "highlight";
|
|
173
|
+
})[]];
|
|
174
|
+
readonly text: string;
|
|
175
|
+
readonly type: "text";
|
|
176
|
+
})[]], E, never, never>>;
|
|
43
177
|
readonly title: RichSlot<E>;
|
|
44
178
|
readonly bars: Schema.optionalKey<Schema.Literals<readonly ["apart", "touching"]>>;
|
|
45
179
|
readonly categories: Schema.NonEmptyArray<Schema.Trimmed>;
|
|
@@ -56,6 +190,73 @@ export declare function chartVisuals<E>(rich: RichSlot<E>): {
|
|
|
56
190
|
}>, "figure">;
|
|
57
191
|
FunctionChart: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
58
192
|
readonly description: RichSlot<E>;
|
|
193
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
194
|
+
readonly attrs: {
|
|
195
|
+
readonly latex: string;
|
|
196
|
+
};
|
|
197
|
+
readonly type: "mathInline";
|
|
198
|
+
} | {
|
|
199
|
+
readonly marks?: readonly [{
|
|
200
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
201
|
+
} | {
|
|
202
|
+
readonly attrs: {
|
|
203
|
+
readonly href: string;
|
|
204
|
+
};
|
|
205
|
+
readonly type: "link";
|
|
206
|
+
} | {
|
|
207
|
+
readonly attrs: {
|
|
208
|
+
readonly variant: "success" | "warning" | null;
|
|
209
|
+
};
|
|
210
|
+
readonly type: "highlight";
|
|
211
|
+
}, ...({
|
|
212
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
213
|
+
} | {
|
|
214
|
+
readonly attrs: {
|
|
215
|
+
readonly href: string;
|
|
216
|
+
};
|
|
217
|
+
readonly type: "link";
|
|
218
|
+
} | {
|
|
219
|
+
readonly attrs: {
|
|
220
|
+
readonly variant: "success" | "warning" | null;
|
|
221
|
+
};
|
|
222
|
+
readonly type: "highlight";
|
|
223
|
+
})[]];
|
|
224
|
+
readonly text: string;
|
|
225
|
+
readonly type: "text";
|
|
226
|
+
}, ...({
|
|
227
|
+
readonly attrs: {
|
|
228
|
+
readonly latex: string;
|
|
229
|
+
};
|
|
230
|
+
readonly type: "mathInline";
|
|
231
|
+
} | {
|
|
232
|
+
readonly marks?: readonly [{
|
|
233
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
234
|
+
} | {
|
|
235
|
+
readonly attrs: {
|
|
236
|
+
readonly href: string;
|
|
237
|
+
};
|
|
238
|
+
readonly type: "link";
|
|
239
|
+
} | {
|
|
240
|
+
readonly attrs: {
|
|
241
|
+
readonly variant: "success" | "warning" | null;
|
|
242
|
+
};
|
|
243
|
+
readonly type: "highlight";
|
|
244
|
+
}, ...({
|
|
245
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
246
|
+
} | {
|
|
247
|
+
readonly attrs: {
|
|
248
|
+
readonly href: string;
|
|
249
|
+
};
|
|
250
|
+
readonly type: "link";
|
|
251
|
+
} | {
|
|
252
|
+
readonly attrs: {
|
|
253
|
+
readonly variant: "success" | "warning" | null;
|
|
254
|
+
};
|
|
255
|
+
readonly type: "highlight";
|
|
256
|
+
})[]];
|
|
257
|
+
readonly text: string;
|
|
258
|
+
readonly type: "text";
|
|
259
|
+
})[]], E, never, never>>;
|
|
59
260
|
readonly title: RichSlot<E>;
|
|
60
261
|
readonly a: Schema.Finite;
|
|
61
262
|
readonly mode: Schema.optionalKey<Schema.Literals<readonly ["continuous", "discrete"]>>;
|
|
@@ -64,6 +265,73 @@ export declare function chartVisuals<E>(rich: RichSlot<E>): {
|
|
|
64
265
|
}>, "figure">;
|
|
65
266
|
HistogramChart: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
66
267
|
readonly description: RichSlot<E>;
|
|
268
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
269
|
+
readonly attrs: {
|
|
270
|
+
readonly latex: string;
|
|
271
|
+
};
|
|
272
|
+
readonly type: "mathInline";
|
|
273
|
+
} | {
|
|
274
|
+
readonly marks?: readonly [{
|
|
275
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
276
|
+
} | {
|
|
277
|
+
readonly attrs: {
|
|
278
|
+
readonly href: string;
|
|
279
|
+
};
|
|
280
|
+
readonly type: "link";
|
|
281
|
+
} | {
|
|
282
|
+
readonly attrs: {
|
|
283
|
+
readonly variant: "success" | "warning" | null;
|
|
284
|
+
};
|
|
285
|
+
readonly type: "highlight";
|
|
286
|
+
}, ...({
|
|
287
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
288
|
+
} | {
|
|
289
|
+
readonly attrs: {
|
|
290
|
+
readonly href: string;
|
|
291
|
+
};
|
|
292
|
+
readonly type: "link";
|
|
293
|
+
} | {
|
|
294
|
+
readonly attrs: {
|
|
295
|
+
readonly variant: "success" | "warning" | null;
|
|
296
|
+
};
|
|
297
|
+
readonly type: "highlight";
|
|
298
|
+
})[]];
|
|
299
|
+
readonly text: string;
|
|
300
|
+
readonly type: "text";
|
|
301
|
+
}, ...({
|
|
302
|
+
readonly attrs: {
|
|
303
|
+
readonly latex: string;
|
|
304
|
+
};
|
|
305
|
+
readonly type: "mathInline";
|
|
306
|
+
} | {
|
|
307
|
+
readonly marks?: readonly [{
|
|
308
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
309
|
+
} | {
|
|
310
|
+
readonly attrs: {
|
|
311
|
+
readonly href: string;
|
|
312
|
+
};
|
|
313
|
+
readonly type: "link";
|
|
314
|
+
} | {
|
|
315
|
+
readonly attrs: {
|
|
316
|
+
readonly variant: "success" | "warning" | null;
|
|
317
|
+
};
|
|
318
|
+
readonly type: "highlight";
|
|
319
|
+
}, ...({
|
|
320
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
321
|
+
} | {
|
|
322
|
+
readonly attrs: {
|
|
323
|
+
readonly href: string;
|
|
324
|
+
};
|
|
325
|
+
readonly type: "link";
|
|
326
|
+
} | {
|
|
327
|
+
readonly attrs: {
|
|
328
|
+
readonly variant: "success" | "warning" | null;
|
|
329
|
+
};
|
|
330
|
+
readonly type: "highlight";
|
|
331
|
+
})[]];
|
|
332
|
+
readonly text: string;
|
|
333
|
+
readonly type: "text";
|
|
334
|
+
})[]], E, never, never>>;
|
|
67
335
|
readonly title: RichSlot<E>;
|
|
68
336
|
readonly chartConfig: Schema.$Record<Schema.Trimmed, Schema.Struct<{
|
|
69
337
|
readonly colors: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
@@ -96,6 +364,73 @@ export declare function chartVisuals<E>(rich: RichSlot<E>): {
|
|
|
96
364
|
}>, "figure">;
|
|
97
365
|
ScatterDiagram: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
98
366
|
readonly description: RichSlot<E>;
|
|
367
|
+
readonly footer: Schema.optionalKey<Schema.Codec<readonly [{
|
|
368
|
+
readonly attrs: {
|
|
369
|
+
readonly latex: string;
|
|
370
|
+
};
|
|
371
|
+
readonly type: "mathInline";
|
|
372
|
+
} | {
|
|
373
|
+
readonly marks?: readonly [{
|
|
374
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
375
|
+
} | {
|
|
376
|
+
readonly attrs: {
|
|
377
|
+
readonly href: string;
|
|
378
|
+
};
|
|
379
|
+
readonly type: "link";
|
|
380
|
+
} | {
|
|
381
|
+
readonly attrs: {
|
|
382
|
+
readonly variant: "success" | "warning" | null;
|
|
383
|
+
};
|
|
384
|
+
readonly type: "highlight";
|
|
385
|
+
}, ...({
|
|
386
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
387
|
+
} | {
|
|
388
|
+
readonly attrs: {
|
|
389
|
+
readonly href: string;
|
|
390
|
+
};
|
|
391
|
+
readonly type: "link";
|
|
392
|
+
} | {
|
|
393
|
+
readonly attrs: {
|
|
394
|
+
readonly variant: "success" | "warning" | null;
|
|
395
|
+
};
|
|
396
|
+
readonly type: "highlight";
|
|
397
|
+
})[]];
|
|
398
|
+
readonly text: string;
|
|
399
|
+
readonly type: "text";
|
|
400
|
+
}, ...({
|
|
401
|
+
readonly attrs: {
|
|
402
|
+
readonly latex: string;
|
|
403
|
+
};
|
|
404
|
+
readonly type: "mathInline";
|
|
405
|
+
} | {
|
|
406
|
+
readonly marks?: readonly [{
|
|
407
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
408
|
+
} | {
|
|
409
|
+
readonly attrs: {
|
|
410
|
+
readonly href: string;
|
|
411
|
+
};
|
|
412
|
+
readonly type: "link";
|
|
413
|
+
} | {
|
|
414
|
+
readonly attrs: {
|
|
415
|
+
readonly variant: "success" | "warning" | null;
|
|
416
|
+
};
|
|
417
|
+
readonly type: "highlight";
|
|
418
|
+
}, ...({
|
|
419
|
+
readonly type: "bold" | "code" | "italic" | "subscript" | "superscript" | "underline";
|
|
420
|
+
} | {
|
|
421
|
+
readonly attrs: {
|
|
422
|
+
readonly href: string;
|
|
423
|
+
};
|
|
424
|
+
readonly type: "link";
|
|
425
|
+
} | {
|
|
426
|
+
readonly attrs: {
|
|
427
|
+
readonly variant: "success" | "warning" | null;
|
|
428
|
+
};
|
|
429
|
+
readonly type: "highlight";
|
|
430
|
+
})[]];
|
|
431
|
+
readonly text: string;
|
|
432
|
+
readonly type: "text";
|
|
433
|
+
})[]], E, never, never>>;
|
|
99
434
|
readonly title: RichSlot<E>;
|
|
100
435
|
readonly calculateRegressionLine: Schema.optionalKey<Schema.Boolean>;
|
|
101
436
|
readonly datasets: Schema.$Array<Schema.Struct<{
|