https://github.com/cytoscape/cytoscape.js-pdf-export

PDF export extension for Cytoscape.js

https://github.com/cytoscape/cytoscape.js-pdf-export

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

PDF export extension for Cytoscape.js

Basic Info
  • Host: GitHub
  • Owner: cytoscape
  • License: mit
  • Language: JavaScript
  • Default Branch: main
  • Size: 7.54 MB
Statistics
  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • Open Issues: 3
  • Releases: 0
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme License

README.md

cytoscape.js-pdf-export

Cytoscape.js extension for exporting networks to PDF (using PDFkit).

License

MIT

Dependencies

  • Cytoscape.js ^3.28.0
    • Older versions of Cytoscape.js may still work, this is the version used for testing.

How to use

Installation

  • via npm: npm install cytoscape-pdf-export
  • via github url... json "dependencies": { "cytoscape-pdf-export": "cytoscape/cytoscape.js-pdf-export#release/0.0.2", }

Importing

```js import cytoscape from 'cytoscape'; import pdf from 'cytoscape-pdf-export';

cytoscape.use(pdf); ```

Using

  • This extension adds a function to the cy object: cy.pdf(options)
  • It works similar to the cy.png(...) function in core cytoscape.js.

js const blobPromise = cy.pdf({ paperSize: 'LETTER', orientation: 'LANDSCAPE', }); const blob = await blobPromise; saveAs(blob, 'network.pdf', true);

Options

  • The options object passed to the cy.pdf(options) function is outlined below, with default values.

```js const options = { // If false then only the visible part of the network will be exported. // If true then the entire network is exported regardless of the current zoom/pan. full: false,

// The background color to use, or none if false. // Can be any CSS color value that's accepted by Cytoscape.js bg: false,

// The paper size and orientation paperSize: 'LETTER', // can be CUSTOM, LETTER (default), LEGAL, TABLOID, A0, A1, A2, A3, A4, A5 orientation: 'PORTRAIT', // can be PORTRAIT or LANDSCAPE

// The width/height to use when paperSize is set to 'CUSTOM' width: null, // paper width in "PostScript points", 72 units per inch height: null, // paper height in "PostScript points", 72 units per inch

// The margin, default is 52 units which is 3/4 of an inch. margin: 52,

// There is limited support for the cytoscape-layers extension. // If this flag is true then any SVG layers registered with the cytoscape-layers // extension will be included in the PDF export. includeSvgLayers: false,

// If true will log debug info to the console. debug: false,

// The options below are temporary and will be removed in the future. save: false, // causes a save-as window to pop up when the PDF is ready to be downloaded fileName: 'cytoscape.pdf', }; ```

Fonts

  • Fonts are limited to those provided by PDFKit.
    • Courier (normal, bold, oblique)
    • Helvetica (normal, bold, oblique)
    • Times (normal, bold, italic)
    • Times New Roman
    • Symbol
    • ZapfDingbats
  • If an unsupported font is specified, it will default to Helvetica.
  • 'sans-serif' defaults to Helvetica
  • 'serif' defaults to Times New Roman

Reporting Bugs

  • This extension is still very new, there are likely to be bugs. Please report bugs to this GitHub repository issue tracker.

Known Limitations

  • In Cytoscape.js when node border opacity is partially transparent it sometimes sometimes looks like two rings. This is because the fill part of the node is 1/2 underneath the border, so when the border is transparent the part that's over the fill ends up with a different color than the part that's not over the fill. This does not happen with PDFkit (not sure why), the border will look like a solid ring.
  • When using dashed or dotted edge lines or node borders, the dashes may not line up exactly as they look in Cytoscape.js.
  • Fonts are limited to the ones listed above.

Owner

  • Name: Cytoscape Consortium
  • Login: cytoscape
  • Kind: organization

GitHub Events

Total
  • Issues event: 2
  • Watch event: 1
  • Push event: 2
Last Year
  • Issues event: 2
  • Watch event: 1
  • Push event: 2

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 60
  • Total Committers: 1
  • Avg Commits per committer: 60.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Mike Kucera m****a@g****m 60

Issues and Pull Requests

Last synced: 11 months ago

Packages

  • Total packages: 1
  • Total downloads:
    • npm 85 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
npmjs.org: cytoscape-pdf-export

Export cytoscape.js networks to PDF

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 85 Last month
Rankings
Dependent repos count: 29.4%
Average: 35.8%
Dependent packages count: 42.1%
Maintainers (1)
Last synced: 11 months ago

Dependencies

package-lock.json npm
  • 292 dependencies
package.json npm
  • brfs ^2.0.2 development
  • html-webpack-plugin ^5.3.2 development
  • transform-loader ^0.2.4 development
  • webpack ^5.44.0 development
  • webpack-cli ^4.7.2 development
  • assert ^2.0.0
  • blob-stream ^0.1.3
  • brace ^0.11.1
  • browserify-zlib ^0.2.0
  • buffer ^6.0.3
  • cytoscape 3.28.1
  • file-saver ^2.0.5
  • pdfkit ^0.12.3
  • process ^0.11.10
  • readable-stream ^3.6.0
  • util ^0.12.4