-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuildListOfMeasurementMethods.ts
68 lines (64 loc) · 2.04 KB
/
buildListOfMeasurementMethods.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { ClientMeasurementObject } from "../interfaces/ClientMeasurementObject";
import { nameForMeasurementMethod } from "./nameForMeasurementMethod";
import { symbolForMeasurementType } from "./symbolForMeasurementType";
import { VictoryLegendDatum } from "../interfaces/VictoryLegendData";
export const selectedMeasurementMethods = (childMeasurements: ClientMeasurementObject, styles: { [key: string]: any }) => {
const finalList: VictoryLegendDatum[]=[];
if (childMeasurements.height.length > 0){
const symbol=symbolForMeasurementType("height");
const name=nameForMeasurementMethod("height");
finalList.push({
name: name,
symbol: {
fill: styles.heightSDS.data.stroke,
type: symbol
},
labels: {
size: 8
}
});
}
if (childMeasurements.weight.length > 0){
const symbol=symbolForMeasurementType("weight");
const name=nameForMeasurementMethod("weight");
finalList.push({
name: name,
symbol: {
fill: styles.weightSDS.data.stroke,
type: symbol
},
labels: {
size: 8
}
});
}
if (childMeasurements.bmi.length > 0){
const symbol=symbolForMeasurementType("bmi");
const name=nameForMeasurementMethod("bmi");
finalList.push({
name: name,
symbol: {
fill: styles.bmiSDS.data.stroke,
type: symbol
},
labels: {
size: 8
}
});
}
if (childMeasurements.ofc.length > 0){
const symbol=symbolForMeasurementType("ofc");
const name=nameForMeasurementMethod("ofc");
finalList.push({
name: name,
symbol: {
fill: styles.ofcSDS.data.stroke,
type: symbol
},
labels: {
size: 8
}
});
}
return finalList;
}