more
This commit is contained in:
+12
-2
@@ -28,14 +28,24 @@ export interface Metrics {
|
||||
gender: Gender;
|
||||
};
|
||||
|
||||
type DataMetric = Extract<keyof Metrics, "age" | "weight">;
|
||||
|
||||
export interface Standard {
|
||||
metrics: Metrics;
|
||||
levels: Levels;
|
||||
}
|
||||
|
||||
type StandardsGeneratorOptions = {
|
||||
metric: DataMetric,
|
||||
spread: number,
|
||||
step: number,
|
||||
ratio: "normal" | "inverse"
|
||||
}
|
||||
|
||||
export type ActivityStandards = Record<Activity, {
|
||||
metadata: {
|
||||
attribute: Attribute
|
||||
attribute: Attribute,
|
||||
standardsGeneratorOptions: StandardsGeneratorOptions[]
|
||||
},
|
||||
standards: Standard[]
|
||||
}>;
|
||||
@@ -269,7 +279,7 @@ export class Standards {
|
||||
getOne: function() {
|
||||
return execMethods.getAll()[0];
|
||||
},
|
||||
getNearest(metric: "age" | "weight", target: number) {
|
||||
getNearest(metric: DataMetric, target: number) {
|
||||
const standards = execMethods.getAll();
|
||||
const lower = [...standards]
|
||||
.sort((a, b) => a.metrics[metric] - b.metrics[metric])
|
||||
|
||||
+19
-6
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"BackSquat": {
|
||||
"metadata": {
|
||||
"attribute": "Strength"
|
||||
"attribute": "Strength",
|
||||
"standardsGeneratorOptions": []
|
||||
},
|
||||
"standards": [
|
||||
{
|
||||
@@ -1576,7 +1577,8 @@
|
||||
},
|
||||
"Deadlift": {
|
||||
"metadata": {
|
||||
"attribute": "Strength"
|
||||
"attribute": "Strength",
|
||||
"standardsGeneratorOptions": []
|
||||
},
|
||||
"standards": [
|
||||
{
|
||||
@@ -3151,7 +3153,8 @@
|
||||
},
|
||||
"BenchPress": {
|
||||
"metadata": {
|
||||
"attribute": "Strength"
|
||||
"attribute": "Strength",
|
||||
"standardsGeneratorOptions": []
|
||||
},
|
||||
"standards": [
|
||||
{
|
||||
@@ -4726,7 +4729,15 @@
|
||||
},
|
||||
"Run": {
|
||||
"metadata": {
|
||||
"attribute": "Endurance"
|
||||
"attribute": "Endurance",
|
||||
"standardsGeneratorOptions": [
|
||||
{
|
||||
"metric": "weight",
|
||||
"spread": 50,
|
||||
"step": 12,
|
||||
"ratio": "inverse"
|
||||
}
|
||||
]
|
||||
},
|
||||
"standards": [
|
||||
{
|
||||
@@ -5209,7 +5220,8 @@
|
||||
},
|
||||
"BroadJump": {
|
||||
"metadata": {
|
||||
"attribute": "Power"
|
||||
"attribute": "Power",
|
||||
"standardsGeneratorOptions": []
|
||||
},
|
||||
"standards": [
|
||||
{
|
||||
@@ -5244,7 +5256,8 @@
|
||||
},
|
||||
"ConeDrill": {
|
||||
"metadata": {
|
||||
"attribute": "Agility"
|
||||
"attribute": "Agility",
|
||||
"standardsGeneratorOptions": []
|
||||
},
|
||||
"standards": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user