Skip to content

Commit

Permalink
✨ (grapher) add labels for manual editing (#3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann authored May 27, 2024
1 parent 8bf0ef7 commit 6c73dfc
Show file tree
Hide file tree
Showing 26 changed files with 467 additions and 217 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ dist/
.wrangler/
.nx/cache
.dev.vars
**/tsup.config.bundled*.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,11 @@ export class MarkdownTextWrap extends React.Component<MarkdownTextWrapProps> {
{
textProps,
detailsMarker = "superscript",
id,
}: {
textProps?: React.SVGProps<SVGTextElement>
detailsMarker?: DetailsMarker
id?: string
} = {}
): JSX.Element | null {
const { fontSize, lineHeight } = this
Expand All @@ -670,7 +672,7 @@ export class MarkdownTextWrap extends React.Component<MarkdownTextWrapProps> {
yOffset + lineHeight * fontSize * lineIndex

return (
<g className="markdown-text-wrap">
<g id={id} className="markdown-text-wrap">
<text
x={x.toFixed(1)}
y={yOffset.toFixed(1)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ export class TextWrap {
render(
x: number,
y: number,
{ textProps }: { textProps?: React.SVGProps<SVGTextElement> } = {}
{
textProps,
id,
}: { textProps?: React.SVGProps<SVGTextElement>; id?: string } = {}
): JSX.Element | null {
const { props, lines, fontSize, fontWeight, lineHeight } = this

Expand All @@ -267,6 +270,7 @@ export class TextWrap {

return (
<text
id={id}
fontSize={fontSize.toFixed(2)}
fontWeight={fontWeight}
x={correctedX.toFixed(1)}
Expand Down
Loading

0 comments on commit 6c73dfc

Please sign in to comment.