yFiles Export Capabilities
Tips & TricksSummary
Description
Graph Exchange and Graph Export Formats
Package y.io provides the necessary functionality for both reading and writing graph structure data from and to a file, respectively. Thus said the following descriptions apply to all yFiles for Java distributions containing the Viewer part (yFiles for Java Complete and yFiles for Java Viewer)
Directly supported file formats are GML, XGML, TGF, and YGF for graph exchange, and GIF and JPG for graph export (image export). Extension packages provide further file formats like GraphML for graph exchange, and SVG, PDF, EMF, SWF, and EPS for graph export (vector graphics export). Via the Java Image I/O API (package javax.imageio, available with Java 2 Standard Edition version 1.4 and higher) additional file formats for graph export, for example PNG, are also accessible. Graph exchange and export file formats lists the features of all yFiles graph exchange and export file formats.
Table: Graph exchange and export file formats
Format Name | Type | Extension Package | Note |
---|---|---|---|
GML | Exchange | No | |
XGML | Exchange | No | XML-ish variant of GML. |
TGF | Exchange | No | |
YGF | Exchange | No | Proprietary; non-standard; binary. |
GIF | Export (Bitmap) | No | |
JPG | Export (Bitmap) | No | |
GraphML | Exchange | GraphML Extension package | XML-based; extension package is free of charge.; contained in the yFiles for Java package since version 2.7 (no extension package required for these versions) |
SVG | Export (Vector Graphics) | ySVG Extension package | XML-based; extension package is free of charge. |
Export (Vector Graphics) | yExport Extension package | ||
SWF | Export (Vector Graphics) | yExport Extension package | |
EMF | Export (Vector Graphics) | yExport Extension package | |
EPS | Export (Vector Graphics) | yExport Extension package | |
PNG | Export (Bitmap) | No | Accessible via the Java Image I/O API available with J2SE 1.4 and higher. |
The graph exchange formats mainly concentrate on the graph structure, which also includes nested graph structure. They do not support visual aspects that are not associated with the graph, like, e.g., zoom level, selection state, or a background image. In contrast, the graph export formats fully support these visual aspects.
Reading and writing graph structures from/to file is decribed in Reading and Writing Graph Structure Data, the section Exporting a Graph's Visual Representation explains image export of a graph's visual representation.