File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change 1515 < select id ="dateSelect ">
1616 < option value ="freq_6months "> 6 months</ option >
1717 < option value ="freq_1year "> 1 year</ option >
18- < option value ="freq_2years "> 2 years</ option >
18+ < option value ="freq_2year "> 2 years</ option >
1919 < option value ="freq_alltime "> All time</ option >
2020 </ select >
2121 </ div >
Original file line number Diff line number Diff line change @@ -90,26 +90,13 @@ async function updateFrequency(selectedFrequency: string) {
9090 const companyProblems = data . companyProblems [ companyName ] ;
9191 if ( Array . isArray ( companyProblems ) ) {
9292 solutions . forEach ( ( solution , index ) => {
93- solution . frequency = companyProblems [ index ] [ selectedFrequency ] ;
93+ // Update the frequency based on the selected option
94+ solution [ 'frequency' ] = companyProblems [ index ] [ selectedFrequency ] ;
9495 } ) ;
9596 }
9697
9798 // Rebuild the table with updated frequency values
98- solutions . forEach ( ( solution ) => {
99- const row = table . insertRow ( - 1 ) ;
100- row . insertCell ( 0 ) . innerText = solution . id . toString ( ) ;
101- row . insertCell ( 1 ) . innerHTML = `<a href="${ solution . url } " target="_blank">${ solution . title } </a>` ;
102-
103- // Add frequency as a bar
104- const frequencyCell = row . insertCell ( 2 ) ;
105- const bar = document . createElement ( 'div' ) ;
106- const width = ( ( solution . frequency - minFrequency ) / ( maxFrequency - minFrequency ) ) * 100 ;
107- bar . style . width = width + '%' ;
108- bar . style . height = '10px' ;
109- bar . style . backgroundColor = 'lightgreen' ;
110- bar . style . borderRadius = '10px' ;
111- frequencyCell . appendChild ( bar ) ;
112- } ) ;
99+ rebuildTable ( ) ;
113100}
114101
115102interface Company {
You can’t perform that action at this time.
0 commit comments