vibesketch.render¶
Publication graphics from the normalized document.
Exports render on the server from the document, not from the canvas picture, so a batch from the CLI looks the same as the button (roadmap, section 3.3). Each structure is drawn by RDKit in the ACS 1996 style (RDKit’s ACS 1996 mode: 14.4 pt bonds, 0.6 pt lines, 10 pt Arial labels) from the coordinates it has on the canvas. A scheme is composed around the structures: plus signs, the arrow, reagents above it, condition lines and the yield below it, and bold compound numbers under each structure.
SVG covers everything. PNG covers a single structure (RDKit’s Cairo backend); a PNG of a scheme needs the publication renderer (roadmap WP 3.2) and is refused with that reason. The browser can rasterize the SVG.
Module Attributes
The style presets this version can draw. |
Functions
|
The document as |
|
The document as an SVG figure: its reactions, or its species in a row. |
|
A PNG of the document's species side by side, for file previews. |
Exceptions
The document cannot be rendered in the requested format or style. |
|
This machine lacks a system library that RDKit's drawing code needs. |
- vibesketch.render.STYLES = ('acs-1996',)¶
The style presets this version can draw.
- exception vibesketch.render.RenderRefused¶
Bases:
ValueErrorThe document cannot be rendered in the requested format or style.
Bases:
RuntimeErrorThis machine lacks a system library that RDKit’s drawing code needs.
- vibesketch.render.render(document, fmt, *, style='acs-1996')¶
The document as
svgorpng; raisesRenderRefused.
- vibesketch.render.render_svg(document, *, style='acs-1996')¶
The document as an SVG figure: its reactions, or its species in a row.
- vibesketch.render.thumbnail(document)¶
A PNG of the document’s species side by side, for file previews.
The panels shrink so the longest side stays within 1024 pixels; one species fills a panel of 300 by 225. Returns the PNG, its width and its height. Raises
RenderRefusedfor a document without species andRenderUnavailablewithout the drawing libraries.