diff --git a/src/TernaryGraph.purs b/src/TernaryGraph.purs index f14caef..6f8d65b 100644 --- a/src/TernaryGraph.purs +++ b/src/TernaryGraph.purs @@ -94,9 +94,9 @@ svgTextID idMaybe text { x: x, y: y } angle style dimension = XMLFragment $ " idText <> " xml:space=\"preserve\" style=\"font-size:" <> (toString style.sizePx) <> "px;line-height:131%;font-family:'" <> style.typeface <> "';fill:#000000;stroke:#000000;stroke-width:0.0999998;stroke-linecap:round;stop-color:#000000;fill-opacity:1\" " <> "transform=\"translate(" <> (toString centerX) <> ", " <> (toString centerY) <> ") rotate(" <> (toString (angle * 180.0 / pi)) <> ")\">" <> text <> "" where - offset = rotate angle {x: dimension.widthPx, y: dimension.heightPx} - centerX = x - offset.x / 4.0 - centerY = y - offset.y / 4.0 + offset = rotate angle {x: dimension.widthPx / 4.0, y: -dimension.heightPx / 8.0} + centerX = x - offset.x + centerY = y - offset.y idText = case idMaybe of Maybe.Nothing -> "" Maybe.Just id -> "id=\"" <> id <> "\""