Gregs Notes

From Evolutionary Informatics Working Group
Jump to: navigation, search

(Back to Visualization Subgroup)

Random top-level notes

Verified working NeXML files:


Example Nexus files:

Dublin Core:

PhyloWidget public methods

<javascript> var numberOfLeaves = PhyloWidget.getApplet().getNodeCount(); </javascript>

<java> public double getHoveredBranchLength() public double getHoveredDepthToRoot() public double getHoveredDistanceToRoot() public int getHoveredLeafCount() public double getHoveredMaxTreeLength() public String getHoveredNode() public int getHoveredNodeCount() public int getLeafCount() public String[] getLeafNames() public double getMaxTreeLength() public int getNodeCount() public double getTotalTreeLength() public String getTree() public String getTreeNewick() public String getTreeNHX() public String getTreeString() public abstract String getUrlParameters(); public abstract String getClipboardString(); // This is implemented in PhyloWidget.java public abstract void setClipboard(String clip); // This is implemented in PhyloWidget.java public abstract void setMessage(String message); // This is implemented in PhyloWidget.java public abstract void setTree(String tree); // This is implemented in PhyloWidget.java </java>

PhyloWidget display parameter annotations

A pretty unorganized list from the org.phylowidget.UsefulConstants.java file:

The most useful ones are:

  • LABEL_COLOR : The color of the label.
  • BRANCH_COLOR : "" branch.
  • NODE_COLOR : "" node.
  • LABEL_SIZE : The size of the label.
  • BRANCH_SIZE : "" branch.
  • IMAGE_SIZE : "" image.
  • NODE_SIZE : "" node.
  • NODE_SHAPE : The shape of the drawn node. Possible values:
    • s : square
    • t : triangle
    • x : star-shaped
    • o : filled circle


Some notes:

  • All sizes are relative to 1, which is the default/normal size.
  • Colors may be specified in web/hex format (#FF00FF) or as names ("red").

<java> // Below are some of our own juicy extras, stacked on top of the plain vanilla NHX. public static final String IMG_TAG = "IMG"; // a URL to an image that will be displayed. public static final String OLD_IMG_TAG = "OLD_IMG"; // Used for internal caching purposes by PhyloWidget.

public static final String CIGAR = "CIGAR"; // Cigar line, for gene tree alignments.

public static final String LABEL_COLOR = "LCOL"; // Color of a node's label public static final String LABEL_COLOR_ALT = "LABEL_COLOR"; public static final String NODE_COLOR = "NCOL"; // Color of a node's dot marker public static final String NODE_COLOR_ALT = "NODE_COLOR"; public static final String BRANCH_COLOR = "BCOL"; // Color of a node's branch (the branch leading to its parent) public static final String BRANCH_COLOR_ALT = "BRANCH_COLOR"; public static final String ALIGNMENT_COLOR = "ALNCOL"; // Color of a node's branch (the branch leading to its parent) public static final String ALIGNMENT_COLOR_ALT = "BRANCH_COLOR"; // NB: The values of the color annotations should be in R,G,B format, either with or without parentheses (your choice!) // [Alternatively, if you specify a single integer value, it will be interpreted as a single grayscale value] // NB: The above color annotations take precedence over any other auto-coloring that is usually done. public static final String LABEL_SIZE = "LSZ"; // Multiplier for label text size. public static final String LABEL_SIZE_ALT = "LABEL_SIZE"; public static final String NODE_SIZE = "NSZ"; // Multiplier for node marker size. public static final String NODE_SIZE_ALT = "NODE_SIZE"; public static final String NODE_SHAPE = "NSH"; public static final String NODE_SHAPE_ALT = "NODE_SHAPE"; public static final String SHAPE_SQUARE = "s"; public static final String SHAPE_TRIANGLE = "t"; public static final String SHAPE_STAR = "x"; public static final String SHAPE_FILLED_CIRCLE = "o";

public static final String BRANCH_SIZE = "BSZ"; // Multiplier for branch thickness size. public static final String BRANCH_SIZE_ALT = "BRANCH_SIZE"; public static final String IMAGE_SIZE = "ISZ"; // Multiplier for photo size. public static final String IMAGE_SIZE_ALT = "IMAGE_SIZE"; public static final String CIGAR_SIZE = "ALNSZ"; // Multiplier for photo size. public static final String LABEL_ALWAYSSHOW = "PW_ALWAYS"; // Pretty hacky, but this is a tag to make sure a label is ALWAYS shown, no matter what. public static final String LABEL_ALWAYSSHOW_ALT = "PW_A"; // A shorter version of the above. public static final String Z_ORDER = "PW_Z"; // Another hack: specify the z-order of the node, to be used in combination with ALWAYSSHOW. </java>