Skip to content

Commit

Permalink
Merge pull request #18 from doublestranded/publish
Browse files Browse the repository at this point in the history
Publish
  • Loading branch information
doublestranded committed Aug 5, 2017
2 parents 527ef03 + dc2856f commit d09628a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ NOTE: you can still add graph-node and graph-edge child components with graphDat
| --- | --- | --- |
| settings | settings | An object including any of [these](https://github.com/jacomyal/sigma.js/wiki/Settings#graph-settings). In addition, the included edgeLabel plugin specifies [label settings](https://github.com/jacomyal/sigma.js/tree/master/plugins/sigma.renderers.edgeLabels). |
| graphData | None. Passed to the sigma instance's `graph` option on instantiation. | Format example: `{ nodes: [{id: 'n1', label: 'Hello', etc.},{id: 'n2', label: 'World', etc.}], edges: [{id: 'e0', label: 'the edge'}] }` See the two tables for graph-node and graph-edge below. |
| rendererType | None. Passed to `renderer` argument of sigma instance as `type`. | `canvas` or `webgl` if WebGL is enabled. Default is `canvas` |
| rendererType | None. Passed to 'renderer' argument of sigma instance as 'type'. Each SigmaGraph is assigned 1 renderer. | 'canvas' or 'webgl' if WebGL is enabled. Default is 'canvas' |
| rendererSettings | None. Passed to `renderer` argument of sigma instance as `settings`. | An object including any of [these](https://github.com/jacomyal/sigma.js/wiki/Settings#renderers-settings) |
| camera | camera | camera string id. |
| forceAtlas2Settings | None. Passed to `startForceAtlas2` on sigma instance. | Plugin settings [here](https://github.com/jacomyal/sigma.js/tree/master/plugins/sigma.layout.forceAtlas2) |
Expand Down Expand Up @@ -158,6 +158,7 @@ More will be supported in future releases.
The addon utilizes the parent-child helper pattern developed in [ember-composability-tools](https://github.com/miguelcobain/ember-composability-tools).

GraphNodes and GraphEdges are tagless (empty `tagName`) child components of the SigmaGraph component. They are not strictly necessary, but they provide convenience.
The SigmaGraph component has one renderer and camera.

This addon is still experimental. Contributions are welcome and encouraged. There may be issues with either this addon or the [sigma.js library](https://github.com/jacomyal/sigma.js/issues), so it's worth taking a look there to see if the issue has already been noticed.

Expand Down
4 changes: 2 additions & 2 deletions addon/components/sigma-child-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Ember from 'ember';
import { ChildMixin } from 'ember-composability-tools';

export default Ember.Component.extend(ChildMixin, {

tagName: '',

sigma: function() {
Expand All @@ -16,7 +16,7 @@ export default Ember.Component.extend(ChildMixin, {
getAttrs: function() {
let attrs = { id: this.get('id') };
this.get('attrNames').forEach((attr) => {
if (this.get(attr) !== undefined) attrs[attr] = this.get(attr);
if (typeof this.get(attr) !== "undefined") attrs[attr] = this.get(attr);
});
return attrs;
}
Expand Down
2 changes: 1 addition & 1 deletion addon/components/sigma-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default Ember.Component.extend(ParentMixin, {

_bindEvents: function() {
this.get('events').forEach((eventName) => {
if (this.get(eventName) !== undefined) {
if (typeof this.get(eventName) !== "undefined") {
this.sigma().bind(eventName, this.get(eventName));
}
});
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"name": "ember-sigmajs",
"version": "0.0.0",
"description": "The default blueprint for ember-cli addons.",
"version": "1.0.0",
"description": "ember addon for the sigma.js graph drawing library",
"keywords": [
"ember-addon"
"ember-addon",
"sigma.js",
"ember-sigmajs"
],
"license": "MIT",
"author": "",
"author": "Alexander Smith <saalexantay@gmail.com>",
"directories": {
"doc": "doc",
"test": "tests"
},
"repository": "",
"repository": "https://github.com/doublestranded/ember-sigmajs",
"scripts": {
"build": "ember build",
"start": "ember server",
Expand Down

0 comments on commit d09628a

Please sign in to comment.