@@ -56,20 +56,20 @@ const ChartVisualization = ({
5656
5757 const { rowStart, rowEnd, colStart, colEnd } = selectedCells ;
5858
59- // Verificar se temos dados válidos e se os índices são válidos
59+ // Check if we have valid data and if indices are valid
6060 if ( rowStart === - 1 || colStart === - 1 || rowEnd >= data . length || rowStart < 0 ) {
6161 return null ;
6262 }
6363
64- // Verificar se todos os índices de linha são válidos
64+ // Check if all row indices are valid
6565 for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
6666 if ( ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
6767 return null ; // Dados inconsistentes, abortar
6868 }
6969 }
7070
7171 // Determinar se é time series de forma mais rigorosa
72- // Time series se: temos múltiplas colunas E pelo menos uma coluna é data
72+ // Time series if: we have multiple columns AND at least one column is a date
7373 let isTimeSeries = false ;
7474 let dateColumnName = null ;
7575 let dateColumnIndex = - 1 ;
@@ -82,20 +82,20 @@ const ChartVisualization = ({
8282 continue ;
8383 }
8484
85- // Verificar o tipo da coluna no schema
85+ // Check the column type in the schema
8686 const columnType = columns [ columnName ] ?. type ;
8787 const isDateColumn = columnType === 'Date' ||
8888 / ^ ( d a t e | t i m e | c r e a t e d | u p d a t e d | w h e n | a t ) $ / i. test ( columnName ) ||
8989 columnName . toLowerCase ( ) . includes ( 'date' ) ||
9090 columnName . toLowerCase ( ) . includes ( 'time' ) ;
9191
9292 if ( isDateColumn ) {
93- // Verificar se a coluna contém realmente datas válidas
93+ // Check if the column actually contains valid dates
9494 let dateCount = 0 ;
95- const totalRows = Math . min ( 3 , rowEnd - rowStart + 1 ) ; // Verificar até 3 linhas
95+ const totalRows = Math . min ( 3 , rowEnd - rowStart + 1 ) ; // Check up to 3 rows
9696
9797 for ( let rowIndex = rowStart ; rowIndex < rowStart + totalRows ; rowIndex ++ ) {
98- // Verificar se o índice é válido antes de acessar
98+ // Check if the index is valid before accessing
9999 if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
100100 continue ;
101101 }
@@ -110,7 +110,7 @@ const ChartVisualization = ({
110110 isTimeSeries = true ;
111111 dateColumnName = columnName ;
112112 dateColumnIndex = colIndex ;
113- break ; // Encontrou uma coluna de data válida
113+ break ; // Found a valid date column
114114 }
115115 }
116116 }
@@ -136,7 +136,7 @@ const ChartVisualization = ({
136136 const dataPoints = [ ] ;
137137
138138 for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
139- // Verificar se o índice é válido
139+ // Check if the index is valid
140140 if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
141141 continue ;
142142 }
@@ -217,12 +217,12 @@ const ChartVisualization = ({
217217 continue ;
218218 }
219219
220- // Coletar todos os valores desta coluna
220+ // Collect all values from this column
221221 const columnValues = [ ] ;
222222 const columnLabels = [ ] ;
223223
224224 for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
225- // Verificar se o índice é válido
225+ // Check if the index is valid
226226 if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
227227 continue ;
228228 }
@@ -272,7 +272,7 @@ const ChartVisualization = ({
272272 color : '#333'
273273 } ,
274274 legend : {
275- display : datasets . length > 1 // Mostrar legenda se múltiplas colunas
275+ display : datasets . length > 1 // Show legend if multiple columns
276276 } ,
277277 tooltip : {
278278 backgroundColor : 'rgba(0, 0, 0, 0.8)' ,
@@ -302,7 +302,7 @@ const ChartVisualization = ({
302302 const columnName = order [ colStart ] ?. name ;
303303 if ( columnName ) {
304304 for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
305- // Verificar se o índice é válido
305+ // Check if the index is valid
306306 if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
307307 continue ;
308308 }
0 commit comments