Problems for drawing symbol using vega


#1

Hi,
I have a piece of vega style code that used to draw points, and last week I was able to draw points normally, but when I run it again today, it just can’t draw points at all.

Here is the code:
const vega_spec =
{
width,
height,
“data”: [
{
“name”: “points”,
“sql”: sls SELECT rowid, conv_4326_900913_x(x) as x, conv_4326_900913_y(y) as y FROM share_point
}
],
“scales”: [
{
“name”: “x”,
“type”: “linear”,
“domain”: [minXBounds, maxXBounds],
“range”: “width”
},
{
“name”: “y”,
“type”: “linear”,
“domain”: [minYBounds, maxYBounds],
“range”: “height”
},
],
“marks”: [
{
“type”: “symbol”,
“from”: {“data”: “points”},
“properties”: {
“width”: 5,
“height”: 5,
“x”: {
“scale”: “x”,
“field”: “x”
},
“y”: {
“scale”: “y”,
“field”: “y”
},
“fillColor”: “red”,
“strokeColor”: “red”,
“fillOpacity”: 1,
“opacity”: 1,
“strokeWidth”: 5,
“shape”: “square”
},
},
]
}

The structure of table share_point:
x DOUBLE NOT NULL,
y DOUBLE NOT NULL

Result:
mapd didn’t give me any error warnings, it just returned a blank image, so I don’t know what to do.

Note:I am using mapd gpu 4.1 community version.

Thanks
Jason


#2

Hi @Jason,

I created a sample dataset with x & y which are defined as double:

I was able to render the points using Vega after converting SRID 4326 to web mercator: