Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to copy plugin over to correct repository but having difficulty, so posted it here. #8

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b9ea1a8
checkpoint: no compile error in mvn package
juliannej Aug 14, 2018
c09f5a8
hot fix on putting in weight column
juliannej Aug 16, 2018
46c559d
real fix for nullpointer issue
juliannej Aug 16, 2018
6b048d2
it works, gephi 0.9.2
juliannej Aug 17, 2018
44fcaf6
created a NullPointerException when trying to turn weight column dyna…
juliannej Aug 19, 2018
b920a1a
dynamic workinggit add .git add .git add .git add .
juliannej Aug 19, 2018
3218efd
Merge pull request #1 from juliannej/timestamptry2
juliannej Aug 19, 2018
491add0
put in method declarations with pseudocode for normalization, transpa…
juliannej Aug 19, 2018
d932fbf
first attempt at adding transparency feature
juliannej Aug 20, 2018
a06adb6
inserted print statement to test then commented out
juliannej Aug 20, 2018
cbe4cd2
removed sizing objective
juliannej Aug 21, 2018
ebcea4e
TODO updated
juliannej Aug 21, 2018
32ef5fb
Merge branch 'master' into transparency
juliannej Aug 21, 2018
ab23b5c
TODO updated'
juliannej Aug 21, 2018
34b8ddc
min achieved and compiles
juliannej Aug 22, 2018
62c20f4
have fn for min and max of weights
juliannej Aug 22, 2018
99c15df
merge ready
juliannej Aug 22, 2018
c9bc897
messing around with histogram
juliannej Aug 23, 2018
7dc2b61
toggle of heat map and heat map implemented
juliannej Aug 25, 2018
80a597c
changed color scheme on heat map
juliannej Aug 25, 2018
7cbf652
Merge branch 'master' into transparency
juliannej Aug 26, 2018
74dc2f0
Merge pull request #2 from juliannej/transparency
juliannej Aug 26, 2018
5675b95
node weight given scaling factor; error with previous node weight bei…
juliannej Aug 28, 2018
b6433e7
Delete hs_err_pid39777.log
juliannej Aug 28, 2018
e319425
Delete hs_err_pid43526.log
juliannej Aug 28, 2018
cc5b0b6
Delete hs_err_pid44976.log
juliannej Aug 28, 2018
5078714
Merge pull request #3 from juliannej/nodeWeights
juliannej Aug 28, 2018
264551e
code cleaned up a little bit and differences heat map finished
juliannej Aug 29, 2018
6d442c1
added transparency in preview mode
juliannej Aug 30, 2018
780ee20
Merge pull request #4 from juliannej/changeOrientedHeatMap
juliannej Aug 30, 2018
1abefc3
changed minimum gravity to avoid runaway nodes
juliannej Sep 9, 2018
5b1cb72
changed red blue to simplistic colorblend (linear interpolating)
juliannej Sep 18, 2018
8dc3573
refactored blending code
juliannej Sep 18, 2018
84ea368
final draft except if want to clean up package hierarchy
juliannej Sep 20, 2018
0b1f647
Update README.md
juliannej Sep 20, 2018
dd57f61
Update README.md
juliannej Sep 20, 2018
4d2725c
Update README.md
juliannej Sep 20, 2018
760b17a
Update README.md
juliannej Sep 20, 2018
558acf6
Update README.md
juliannej Sep 20, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OpenIDE-Module-Display-Category=Plugin
OpenIDE-Module-Display-Category=Layout
OpenIDE-Module-Long-Description=\
Example of Layout Plugins:\n<ul>\n<li><b>Grid Layout:</b> Place all nodes in a simple grid. \
Users can configure the size of the area and the speed.\
Expand Down
31 changes: 31 additions & 0 deletions modules/NodeWeight/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# User Guide for Node Weight Plugin

