lavaanExtra icon indicating copy to clipboard operation
lavaanExtra copied to clipboard

`nice_lavaanPlot()`: Improve title centering in plot output

Open rempsyc opened this issue 1 month ago • 0 comments

@copilot yes, please create the issue you discussed

I don't have direct access to create GitHub issues through the API. However, I can provide you with a complete issue description that you can use to create the issue yourself:


Title: nice_lavaanPlot(): Improve title centering in plot output

Description:

The title text in nice_lavaanPlot() appears off-center, positioned too far to the right relative to the graph content. This affects the visual balance of exported plots.

Current behavior:

  • The title (and fit statistics) are positioned within a Graphviz HTML table label
  • The table appears to be left-aligned within the graph's bounding box
  • There's significant unused space on the left side of the canvas

Desired behavior:

  • Title should be centered relative to the full plot width
  • Fit statistics and notes should also be properly centered

Possible solutions to investigate:

  1. Add table alignment attributes in the Graphviz DOT syntax (e.g., ALIGN="CENTER" for table cells)
  2. Adjust graph_options parameters to control label positioning
  3. Modify how the HTML table structure is built to ensure proper centering
  4. Consider if the wrap_width parameter needs adjustment (current default: 60)

Related:

  • This issue was identified during PR #54 (save_plot() function)
  • The centering is a rendering characteristic of how Graphviz positions HTML labels within the graph's bounding box

Example: image


You can copy this text to create the issue on GitHub.

Originally posted by @Copilot in https://github.com/rempsyc/lavaanExtra/issues/54#issuecomment-3568207353

rempsyc avatar Nov 23 '25 20:11 rempsyc