Skip to content

Commit 7fd0b70

Browse files
committed
able to pull actions to compare in performance visx, need to fix rendering frequency
1 parent 5ceb3c1 commit 7fd0b70

File tree

3 files changed

+37
-29
lines changed

3 files changed

+37
-29
lines changed

src/app/components/Action.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const Action = (props: ActionProps): JSX.Element => {
113113
<Trigger type="trigger">
114114
<div className="action-component-trigger" style={index > sliderIndex ? { color: '#5f6369' } : {}}>
115115
<div className="action-component-text">
116-
{`${displayName}: ${componentName !== 'nameless' ? componentName : ''} `}
116+
<input key={`ActionInput${displayName}`} type="text" className="actionname" placeholder={`${displayName}: ${componentName !== 'nameless' ? componentName : ''} `} />
117117
</div>
118118
<button className="time-button" type="button">
119119
{displayTime}

src/app/components/BarGraph.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,20 @@ const BarGraph = props => {
123123
}
124124
});
125125

126-
// const test = 0;
126+
const saveSeriesClickHandler = () => {
127+
const seriesName = document.getElementById('seriesname').value;
128+
const actionNames = document.getElementsByClassName('actionname');
129+
console.log("action names", actionNames);
130+
// const testname = document.getElementsByClassName('actionname').value
131+
// console.log(testname)
132+
for (let i = 0; i < actionNames.length; i++ ) {
133+
toStorage.data.barStack[i].name = actionNames[i].value;
134+
}
135+
// displayName: ${componentName !== 'nameless' ? componentName :
127136

128-
// let textbox;
129-
// function textboxCreator() {
130-
// if (test === 0) {
131-
// textbox = <input type="text" className="seriesname" placeholder="Series Name" />
132-
// }
133-
// test++;
134-
// }
137+
138+
dispatch(save(toStorage, seriesName));
139+
}
135140

136141
// const textbox = tabs[currentTab].seriesSavedStatus === 'inputBoxOpen' ? <input type="text" className="seriesname" placeholder="Series Name" /> : null
137142

@@ -141,16 +146,7 @@ const BarGraph = props => {
141146
<button
142147
type="button"
143148
className="save-series-button"
144-
onClick={e => {
145-
// textboxCreator();
146-
const seriesName = document.getElementById('seriesname').value;
147-
console.log("seriesName", seriesName)
148-
// render text box if not already rendered
149-
// grab text from textbox
150-
// dispatch save tostorage if text is being passed in
151-
// if not do nothing
152-
dispatch(save(toStorage, seriesName));
153-
}}
149+
onClick={saveSeriesClickHandler}
154150
>
155151
Save Series
156152
</button>

src/app/components/BarGraphComparison.tsx

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ const BarGraphComparison = props => {
235235
for (let i = 0; i < classname.length; i++) {
236236
classname[i].addEventListener('click', animateButton, false);
237237
}
238+
const seriesList = comparison.map(elem => elem.data.barStack);
239+
const actionsList = seriesList.flat();
240+
const testList = actionsList.map(elem => elem.name);
241+
242+
const finalList = [];
243+
for (let i = 0; i < testList.length; i++) {
244+
if (testList[i] !== "") finalList.push(testList[i]);
245+
}
246+
console.log('Final List', finalList)
247+
// )
248+
238249
return (
239250
<div>
240251
<div className="series-options-container">
@@ -248,7 +259,7 @@ const BarGraphComparison = props => {
248259
>
249260
Clear All Series
250261
</button>
251-
<h4 style={{ padding: '0 1rem' }}>Comparison Series: </h4>
262+
<h4 style={{ padding: '0 1rem' }}>Compare Series: </h4>
252263
<FormControl variant="outlined" className={classes.formControl}>
253264
<Select
254265
style={{ color: 'white' }}
@@ -273,7 +284,7 @@ const BarGraphComparison = props => {
273284
)}
274285
</Select>
275286
</FormControl>
276-
{/* <h4 style={{ padding: '0 1rem' }}>Comparator Snapshot? </h4>
287+
<h4 style={{ padding: '0 1rem' }}>Compare Actions </h4>
277288
<FormControl variant="outlined" className={classes.formControl}>
278289
<Select
279290
style={{ color: 'white' }}
@@ -289,14 +300,13 @@ const BarGraphComparison = props => {
289300
{!comparison[snapshots] ? (
290301
<MenuItem>No snapshots available</MenuItem>
291302
) : (
292-
titleFilter(comparison).map((tabElem, index) => {
293-
return (
294-
<MenuItem value={index}>{`${index + 1}`}</MenuItem>
295-
);
296-
})
297-
)}
303+
// finalList.map((elem, index) => (
304+
// <MenuItem value={index}>{elem}</MenuItem>
305+
<MenuItem value="test">Testing</MenuItem>
306+
)
307+
}
298308
</Select>
299-
</FormControl> */}
309+
</FormControl>
300310
</div>
301311
</div>
302312

@@ -335,7 +345,7 @@ const BarGraphComparison = props => {
335345
// Uses map method to iterate through all components,
336346
// creating a rect component (from visx) for each iteration.
337347
// height/width/etc. are calculated by visx.
338-
// to set X and Y scale, it will used the passed in function and
348+
// to set X and Y scale, it will used the p`assed in function and
339349
// will run it on the array thats outputted by data
340350
const bar = barStack.bars[currentIndex];
341351
if (Number.isNaN(bar.bar[1]) || bar.height < 0) {
@@ -379,6 +389,8 @@ const BarGraphComparison = props => {
379389
// Comparison Barstack (populates based on series selected)
380390
// to set X and Y scale, it will used the passed in function and
381391
// will run it on the array thats outputted by data
392+
// setXpointsComparison()}
393+
// comparison[series].data.barStack
382394
data={!comparison[series] ? [] : setXpointsComparison()}
383395
keys={keys}
384396
x={getCurrentTab}

0 commit comments

Comments
 (0)