1. Launch Gephi (to get started with Gephi visit https://gephi.org or https://github.com/gephi/gephi)
2. Install Node Weight plugin from Plugin menu in Gephi
3. Import data or a .gexf file
* Dynamic data should be in string form like [Timestamp: data], [timestamp: data].
e.g. : “[2018-07-21T00:00:00.000Z, 0.21100000000000002]; [2018-07-21T00:30:00.000Z, 0.429]; [2018-07-21T03:00:00.000Z, 0.525]; [2018-07-21T06:00:00.000Z, 0.465]; [2018-07-21T12:00:00.000Z, 0.545]”
* Edges should have an ID in ‘Source’ and an ID in ‘Target’ that corresponds to the correct node IDs
* To use the Node Weight plugin functionality, you should have data in the nodes table in a column entitled ‘weight’ or ‘weight_dynamic’ (either will accept dynamic and non dynamic data)
4. In Data Observatory, designate dynamic data columns as appropriate with your data.
5. Go to Overview
6. In the Layout tab select ‘Node Weight’ from the drop-down list
7. Important fields for the Node Layout are:
* Node Weight Influence: Adjust scaling on node weight attraction. More creates larger distance between nodes.
* Opacity mode: Requires data scaled to its standard deviation. Opacity changes according to weight (in preview / export), turn on per-node opacity in preview tab to activate.
* Heat Map: Checkbox to turn on heat map based on normalized node weights. Requires data scaled to its standard deviation.
* Change Heat Map: Checkbox to turn on heat map to show change of normalized node weights between time slices in dynamic data. Red-green.
* Alternative Change Heat Map: Checkbox to turn on heat map to show change of normalized node weights between time slices in dynamic data Requires data scaled to its standard deviation. Blue-yellow.
* Gravity: Attracts nodes to the center. Prevents islands from drifting away. If negative weight averages in your network, minimum gravity set to avoid nodes floating out of graph space.
* Stronger Gravity: A stronger gravity law. Highly recommended to keep nodes in graph space if there are negative weights.
* Scaling: Because of the stronger gravity anchoring nodes with negative weights, you will probably want to turn this up.

8. Experiment with features. Select one of the heat maps. Select opacity. Change the Node Weight influence.
Dynamic-specific
A. Turn on the Timeline feature: Select Timeline from the Window drop-down menu. Go to the bottom of the Gephi interface and click ‘Enable Timeline’
B. Adjust the intervals by sliding the edges of the translucent blue bar.
C. Drag your interval to the 1 marker and press the play button or manually drag the interval around. The interval for which you have data must be completed: e.g. if you want data for hour 3, cover the whole of 3 with an hour-long interval or with a smaller time-slice go to the next hour area not covered by your data. Mouse over the interval for a tooltip telling the duration and bounds of your interval. For the change heat maps, offset your interval an hour (or whatever other unit your timeline is using) later to see the change.




106 changes: 106 additions & 0 deletions modules/NodeWeight/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>gephi-plugin-parent</artifactId>
<groupId>org.gephi</groupId>
<version>0.9.0</version>
</parent>

<groupId>imperial</groupId>
<artifactId>node-weight</artifactId>
<version>1.0.0</version>
<packaging>nbm</packaging>

<name>Node Weight</name>

<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-dialogs</artifactId>
<type>jar</type>
<version>RELEASE81</version>

</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>graph-api</artifactId>
</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>layout-api</artifactId>
</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>ui-propertyeditor</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.gephi</groupId>
<artifactId>graph-api</artifactId>
<type>jar</type>
</dependency> -->
<!-- <dependency>
<groupId>org.gephi</groupId>
<artifactId>ui-propertyeditor</artifactId>
<type>jar</type>
</dependency> -->
<!-- <dependency>
<groupId>org.gephi</groupId>
<artifactId>graph-api</artifactId>
</dependency> -->
<!-- <dependency>
<groupId>org.gephi</groupId>
<artifactId>layout-api</artifactId>
</dependency> -->
<dependency>
<groupId>org.gephi</groupId>
<artifactId>project-api</artifactId>
</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>core-library-wrapper</artifactId>
</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>utils-longtask</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-lookup</artifactId>
</dependency> -->
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-nodes</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>nbm-maven-plugin</artifactId>
<configuration>
<licenseName>Apache 2.0</licenseName>
<author>Julianne Joswiak</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl></authorUrl>
<sourceCodeUrl>http://github.com/gephi/gephi-plugins-bootcamp</sourceCodeUrl>
<homePageUrl>$homepage_url</homePageUrl>
<publicPackages>
<!-- Insert public packages -->
</publicPackages>
</configuration>
</plugin>
</plugins>
</build>
</project>


Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
Copyright 2008-2010 Gephi
Authors : Helder Suzuki <[email protected]>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.layout.plugins.layout.NodeWeight;

import org.gephi.graph.api.Graph;
import org.gephi.graph.api.GraphModel;
import org.gephi.graph.api.Node;
import org.gephi.graph.api.NodeIterable;
import org.gephi.layout.spi.Layout;
import org.gephi.layout.spi.LayoutBuilder;

/**
* Base class for layout algorithms.
*
* @author Helder Suzuki <[email protected]>
*/
public abstract class AbstractLayout implements Layout {

private final LayoutBuilder layoutBuilder;
protected GraphModel graphModel;
private boolean converged;

public AbstractLayout(LayoutBuilder layoutBuilder) {
this.layoutBuilder = layoutBuilder;
}

@Override
public LayoutBuilder getBuilder() {
return layoutBuilder;
}

@Override
public void setGraphModel(GraphModel graphModel) {
this.graphModel = graphModel;
}

@Override
public boolean canAlgo() {
return !isConverged() && graphModel != null;
}

public void setConverged(boolean converged) {
this.converged = converged;
}

public boolean isConverged() {
return converged;
}

/**
* See https://github.com/gephi/gephi/issues/603 Nodes position to NaN on applied layout
*
* @param graphModel
*/
public static void ensureSafeLayoutNodePositions(GraphModel graphModel) {
Graph graph = graphModel.getGraph();
NodeIterable nodesIterable = graph.getNodes();
for (Node node : nodesIterable) {
if (node.x() != 0 || node.y() != 0) {
nodesIterable.doBreak();
return;
}
}

//All at 0.0, init some random positions
nodesIterable = graph.getNodes();
for (Node node : nodesIterable) {
node.setX((float) ((0.01 + Math.random()) * 1000) - 500);
node.setY((float) ((0.01 + Math.random()) * 1000) - 500);
}
}
}
Loading