<script>part) to the appropriate place. Width and height can be configured via the
trueif the viewer could be started successfuly and
falseif not (most likely due to a missing / too old Flash Player). The viewer can be configured via the following parameters. These parameters are passed (as seen in the above example) as key-value-pairs.
|graphUrl||The URL of the GraphML file to display||String||-|
|width||The width of the viewer (% or absolute)||size||100%|
|height||The height of the viewer (% or absolute)||size||100%|
|overview||Whether to show an overview window. "true" enables the overview.||true, false||false|
|toolbar||Whether to show the tool bar. "true" enables the tool bar, if the view can be moved (movable=true).||true, false||false|
|movable||Whether the user is allowed to move or zoom the view. "true" enables moving the view.||true, false||false|
|scrollbars||Whether to show scroll bars if the diagramm is larger than the visible part. "true" enables scroll bars.||true, false||true|
|tooltips||Whether to show tool tips. "true" enables tool tips.||true, false||false|
|links||Whether the user is allowed navigate to web links which are attached to graph elements. "true" enables navigation.||true, false||false|
|linksInNewWindow||Whether to open web links in a new browser window. Web links are opened in a new window if set to "true"||true, false||true|
|viewport||The section (view) of the diagram which is displayed. Possible parameters are "full", which shows the full diagram, or comma (,) separated coordinates in the order left, top, width, height (e.g. "-100,-100,200,200"). These coordinates define the part of the diagram which is displayed.||"full" or four comma separated numbers||full|
InstallFlashUpdate("width", "100%", "height", "100%"). This function installs the current Flash Player version. The size of the install window is determined by the "width" and "height" parameter. The function returns
falseif it failed to install the new Flash Player. If you don't want to offer an automatic update omit calling InstallFlashUpdate().
GetUrl()which returns the URL of the current document is needed.
LoadGraphML(url)which loads a GraphML file from the given URL and returns its contents as String is needed.
"always"in the Flash Player's starting method.
When exporting a diagram using the Option "HTML Flash Viewer", yEd creates a HTML page which displays the exported diagram using GraphMLViewer. The following files are created:
yEd exports the necessary files in a way that they can be viewed with no further adjustments by opening the HTML file in a browser.
The following files are necessary to integrate the GraphMLViewer into a HTML page for local preview:
If you don't want to place all files in one folder it is possible to customize the folder structure:
graphUrlparameter of the
RunPlayer()function has to be changed to the new URL. The rules for definig URLs in HTML documents apply here, too: If you provide a relative URL (recommended), the URL relates to the HTML file.
srcattribute of the
scripttags, which refers to the file (
var url = "GraphMLViewer.swf";in the
RunPlayer()function in GraphMLViewer.js. The rules for definig URLs in HTML documents apply here, too.
To publish the created pages on a web server, put the files together as described above. Upload these files to the web server, with the following exceptions:
GraphMLViewer.swfis not needed on the web server and thus does not have to be uploaded.
<allow-access-from domain="www.yworks.com"/>to the list
<cross-domain-policy>. Please read the following section for more details.
In a web environment the actual viewer will be loaded from the domain www.yworks.com. Thus, the viewer has to be granted access rights to the GraphML file. Without further configuration swf files which are loaded from domain A (here: www.yworks.com) are not allowed to access data from domain B (e.g. your.domain.com). Domain B can permit this by providing a crossdomain policy file, crossdomain.xml. By default, Flash Player tries to load this file from the root folder of the domain from which the data should be loaded. Example: the HTML page is loaded from http://your.domain.com/en/graphs.html, the graph is loaded from http://your.domain.com/en/graphs/example.graphml. In this case Flash Player attempts to load the file http://your.domain.com/crossdomain.xml.
As web authors do not neccessarily have write access to that folder, GraphMLViewer additionally tries to load the crossdomain policy file from the folder in which the GraphML file is stored. Since Flash Player 10 such an access is only accepted if a so called meta policy grants read access to this folder.
Further information about this topic can be found here:
crossdomain.xml in the root folder of the domain. The URL from which the SWF-file is loaded
has to be set manually.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="GraphMLViewer" width="@WIDTH@" height="@HEIGHT@" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="@VIEWERURL@" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="always" /> <param name="FlashVars" value="graphUrl=@GRAPHURL@&overview=@OVERVIEW@&toolbar=@TOOLBAR@&tooltips=@TOOLTIPS@& &movable=@MOVABLE@&scrollbars=@SCROLLBARS@&links=@LINKS@&linksInNewWindow=@WINDOW@& &viewport=@VIEWPORT@"/> <embed src="@VIEWERURL@" quality="high" bgcolor="#ffffff"' + width="@WIDTH@" height="@HEIGHT@" name="GraphMLViewer" align="middle"' + play="true" loop="false" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="graphUrl=@GRAPHURL@&overview=@OVERVIEW@&toolbar=@TOOLBAR@&tooltips=@TOOLTIPS@& &movable=@MOVABLE@&scrollbars=@SCROLLBARS@&links=@LINKS@&linksInNewWindow=@WINDOW@& &viewport=@VIEWPORT@"> </embed> </object>
In the above listing, wildcards have been inserted for parameters which have to be customized. Appropriate values for these wildcards are described below. As most of these parameters have to be replaced twice (Internet Explorer and Mozilla / Firefox use different syntaxes), it is best to use your editor's search-and-replace function.
GraphMLViewer.swfif the viewer is placed in the same folder as the HTML page).