Skip to content

Commit

Permalink
SVG Exporter now encodes node and edge labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrtannus committed Aug 8, 2014
1 parent dae96b3 commit b6638d5
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 20 deletions.
35 changes: 17 additions & 18 deletions .actionScriptProperties
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8"?>
<actionScriptProperties mainApplicationPath="CytoscapeWeb.mxml" version="3">
<compiler additionalCompilerArguments="-locale en_US -source-path=assets/locale/{locale}" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="9.0.124" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
<compilerSourcePath>
<compilerSourcePathEntry kind="1" linkType="1" path="src"/>
<compilerSourcePathEntry kind="1" linkType="1" path="src-test"/>
</compilerSourcePath>
<libraryPath defaultLinkType="1">
<libraryPathEntry kind="4" path=""/>
<libraryPathEntry kind="1" linkType="1" path="lib"/>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
<applications>
<application path="TestRunner.mxml"/>
<application path="CytoscapeWeb.mxml"/>
</applications>
<modules/>
<buildCSSFiles/>
<compiler additionalCompilerArguments="-locale en_US -source-path=assets/locale/{locale}" copyDependentFiles="true" enableModuleDebug="true" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersion="10.0.0" htmlPlayerVersionCheck="true" outputFolderPath="bin" sourceFolderPath="src" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
<compilerSourcePath>
<compilerSourcePathEntry kind="1" linkType="1" path="src-test"/>
</compilerSourcePath>
<libraryPath defaultLinkType="1">
<libraryPathEntry kind="4" path=""/>
<libraryPathEntry kind="1" linkType="1" path="lib"/>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
<applications>
<application path="TestRunner.mxml"/>
<application path="CytoscapeWeb.mxml"/>
</applications>
<modules/>
<buildCSSFiles/>
</actionScriptProperties>
2 changes: 1 addition & 1 deletion .flexProperties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8"?>
<flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bin
bin-release/
18 changes: 18 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>cytoscapeweb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.adobe.flexbuilder.project.flexbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.adobe.flexbuilder.project.flexnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
</natures>
</projectDescription>
3 changes: 3 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Fri Aug 08 12:51:00 EDT 2014
eclipse.preferences.version=1
encoding/<project>=utf-8
8 changes: 7 additions & 1 deletion src/org/cytoscapeweb/model/converters/SVGExporter.as
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ package org.cytoscapeweb.model.converters {
import flash.text.TextField;
import flash.text.TextFormatAlign;
import flash.utils.ByteArray;
import flash.xml.XMLDocument;

import mx.graphics.codec.PNGEncoder;
import mx.utils.Base64Encoder;
Expand Down Expand Up @@ -479,7 +480,12 @@ package org.cytoscapeweb.model.converters {
if (lines.length > 0) {
for (var i:int = 0; i < lines.length; i++) {
var ln:String = lines[i];
svg += '<tspan style="text-anchor:'+ta+';" x="'+p.x+'" dy="'+textHeight+'">'+ln+'</tspan>';
var tspan:XML = <tspan/>;
tspan.@style = "text-anchor:"+ta+";";
tspan.@x = p.x;
tspan.@dy = textHeight;
tspan.appendChild(ln);
svg += tspan.toXMLString();
}
} else {
svg += text;
Expand Down

0 comments on commit b6638d5

Please sign in to comment.