Skip to content

PowerPoint export: the diagram is a single item, not editable shapes #167

Closed

Description

@adamjohnwright

Reported by curators: "Download a diagram as PPTX, open it in real PowerPoint, then right-click the diagram → Graphics Format → Convert to Shape." Their answer: "NO — The whole pathway diagram is treated as a single item."

Status: open, not started.

Why we asked rather than tested it: there is no PowerPoint on the build machine. The file is validated structurally by e2e/downloads.spec.ts — it checks a PPTX contains PPTX and is the right figure — but "opens in PowerPoint and converts to editable shapes" is a different claim and we have no automated coverage of it. The curators' answer is the test result here.

Next step: compare against what production's exporter produces for the same diagram, since the old Java exporter is what curators are used to. If production yields editable shapes and ours yields one, the difference is in how our renderer emits the PPTX.

Activity

  1. adamjohnwright commented on Sep 4, 2026

    @adamjohnwright
    ContributorAuthor

    Fixed in b1af460. A downloaded PPTX is now built out of shapes rather than
    holding a picture of the diagram.

    What you get. For the Intrinsic Pathway for Apoptosis (R-HSA-109606),
    635 shapes: one per compartment, one per connector, one per entity, and one
    per sub-pathway tint. Each is selectable and movable the moment the file
    opens — no Convert to Shape step. The file is 32 KB, against roughly
    1.5 MB when it carried the diagram as a vector image.

    The slide is the size of the diagram, which is what the old Java
    exporter does too: 56 by 32 inches for this pathway, with labels at 5 to
    53pt. Fitting the diagram onto an ordinary 13.3in slide instead — which is
    what a slide holding a picture wants — put every label at 1.65pt.

    Where the shapes come from. The site's own page reports every position,
    colour, opacity, dash and font from the live style, and the exporter writes
    those out as OOXML. It is a spelling of the diagram rather than a second
    opinion about it, which is what made the old exports drift from the site.

    What it does not carry yet, both worth telling us about if they matter:

    • The small decorations the style draws with background images — so a
      complex loses the band that marks it as one.
    • The rounded corners on connectors that use round-segments routing. The
      points are right; the corners are square.

    What we could not test. There is no PowerPoint on the build machine, so
    "it opens cleanly in PowerPoint" is still your check rather than ours. What
    was checked here: the package's relationships all resolve, every part has a
    declared content type, every part parses, the element ordering matches
    production's own PPTX for the same pathway, no shape reaches past the slide
    edge, and no path point leaves its own coordinate space. Those are the
    things that make PowerPoint offer to repair a file.

    Please try it on beta and say whether the shapes are the ones you wanted.

  2. adamjohnwright commented on Sep 9, 2026

    @adamjohnwright
    ContributorAuthor

    Correcting something I wrote here on 4 September, and fixing it.

    I listed "node decorations drawn with background-image" as a minor gap — "a
    complex loses the band that marks it as one". That understated it badly. A
    complex, a set and a gene do not have a fill at all: they set
    background-opacity: 0 and carry their whole body in that image. So the
    slide drew 65 of this diagram's 203 glyphs as empty outlined rectangles —
    every complex, every set, both genes.

    Fixed in #176, live on beta. The images turned out to be SVG markup rather than
    rasters, so the real geometry was there: a complex now comes out as its octagon
    with the white inner line, a set as its braced box with the drug marker at its
    own size in the corner, all as editable shapes.

    Three things had to be right, and each is now covered by a test taken from a
    captured payload rather than from my assumptions: each image keeps its own
    position and size; the contents of defs, clipPath and mask are definitions
    and are not drawn; and a masked outline is clipped to the pieces the mask
    actually reveals, which is what makes a set's braces appear at its two ends
    rather than as a line all the way round.

    The file is 54 KB for 974 shapes, against production's 74 KB for 976.

    What is left: edges with weights keep their points but not their rounded
    corners. That is the only fidelity gap I know of now, and it is a small one.
    "Does it open cleanly in PowerPoint" is still your check rather than ours.

  3. adamjohnwright commented on Sep 18, 2026

    @adamjohnwright
    ContributorAuthor

    Already fixed, and here is the evidence rather than an assurance.

    The curators tested the old exporter, which embedded the diagram as one
    picture. PPTX on beta is produced by the render service (tools/render), which
    builds DrawingML shapes and only falls back to a raster when there is no SVG to
    work from — render-core.mjs:

    async function pptxFromPage(page, { scale, title }) {
      // Shapes first: a slide of shapes needs no picture, and the diagram is around
      ...
      bytes: pptx({ title, shapes, width: shapes.width, height: shapes.height }),

    Measured, through beta, as a curator would get it

    https://beta.reactome.org/RenderService/render/R-HSA-109606.pptx — 200, 54,224
    bytes. Unzipped and counted in ppt/slides/slide1.xml:

    shapes   <p:sp>      974
    pictures <p:pic>       0
    embedded media         0
    slide xml        724,639 bytes
    

    974 individual shapes, no picture anywhere in the file, and no media parts at
    all — so there is nothing for "Convert to Shape" to convert, because it is already
    shapes. Identical numbers straight from the render service on the box, so the site
    and the service agree.

    What this does not prove

    That PowerPoint itself is happy with the result. The curators' original test was
    "open it in real PowerPoint, right-click the diagram, Graphics Format → Convert to
    Shape", and there is no PowerPoint on the build machine — which is why this was
    originally answered by asking them rather than testing it.

    What can be said is that the file contains 974 shapes and zero pictures, which is
    the structural condition their test was checking for. If it still behaves as one
    object in PowerPoint, that is a different bug — grouping, or the shapes being
    malformed — and worth reopening with the file attached.

    Worth putting back to the curators on the next round, since they have the
    software and we do not. The question is now narrow: not "is it a picture" — it
    demonstrably is not — but "does it come apart when you convert it".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions