To kolejny hack, ale możesz dodać filtr do kształtu i przyciąć górny i dolny przez swoją strokewidth - co tutaj zakładam, to 1 jednostka.
<defs>
<filter id="clippy" x="0" y="1" height="248" width="356">
<feColorMatrix type="identity"/>
</filter>
</defs>
<rect filter="url(#clippy)" class="extent" width="356" height="250"
style="cursor: move;opacity: 0.2; fill: #FF9000;" x="578"></rect>
Aktualizacja:
Oto wersja d3.js z odpowiedzią stworzony przez Christophera Chiche (patrz niżej oryginalna):
svg.append("defs").append("filter")
.attr("id", "clippy")
.attr("x", "0")
.attr("y", "1")
.attr("height", "248")
.attr("width" "356")
.append("feColorMatrix")
.attr("type", "identity")
svg.append("rect")
.attr("filter", "url(#clippy)")
.attr("class", "extent")
.attr("style", "cursor:move; opacity:0.2; fill: #FF9000")
.attr("x", "578")
.attr("height", "250")
.attr("width" "356")
możliwe duplikat [Jak ustawić szerokość skoku: 1 tylko na niektórych stronach kształtów SVG] (http: // stackoverflow. com/questions/8976791/how-to-set-a-stroke-width1-on-only-certain-sides-of-svg-shapes) – KyleMit
Oto kolejne SO pytanie, które sugeruje hack to zrobić: http: // stackoverflow.com/questions/8976791/how-to-set-a-stroke-width1-on-certain-sides-of-svg-shapes – Jonah