Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hasanbalci authored Oct 5, 2019
1 parent ccff3be commit b68214c
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ edge.data('bendPointPositions');

## API

`sbgnviz.register(options)`
`sbgnviz.register(libs)`
Register with libraries before creating instances

`sbgnviz.validMapProperties`
Expand Down Expand Up @@ -374,24 +374,17 @@ library of sbgnviz. Most users will not need to use this. It includes the follow
* `canHaveUnitOfInformation(ele)` Returns whether the give element have unit of information.
* `isEmptySetClass(ele)` Returns wether the given element or string is of the special empty set/source and sink class.
* `isModulationArcClass(ele)` Returns whether the class of given element is a modulation arc as defined in PD specs.
* `convertToRenderedPosition(modelPos, pan, zoom)` ?????.
* `extendNodeList(nodesToShow)` ????????.
* `extendRemainingNodes(nodesToFilter, allNodes)` ????.
* `getArrayLineStyle(ele)` ?????.
* `getCyShape(ele)` ????.
* `getCyTargetArrowFill(ele)` ?????.
* `getCyArrowShape(ele)` ????????.
* `getElementContent(ele)` ????.
* `getLabelTextSize(ele)` ?????.
* `getCardinalityDistance(ele)` ????.
* `getInfoLabel(node)` ?????.
* `getQtipContent(node)` ????????.
* `getDynamicLabelSizeCoefficient(dynamicLabelSize)` ????.
* `getDynamicLabelTextSize(ele, dynamicLabelSizeCoefficient)` ?????.
* `convertToRenderedPosition(modelPos, pan, zoom)` Returns rendered position of a given model position.
* `getArrayLineStyle(ele)` Returns whether the line style is dashed or solid.
* `getCyShape(ele)` Returns shape of the node.
* `getCyTargetArrowFill(ele)` Returns whether target arrow of an edge is filled or hollow.
* `getCyArrowShape(ele)` Returns arrow shape of an edge.
* `getLabelTextSize(ele)` Returns text size of a node label.
* `getCardinalityDistance(ele)` Returns the distance where the cardinality value is placed on the given edge.
* `getEndPoint(edge, sourceOrTarget)` Get source/target end point of edge in 'x-value% y-value%' format. It returns 'outside-to-node' if there is no source/target port.
* `addPorts(node, ordering, portDistance)` Add ports to the given node, with given ordering and port distance.
* `removePorts(node)` Remove the ports of the given node
* `changePortsOrientationAfterLayout()` ?????.
* `changePortsOrientationAfterLayout()` Changes ports orientation after layout to beautify the visual quality
* `changePortsOrientation(ele)` Calculates the best orientation for an 'ele' with port (process or logical operator) and returns it.
* `calculateOrientationScore(ele, other, orientation, firstOrientation, oppositeOrientation, pos, simple)`
This function calculates the scores for each orientation
Expand All @@ -412,11 +405,9 @@ library of sbgnviz. Most users will not need to use this. It includes the follow
@param other - is the other node, and based on its position score of a node is calculated
@param orientation - A string which holds current best orientation
* `swapElements(firstEle, secondEle)` Swaps the positions of 2 elements.
* `getComplexPadding(ele)` ??????.
* `getComplexMargin(ele)` Swaps the positions of 2 elements.
* `setCloneMarkerStatus(node, status)` et clone marker status of given nodes to the given status.
* `languageToMapType(lang)` ????????
* `mapTypeToLanguage(mapType)` ???????
* `setCloneMarkerStatus(node, status)` Set clone marker status of given nodes to the given status.
* `languageToMapType(lang)` Returns the corresponding map type of the given SBGN language.
* `mapTypeToLanguage(mapType)` Returns the corresponding SBGN language of the given map type.
* `getAllCollapsedChildrenRecursively(nodes)` Returns all collapsed descendants of the given nodes.
* `getWidthByContent(content, fontFamily, fontSize, options)` Calculates and returns the width barely enough to fit the given content typed with the given fontName and fontSize. 'options' parameter may have extra margin to add both sides, min and max values to return.

Expand Down Expand Up @@ -488,17 +479,23 @@ var sbgnviz = require('sbgnviz');
var cytoscape = require('cytoscape-for-sbgnviz');
var jQuery = require('jQuery');
var filesaverjs = require('filesaverjs');
var tippy = require('tippy.js');

var options = {
};

var libs = {
cytoscape: cytoscape,
jQuery: jQuery,
filesaverjs: filesaverjs
filesaverjs: filesaverjs,
tippy = tippy;
};

sbgnviz( options, libs );
// Register sbgnviz with libs
sbgnviz.register(libs);

// Create a new sbgnviz.js instance
var sbgnInstance = sbgnviz( options );
```

In plain JS you do not need to require the libraries you just need to register sbgnviz with the options.
Expand Down

0 comments on commit b68214c

Please sign in to comment.