@nakafa/aksara-contracts 7.1.0 → 8.0.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/visual/card.d.ts +0 -2
- package/dist/visual/card.js +0 -6
- package/dist/visual/catalog.d.ts +2 -210
- package/dist/visual/mathematics/geometry.d.ts +3 -212
- package/dist/visual/mathematics/geometry.js +3 -65
- package/package.json +1 -1
- package/dist/visual/mathematics/line.d.ts +0 -179
- package/dist/visual/mathematics/line.js +0 -156
- package/dist/visual/mathematics/number.d.ts +0 -21
- package/dist/visual/mathematics/number.js +0 -53
package/dist/visual/card.d.ts
CHANGED
|
@@ -26,7 +26,5 @@ export declare function factSchema<E>(rich: RichSlot<E>): Schema.Struct<{
|
|
|
26
26
|
readonly label: Schema.Trimmed;
|
|
27
27
|
readonly value: RichSlot<E>;
|
|
28
28
|
}>;
|
|
29
|
-
/** Three finite numbers, such as a camera position: x, y, and z. */
|
|
30
|
-
export declare const TripleSchema: Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>;
|
|
31
29
|
/** How a kinematics lab writes a decimal number: with a comma or a dot. */
|
|
32
30
|
export declare const DecimalSeparatorSchema: Schema.Literals<readonly ["comma", "dot"]>;
|
package/dist/visual/card.js
CHANGED
|
@@ -20,11 +20,5 @@ export function byIds(ids, value) {
|
|
|
20
20
|
export function factSchema(rich) {
|
|
21
21
|
return Schema.Struct({ label: TextSchema, value: rich });
|
|
22
22
|
}
|
|
23
|
-
/** Three finite numbers, such as a camera position: x, y, and z. */
|
|
24
|
-
export const TripleSchema = Schema.Tuple([
|
|
25
|
-
Schema.Finite,
|
|
26
|
-
Schema.Finite,
|
|
27
|
-
Schema.Finite,
|
|
28
|
-
]);
|
|
29
23
|
/** How a kinematics lab writes a decimal number: with a comma or a dot. */
|
|
30
24
|
export const DecimalSeparatorSchema = Schema.Literals(["comma", "dot"]);
|
package/dist/visual/catalog.d.ts
CHANGED
|
@@ -1795,219 +1795,11 @@ export declare function visualCatalog<E>(rich: RichSlot<E>): {
|
|
|
1795
1795
|
readonly title: RichSlot<E>;
|
|
1796
1796
|
}>;
|
|
1797
1797
|
}>, "figure">;
|
|
1798
|
-
LineEquation: VisualEntry<Schema.Struct<{
|
|
1799
|
-
readonly description: RichSlot<E>;
|
|
1800
|
-
readonly title: RichSlot<E>;
|
|
1801
|
-
readonly cameraPosition: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1802
|
-
readonly cameraTarget: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1803
|
-
readonly data: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
1804
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
1805
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
1806
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
1807
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
1808
|
-
}>>;
|
|
1809
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
1810
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
1811
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1812
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1813
|
-
}>>;
|
|
1814
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1815
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1816
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1817
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1818
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1819
|
-
readonly text: RichSlot<E>;
|
|
1820
|
-
}>>>;
|
|
1821
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1822
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
1823
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1824
|
-
readonly points: Schema.NonEmptyArray<Schema.Struct<{
|
|
1825
|
-
readonly x: Schema.Finite;
|
|
1826
|
-
readonly y: Schema.Finite;
|
|
1827
|
-
readonly z: Schema.Finite;
|
|
1828
|
-
}>>;
|
|
1829
|
-
readonly smooth: Schema.optionalKey<Schema.Boolean>;
|
|
1830
|
-
}>, Schema.Struct<{
|
|
1831
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
1832
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
1833
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
1834
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
1835
|
-
}>>;
|
|
1836
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
1837
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
1838
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1839
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1840
|
-
}>>;
|
|
1841
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1842
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1843
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1844
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1845
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1846
|
-
readonly text: RichSlot<E>;
|
|
1847
|
-
}>>>;
|
|
1848
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1849
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
1850
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1851
|
-
readonly curve: Schema.Struct<{
|
|
1852
|
-
readonly amplitude: Schema.Finite;
|
|
1853
|
-
readonly domain: Schema.Tuple<readonly [Schema.Finite, Schema.Finite]>;
|
|
1854
|
-
readonly frequency: Schema.Finite;
|
|
1855
|
-
readonly kind: Schema.Literals<readonly ["sin", "cos", "tan"]>;
|
|
1856
|
-
readonly phase: Schema.Finite;
|
|
1857
|
-
readonly samples: Schema.optionalKey<Schema.Int>;
|
|
1858
|
-
readonly shift: Schema.Finite;
|
|
1859
|
-
}>;
|
|
1860
|
-
}>, Schema.Struct<{
|
|
1861
|
-
readonly center: Schema.optionalKey<Schema.Struct<{
|
|
1862
|
-
readonly x: Schema.Finite;
|
|
1863
|
-
readonly y: Schema.Finite;
|
|
1864
|
-
readonly z: Schema.Finite;
|
|
1865
|
-
}>>;
|
|
1866
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
1867
|
-
readonly height: Schema.Finite;
|
|
1868
|
-
readonly kind: Schema.Literal<"cuboid">;
|
|
1869
|
-
readonly length: Schema.Finite;
|
|
1870
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1871
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1872
|
-
readonly width: Schema.Finite;
|
|
1873
|
-
}>, Schema.Struct<{
|
|
1874
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
1875
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
1876
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
1877
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
1878
|
-
}>>;
|
|
1879
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
1880
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
1881
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1882
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1883
|
-
}>>;
|
|
1884
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1885
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1886
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1887
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1888
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1889
|
-
readonly text: RichSlot<E>;
|
|
1890
|
-
}>>>;
|
|
1891
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1892
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
1893
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1894
|
-
readonly kind: Schema.Literal<"circle-outline">;
|
|
1895
|
-
readonly radius: Schema.Finite;
|
|
1896
|
-
}>, Schema.Struct<{
|
|
1897
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
1898
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
1899
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
1900
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
1901
|
-
}>>;
|
|
1902
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
1903
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
1904
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1905
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1906
|
-
}>>;
|
|
1907
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1908
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1909
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1910
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1911
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1912
|
-
readonly text: RichSlot<E>;
|
|
1913
|
-
}>>>;
|
|
1914
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1915
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
1916
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1917
|
-
readonly radius: Schema.Finite;
|
|
1918
|
-
readonly startDegrees: Schema.Finite;
|
|
1919
|
-
readonly sweepDegrees: Schema.Finite;
|
|
1920
|
-
readonly kind: Schema.Literal<"circle-chord">;
|
|
1921
|
-
}>, Schema.Struct<{
|
|
1922
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
1923
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
1924
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
1925
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
1926
|
-
}>>;
|
|
1927
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
1928
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
1929
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1930
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
1931
|
-
}>>;
|
|
1932
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
1933
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1934
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
1935
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1936
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1937
|
-
readonly text: RichSlot<E>;
|
|
1938
|
-
}>>>;
|
|
1939
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1940
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
1941
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1942
|
-
readonly degrees: Schema.Finite;
|
|
1943
|
-
readonly kind: Schema.Literal<"circle-radius">;
|
|
1944
|
-
readonly radius: Schema.Finite;
|
|
1945
|
-
}>, Schema.Struct<{
|
|
1946
|
-
readonly radius: Schema.Finite;
|
|
1947
|
-
readonly startDegrees: Schema.Finite;
|
|
1948
|
-
readonly sweepDegrees: Schema.Finite;
|
|
1949
|
-
readonly color: Schema.Trimmed;
|
|
1950
|
-
readonly kind: Schema.Literal<"circle-arc" | "circle-segment">;
|
|
1951
|
-
readonly label: Schema.optionalKey<Schema.Struct<{
|
|
1952
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1953
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1954
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1955
|
-
readonly text: RichSlot<E>;
|
|
1956
|
-
readonly progress: Schema.optionalKey<Schema.Finite>;
|
|
1957
|
-
}>>;
|
|
1958
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1959
|
-
readonly segments: Schema.optionalKey<Schema.Int>;
|
|
1960
|
-
}>, Schema.Struct<{
|
|
1961
|
-
readonly radius: Schema.Finite;
|
|
1962
|
-
readonly startDegrees: Schema.Finite;
|
|
1963
|
-
readonly sweepDegrees: Schema.Finite;
|
|
1964
|
-
readonly color: Schema.Trimmed;
|
|
1965
|
-
readonly kind: Schema.Literal<"circle-arc" | "circle-segment">;
|
|
1966
|
-
readonly label: Schema.optionalKey<Schema.Struct<{
|
|
1967
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
1968
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
1969
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
1970
|
-
readonly text: RichSlot<E>;
|
|
1971
|
-
readonly progress: Schema.optionalKey<Schema.Finite>;
|
|
1972
|
-
}>>;
|
|
1973
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
1974
|
-
readonly segments: Schema.optionalKey<Schema.Int>;
|
|
1975
|
-
}>]>>;
|
|
1976
|
-
readonly showZAxis: Schema.optionalKey<Schema.Boolean>;
|
|
1977
|
-
}>, "figure">;
|
|
1978
|
-
NumberLine: VisualEntry<Schema.Struct<{
|
|
1979
|
-
readonly description: RichSlot<E>;
|
|
1980
|
-
readonly title: RichSlot<E>;
|
|
1981
|
-
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
1982
|
-
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
1983
|
-
readonly segments: Schema.NonEmptyArray<Schema.Struct<{
|
|
1984
|
-
readonly backgroundColor: Schema.optionalKey<Schema.Literal<"transparent">>;
|
|
1985
|
-
readonly end: Schema.optionalKey<Schema.Finite>;
|
|
1986
|
-
readonly endInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
1987
|
-
readonly endLabel: Schema.optionalKey<RichSlot<E>>;
|
|
1988
|
-
readonly label: Schema.optionalKey<RichSlot<E>>;
|
|
1989
|
-
readonly shaded: Schema.optionalKey<Schema.Boolean>;
|
|
1990
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
1991
|
-
readonly start: Schema.optionalKey<Schema.Finite>;
|
|
1992
|
-
readonly startInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
1993
|
-
readonly startLabel: Schema.optionalKey<RichSlot<E>>;
|
|
1994
|
-
}>>;
|
|
1995
|
-
}>, "figure">;
|
|
1996
1798
|
QuadraticEquationReadingRoomProblem: VisualEntry<Schema.Struct<{
|
|
1997
1799
|
readonly description: Schema.optionalKey<RichSlot<E>>;
|
|
1998
1800
|
readonly heightLabel: RichSlot<E>;
|
|
1999
1801
|
readonly widthLabel: RichSlot<E>;
|
|
2000
1802
|
}>, "figure">;
|
|
2001
|
-
UnitCircle: VisualEntry<Schema.Struct<{
|
|
2002
|
-
readonly description: RichSlot<E>;
|
|
2003
|
-
readonly title: RichSlot<E>;
|
|
2004
|
-
readonly angle: Schema.optionalKey<Schema.Finite>;
|
|
2005
|
-
readonly trigValues: Schema.optionalKey<Schema.Struct<{
|
|
2006
|
-
readonly cos: Schema.optionalKey<Schema.Trimmed>;
|
|
2007
|
-
readonly sin: Schema.optionalKey<Schema.Trimmed>;
|
|
2008
|
-
readonly tan: Schema.optionalKey<Schema.Trimmed>;
|
|
2009
|
-
}>>;
|
|
2010
|
-
}>, "figure">;
|
|
2011
1803
|
BrakeHeatLab: VisualEntry<Schema.Struct<{
|
|
2012
1804
|
readonly description: RichSlot<E>;
|
|
2013
1805
|
readonly title: RichSlot<E>;
|
|
@@ -3354,7 +3146,7 @@ export type AssessmentVisuals = ReturnType<typeof visualCatalog<typeof RichTextS
|
|
|
3354
3146
|
*/
|
|
3355
3147
|
export declare const assessmentVisuals: AssessmentVisuals;
|
|
3356
3148
|
/** Every catalog name, in code-unit order. */
|
|
3357
|
-
export declare const VISUAL_NAMES: ("AccelerationGraphCard" | "AccelerationLab" | "AgentContext" | "AircraftCrosswindLab" | "AlkaliWaterLab" | "AncientAtomLab" | "AntibodyNeutralizeLab" | "AtomShellLab" | "AtomSymbolLab" | "AverageVelocitySpeedLab" | "BacteriaStructureLab" | "BacterialGrowth" | "BarChart" | "BicycleWheelSpeedLab" | "BinaryFissionLab" | "BiogasDigesterLab" | "BlockMath" | "BohrEmissionLab" | "BoltDimensionsLab" | "BrakeHeatLab" | "BrakingSurfaceLab" | "CarTripSecantSlopeLab" | "CarbonBudgetLab" | "CathodeRayLab" | "CellCutawayLab" | "CellScaleLab" | "Chart" | "ChemicalReactionCharacteristicsLab" | "ChemicalReactionTypesLab" | "ChemotaxisLab" | "CityWalkDisplacementLab" | "ClimateObservationLab" | "CodeBlock" | "CombiningVolumesLab" | "CommonReferenceLab" | "ConstantCompositionLab" | "ContentBlock" | "ContentGrid" | "ContentStack" | "CoralBleachLab" | "DaltonEvidenceLab" | "DecimalSumLab" | "DensityMeasurementLab" | "DimensionLab" | "DisplacementDistanceLab" | "DnaHelixLab" | "DoorHingeTorqueLab" | "DroneDisplacementLab" | "ElectronConfigurationLab" | "EnergyFlowLossLab" | "EpidemicSpreadLab" | "FallingTargetAimLab" | "FeatherCoinVacuumLab" | "FizzBalanceLab" | "FlashlightEfficiencyLab" | "FollowingDistanceLab" | "ForceTableResultantLab" | "FuelCombustionCarbonLab" | "FunctionAndNonFunctionDiagram" | "FunctionAndNonFunctionRelationVisualizer" | "FunctionChart" | "FunctionExplorationVirusChart" | "FunctionMachine" | "FungiMyceliumLab" | "GalileoInclineBellsLab" | "GeothermalLoopLab" | "GramStainLab" | "GreenhouseEffectLab" | "GreenhouseLayerLab" | "GridLoadCurveLab" | "Highlight" | "HistogramChart" | "HoistWorkLab" | "HoseJetProjectileLab" | "HydroDamLab" | "HyphaeDecayLab" | "InlineMath" | "InstantaneousVelocitySpeedLab" | "InverseFunctionIllustration" | "IonFormationLab" | "IonLab" | "IonLatticeLab" | "IsotopeLab" | "KettleHeatingLab" | "KimPlusElectabilityChart" | "KiteStringTensionLab" | "LavoisierCalxLab" | "LightGateSpeedLab" | "
|
|
3149
|
+
export declare const VISUAL_NAMES: ("AccelerationGraphCard" | "AccelerationLab" | "AgentContext" | "AircraftCrosswindLab" | "AlkaliWaterLab" | "AncientAtomLab" | "AntibodyNeutralizeLab" | "AtomShellLab" | "AtomSymbolLab" | "AverageVelocitySpeedLab" | "BacteriaStructureLab" | "BacterialGrowth" | "BarChart" | "BicycleWheelSpeedLab" | "BinaryFissionLab" | "BiogasDigesterLab" | "BlockMath" | "BohrEmissionLab" | "BoltDimensionsLab" | "BrakeHeatLab" | "BrakingSurfaceLab" | "CarTripSecantSlopeLab" | "CarbonBudgetLab" | "CathodeRayLab" | "CellCutawayLab" | "CellScaleLab" | "Chart" | "ChemicalReactionCharacteristicsLab" | "ChemicalReactionTypesLab" | "ChemotaxisLab" | "CityWalkDisplacementLab" | "ClimateObservationLab" | "CodeBlock" | "CombiningVolumesLab" | "CommonReferenceLab" | "ConstantCompositionLab" | "ContentBlock" | "ContentGrid" | "ContentStack" | "CoralBleachLab" | "DaltonEvidenceLab" | "DecimalSumLab" | "DensityMeasurementLab" | "DimensionLab" | "DisplacementDistanceLab" | "DnaHelixLab" | "DoorHingeTorqueLab" | "DroneDisplacementLab" | "ElectronConfigurationLab" | "EnergyFlowLossLab" | "EpidemicSpreadLab" | "FallingTargetAimLab" | "FeatherCoinVacuumLab" | "FizzBalanceLab" | "FlashlightEfficiencyLab" | "FollowingDistanceLab" | "ForceTableResultantLab" | "FuelCombustionCarbonLab" | "FunctionAndNonFunctionDiagram" | "FunctionAndNonFunctionRelationVisualizer" | "FunctionChart" | "FunctionExplorationVirusChart" | "FunctionMachine" | "FungiMyceliumLab" | "GalileoInclineBellsLab" | "GeothermalLoopLab" | "GramStainLab" | "GreenhouseEffectLab" | "GreenhouseLayerLab" | "GridLoadCurveLab" | "Highlight" | "HistogramChart" | "HoistWorkLab" | "HoseJetProjectileLab" | "HydroDamLab" | "HyphaeDecayLab" | "InlineMath" | "InstantaneousVelocitySpeedLab" | "InverseFunctionIllustration" | "IonFormationLab" | "IonLab" | "IonLatticeLab" | "IsotopeLab" | "KettleHeatingLab" | "KimPlusElectabilityChart" | "KiteStringTensionLab" | "LavoisierCalxLab" | "LightGateSpeedLab" | "MassConservationLab" | "MassSpectrometerLab" | "MathContainer" | "MathVisual" | "MatterParticleReaderLab" | "MeasurementToolsLab" | "MerahPutihCabinetChart" | "MerahPutihCompositionChart" | "Mermaid" | "MethaneCombustionEquationLab" | "MicrohydroLab" | "MicrometerScrewLab" | "MicroscopeScaleLab" | "MillikanOilDropLab" | "ModernPeriodicTableLab" | "MoleculeShapeLab" | "MultipleProportionsLab" | "NepotismStage" | "NepotismStateTable" | "NonUniformLinearMotionGraphCard" | "NonUniformLinearMotionLab" | "OrbitalCloudLab" | "OrienteeringMapVectorLab" | "PaperStackLab" | "ParabolicMovementAnalysisLab" | "ParabolicMovementLab" | "ParallaxReadingLab" | "ParticleTrackLab" | "PendulumEnergyLab" | "PendulumPeriodLab" | "PeriodicPropertiesLab" | "PorkBarrelBudgetChart" | "PorkBarrelElectabilityChart" | "PorkBarrelFundChart" | "PrecipitateLab" | "PredatorPreyLab" | "QuadraticEquationReadingRoomProblem" | "RadioactiveDecayLab" | "RainDriveRelativeVelocityLab" | "RampBlockComponentLab" | "ReactionBalanceLab" | "ReactionTimeLab" | "RelativeMovementLab" | "RiverBoatCrossingLab" | "RunningTrackDisplacementLab" | "RutherfordScatteringLab" | "SarsCov2VirionLab" | "SatelliteOrbitCircularLab" | "ScatterDiagram" | "SeaLevelRiseLab" | "SequenceConceptTableChairsAnimation" | "ShipBearingComponentLab" | "SignificantZerosLab" | "SledPullWorkLab" | "SolarBatteryStorageLab" | "SolarPanelAngleLab" | "SolarPanelFluxLab" | "SolarPanelHeatLab" | "SolarRoofPaybackLab" | "SpeedTrapInstantSpeedLab" | "SteamPlantCycleLab" | "SteelWoolLab" | "StoppingDistanceLab" | "StopwatchSpreadLab" | "StreetOriginPositionLab" | "StringWhirlReleaseLab" | "StrobePhotoMotionLab" | "SubatomicParticlePropertiesLab" | "SubatomicParticlesLab" | "TickerTapeMotionLab" | "TrainPassengerRelativeLab" | "TugOfWarForceLab" | "TugboatResultantLab" | "UniformCircularMotionLab" | "UniformLinearMotionLab" | "UnitSystemsLab" | "ValenceElectronLab" | "VectorConceptLab" | "VelocitySpeedLab" | "VernierCaliperLab" | "VerticalMovementLab" | "VirusMorphologyLab" | "VirusReplicationLab" | "VirusRoleLab" | "VirusStructureLab" | "WaveBuoyPowerLab" | "WeightLampEnergyLab" | "WindEnergyConversionLab" | "WindMapVectorLab" | "WindRotorLab" | "WrenchTorqueLab" | "YogurtLab" | "Youtube")[];
|
|
3358
3150
|
/** The name of one catalog component that a document draws as a figure. */
|
|
3359
3151
|
export type FigureName = {
|
|
3360
3152
|
readonly [Name in VisualName]: AssessmentVisuals[Name]["kind"] extends "figure" ? Name : never;
|
|
@@ -3362,7 +3154,7 @@ export type FigureName = {
|
|
|
3362
3154
|
/** The catalog components a document draws as a figure, in code-unit order. */
|
|
3363
3155
|
export declare const FIGURE_NAMES: FigureName[];
|
|
3364
3156
|
/** The name of one catalog component. */
|
|
3365
|
-
export declare const VisualNameSchema: Schema.Literals<("AccelerationGraphCard" | "AccelerationLab" | "AgentContext" | "AircraftCrosswindLab" | "AlkaliWaterLab" | "AncientAtomLab" | "AntibodyNeutralizeLab" | "AtomShellLab" | "AtomSymbolLab" | "AverageVelocitySpeedLab" | "BacteriaStructureLab" | "BacterialGrowth" | "BarChart" | "BicycleWheelSpeedLab" | "BinaryFissionLab" | "BiogasDigesterLab" | "BlockMath" | "BohrEmissionLab" | "BoltDimensionsLab" | "BrakeHeatLab" | "BrakingSurfaceLab" | "CarTripSecantSlopeLab" | "CarbonBudgetLab" | "CathodeRayLab" | "CellCutawayLab" | "CellScaleLab" | "Chart" | "ChemicalReactionCharacteristicsLab" | "ChemicalReactionTypesLab" | "ChemotaxisLab" | "CityWalkDisplacementLab" | "ClimateObservationLab" | "CodeBlock" | "CombiningVolumesLab" | "CommonReferenceLab" | "ConstantCompositionLab" | "ContentBlock" | "ContentGrid" | "ContentStack" | "CoralBleachLab" | "DaltonEvidenceLab" | "DecimalSumLab" | "DensityMeasurementLab" | "DimensionLab" | "DisplacementDistanceLab" | "DnaHelixLab" | "DoorHingeTorqueLab" | "DroneDisplacementLab" | "ElectronConfigurationLab" | "EnergyFlowLossLab" | "EpidemicSpreadLab" | "FallingTargetAimLab" | "FeatherCoinVacuumLab" | "FizzBalanceLab" | "FlashlightEfficiencyLab" | "FollowingDistanceLab" | "ForceTableResultantLab" | "FuelCombustionCarbonLab" | "FunctionAndNonFunctionDiagram" | "FunctionAndNonFunctionRelationVisualizer" | "FunctionChart" | "FunctionExplorationVirusChart" | "FunctionMachine" | "FungiMyceliumLab" | "GalileoInclineBellsLab" | "GeothermalLoopLab" | "GramStainLab" | "GreenhouseEffectLab" | "GreenhouseLayerLab" | "GridLoadCurveLab" | "Highlight" | "HistogramChart" | "HoistWorkLab" | "HoseJetProjectileLab" | "HydroDamLab" | "HyphaeDecayLab" | "InlineMath" | "InstantaneousVelocitySpeedLab" | "InverseFunctionIllustration" | "IonFormationLab" | "IonLab" | "IonLatticeLab" | "IsotopeLab" | "KettleHeatingLab" | "KimPlusElectabilityChart" | "KiteStringTensionLab" | "LavoisierCalxLab" | "LightGateSpeedLab" | "
|
|
3157
|
+
export declare const VisualNameSchema: Schema.Literals<("AccelerationGraphCard" | "AccelerationLab" | "AgentContext" | "AircraftCrosswindLab" | "AlkaliWaterLab" | "AncientAtomLab" | "AntibodyNeutralizeLab" | "AtomShellLab" | "AtomSymbolLab" | "AverageVelocitySpeedLab" | "BacteriaStructureLab" | "BacterialGrowth" | "BarChart" | "BicycleWheelSpeedLab" | "BinaryFissionLab" | "BiogasDigesterLab" | "BlockMath" | "BohrEmissionLab" | "BoltDimensionsLab" | "BrakeHeatLab" | "BrakingSurfaceLab" | "CarTripSecantSlopeLab" | "CarbonBudgetLab" | "CathodeRayLab" | "CellCutawayLab" | "CellScaleLab" | "Chart" | "ChemicalReactionCharacteristicsLab" | "ChemicalReactionTypesLab" | "ChemotaxisLab" | "CityWalkDisplacementLab" | "ClimateObservationLab" | "CodeBlock" | "CombiningVolumesLab" | "CommonReferenceLab" | "ConstantCompositionLab" | "ContentBlock" | "ContentGrid" | "ContentStack" | "CoralBleachLab" | "DaltonEvidenceLab" | "DecimalSumLab" | "DensityMeasurementLab" | "DimensionLab" | "DisplacementDistanceLab" | "DnaHelixLab" | "DoorHingeTorqueLab" | "DroneDisplacementLab" | "ElectronConfigurationLab" | "EnergyFlowLossLab" | "EpidemicSpreadLab" | "FallingTargetAimLab" | "FeatherCoinVacuumLab" | "FizzBalanceLab" | "FlashlightEfficiencyLab" | "FollowingDistanceLab" | "ForceTableResultantLab" | "FuelCombustionCarbonLab" | "FunctionAndNonFunctionDiagram" | "FunctionAndNonFunctionRelationVisualizer" | "FunctionChart" | "FunctionExplorationVirusChart" | "FunctionMachine" | "FungiMyceliumLab" | "GalileoInclineBellsLab" | "GeothermalLoopLab" | "GramStainLab" | "GreenhouseEffectLab" | "GreenhouseLayerLab" | "GridLoadCurveLab" | "Highlight" | "HistogramChart" | "HoistWorkLab" | "HoseJetProjectileLab" | "HydroDamLab" | "HyphaeDecayLab" | "InlineMath" | "InstantaneousVelocitySpeedLab" | "InverseFunctionIllustration" | "IonFormationLab" | "IonLab" | "IonLatticeLab" | "IsotopeLab" | "KettleHeatingLab" | "KimPlusElectabilityChart" | "KiteStringTensionLab" | "LavoisierCalxLab" | "LightGateSpeedLab" | "MassConservationLab" | "MassSpectrometerLab" | "MathContainer" | "MathVisual" | "MatterParticleReaderLab" | "MeasurementToolsLab" | "MerahPutihCabinetChart" | "MerahPutihCompositionChart" | "Mermaid" | "MethaneCombustionEquationLab" | "MicrohydroLab" | "MicrometerScrewLab" | "MicroscopeScaleLab" | "MillikanOilDropLab" | "ModernPeriodicTableLab" | "MoleculeShapeLab" | "MultipleProportionsLab" | "NepotismStage" | "NepotismStateTable" | "NonUniformLinearMotionGraphCard" | "NonUniformLinearMotionLab" | "OrbitalCloudLab" | "OrienteeringMapVectorLab" | "PaperStackLab" | "ParabolicMovementAnalysisLab" | "ParabolicMovementLab" | "ParallaxReadingLab" | "ParticleTrackLab" | "PendulumEnergyLab" | "PendulumPeriodLab" | "PeriodicPropertiesLab" | "PorkBarrelBudgetChart" | "PorkBarrelElectabilityChart" | "PorkBarrelFundChart" | "PrecipitateLab" | "PredatorPreyLab" | "QuadraticEquationReadingRoomProblem" | "RadioactiveDecayLab" | "RainDriveRelativeVelocityLab" | "RampBlockComponentLab" | "ReactionBalanceLab" | "ReactionTimeLab" | "RelativeMovementLab" | "RiverBoatCrossingLab" | "RunningTrackDisplacementLab" | "RutherfordScatteringLab" | "SarsCov2VirionLab" | "SatelliteOrbitCircularLab" | "ScatterDiagram" | "SeaLevelRiseLab" | "SequenceConceptTableChairsAnimation" | "ShipBearingComponentLab" | "SignificantZerosLab" | "SledPullWorkLab" | "SolarBatteryStorageLab" | "SolarPanelAngleLab" | "SolarPanelFluxLab" | "SolarPanelHeatLab" | "SolarRoofPaybackLab" | "SpeedTrapInstantSpeedLab" | "SteamPlantCycleLab" | "SteelWoolLab" | "StoppingDistanceLab" | "StopwatchSpreadLab" | "StreetOriginPositionLab" | "StringWhirlReleaseLab" | "StrobePhotoMotionLab" | "SubatomicParticlePropertiesLab" | "SubatomicParticlesLab" | "TickerTapeMotionLab" | "TrainPassengerRelativeLab" | "TugOfWarForceLab" | "TugboatResultantLab" | "UniformCircularMotionLab" | "UniformLinearMotionLab" | "UnitSystemsLab" | "ValenceElectronLab" | "VectorConceptLab" | "VelocitySpeedLab" | "VernierCaliperLab" | "VerticalMovementLab" | "VirusMorphologyLab" | "VirusReplicationLab" | "VirusRoleLab" | "VirusStructureLab" | "WaveBuoyPowerLab" | "WeightLampEnergyLab" | "WindEnergyConversionLab" | "WindMapVectorLab" | "WindRotorLab" | "WrenchTorqueLab" | "YogurtLab" | "Youtube")[]>;
|
|
3366
3158
|
/** The name of one catalog component that a document draws as a figure. */
|
|
3367
3159
|
export declare const FigureNameSchema: Schema.Literals<FigureName[]>;
|
|
3368
3160
|
/**
|
|
@@ -1,222 +1,13 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import type { RichSlot } from "#contracts/visual/card";
|
|
3
3
|
/**
|
|
4
|
-
* The visuals
|
|
5
|
-
*
|
|
6
|
-
* state.
|
|
4
|
+
* The geometry visuals that a figure draws with its own model. Lines, number
|
|
5
|
+
* lines, and circles are MathVisual scenes, the one mathematics visual.
|
|
7
6
|
*/
|
|
8
7
|
export declare function geometryVisuals<E>(rich: RichSlot<E>): {
|
|
9
|
-
LineEquation: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
10
|
-
readonly description: RichSlot<E>;
|
|
11
|
-
readonly title: RichSlot<E>;
|
|
12
|
-
readonly cameraPosition: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
13
|
-
readonly cameraTarget: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
14
|
-
readonly data: Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
15
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
16
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
17
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
18
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
19
|
-
}>>;
|
|
20
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
21
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
22
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
23
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
24
|
-
}>>;
|
|
25
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
26
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
27
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
28
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
29
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
30
|
-
readonly text: RichSlot<E>;
|
|
31
|
-
}>>>;
|
|
32
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
33
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
34
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
35
|
-
readonly points: Schema.NonEmptyArray<Schema.Struct<{
|
|
36
|
-
readonly x: Schema.Finite;
|
|
37
|
-
readonly y: Schema.Finite;
|
|
38
|
-
readonly z: Schema.Finite;
|
|
39
|
-
}>>;
|
|
40
|
-
readonly smooth: Schema.optionalKey<Schema.Boolean>;
|
|
41
|
-
}>, Schema.Struct<{
|
|
42
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
43
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
44
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
45
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
46
|
-
}>>;
|
|
47
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
48
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
49
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
50
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
51
|
-
}>>;
|
|
52
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
53
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
54
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
55
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
56
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
57
|
-
readonly text: RichSlot<E>;
|
|
58
|
-
}>>>;
|
|
59
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
60
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
61
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
62
|
-
readonly curve: Schema.Struct<{
|
|
63
|
-
readonly amplitude: Schema.Finite;
|
|
64
|
-
readonly domain: Schema.Tuple<readonly [Schema.Finite, Schema.Finite]>;
|
|
65
|
-
readonly frequency: Schema.Finite;
|
|
66
|
-
readonly kind: Schema.Literals<readonly ["sin", "cos", "tan"]>;
|
|
67
|
-
readonly phase: Schema.Finite;
|
|
68
|
-
readonly samples: Schema.optionalKey<Schema.Int>;
|
|
69
|
-
readonly shift: Schema.Finite;
|
|
70
|
-
}>;
|
|
71
|
-
}>, Schema.Struct<{
|
|
72
|
-
readonly center: Schema.optionalKey<Schema.Struct<{
|
|
73
|
-
readonly x: Schema.Finite;
|
|
74
|
-
readonly y: Schema.Finite;
|
|
75
|
-
readonly z: Schema.Finite;
|
|
76
|
-
}>>;
|
|
77
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
78
|
-
readonly height: Schema.Finite;
|
|
79
|
-
readonly kind: Schema.Literal<"cuboid">;
|
|
80
|
-
readonly length: Schema.Finite;
|
|
81
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
82
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
83
|
-
readonly width: Schema.Finite;
|
|
84
|
-
}>, Schema.Struct<{
|
|
85
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
86
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
87
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
88
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
89
|
-
}>>;
|
|
90
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
91
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
92
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
93
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
94
|
-
}>>;
|
|
95
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
96
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
97
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
98
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
99
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
100
|
-
readonly text: RichSlot<E>;
|
|
101
|
-
}>>>;
|
|
102
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
103
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
104
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
105
|
-
readonly kind: Schema.Literal<"circle-outline">;
|
|
106
|
-
readonly radius: Schema.Finite;
|
|
107
|
-
}>, Schema.Struct<{
|
|
108
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
109
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
110
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
111
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
112
|
-
}>>;
|
|
113
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
114
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
115
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
116
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
117
|
-
}>>;
|
|
118
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
119
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
120
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
121
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
122
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
123
|
-
readonly text: RichSlot<E>;
|
|
124
|
-
}>>>;
|
|
125
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
126
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
127
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
128
|
-
readonly radius: Schema.Finite;
|
|
129
|
-
readonly startDegrees: Schema.Finite;
|
|
130
|
-
readonly sweepDegrees: Schema.Finite;
|
|
131
|
-
readonly kind: Schema.Literal<"circle-chord">;
|
|
132
|
-
}>, Schema.Struct<{
|
|
133
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
134
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
135
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
136
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
137
|
-
}>>;
|
|
138
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
139
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
140
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
141
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
142
|
-
}>>;
|
|
143
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
144
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
145
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
146
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
147
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
148
|
-
readonly text: RichSlot<E>;
|
|
149
|
-
}>>>;
|
|
150
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
151
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
152
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
153
|
-
readonly degrees: Schema.Finite;
|
|
154
|
-
readonly kind: Schema.Literal<"circle-radius">;
|
|
155
|
-
readonly radius: Schema.Finite;
|
|
156
|
-
}>, Schema.Struct<{
|
|
157
|
-
readonly radius: Schema.Finite;
|
|
158
|
-
readonly startDegrees: Schema.Finite;
|
|
159
|
-
readonly sweepDegrees: Schema.Finite;
|
|
160
|
-
readonly color: Schema.Trimmed;
|
|
161
|
-
readonly kind: Schema.Literal<"circle-arc" | "circle-segment">;
|
|
162
|
-
readonly label: Schema.optionalKey<Schema.Struct<{
|
|
163
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
164
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
165
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
166
|
-
readonly text: RichSlot<E>;
|
|
167
|
-
readonly progress: Schema.optionalKey<Schema.Finite>;
|
|
168
|
-
}>>;
|
|
169
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
170
|
-
readonly segments: Schema.optionalKey<Schema.Int>;
|
|
171
|
-
}>, Schema.Struct<{
|
|
172
|
-
readonly radius: Schema.Finite;
|
|
173
|
-
readonly startDegrees: Schema.Finite;
|
|
174
|
-
readonly sweepDegrees: Schema.Finite;
|
|
175
|
-
readonly color: Schema.Trimmed;
|
|
176
|
-
readonly kind: Schema.Literal<"circle-arc" | "circle-segment">;
|
|
177
|
-
readonly label: Schema.optionalKey<Schema.Struct<{
|
|
178
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
179
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
180
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
181
|
-
readonly text: RichSlot<E>;
|
|
182
|
-
readonly progress: Schema.optionalKey<Schema.Finite>;
|
|
183
|
-
}>>;
|
|
184
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
185
|
-
readonly segments: Schema.optionalKey<Schema.Int>;
|
|
186
|
-
}>]>>;
|
|
187
|
-
readonly showZAxis: Schema.optionalKey<Schema.Boolean>;
|
|
188
|
-
}>, "figure">;
|
|
189
|
-
NumberLine: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
190
|
-
readonly description: RichSlot<E>;
|
|
191
|
-
readonly title: RichSlot<E>;
|
|
192
|
-
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
193
|
-
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
194
|
-
readonly segments: Schema.NonEmptyArray<Schema.Struct<{
|
|
195
|
-
readonly backgroundColor: Schema.optionalKey<Schema.Literal<"transparent">>;
|
|
196
|
-
readonly end: Schema.optionalKey<Schema.Finite>;
|
|
197
|
-
readonly endInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
198
|
-
readonly endLabel: Schema.optionalKey<RichSlot<E>>;
|
|
199
|
-
readonly label: Schema.optionalKey<RichSlot<E>>;
|
|
200
|
-
readonly shaded: Schema.optionalKey<Schema.Boolean>;
|
|
201
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
202
|
-
readonly start: Schema.optionalKey<Schema.Finite>;
|
|
203
|
-
readonly startInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
204
|
-
readonly startLabel: Schema.optionalKey<RichSlot<E>>;
|
|
205
|
-
}>>;
|
|
206
|
-
}>, "figure">;
|
|
207
8
|
QuadraticEquationReadingRoomProblem: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
208
9
|
readonly description: Schema.optionalKey<RichSlot<E>>;
|
|
209
10
|
readonly heightLabel: RichSlot<E>;
|
|
210
11
|
readonly widthLabel: RichSlot<E>;
|
|
211
12
|
}>, "figure">;
|
|
212
|
-
UnitCircle: import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
213
|
-
readonly description: RichSlot<E>;
|
|
214
|
-
readonly title: RichSlot<E>;
|
|
215
|
-
readonly angle: Schema.optionalKey<Schema.Finite>;
|
|
216
|
-
readonly trigValues: Schema.optionalKey<Schema.Struct<{
|
|
217
|
-
readonly cos: Schema.optionalKey<Schema.Trimmed>;
|
|
218
|
-
readonly sin: Schema.optionalKey<Schema.Trimmed>;
|
|
219
|
-
readonly tan: Schema.optionalKey<Schema.Trimmed>;
|
|
220
|
-
}>>;
|
|
221
|
-
}>, "figure">;
|
|
222
13
|
};
|
|
@@ -1,63 +1,5 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import {
|
|
3
|
-
import { cardFields, TripleSchema, } from "#contracts/visual/card";
|
|
4
|
-
import { answerAt, figure } from "#contracts/visual/entry";
|
|
5
|
-
import { sceneLine } from "#contracts/visual/mathematics/line";
|
|
6
|
-
import { numberLine } from "#contracts/visual/mathematics/number";
|
|
7
|
-
/**
|
|
8
|
-
* Where the `LineEquation` card puts the camera when `cameraPosition` is left
|
|
9
|
-
* out: `DEFAULT_CAMERA_POSITION_X`, `_Y`, and `_Z` in
|
|
10
|
-
* `components/contents/mathematics/line/equation.tsx` of Nakafa's design system
|
|
11
|
-
* (read on 13 October 2026).
|
|
12
|
-
*/
|
|
13
|
-
const DEFAULT_CAMERA_POSITION = [10, 6, 10];
|
|
14
|
-
/**
|
|
15
|
-
* Where the scene looks when `cameraTarget` is left out: the origin, as
|
|
16
|
-
* `DEFAULT_CAMERA_TARGET` in `components/three/camera-controls.tsx` of the
|
|
17
|
-
* same package says (read on 13 October 2026).
|
|
18
|
-
*/
|
|
19
|
-
const DEFAULT_CAMERA_TARGET = [0, 0, 0];
|
|
20
|
-
/** The camera of a scene: where it sits and where it looks, each optional. */
|
|
21
|
-
const CameraPoseSchema = Schema.Struct({
|
|
22
|
-
cameraPosition: Schema.optionalKey(TripleSchema),
|
|
23
|
-
cameraTarget: Schema.optionalKey(TripleSchema),
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Checks that the camera sits away from the point it looks at, with the
|
|
27
|
-
* renderer's defaults for a pose that is left out. A camera on its target has
|
|
28
|
-
* no direction to look in, and the renderer measures its zoom and its distance
|
|
29
|
-
* limits from that distance, which is then zero.
|
|
30
|
-
*/
|
|
31
|
-
function hasCameraDistance({ cameraPosition = DEFAULT_CAMERA_POSITION, cameraTarget = DEFAULT_CAMERA_TARGET, }) {
|
|
32
|
-
const [x, y, z] = cameraPosition;
|
|
33
|
-
const [targetX, targetY, targetZ] = cameraTarget;
|
|
34
|
-
return x !== targetX || y !== targetY || z !== targetZ;
|
|
35
|
-
}
|
|
36
|
-
/** Props of `LineEquation`: lines, curves, and circle parts in three dimensions. */
|
|
37
|
-
function lineEquation(rich) {
|
|
38
|
-
return figure(Schema.Struct({
|
|
39
|
-
...cardFields(rich),
|
|
40
|
-
...CameraPoseSchema.fields,
|
|
41
|
-
data: Schema.NonEmptyArray(sceneLine(rich)),
|
|
42
|
-
showZAxis: Schema.optionalKey(Schema.Boolean),
|
|
43
|
-
}).check(Schema.makeFilter(hasCameraDistance, {
|
|
44
|
-
message: "Expected a camera that sits away from the point it looks at.",
|
|
45
|
-
})));
|
|
46
|
-
}
|
|
47
|
-
/** The exact sine, cosine, and tangent of the angle, each as LaTeX, such as `5/13`. */
|
|
48
|
-
const TrigValuesSchema = Schema.Struct({
|
|
49
|
-
cos: Schema.optionalKey(LatexSchema),
|
|
50
|
-
sin: Schema.optionalKey(LatexSchema),
|
|
51
|
-
tan: Schema.optionalKey(LatexSchema),
|
|
52
|
-
});
|
|
53
|
-
/** Props of `UnitCircle`: the angle in degrees and its exact values in LaTeX. */
|
|
54
|
-
function unitCircle(rich) {
|
|
55
|
-
return figure(Schema.Struct({
|
|
56
|
-
...cardFields(rich),
|
|
57
|
-
angle: Schema.optionalKey(Schema.Finite),
|
|
58
|
-
trigValues: Schema.optionalKey(TrigValuesSchema),
|
|
59
|
-
}), answerAt(["trigValues"]));
|
|
60
|
-
}
|
|
2
|
+
import { figure } from "#contracts/visual/entry";
|
|
61
3
|
/** Props of `QuadraticEquationReadingRoomProblem`: a room whose sides are unknown. */
|
|
62
4
|
function readingRoom(rich) {
|
|
63
5
|
return figure(Schema.Struct({
|
|
@@ -67,15 +9,11 @@ function readingRoom(rich) {
|
|
|
67
9
|
}));
|
|
68
10
|
}
|
|
69
11
|
/**
|
|
70
|
-
* The visuals
|
|
71
|
-
*
|
|
72
|
-
* state.
|
|
12
|
+
* The geometry visuals that a figure draws with its own model. Lines, number
|
|
13
|
+
* lines, and circles are MathVisual scenes, the one mathematics visual.
|
|
73
14
|
*/
|
|
74
15
|
export function geometryVisuals(rich) {
|
|
75
16
|
return {
|
|
76
|
-
LineEquation: lineEquation(rich),
|
|
77
|
-
NumberLine: numberLine(rich),
|
|
78
17
|
QuadraticEquationReadingRoomProblem: readingRoom(rich),
|
|
79
|
-
UnitCircle: unitCircle(rich),
|
|
80
18
|
};
|
|
81
19
|
}
|
package/package.json
CHANGED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
-
/**
|
|
4
|
-
* One line of a `LineEquation` scene: a line through points, a curve by its
|
|
5
|
-
* formula, a cuboid, or a part of a circle.
|
|
6
|
-
*/
|
|
7
|
-
export declare function sceneLine<E>(rich: RichSlot<E>): Schema.Union<readonly [Schema.Struct<{
|
|
8
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
9
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
10
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
11
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
12
|
-
}>>;
|
|
13
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
14
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
15
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
16
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
17
|
-
}>>;
|
|
18
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
19
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
20
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
21
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
22
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
23
|
-
readonly text: RichSlot<E>;
|
|
24
|
-
}>>>;
|
|
25
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
26
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
27
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
28
|
-
readonly points: Schema.NonEmptyArray<Schema.Struct<{
|
|
29
|
-
readonly x: Schema.Finite;
|
|
30
|
-
readonly y: Schema.Finite;
|
|
31
|
-
readonly z: Schema.Finite;
|
|
32
|
-
}>>;
|
|
33
|
-
readonly smooth: Schema.optionalKey<Schema.Boolean>;
|
|
34
|
-
}>, Schema.Struct<{
|
|
35
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
36
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
37
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
38
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
39
|
-
}>>;
|
|
40
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
41
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
42
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
43
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
44
|
-
}>>;
|
|
45
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
46
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
47
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
48
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
49
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
50
|
-
readonly text: RichSlot<E>;
|
|
51
|
-
}>>>;
|
|
52
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
53
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
54
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
55
|
-
readonly curve: Schema.Struct<{
|
|
56
|
-
readonly amplitude: Schema.Finite;
|
|
57
|
-
readonly domain: Schema.Tuple<readonly [Schema.Finite, Schema.Finite]>;
|
|
58
|
-
readonly frequency: Schema.Finite;
|
|
59
|
-
readonly kind: Schema.Literals<readonly ["sin", "cos", "tan"]>;
|
|
60
|
-
readonly phase: Schema.Finite;
|
|
61
|
-
readonly samples: Schema.optionalKey<Schema.Int>;
|
|
62
|
-
readonly shift: Schema.Finite;
|
|
63
|
-
}>;
|
|
64
|
-
}>, Schema.Struct<{
|
|
65
|
-
readonly center: Schema.optionalKey<Schema.Struct<{
|
|
66
|
-
readonly x: Schema.Finite;
|
|
67
|
-
readonly y: Schema.Finite;
|
|
68
|
-
readonly z: Schema.Finite;
|
|
69
|
-
}>>;
|
|
70
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
71
|
-
readonly height: Schema.Finite;
|
|
72
|
-
readonly kind: Schema.Literal<"cuboid">;
|
|
73
|
-
readonly length: Schema.Finite;
|
|
74
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
75
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
76
|
-
readonly width: Schema.Finite;
|
|
77
|
-
}>, Schema.Struct<{
|
|
78
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
79
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
80
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
81
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
82
|
-
}>>;
|
|
83
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
84
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
85
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
86
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
87
|
-
}>>;
|
|
88
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
89
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
90
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
91
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
92
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
93
|
-
readonly text: RichSlot<E>;
|
|
94
|
-
}>>>;
|
|
95
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
96
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
97
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
98
|
-
readonly kind: Schema.Literal<"circle-outline">;
|
|
99
|
-
readonly radius: Schema.Finite;
|
|
100
|
-
}>, Schema.Struct<{
|
|
101
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
102
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
103
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
104
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
105
|
-
}>>;
|
|
106
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
107
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
108
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
109
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
110
|
-
}>>;
|
|
111
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
112
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
113
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
114
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
115
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
116
|
-
readonly text: RichSlot<E>;
|
|
117
|
-
}>>>;
|
|
118
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
119
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
120
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
121
|
-
readonly radius: Schema.Finite;
|
|
122
|
-
readonly startDegrees: Schema.Finite;
|
|
123
|
-
readonly sweepDegrees: Schema.Finite;
|
|
124
|
-
readonly kind: Schema.Literal<"circle-chord">;
|
|
125
|
-
}>, Schema.Struct<{
|
|
126
|
-
readonly color: Schema.optionalKey<Schema.Trimmed>;
|
|
127
|
-
readonly cone: Schema.optionalKey<Schema.Struct<{
|
|
128
|
-
readonly position: Schema.Literals<readonly ["start", "end", "both"]>;
|
|
129
|
-
readonly size: Schema.optionalKey<Schema.Finite>;
|
|
130
|
-
}>>;
|
|
131
|
-
readonly curvePoints: Schema.optionalKey<Schema.Int>;
|
|
132
|
-
readonly endpoints: Schema.optionalKey<Schema.Struct<{
|
|
133
|
-
readonly end: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
134
|
-
readonly start: Schema.optionalKey<Schema.Literals<readonly ["open", "closed"]>>;
|
|
135
|
-
}>>;
|
|
136
|
-
readonly labels: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
|
|
137
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
138
|
-
readonly at: Schema.optionalKey<Schema.Int>;
|
|
139
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
140
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
141
|
-
readonly text: RichSlot<E>;
|
|
142
|
-
}>>>;
|
|
143
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
144
|
-
readonly pointIndices: Schema.optionalKey<Schema.NonEmptyArray<Schema.Int>>;
|
|
145
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
146
|
-
readonly degrees: Schema.Finite;
|
|
147
|
-
readonly kind: Schema.Literal<"circle-radius">;
|
|
148
|
-
readonly radius: Schema.Finite;
|
|
149
|
-
}>, Schema.Struct<{
|
|
150
|
-
readonly radius: Schema.Finite;
|
|
151
|
-
readonly startDegrees: Schema.Finite;
|
|
152
|
-
readonly sweepDegrees: Schema.Finite;
|
|
153
|
-
readonly color: Schema.Trimmed;
|
|
154
|
-
readonly kind: Schema.Literal<"circle-arc" | "circle-segment">;
|
|
155
|
-
readonly label: Schema.optionalKey<Schema.Struct<{
|
|
156
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
157
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
158
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
159
|
-
readonly text: RichSlot<E>;
|
|
160
|
-
readonly progress: Schema.optionalKey<Schema.Finite>;
|
|
161
|
-
}>>;
|
|
162
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
163
|
-
readonly segments: Schema.optionalKey<Schema.Int>;
|
|
164
|
-
}>, Schema.Struct<{
|
|
165
|
-
readonly radius: Schema.Finite;
|
|
166
|
-
readonly startDegrees: Schema.Finite;
|
|
167
|
-
readonly sweepDegrees: Schema.Finite;
|
|
168
|
-
readonly color: Schema.Trimmed;
|
|
169
|
-
readonly kind: Schema.Literal<"circle-arc" | "circle-segment">;
|
|
170
|
-
readonly label: Schema.optionalKey<Schema.Struct<{
|
|
171
|
-
readonly anchorX: Schema.optionalKey<Schema.Literals<readonly ["center", "left", "right"]>>;
|
|
172
|
-
readonly fontSize: Schema.optionalKey<Schema.Union<readonly [Schema.Literals<readonly ["marker", "compact", "annotation", "reading", "display", "diagram"]>, Schema.Finite]>>;
|
|
173
|
-
readonly offset: Schema.optionalKey<Schema.Tuple<readonly [Schema.Finite, Schema.Finite, Schema.Finite]>>;
|
|
174
|
-
readonly text: RichSlot<E>;
|
|
175
|
-
readonly progress: Schema.optionalKey<Schema.Finite>;
|
|
176
|
-
}>>;
|
|
177
|
-
readonly lineWidth: Schema.optionalKey<Schema.Finite>;
|
|
178
|
-
readonly segments: Schema.optionalKey<Schema.Int>;
|
|
179
|
-
}>]>;
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { Array as Arr, Schema } from "effect";
|
|
2
|
-
import { NonNegativeIntSchema } from "#contracts/assessment/scalar";
|
|
3
|
-
import { PositiveMeasureSchema, SpacePointSchema } from "#contracts/math/base";
|
|
4
|
-
import { TextSchema, TripleSchema, } from "#contracts/visual/card";
|
|
5
|
-
/** The named sizes of a label in a three-dimensional scene. */
|
|
6
|
-
const FONT_SIZES = [
|
|
7
|
-
"marker",
|
|
8
|
-
"compact",
|
|
9
|
-
"annotation",
|
|
10
|
-
"reading",
|
|
11
|
-
"display",
|
|
12
|
-
"diagram",
|
|
13
|
-
];
|
|
14
|
-
/** The size of a label: a named size, or a measure in scene units. */
|
|
15
|
-
const FontSizeSchema = Schema.Union([
|
|
16
|
-
Schema.Literals(FONT_SIZES),
|
|
17
|
-
PositiveMeasureSchema,
|
|
18
|
-
]);
|
|
19
|
-
/**
|
|
20
|
-
* The width of a line on screen. Zero is a width: the renderer draws no stroke,
|
|
21
|
-
* so a series with `showPoints` shows its points alone, as the answer to TKA
|
|
22
|
-
* compulsory mathematics set 3, question 8, shows its two fixed points.
|
|
23
|
-
*/
|
|
24
|
-
const LineWidthSchema = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
|
|
25
|
-
/** Whether the first or last point of a line belongs to it. */
|
|
26
|
-
const EndpointStateSchema = Schema.Literals(["open", "closed"]);
|
|
27
|
-
/** A label on a line: rich text at one of its points, nudged by an offset, at an optional size. */
|
|
28
|
-
function lineLabel(rich) {
|
|
29
|
-
return Schema.Struct({
|
|
30
|
-
anchorX: Schema.optionalKey(Schema.Literals(["center", "left", "right"])),
|
|
31
|
-
at: Schema.optionalKey(NonNegativeIntSchema),
|
|
32
|
-
fontSize: Schema.optionalKey(FontSizeSchema),
|
|
33
|
-
offset: Schema.optionalKey(TripleSchema),
|
|
34
|
-
text: rich,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/** The stroke, markers, and labels every drawn line may carry. */
|
|
38
|
-
function strokeFields(rich) {
|
|
39
|
-
return {
|
|
40
|
-
color: Schema.optionalKey(TextSchema),
|
|
41
|
-
cone: Schema.optionalKey(Schema.Struct({
|
|
42
|
-
position: Schema.Literals(["start", "end", "both"]),
|
|
43
|
-
size: Schema.optionalKey(PositiveMeasureSchema),
|
|
44
|
-
})),
|
|
45
|
-
curvePoints: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(1))),
|
|
46
|
-
endpoints: Schema.optionalKey(Schema.Struct({
|
|
47
|
-
end: Schema.optionalKey(EndpointStateSchema),
|
|
48
|
-
start: Schema.optionalKey(EndpointStateSchema),
|
|
49
|
-
})),
|
|
50
|
-
labels: Schema.optionalKey(Schema.NonEmptyArray(lineLabel(rich))),
|
|
51
|
-
lineWidth: Schema.optionalKey(LineWidthSchema),
|
|
52
|
-
pointIndices: Schema.optionalKey(Schema.NonEmptyArray(NonNegativeIntSchema)),
|
|
53
|
-
showPoints: Schema.optionalKey(Schema.Boolean),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/** The indices and label places of a line drawn through its points. */
|
|
57
|
-
const IndexedLineSchema = Schema.Struct({
|
|
58
|
-
labels: Schema.optionalKey(Schema.Array(Schema.Struct({ at: Schema.optionalKey(NonNegativeIntSchema) }))),
|
|
59
|
-
pointIndices: Schema.optionalKey(Schema.Array(NonNegativeIntSchema)),
|
|
60
|
-
points: Schema.Array(Schema.Unknown),
|
|
61
|
-
});
|
|
62
|
-
/** Checks that every index of a line names one of its points. */
|
|
63
|
-
function hasIndexedPoints(line) {
|
|
64
|
-
const count = line.points.length;
|
|
65
|
-
return (Arr.every(line.pointIndices ?? [], (index) => index < count) &&
|
|
66
|
-
Arr.every(line.labels ?? [], ({ at }) => at === undefined || at < count));
|
|
67
|
-
}
|
|
68
|
-
/** A line or curve through its points. */
|
|
69
|
-
function pointLine(rich) {
|
|
70
|
-
return Schema.Struct({
|
|
71
|
-
...strokeFields(rich),
|
|
72
|
-
points: Schema.NonEmptyArray(SpacePointSchema),
|
|
73
|
-
smooth: Schema.optionalKey(Schema.Boolean),
|
|
74
|
-
}).check(Schema.makeFilter(hasIndexedPoints, {
|
|
75
|
-
message: "Expected every point index to name a point of the line.",
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
/** A nonzero finite number, such as the amplitude of a curve. */
|
|
79
|
-
const NonZeroSchema = Schema.Finite.check(Schema.makeFilter((value) => value !== 0, {
|
|
80
|
-
message: "Expected a nonzero finite number.",
|
|
81
|
-
}));
|
|
82
|
-
/**
|
|
83
|
-
* One curve `y = amplitude · f(frequency · x + phase) + shift` over its domain,
|
|
84
|
-
* where `f` is the sine, the cosine, or the tangent. The renderer computes its
|
|
85
|
-
* points on a grid of `samples`, at least 200.
|
|
86
|
-
*/
|
|
87
|
-
const CurveSchema = Schema.Struct({
|
|
88
|
-
amplitude: NonZeroSchema,
|
|
89
|
-
domain: Schema.Tuple([Schema.Finite, Schema.Finite]).check(Schema.makeFilter(([from, to]) => from < to, {
|
|
90
|
-
message: "Expected a domain whose start is below its end.",
|
|
91
|
-
})),
|
|
92
|
-
frequency: NonZeroSchema,
|
|
93
|
-
kind: Schema.Literals(["sin", "cos", "tan"]),
|
|
94
|
-
phase: Schema.Finite,
|
|
95
|
-
samples: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(200))),
|
|
96
|
-
shift: Schema.Finite,
|
|
97
|
-
});
|
|
98
|
-
/** The radius and the turn of a circle part, in degrees. */
|
|
99
|
-
const CircleTurnFields = {
|
|
100
|
-
radius: PositiveMeasureSchema,
|
|
101
|
-
startDegrees: Schema.Finite,
|
|
102
|
-
sweepDegrees: Schema.Finite,
|
|
103
|
-
};
|
|
104
|
-
/** An arc or a segment of a circle, with one optional label along it. */
|
|
105
|
-
function circleArc(rich, kind) {
|
|
106
|
-
return Schema.Struct({
|
|
107
|
-
...CircleTurnFields,
|
|
108
|
-
color: TextSchema,
|
|
109
|
-
kind: Schema.Literal(kind),
|
|
110
|
-
label: Schema.optionalKey(Schema.Struct({
|
|
111
|
-
...lineLabel(rich).fields,
|
|
112
|
-
progress: Schema.optionalKey(Schema.Finite),
|
|
113
|
-
}).mapFields(({ at: _at, ...fields }) => fields)),
|
|
114
|
-
lineWidth: Schema.optionalKey(LineWidthSchema),
|
|
115
|
-
segments: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* One line of a `LineEquation` scene: a line through points, a curve by its
|
|
120
|
-
* formula, a cuboid, or a part of a circle.
|
|
121
|
-
*/
|
|
122
|
-
export function sceneLine(rich) {
|
|
123
|
-
const stroke = strokeFields(rich);
|
|
124
|
-
return Schema.Union([
|
|
125
|
-
pointLine(rich),
|
|
126
|
-
Schema.Struct({ ...stroke, curve: CurveSchema }),
|
|
127
|
-
Schema.Struct({
|
|
128
|
-
center: Schema.optionalKey(SpacePointSchema),
|
|
129
|
-
color: stroke.color,
|
|
130
|
-
height: PositiveMeasureSchema,
|
|
131
|
-
kind: Schema.Literal("cuboid"),
|
|
132
|
-
length: PositiveMeasureSchema,
|
|
133
|
-
lineWidth: stroke.lineWidth,
|
|
134
|
-
showPoints: stroke.showPoints,
|
|
135
|
-
width: PositiveMeasureSchema,
|
|
136
|
-
}),
|
|
137
|
-
Schema.Struct({
|
|
138
|
-
...stroke,
|
|
139
|
-
kind: Schema.Literal("circle-outline"),
|
|
140
|
-
radius: PositiveMeasureSchema,
|
|
141
|
-
}),
|
|
142
|
-
Schema.Struct({
|
|
143
|
-
...stroke,
|
|
144
|
-
...CircleTurnFields,
|
|
145
|
-
kind: Schema.Literal("circle-chord"),
|
|
146
|
-
}),
|
|
147
|
-
Schema.Struct({
|
|
148
|
-
...stroke,
|
|
149
|
-
degrees: Schema.Finite,
|
|
150
|
-
kind: Schema.Literal("circle-radius"),
|
|
151
|
-
radius: PositiveMeasureSchema,
|
|
152
|
-
}),
|
|
153
|
-
circleArc(rich, "circle-arc"),
|
|
154
|
-
circleArc(rich, "circle-segment"),
|
|
155
|
-
]);
|
|
156
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { type RichSlot } from "#contracts/visual/card";
|
|
3
|
-
/** Props of `NumberLine`: segments on a line, with an optional visible range. */
|
|
4
|
-
export declare function numberLine<E>(rich: RichSlot<E>): import("#contracts/visual/entry").VisualEntry<Schema.Struct<{
|
|
5
|
-
readonly description: RichSlot<E>;
|
|
6
|
-
readonly title: RichSlot<E>;
|
|
7
|
-
readonly max: Schema.optionalKey<Schema.Finite>;
|
|
8
|
-
readonly min: Schema.optionalKey<Schema.Finite>;
|
|
9
|
-
readonly segments: Schema.NonEmptyArray<Schema.Struct<{
|
|
10
|
-
readonly backgroundColor: Schema.optionalKey<Schema.Literal<"transparent">>;
|
|
11
|
-
readonly end: Schema.optionalKey<Schema.Finite>;
|
|
12
|
-
readonly endInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
13
|
-
readonly endLabel: Schema.optionalKey<RichSlot<E>>;
|
|
14
|
-
readonly label: Schema.optionalKey<RichSlot<E>>;
|
|
15
|
-
readonly shaded: Schema.optionalKey<Schema.Boolean>;
|
|
16
|
-
readonly showPoints: Schema.optionalKey<Schema.Boolean>;
|
|
17
|
-
readonly start: Schema.optionalKey<Schema.Finite>;
|
|
18
|
-
readonly startInclusive: Schema.optionalKey<Schema.Boolean>;
|
|
19
|
-
readonly startLabel: Schema.optionalKey<RichSlot<E>>;
|
|
20
|
-
}>>;
|
|
21
|
-
}>, "figure">;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
import { cardFields } from "#contracts/visual/card";
|
|
3
|
-
import { figure } from "#contracts/visual/entry";
|
|
4
|
-
/** The two ends of one segment; a missing end is a ray to the edge of the axis. */
|
|
5
|
-
const SegmentEndsSchema = Schema.Struct({
|
|
6
|
-
end: Schema.optionalKey(Schema.Finite),
|
|
7
|
-
start: Schema.optionalKey(Schema.Finite),
|
|
8
|
-
});
|
|
9
|
-
/** Checks that a segment that has two ends does not end before it starts. */
|
|
10
|
-
function isOrderedSegment({ end, start }) {
|
|
11
|
-
return start === undefined || end === undefined || start <= end;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* One segment of a number line. A segment without a start or an end is a ray
|
|
15
|
-
* to the edge of the axis, as the renderer draws it. The corpus sets a
|
|
16
|
-
* background only to transparent, and an arbitrary color is not part of this
|
|
17
|
-
* contract, because no meaning may ride on color.
|
|
18
|
-
*/
|
|
19
|
-
function segment(rich) {
|
|
20
|
-
return Schema.Struct({
|
|
21
|
-
backgroundColor: Schema.optionalKey(Schema.Literal("transparent")),
|
|
22
|
-
end: Schema.optionalKey(Schema.Finite),
|
|
23
|
-
endInclusive: Schema.optionalKey(Schema.Boolean),
|
|
24
|
-
endLabel: Schema.optionalKey(rich),
|
|
25
|
-
label: Schema.optionalKey(rich),
|
|
26
|
-
shaded: Schema.optionalKey(Schema.Boolean),
|
|
27
|
-
showPoints: Schema.optionalKey(Schema.Boolean),
|
|
28
|
-
start: Schema.optionalKey(Schema.Finite),
|
|
29
|
-
startInclusive: Schema.optionalKey(Schema.Boolean),
|
|
30
|
-
startLabel: Schema.optionalKey(rich),
|
|
31
|
-
}).check(Schema.makeFilter(isOrderedSegment, {
|
|
32
|
-
message: "Expected a segment that does not end before it starts.",
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
/** The visible range of a number line, each end optional. */
|
|
36
|
-
const VisibleRangeSchema = Schema.Struct({
|
|
37
|
-
max: Schema.optionalKey(Schema.Finite),
|
|
38
|
-
min: Schema.optionalKey(Schema.Finite),
|
|
39
|
-
});
|
|
40
|
-
/** Checks that the visible range of a number line runs upward. */
|
|
41
|
-
function isOrderedRange({ max, min }) {
|
|
42
|
-
return min === undefined || max === undefined || min < max;
|
|
43
|
-
}
|
|
44
|
-
/** Props of `NumberLine`: segments on a line, with an optional visible range. */
|
|
45
|
-
export function numberLine(rich) {
|
|
46
|
-
return figure(Schema.Struct({
|
|
47
|
-
...cardFields(rich),
|
|
48
|
-
...VisibleRangeSchema.fields,
|
|
49
|
-
segments: Schema.NonEmptyArray(segment(rich)),
|
|
50
|
-
}).check(Schema.makeFilter(isOrderedRange, {
|
|
51
|
-
message: "Expected a visible range whose minimum is below its maximum.",
|
|
52
|
-
})));
|
|
53
|
-
}
|