Моя цель - добавить изображение в существующий круг с d3. Круг будет отображать и взаимодействовать с методом mouseover, но только когда я использую "fill", "color", а не что-то более сложное, например .append( "image" ).
g.append("circle")
.attr("class", "logo")
.attr("cx", 700)
.attr("cy", 300)
.attr("r", 10)
.attr("fill", "black") // this code works OK
.attr("stroke", "white") // displays small black dot
.attr("stroke-width", 0.25)
.on("mouseover", function(){ // when I use .style("fill", "red") here, it works
d3.select(this)
.append("svg:image")
.attr("xlink:href", "/assets/images/logo.jpeg")
.attr("cx", 700)
.attr("cy", 300)
.attr("height", 10)
.attr("width", 10);
});
Изображение не отображается после мышки. Использование приложения Ruby on Rails, где мое изображение "logo.jpeg" хранится в каталоге assets/images/. Любая помощь для получения моего логотипа в круге? Спасибо.