SVG의 Marker-end가 안 나오는 문제.

1518 단어
문제 설명: d3로 그린 그림,svg와div가 겹쳐진 그림,svg로 연결선과 화살표를 그렸고,div에서 d3로 개성화된 전시 패널을 만들었으며, 프로젝트 첫 페이지,d3로 생성된svg 라벨 파일을 단독으로 복사하면 화살표(marker-end)를 볼 수 있습니다!
솔루션
The HTML element is used to say “resolve all relative URLs relative not to this page, but to a new location”. In your case, you’ve told it to resolve relative to the directory with the HTML page.
The SVG marker-mid=”url(…)” attribute is a FuncIRI Reference. When you use a value like url(#foo) that relative IRI is normally resolved relative to the current page, finding the element with the foo id. But, when you use , you change where it looks.
To solve this problem, use a better value. Since your base reference is the current directory, you can simply use the name of the current file:
<line … marker-mid="url(this_page_name.html#arrow)" />

If you have a different href, than what you’ve shown, like:
<base href="http://other.site.com/whee/" />

then you will need to use an absolute href, e.g.
<line … marker-mid="url(http://my.site.com/this_page_name.html#arrow)" />

Angular를 사용하는 경우 $location을 사용할 수 있습니다.path!

좋은 웹페이지 즐겨찾기