marcuscalidus-svg-panel
marcuscalidus-svg-panel copied to clipboard
.image question
Greetings,
This is a lovely plugin!
What is the location of the image referenced below?
const arrow = s.image("apple.png", 10, 10, 150, 150);
And can I use my own image?
Thanks!
ok, I think I now understand. I either need to use a url
const url = 'http://openweathermap.org/img/wn/[email protected]'
or this part of the docu says
To add your own custom SVG graphics you have to fork the original project and add them to the assets folder.
Thanks!
interesting you can even refer to a file on disk
const img = '/public/img/wind-direction-arrow.svg'
drawArrow();
function drawArrow() {
//10,10,150,150
//"apple.png", 10, 10, 80, 80
const arrow = s.image(img,140,10,40,40);
arrow.attr({fill: "blue", transform: "rotate(45)"});
const arrow2 = s.image(img,50,10,40,40);
arrow2.attr({stroke:"blue", fill:"purple", transform: "rotate(-13)"});
const arrow3 = s.image(img,205,7,40,40);
arrow3.attr({stroke:"blue", fill:"purple", transform: "rotate(45)"});
}