New (v5.8) Vega heatmap transform:
"The heatmap transform ≥ 5.8 renders input raster grids (matrices) into output heatmap images.
This transform can be used to visualize 2D input raster data, density estimates,
or mathematical functions as color grids."
The "input raster grids (matrices)" requires a different format that needs more documention
but can be seen in these Vega example data files:
The input data "matrix" of cell values is an object with properties:
"width" : number of columns
"height" : number of rows
"values" : linear array of cell values starting from top row, left column
The Vega transform kde2d can generate this dataset within the Vega spec
given a source dataset with arbitrary x, y corodinates and point values.
Note: If you do not wish to use kde2d, then you have to provide an input dataset in this "matrix" format.
Here is a working example of the new Vega heatmap transform (without kde2d and isocontour transforms):

Vega 5.9.0 spec
----------------
{
"width": 400,
"height": 300,
"padding": 20,
"data": [
{ "name": "data_heatmap",
"values": [ { "width": 4,
"height": 3,
"values": [ 10, 20, 30, 40,
80, 60, 70, 30,
50, 90, 40, 20
]
}
],
"transform": [
{
"type": "heatmap",
"color": {"expr": "scale('scale_color', datum.$value)"},
"opacity": 0.8,
"as": "heatmap_image"
}
]
}
],
"scales": [
{ "name": "scale_x",
"type": "linear",
"domain": [0, 4],
"range": "width"
},
{ "name": "scale_y",
"type": "linear",
"domain": [0, 3],
"range": "height"
},
{"name": "scale_color",
"type": "linear",
"domain": [0, 100],
"range": {"scheme": "blues"}
}
],
"axes": [
{
"scale": "scale_x",
"orient": "bottom",
"tickCount": 5,
"title": "x",
"grid": true
},
{
"scale": "scale_y",
"orient": "left",
"tickCount": 4,
"title": "y",
"grid": true
}
],
"marks": [
{
"type": "image",
"from": {"data": "data_heatmap"},
"encode": {
"update": {
"x": {"value": 0},
"y": {"value": 0},
"image": {"field": "heatmap_image"},
"width": {"signal": "width"},
"height": {"signal": "height"},
"smooth": true
}
}
}
]
}