Skip to main content

Interface: PNGOptions

Defined in: packages/sdvtables/src/export/index.ts:28

Options for htmlToPNG and tableToPNG; defaults are Python gt_save_crop's. Its expand (the page captured before trimming) is fixed here, as it only has to leave background around the content. (The HTML itself takes RenderOptions from @sportsdataverse/sdvtables/html.)

Extended by​

Properties​

background?​

optional background?: string

Defined in: packages/sdvtables/src/export/index.ts:34

the color around the content; default "white"


deviceScaleFactor?​

optional deviceScaleFactor?: number

Defined in: packages/sdvtables/src/export/index.ts:32

the rendering zoom (Python zoom); default 2, a sharp (retina) image


file?​

optional file?: string

Defined in: packages/sdvtables/src/export/index.ts:40

also write the PNG here (must end in .png)


optional fontLinks?: readonly string[]

Defined in: packages/sdvtables/src/export/index.ts:38

stylesheet URLs (Google Fonts) awaited via document.fonts.ready


whitespace?​

optional whitespace?: number

Defined in: packages/sdvtables/src/export/index.ts:36

image pixels of background left around the trimmed content (Python whitespace, truncated to an integer); default 50


width?​

optional width?: number

Defined in: packages/sdvtables/src/export/index.ts:30

the final image width in pixels, the height following (Python width); absent: the rendered width