@@ -56,20 +56,20 @@ const ChartVisualization = ({
56
56
57
57
const { rowStart, rowEnd, colStart, colEnd } = selectedCells ;
58
58
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
60
60
if ( rowStart === - 1 || colStart === - 1 || rowEnd >= data . length || rowStart < 0 ) {
61
61
return null ;
62
62
}
63
63
64
- // Verificar se todos os índices de linha são válidos
64
+ // Check if all row indices are valid
65
65
for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
66
66
if ( ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
67
67
return null ; // Dados inconsistentes, abortar
68
68
}
69
69
}
70
70
71
71
// 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
73
73
let isTimeSeries = false ;
74
74
let dateColumnName = null ;
75
75
let dateColumnIndex = - 1 ;
@@ -82,20 +82,20 @@ const ChartVisualization = ({
82
82
continue ;
83
83
}
84
84
85
- // Verificar o tipo da coluna no schema
85
+ // Check the column type in the schema
86
86
const columnType = columns [ columnName ] ?. type ;
87
87
const isDateColumn = columnType === 'Date' ||
88
88
/ ^ ( 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 ) ||
89
89
columnName . toLowerCase ( ) . includes ( 'date' ) ||
90
90
columnName . toLowerCase ( ) . includes ( 'time' ) ;
91
91
92
92
if ( isDateColumn ) {
93
- // Verificar se a coluna contém realmente datas válidas
93
+ // Check if the column actually contains valid dates
94
94
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
96
96
97
97
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
99
99
if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
100
100
continue ;
101
101
}
@@ -110,7 +110,7 @@ const ChartVisualization = ({
110
110
isTimeSeries = true ;
111
111
dateColumnName = columnName ;
112
112
dateColumnIndex = colIndex ;
113
- break ; // Encontrou uma coluna de data válida
113
+ break ; // Found a valid date column
114
114
}
115
115
}
116
116
}
@@ -136,7 +136,7 @@ const ChartVisualization = ({
136
136
const dataPoints = [ ] ;
137
137
138
138
for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
139
- // Verificar se o índice é válido
139
+ // Check if the index is valid
140
140
if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
141
141
continue ;
142
142
}
@@ -217,12 +217,12 @@ const ChartVisualization = ({
217
217
continue ;
218
218
}
219
219
220
- // Coletar todos os valores desta coluna
220
+ // Collect all values from this column
221
221
const columnValues = [ ] ;
222
222
const columnLabels = [ ] ;
223
223
224
224
for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
225
- // Verificar se o índice é válido
225
+ // Check if the index is valid
226
226
if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
227
227
continue ;
228
228
}
@@ -272,7 +272,7 @@ const ChartVisualization = ({
272
272
color : '#333'
273
273
} ,
274
274
legend : {
275
- display : datasets . length > 1 // Mostrar legenda se múltiplas colunas
275
+ display : datasets . length > 1 // Show legend if multiple columns
276
276
} ,
277
277
tooltip : {
278
278
backgroundColor : 'rgba(0, 0, 0, 0.8)' ,
@@ -302,7 +302,7 @@ const ChartVisualization = ({
302
302
const columnName = order [ colStart ] ?. name ;
303
303
if ( columnName ) {
304
304
for ( let rowIndex = rowStart ; rowIndex <= rowEnd ; rowIndex ++ ) {
305
- // Verificar se o índice é válido
305
+ // Check if the index is valid
306
306
if ( rowIndex >= data . length || ! data [ rowIndex ] || ! data [ rowIndex ] . attributes ) {
307
307
continue ;
308
308
}
0 commit comments