Overlay values as text in a PlotlyJS heatmap annotations

I would first define the plot trace (data) separate to the layout options; annotations are added in layouts, not traces. So a simple example:

trace = heatmap(x=["a","b"],y=["c","d"],z=rand(2,2),
              colorscale="Reds",
              showscale=false)

layout = Layout(
       annotations=[
           attr(x=0.25, y=0.25, text=1),
           attr(x=0.25, y=0.75, text=2), 
           attr(x=0.75, y=0.25, text=3),
           attr(x=0.85, y=0.95, text=4, showarrow=false)
           ],
           font=attr(size=20))

plot(trace, layout)

If you want to get more involved, consider this example: Annotated Heatmap

Unfortunately, there is currently no equivalent in the Julia Plotly examples, but you can adapt most JavaScript examples by remembering to use the notation font=attr(family="Arial", size=12) in place of the JavaScript equivalent

font: {
        family: 'Arial',
        size: 12,
}

Full options for annotations are described here: annotations