@@ -37,15 +37,6 @@ export const log = (...msgs) => {
37
37
if ( process . env . NODE_ENV === 'development' ) console . log ( ...msgs ) ;
38
38
} ;
39
39
40
- export const columnToKeplerField = ( col , i ) => ( {
41
- // TODO: generate time format here
42
- format : '' ,
43
- name : col . fieldName ,
44
- type : DataTypeMap [ col . dataType ] ,
45
- tableauType : col . dataType ,
46
- tableauIdx : i
47
- } ) ;
48
-
49
40
// https://tableau.github.io/extensions-api/docs/enums/datatype.html
50
41
export const DataTypeMap = {
51
42
// TODO: Shan: figure out how to parse boolean format
@@ -60,6 +51,15 @@ export const DataTypeMap = {
60
51
string : KeplerFieldTypes . string
61
52
} ;
62
53
54
+ export const columnToKeplerField = ( col , i ) => ( {
55
+ // TODO: generate time format here
56
+ format : '' ,
57
+ name : col . fieldName ,
58
+ type : DataTypeMap [ col . dataType ] ,
59
+ tableauType : col . dataType ,
60
+ tableauIdx : i
61
+ } ) ;
62
+
63
63
export const StringToValueByType = {
64
64
[ KeplerFieldTypes . boolean ] : d =>
65
65
( typeof d === 'string' && d . toLowerCase ( ) === 'true' ) ||
@@ -144,7 +144,7 @@ export function analyzeStringFields(fields, data) {
144
144
fieldMeta . forEach ( ( { name, type} , i ) => {
145
145
if ( type === KeplerFieldTypes . geojson ) {
146
146
// update current fieldType
147
- const index = stringFields [ i ] . tableauIdx ;
147
+ const index = fields [ i ] . tableauIdx ;
148
148
const geoField = {
149
149
...fields [ index ] ,
150
150
type : KeplerFieldTypes . geojson
0 commit comments