img = {
var mapdVega = {
width: 1410,
height: 399,
data: [
{
name: 'points',
sql
}
],
scales: [
{
name: 'x',
type: 'linear',
domain: [
-20037508.34004,
20037508.34004
],
range: 'width'
},
{
name: 'y',
type: 'linear',
domain: [
-2166638.6872511,
9173738.3733072
],
range: 'height'
},
{
name: 'points_size',
type: 'linear',
domain: [
0,
5000
],
range: [
1,
5
],
clamp: true
},
{
name: 'points_fillColor',
type: 'ordinal',
domain: ordDomains,
range: colors,
'default': '#80DEEA',
nullValue: '#CACACA'
}
],
marks: [
{
type: 'points',
from: {
data: 'points'
},
properties: {
x: {
scale: 'x',
field: 'x'
},
y: {
scale: 'y',
field: 'y'
},
size: {
scale: 'points_size',
field: 'size'
},
fillColor: {
scale: 'points_fillColor',
field: 'color'
}
}
}
]
}
var data = connector.renderVega(0, JSON.stringify(mapdVega))
var blobUrl = "data:image/png;base64," + data.image
return blobUrl
}