Skip to content

Commit 342e35c

Browse files
author
Chris DeMartini
authored
Merge pull request #7 from uber/fix/geoJSON-bug
fix: geoJSON bug
2 parents 376e237 + 8f1a0fd commit 342e35c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/utils/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ export const log = (...msgs) => {
3737
if (process.env.NODE_ENV === 'development') console.log(...msgs);
3838
};
3939

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-
4940
// https://tableau.github.io/extensions-api/docs/enums/datatype.html
5041
export const DataTypeMap = {
5142
// TODO: Shan: figure out how to parse boolean format
@@ -60,6 +51,15 @@ export const DataTypeMap = {
6051
string: KeplerFieldTypes.string
6152
};
6253

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+
6363
export const StringToValueByType = {
6464
[KeplerFieldTypes.boolean]: d =>
6565
(typeof d === 'string' && d.toLowerCase() === 'true') ||
@@ -144,7 +144,7 @@ export function analyzeStringFields(fields, data) {
144144
fieldMeta.forEach(({name, type}, i) => {
145145
if (type === KeplerFieldTypes.geojson) {
146146
// update current fieldType
147-
const index = stringFields[i].tableauIdx;
147+
const index = fields[i].tableauIdx;
148148
const geoField = {
149149
...fields[index],
150150
type: KeplerFieldTypes.geojson

0 commit comments

Comments
 (0)