Core evolution - Toolkit & Headless Gephi

From Gephi:Wiki

Jump to: navigation, search

The Gephi Toolkit project aims to package essential modules (Graph, Layout, Filters, IO...) in a toolkit application - without UI and usable in command-line. The toolkit would be just a single JAR that anyone could reuse in new Java applications. Gephi's API could be used in many different uses-cases like a layout server but the most obvious is doing the whole chain, from file import to PDF export.

Although Gephi's architecture is designed in a modular way, small changes have to be made to current code to isolate all core features in modules that don't depend on UI.

This project is finished. See the Toolkit releases..

Contents

Gephi Toolkit

Here is the list of APIs that will be included in the Tookit:

  • Graph API
  • Project API
  • Attributes API
  • Import API (File & DB)
  • Layout API
  • Filters API
  • Statistics API
  • Generator API
  • Preview API
  • Export API
  • LongTask API
  • Algorithms ?

In order to profit from these APIs we need to include the following implementations and dependencies:

  • Collection Utils
  • Visualization API
  • FiltersPlugin
  • ImportPlugin
  • ExportPlugin
  • PartitionAPI
  • TimelineAPI
  • DHNSGraph
  • AttributeColumnPropertyEditor
  • Layout Plugin
  • Statistics Plugin
  • AttributesImpl
  • Processor Plugin
  • FiltersImpl
  • FiltersPlugin
  • Export Plugin
  • Generator Plugin
  • DBDrivers
  • Utils
  • PreviewExport
  • PreviewImpl
  • TimelineAPI
  • LongTaskAPI

And the following 3rd-parties libraries:

  • iText
  • Batik
  • JFreeChart
  • Processing
  • SQL Connectors

These modules have dependencies on Netbeans modules and various libraries as well.

Netbeans modules that are probably necessary:

  • org-openide-filesystems.jar
  • org-openide-util.jar
  • org-openide-util-lookup.jar
  • org-openide-nodes.jar
  • org-netbeans-modules-masterfs.jar (for FS implementation)

ANT

An ANT task toolkit has been created, it has the following features:

  • Copy all JARs in a toolkit directory, including Gephi and Netbeans JARs
  • Build a gephi-toolkit JAR
