(
panels, text_boxes, figure_boxes, poster_width, poster_height
)
| 668 | return panel_arrangement, figure_arrangement, text_arrangement |
| 669 | |
| 670 | def visualize_complete_layout( |
| 671 | panels, text_boxes, figure_boxes, poster_width, poster_height |
| 672 | ): |
| 673 | fig, ax = plt.subplots(figsize=(12,8)) |
| 674 | ax.set_xlim(0, poster_width) |
| 675 | ax.set_ylim(0, poster_height) |
| 676 | ax.set_aspect('equal') |
| 677 | |
| 678 | # Draw panels |
| 679 | for panel in panels: |
| 680 | rect = patches.Rectangle( |
| 681 | (panel["x"], panel["y"]), panel["width"], panel["height"], |
| 682 | linewidth=1, edgecolor='black', facecolor='none' |
| 683 | ) |
| 684 | ax.add_patch(rect) |
| 685 | ax.text( |
| 686 | panel["x"] + 5, panel["y"] + panel["height"] - 5, |
| 687 | f'Panel {panel["panel_id"]}', fontsize=8, va='top', color='black' |
| 688 | ) |
| 689 | |
| 690 | # Draw text boxes |
| 691 | for txt in text_boxes: |
| 692 | rect = patches.Rectangle( |
| 693 | (txt["x"], txt["y"]), txt["width"], txt["height"], |
| 694 | linewidth=1, edgecolor='green', linestyle='-.', facecolor='none' |
| 695 | ) |
| 696 | ax.add_patch(rect) |
| 697 | ax.text( |
| 698 | txt["x"] + 2, txt["y"] + txt["height"] - 2, |
| 699 | f'Text {txt["panel_id"]}', fontsize=7, color='green', va='top' |
| 700 | ) |
| 701 | |
| 702 | # Draw figures |
| 703 | for fig_box in figure_boxes: |
| 704 | rect = patches.Rectangle( |
| 705 | (fig_box["x"], fig_box["y"]), fig_box["width"], fig_box["height"], |
| 706 | linewidth=1, edgecolor='blue', linestyle='--', facecolor='none' |
| 707 | ) |
| 708 | ax.add_patch(rect) |
| 709 | ax.text( |
| 710 | fig_box["x"] + 2, fig_box["y"] + 2, |
| 711 | f'Fig {fig_box["panel_id"]}', fontsize=7, color='blue', va='bottom' |
| 712 | ) |
| 713 | |
| 714 | plt.gca().invert_yaxis() # optional: invert y-axis if needed |
| 715 | plt.show() |
| 716 | |
| 717 | |
| 718 | def get_arrangments_in_inches( |
nothing calls this directly
no outgoing calls
no test coverage detected