좋은 아침,
D3를 사용하여 코드 다이어그램을 만들었습니다. 그러나 일부 버전의 Chrome에서 경로가 제대로 렌더링되지 않는 출력 문제가 발생했습니다.
다음은 D3에 의해 생성 된 문제 경로의 예입니다.
<svg height="1000px" width="1000px">
<g transform="translate(400,400)">
<path d="M329.2336690603744,-46.49130195040491A332.5,332.5 0 0,1 329.2336694247276,-46.491299370194035Q 0,0 -25.421977592957564,-331.5267305290222A332.5,332.5 0 0,1 -25.42197499477598,-331.5267307282548Q 0,0 329.2336690603744,-46.49130195040491Z" class="chord" fill="#c8cfdc" stroke-width="1px" stroke="#000000"></path>
</g>
</svg>
대부분의 브라우저에서 단일 호가 표시됩니다. 그러나 Ubuntu 14.04에서 Chrome 버전 36.0.1985.125를 실행하는 dev 컴퓨터에서는 큰 회색 원 위에 호가 표시됩니다. 큰 원은 다이어그램의 나머지 부분을 파괴합니다.
이 경로의 d 속성에 대해 브라우저에서 일관되지 않게 칠할 수있는 문제가 있습니까?
감사합니다.
다음은 잘못되었을 때 내가 보는 이미지입니다.
@jshanley의 설명을 확장하면 경로 데이터의 분류는 다음과 같습니다 (가독성을 위해 긴 소수 자릿수를 잘라 냄).
d="M 329,-46
//Move the pen to the starting point (329,-46)
A 332.5,332.5 0 0,1 329,-46
//draw a circular arc (radius in both directions 332.5 with 0 degrees rotation),
//in a clockwise direction taking the shortest route (flags 0,1)
//ending at point (329,-46).
//In a normal chord diagram, this is the edge of the chord, which follows the
//arc of the large circle.
//However, in this case the start and end points are the same
//and nothing should be drawn
Q 0,0 -25,-331
//draw a quadratic curve to point (-25, -331) using control point (0,0)
//this is the curve you see, connecting different points on the large circle
A 332.5,332.5 0 0,1 -25,-331
//another arc with the same start and end points, which shouldn't be drawn
Q 0,0 329,-46
//Another quadratic curve, the exact same shape as the previous one
//but going back in the opposite direction;
//this is what causes the curve to look like a single line, no fill
Z"
//close the shape
이것은 사용중인 Ubuntu Chrome 버전의 확실한 버그입니다. 동일한 지점에서 시작하고 끝나는 경로 호 세그먼트 는 명확하게 정의되지 않았기 때문에 플래그 설정에 관계없이 건너 뛰어야 합니다. 브라우저가 자동으로 건너 뛰지 않더라도 "짧은 호"플래그를 존중하고 길이가 0 인 호를 그릴 것이라고 생각할 것입니다.
특정 브라우저 버전에 대한 지원이 중요한 경우 코드에 오류 검사를 추가하여 양쪽 끝의 너비가 0 일 때 코드를 전혀 그리지 않거나 경로를 수동으로 편집하지 않도록해야합니다. 빈 호 명령을 제거하기위한 데이터.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다