There should be a defined template that could be used to apply marking on variety of chart libraries such as Google charts, Plotly JS, D3 etc.
Currently, there are no best practices available to enable marking and JS not being the strongest suite, it becomes very difficult to make it look as a Spotfire native visualization
Also would be good to have some sample code to do marking in plain JS and SVG.
The tricky part is rectangle or lasso marking.