<target name="toolkit" depends="clean-toolkit,build,build-launchers" description="Build Gephi Toolkit JAR">
 
        <property name="build.dir" value="${basedir}/build/cluster/modules"/>
        <property name="libs.dir" value="${basedir}/build/cluster/modules/ext"/>
        <property name="toolkit.jar.name" value="gephi-toolkit"/>
        <property name="toolkit.dir" value="${basedir}/toolkit"/>
        <property name="toolkit.jar" value="${toolkit.dir}/${toolkit.jar.name}.jar"/>
        <property name="platform.dir" value="${toolkit.dir}/platform"/>
        <mkdir dir="${toolkit.dir}"/>
 
        <echo message="Packaging ${app.name} into a single JAR at ${toolkit.jar}"/>
 
        <subant genericantfile="${harness.dir}/suite.xml" target="copy-cluster" inheritrefs="true">
            <property name="dest.dir" value="${toolkit.dir}"/>
            <property name="nbexec.dir" value="${toolkit.dir}"/>
            <property name="build.dir" value="${toolkit.dir}"/>
            <resources refid="zip.platform.clusters"/>
        </subant>
 
        <property name="toolkit.tempdir" value="${toolkit.dir}/${toolkit.jar.name}"/>
        <mkdir dir="${toolkit.tempdir}"/>
        <property name="toolkit.platformdir" value="${platform.dir}"/>
        <copy file="${toolkit.platformdir}/core/org-openide-filesystems.jar" todir="${toolkit.tempdir}"/>
        <copy file="${toolkit.platformdir}/lib/org-openide-util.jar" todir="${toolkit.tempdir}"/>
        <copy file="${toolkit.platformdir}/lib/org-openide-util-lookup.jar" todir="${toolkit.tempdir}"/>
        <copy todir="${toolkit.tempdir}">
            <fileset dir="${toolkit.platformdir}/modules">
                <include name="org-openide-nodes.jar"/>
                <include name="org-netbeans-modules-masterfs.jar"/>
            </fileset>
        </copy>
        <copy todir="${toolkit.tempdir}">
            <fileset dir="${build.dir}">
                <include name="org-gephi-algorithms.jar"/>
                <include name="org-gephi-data-attributes.jar"/>
                <include name="org-gephi-data-attributes-api.jar"/>
                <include name="org-gephi-io-exporter-preview.jar"/>
                <include name="org-gephi-filters.jar"/>
                <include name="org-gephi-filters-api.jar"/>
                <include name="org-gephi-filters-plugin.jar"/>
                <include name="org-gephi-graph-api.jar"/>
                <include name="org-gephi-graph-dhns.jar"/>
                <include name="org-gephi-io-database-drivers.jar"/>
                <include name="org-gephi-utils-collection.jar"/>
                <include name="org-gephi-utils-collection.jar"/>
                <include name="org-gephi-io-exporter-api.jar"/>
                <include name="org-gephi-io-exporter-plugin.jar"/>
                <include name="org-gephi-io-importer-api.jar"/>
                <include name="org-gephi-io-importer-plugin.jar"/>
                <include name="org-gephi-io-processor-plugin.jar"/>
                <include name="org-gephi-layout-api.jar"/>
                <include name="org-gephi-layout-plugin.jar"/>
                <include name="org-gephi-preview-api.jar"/>
                <include name="org-gephi-preview.jar"/>
                <include name="org-gephi-project-api.jar"/>
                <include name="org-gephi-statistics-api.jar"/>
                <include name="org-gephi-statistics-plugin.jar"/>
                <include name="org-gephi-project-api.jar"/>
                <include name="org-gephi-timeline.jar"/>
                <include name="org-gephi-utils.jar"/>
                <include name="org-gephi-utils-longtask.jar" />
                <include name="org-gephi-utils-collection.jar"/>
                <include name="org-gephi-ranking-api.jar"/>
                <include name="org-gephi-partition-api.jar"/>
                <include name="org-gephi-partition-plugin.jar"/>
                <include name="org-gephi-io-generator-api.jar"/>
                <include name="org-gephi-io-generator-plugin.jar"/>
            </fileset>
        </copy>
        <copy todir="${toolkit.tempdir}">
            <fileset dir="${libs.dir}">
                <include name="batik*.jar"/>
                <include name="core.jar"/><!-- Processing -->
                <include name="iText*.jar"/>
                <include name="jcommon*.jar"/>
                <include name="jfreechart*.jar"/>
                <include name="joda-time*.jar"/>
                <include name="mysql-connector*.jar"/>
                <include name="postgresql*.jar"/>
                <include name="sqljdbc*.jar"/>
                <include name="google-collect*.jar"/>
                <include name="trove*.jar"/>
                <include name="xml-apis-ext*.jar"/>
            </fileset>
        </copy>
 
        <jar destfile="${toolkit.dir}/temp_final.jar" filesetmanifest="merge" duplicate="preserve">
            <zipgroupfileset dir="${toolkit.tempdir}" includes="*.jar"/>
 
            <manifest>
 
            </manifest>
        </jar>
 
        <zip destfile="${toolkit.jar}">
            <zipfileset src="${toolkit.dir}/temp_final.jar"
            excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
        </zip>
 
        <delete file="${toolkit.dir}/temp_final.jar"/>
        <delete dir="${platform.dir}"/>
 
    </target>

TODO

- Because of implementation hiding, every implementation class should be marked default/friendly/package private. So it will not be visible in Gephi Toolkit and only the API will be visible...

Gephi Headless

Gephi Headless is a project that uses Gephi Toolkit to build an out-of the box command line application to perform network visualization.

Possible features:

  • Import graph files
  • Automatic, yet configurable layout
  • Text drawing options
  • Ranking options, node color and size
  • Compute metrics
  • Basic filtering - edge weight / degree / ego-network / ...
  • PDF export options (Preview)
  • Export PDF/SVG
Personal tools