add `annotations` guide
See original GitHub issueFollowing this vega-lite related issue as well as #749 , I wonder whether it would make sense adding a more general annotations guide in the same fashion as the axes or legends guides, allowing to place a text annotation anywhere in the visualisation. Examples of annotations are title, subtitle, source, explanations within the graph, etc.
Placement could happen in a similar fashion than legends (top, right, bottom, left, etc. , (x, y) values in encoding block, or even scale dependent x and y values). An array could contain several annotation objects, each one specified and placed on its own.
text marks can currently be used for that purpose but their use as annotations is not obvious to everyone. When there are many annotations, the use of text mark & co. will remain the way to go. Maybe a good short run solution would be to provide a quick tutorial or example on how annotations can already be implemented.
The advantages of annotations as a guide over annotations as a text mark instance are:
- more intuitive use for single instance annotations outside of the plot (e.g. title) and their better visibility in the spec, thus improving the documentation of the latter;
- no need for extra
data,scale,filtertransform, etc. definitions to render a single piece of text;
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:16 (8 by maintainers)

Top Related StackOverflow Question
Yes. Please take a look at the fantastic work on annotations by @susielu http://d3-annotation.susielu.com/
I just wanted to point out that when using vega-embed, the susielu d3 annotations work quite well with vega if you use SVG as the renderer. If you don’t mind blending the two, I’d recommend going that route for anyone else looking to incorporate annotations for the time being!