2

SVG要素にロードしている大きな画像があります:

<svg id="plate-svg" width="800px" height="500px">
    <image id="plate" xlink:href="plate_red.JPG" x="0" y="0" height="500px" width="800px"/>
</svg>
<div id="mpos"></div>

そして、私はこのようにマウスの位置を設定しています:

<script>
function mouseover(d, i) {
  var x = d3.mouse(this)
  d3.select('#mpos').text(x);
}
var plate = d3.select('#plate-svg')
plate.on("mousemove", mouseover);
</script>

ただし、元の大きな画像に対するマウスの座標が必要です。これは可能ですか?

ありがとう

4

0 に答える 0