Skip to content

Commit 6ec7cc7

Browse files
author
Brent Kimmel
committed
Robert Austin review: replace function with consts
1 parent 2da7cb0 commit 6ec7cc7

1 file changed

Lines changed: 16 additions & 25 deletions

File tree

x-pack/plugins/endpoint/public/embeddables/resolver/view/process_event_dot.tsx

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,12 @@ export const ProcessEventDot = styled(
110110
);
111111

112112
const markerBaseSize = 15;
113-
const markerSize = (magFactor: number) => {
114-
return markerBaseSize;
115-
};
113+
const markerSize = markerBaseSize;
114+
const markerPositionOffset = -markerBaseSize / 2;
116115

117-
const markerPositionOffset = (magFactor: number) => {
118-
return -markerBaseSize / 2;
119-
};
116+
const labelYOffset = markerPositionOffset + 0.25 * markerSize - 0.5;
120117

121-
const labelYOffset = (magFactor: number) => {
122-
return markerPositionOffset(magFactorX) + 0.25 * markerSize(magFactorX) - 0.5;
123-
};
124-
125-
const labelYHeight = (magFactor: number) => {
126-
return markerSize(magFactorX) / 1.7647;
127-
};
118+
const labelYHeight = markerSize / 1.7647;
128119

129120
const levelAttribute = adjacentNodeMap?.level
130121
? {
@@ -195,10 +186,10 @@ export const ProcessEventDot = styled(
195186
<use
196187
role="presentation"
197188
xlinkHref={cubeSymbol}
198-
x={markerPositionOffset(magFactorX)}
199-
y={markerPositionOffset(magFactorX)}
200-
width={markerSize(magFactorX)}
201-
height={markerSize(magFactorX)}
189+
x={markerPositionOffset}
190+
y={markerPositionOffset}
191+
width={markerSize}
192+
height={markerSize}
202193
opacity="1"
203194
className="cube"
204195
>
@@ -217,16 +208,16 @@ export const ProcessEventDot = styled(
217208
<use
218209
role="presentation"
219210
xlinkHref={`#${SymbolIds.processNode}`}
220-
x={markerPositionOffset(magFactorX) + markerSize(magFactorX) - 0.5}
221-
y={labelYOffset(magFactorX)}
222-
width={(markerSize(magFactorX) / 1.7647) * 5}
223-
height={markerSize(magFactorX) / 1.7647}
211+
x={markerPositionOffset + markerSize - 0.5}
212+
y={labelYOffset}
213+
width={(markerSize / 1.7647) * 5}
214+
height={markerSize / 1.7647}
224215
opacity="1"
225216
fill={labelFill}
226217
/>
227218
<text
228-
x={markerPositionOffset(magFactorX) + 0.7 * markerSize(magFactorX) + 50 / 2}
229-
y={labelYOffset(magFactorX) + labelYHeight(magFactorX) / 2}
219+
x={markerPositionOffset + 0.7 * markerSize + 50 / 2}
220+
y={labelYOffset + labelYHeight / 2}
230221
textAnchor="middle"
231222
dominantBaseline="middle"
232223
fontSize="3.75"
@@ -240,8 +231,8 @@ export const ProcessEventDot = styled(
240231
{eventModel.eventName(event)}
241232
</text>
242233
<text
243-
x={markerPositionOffset(magFactorX) + markerSize(magFactorX)}
244-
y={labelYOffset(magFactorX) - 1}
234+
x={markerPositionOffset + markerSize}
235+
y={labelYOffset - 1}
245236
textAnchor="start"
246237
dominantBaseline="middle"
247238
fontSize="2.67"

0 commit comments

Comments
 (0)