Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX check if shapes exist before setting the labels in the WebGL viewer #501

Merged
merged 1 commit into from
Nov 3, 2023

Conversation

mvdoc
Copy link
Contributor

@mvdoc mvdoc commented Oct 27, 2023

I'm having some issues with loading some very old overlay files. Without the fix in the javascript part, the viewer does not even load. The fix in svgoverlay.py is still a work in progress. It fails creating splines for paths such as the following

M 612.125 549.625 C 606.51441 549.71551 601.02784 550.65202 596.09375 553 C 589.17538 556.29224 581.97592 562.54109 580.6875 570.09375 C 579.79889 575.30273 580.38513 580.34214 581.84375 585.28125 C 595.21597 595.86604 617.82389 619.97107 616.0625 634.59375 C 615.59786 638.45112 613.76677 641.15406 611.125 643.1875 C 611.24105 643.44807 611.35059 643.70914 611.46875 643.96875 C 614.40667 650.42362 617.18423 652.68087 618.625 659.625 C 619.66885 664.65608 614.83353 672.68837 618.625 676.15625 C 624.39758 681.43616 633.04748 677.01176 638.75 671.65625 C 645.59411 665.22862 647.98061 657.99084 648.8125 649.90625 C 645.7223 646.27481 642.78306 642.19423 639.96875 637.53125 C 637.01433 632.63612 641.5484 627.65256 647.0625 623.15625 C 644.96214 618.76146 642.40742 614.35976 644.625 610.9375 C 647.11354 607.09708 653.35619 607.32934 657.84375 605.53125 C 658.27778 602.14541 659.22061 598.88351 660.71875 596.09375 C 662.40156 592.9601 665.39419 591.22625 668.8125 589.90625 C 670.38848 584.22044 670.27093 578.19798 667.71875 573.03125 C 660.39833 558.21155 645.04481 554.46213 628.8125 551.34375 C 623.44636 550.31286 617.73559 549.53449 612.125 549.625 z

I think gen_path in

elif mode.lower() == 'c':
p1 = [float(ss) for ss in cmd.split(',')]
p2 = [float(ss) for ss in next(it).split(',')]
p3 = [float(ss) for ss in next(it).split(',')]
if mode == 'c':
verts.append(pen + p1)
verts.append(pen + p2)
verts.append(pen + p3)
pen += p3
else:
is expecting commas after the C mode.

@mvdoc mvdoc marked this pull request as draft November 3, 2023 00:40
@mvdoc mvdoc changed the title WIP Some fixes for SVG overlays that are not parsed correctly FIX check if shapes exist before setting the labels in the WebGL viewer Nov 3, 2023
@mvdoc mvdoc marked this pull request as ready for review November 3, 2023 01:02
@mvdoc mvdoc merged commit cbb9d8e into gallantlab:main Nov 3, 2023
7 checks passed
@mvdoc mvdoc deleted the fix/svgoverlay branch November 3, 2023 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant