Encode a URL for use with the
Image mark type.
The URL can be encoded directly:
let axVals = Numbers [ 0.5, 1.5, 2.5 ]
dvals = dataFromColumns []
. dataColumn "x" axVals
. dataColumn "y" axVals
enc = encoding
. position X [ PName "x", PmType Quantitative ]
. position Y [ PName "y", PmType Quantitative ]
. url [ HString "wonderful-image.png" ]
imMark = mark Image [ MWidth 50, MHeight 25 ]
in toVegaLite [ dvals [], enc [], imMark ]
or by referencing a data field containing the URL values:
... dataColumn "img" (Strings [ "i1.png", "i2.png", "i4.png" ])
... url [ HName "img", HmType Nominal ]