I am trying to build a custom visual for datastudio, I got it working but there is a step, i can't fix, Datastudio generate a json file like this
export const message = {
"tables": {
"DEFAULT": [
{
"coordinateid": [
"143.4999336,-34.777302"
],
"colorid": [
"169,255,169"
],
"sizeid": [
1
]
},
{
"coordinateid": [
"143.4999358,-34.7773749"
],
"colorid": [
"169,169,169"
],
"sizeid": [
1
]
},
{
in deckgl the relevant code is
const drawViz = (data) => {
var data1 = data.tables.DEFAULT;
getPosition: d => d.coordinateid,
the only way to make it work, is when i remove the quotes from the values inside the array
"coordinateid": [
143.4999336,-34.777302
]
is there a way either to remove the double quotes between the bracket or a way just to parse the values and ignoring the double quotes
DataStudio returns GEO LatLong coordinates as a comma separated string. The correct way to parse this would be the following:
This will give you the coordinates as floats in an array, which seems to be the format that deckgl is expecting.